titanfiber 1.0.140 → 1.0.142
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.js +1 -0
- package/build.pkg.js +1 -1
- package/cli.js +1 -0
- package/cli.pkg.js +1 -1
- package/custom.js +1 -0
- package/eval.js +1 -0
- package/eval.pkg.js +1 -1
- package/harness.js +1 -0
- package/harness.pkg.js +1 -1
- package/package.json +10 -10
- package/router.js +1 -0
- package/router.min.js +1 -1
- package/script.js +1 -0
- package/script.pkg.js +1 -1
- package/_console.pkg.js +0 -6
package/build.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require("./build.pkg.js"),args=t.env.parseArgs(),pause=t.node.pause,dir=globalThis.dir??".";try{packageJSON=t.node.loadPackageJSON(dir)}catch(a){console.warn("No package.json found in "+dir)}packageJSON&&(main=mainFile=packageJSON.main),require("./script.min.js");
|
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){return e instanceof String},o=function(e){return u(e)||i(e)},s=o,c=function(e,n){const r=[];let u="",i="outside",o=!1;for(let s=0;s<e.length;s++){const c=e[s];switch(i){case"outside":'"'===c?o?(u+=c,o=!1):(n&&(u+=c),i="insideQuote"):"\\"===c?o=!0:" "===c?(u.length>0&&(r.push(u),u=""),o=!1):(u+=c,o=!1);break;case"insideQuote":'"'!==c||o?"\\"!==c||o?(u+=c,o=!1):o=!0:(n&&(u+=c),i="outside")}}return u.length>0&&r.push(u),r},l=function(e,n){var u=e;return null==u?r():s(u)?c(u,n):u},a=function(e,n){for(var r=l(e,n),u=[],i=!1,o=r.length,s=0;s<o;s++){var c=r[s];if(!i){var a=c[0];let e;if("-"===a)if("-"===c[1]){if(2===c.length){i=!0;continue}e=2}else e=1;else"/"===a&&(e=1);if(e){var f,p,d=c.slice(e),h=d.indexOf("=");if(-1!==h)f=d.slice(0,h),p=d.slice(h+1);else{f=d;var v=r[s+1];null==v||"-"===v[0]?p=!0:(p=v,s++)}u[f]=p;continue}}u.push(c)}return u},f=a,p=f,d=function(e){return require(e)},h=function(e){return!!e.startsWith("node:")||d("node:module").isBuiltin(e)},v=function(e){return e.startsWith(".")},m=function(e){return Array.isArray(e)},g=function(e){return class extends e{constructor(e,n){super(e,n);var r=this.constructor.name;r&&(this.name=r)}}},y=g(globalThis.Error),w=class extends y{constructor(e,n){super(e??"Unexpected value",n)}},b=e(function(){return"undefined"==typeof window}),x=function(e){return require("node:"+e)},E=function(n){return e(()=>x(n))},F=E("util"),A=function(e,n){return n||(n={}),null==n.colors&&(n.colors=!0),F().inspect(e,n)},O=function(e,n){return null!=e&&e.constructor===n},S=function(e){return O(e,Object)},_=function(e,n){return n<0?e.length+n:n},j=_,I=function(e,n,r,u){return void 0!==n&&(null===n||0===n?n=void 0:(n=j(e,n),u&&0==u.inclusiveStart&&n++)),void 0!==r&&(null===r||r===e.length?r=void 0:(r=j(e,r),u&&u.inclusiveEnd&&r++)),[n,r]},k=function(e,n,r,u,i,o){if(r||null!=u){[r,u]=I(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)},N=function(e,n,r,u,i){return k(e,n,r,u,(n,r,u)=>(void 0!==r?e.slice(0,r):"")+(n||"")+(void 0!==u?e.slice(u):""),i)},q=O,R=function(e){return q(e,RegExp)},T=function(e){return m(e)?e:[e]},C=function(e){return e instanceof Promise},P=function(e,n){var r=e;return C(r)?r.then(n):n(r)},M=function(e){return"function"==typeof e},L=function(e){return M(e)&&null==e.prototype},D=L,W=function(e){return function(){return e.apply(this,arguments)}},K=function(e,n){var r;return r=n?function(){this.super=n;var r=e.apply(this,arguments);return P(r,()=>(delete this.super,r))}:D(e)?W(e):e,r._isConstructor=!0,r},B=function(e,n){return e._isConstructor?e:K(e,n)},U=function(){return this},Y=function(e){var n=typeof e;return"object"!==n&&"function"!==n||null===e},z=function(e){return!Y(e)},J=function(e,n,r){return!1===r?Object.keys(n).forEach(r=>{void 0===e[r]&&(e[r]=n[r])}):Object.assign(e,n),e},V=function(e,n){return J(e,n,!1)},G=function(e,n,r,u){return r||(r={}),u&&V(r,u),null==r.enumerable&&(r.enumerable=!0),null==r.configurable&&(r.configurable=!0),Object.defineProperty(e,n,r)},Q=function(e,n,r,u){return G(e,n,{value:r,writable:!0,enumerable:!1},u),r},$=Q,H=class extends y{constructor(e,n){super(e??"Not yet implemented",n)}},X=function(e,n,r,u){var i=e[n];if(void 0===i){var o=r;!1!==u&&M(o)&&(o=o(e,n)),e[n]=i=o}return i},Z=function(e,n,r,u){return e||(e={}),X(e,n,r,u),e},ee=function(e,n){return Z(e,"fromFn",n,!1)},ne=function(e,n){return new H(e,ee(n,ne))},re=function(e,n){Object.defineProperty(e,"name",{value:n,configurable:!0}),$(e,"displayName",n)},te=re,ue=function(e,n){return Object.assign(e,n)},ie=b()?require("util").inspect.custom:Symbol("Display"),oe=function(e,n){e.prototype[ie]=n},se=function(e,n,r,u,i,o){o||(o={}),s(n)&&(n=null);var c,l,a,f=r;f&&(m(f)?([l,a]=f,l&&(l=B(l))):c=B(f,n));var p=o.bareFn;o.singleton&&(p=function(){return null==v.default&&(v.default=new v(...arguments)),v.default});var d,h=l||c||n||U;function v(){if(!new.target&&p&&!(this instanceof v))return p.apply(this,arguments);var e=this;return P(h.apply(e,arguments),r=>{if(r&&z(r)&&(e=r,l)){if(!new.target)throw ne('Prototype repair is NYI for class instantiation without "new".');if(!n)throw ne("instanceFn is not yet supported when extendsClass is null.");var u=Object.getPrototypeOf(this);Object.getPrototypeOf(e)!==u&&Object.setPrototypeOf(e,u)}return a?P(a.apply(e,arguments),()=>e):e})}return e&&te(v,e),u?(d=u,n&&Object.setPrototypeOf(u,n.prototype)):d=n?Object.create(n.prototype):{},$(d,"constructor",v),v.prototype=d,i&&ue(v,i),o.display&&oe(v,o.display),o.implements&&T(o.implements).forEach(e=>e(v)),v},ce=function(e,n){Object.defineProperty(e,n,{enumerable:!1})},le=ce,ae=function(e,n,r,u,i){var o=Symbol();return se(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,le(this,o)}],r,u,i)},fe=function(e,n,r,u){return n=null==n?0:_(e,n),r=null==r?e.length:_(e,r),u&&(0==u.inclusiveStart&&n++,u.inclusiveEnd&&r++),[n,r]},pe=function(e,n,r,u){var i=n;if([r,u]=fe(e,r,u),M(i))for(var o=r;o<u;o++)e[o]=i(o,e);else e.fill(i,r,u);return e},de=function(e,n){var r=new Array(e||0);return arguments.length>1&&pe(r,n),r},he=function(e,n){return de(n.length,r=>e[n[r]])},ve=function(e,n){return e[n]},me=function(e,n,r){return e[n]=r},ge=function(e,n,r){var u=e;return M(u)?u.apply(r,n):u},ye=function(e,n,r,u,i){u||(u=ve);var o=u(e,n);return void 0===o&&(o=ge(r,[e,n]),i||(i=me),i(e,n,o)),o},we=function(e,n){return e.get(n)},be=function(e,n,r){return e.set(n,r)},xe=function(e,n,r){return ye(e,n,r,we,be)},Ee=class{constructor(){this.store=new Map}get(e,n){return xe(this.store,e,n)}remove(e){return this.store.delete(e)}delete(e){return this.remove(e)}},Fe=function(e,n){return e.push(n),e},Ae=Fe,Oe=function(e){var n=e;return Array.isArray(n)?n:Array.from(n)},Se=Symbol("Value"),_e=function(){return{}},je=function(e){return[e.slice(0,-1),e[e.length-1]]},Ie=je,ke=function(e,n,r,u,i,o){r||(r=ve),null==u&&(u=_e),null==i&&(i=me),null==o&&(o=r);for(var[s,c]=Ie(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=ye(l,p,u,r,i)}l=d}if(o)return o(l,c,i)},Ne=function(e,n,r,u,i,o){return ke(e,n,u,i,o,(e,n)=>ye(e,n,r,u,o))},qe=function(){return new Map},Re=function(e,n,r){return Ne(e,n,r,we,qe,be)},Te=function(e,n){return delete e[n],e},Ce=function(e,n,r,u){return ke(e,n,r,!1,!1,u||Te)},Pe=function(e,n){return e.delete(n)},Me=function(e,n){return Ce(e,n,we,Pe)},Le=class{constructor(){this.store=new Map}get(e,n){return e=Ae(Oe(e),Se),Re(this.store,e,n)}remove(e){return e=Ae(Oe(e),Se),Me(this.store,e)}delete(e){return this.remove(e)}},De=ae("MemoizedFunction",function(e,n){if(this.base=e,null!=n)if(1===(n=T(n)).length){this.cache=new Ee;var r=n[0];this._cacheKeyFormatter=e=>e[r]}else this.cache=new Le,this._cacheKeyFormatter=e=>he(e,n);else this.cache=new Le,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))}}),We=function(e,n){return new De(e,n)},Ke=function(e){return new Set(e)},Be=function(e){var n={};if(e){var r=Ke(e);r.has("g")&&(n.global=!0),r.has("i")&&(n.caseInsensitive=!0),r.has("y")&&(n.sticky=!0)}return n},Ue=function(e){var n="";return e.global&&(n+="g"),(e.caseInsensitive||0==e.caseSensitive)&&(n+="i"),e.sticky&&(n+="y"),n},Ye=function(e,n){var r=Be(e);return Ue(Object.assign(r,n))},ze=function(e,n){var r=n,u=void 0;return s(r)?u=r:S(r)&&(u=Ye(e.flags,r)),new RegExp(e,u)},Je=function(e,n){return ze(e,e.flags+n)},Ve=function(e){return Je(e,"g")},Ge=We(function(e){return e.global?e:Ve(e)},0),Qe=function(e){var n=e;return null==n?void 0:s(n)?n:Ue(n)},$e=function(e,n){return new RegExp(e,Qe(n))},He=function(e){return e.replace(/[-[\]{}()*+!<=:?.\/\\^$|#\s,]/g,"\\$&")},Xe=function(e,n){return $e(He(e),n)},Ze=function(e,n,r,u,i,o){return N(e,function(e){return e.replaceAll?(R(n)&&(n=Ge(n)),e.replaceAll(n,r)):(n=s(n)?Xe(n,"g"):Ge(n),this.replace(n,r))},u,i,o)},en=function(e,n,r){return Ze(e,n,(r??"\\")+n)},nn=function(e,n,r){return null==n&&(n='"'),!1!==r&&(e=en(e,n,r)),n+e+n},rn=function(e){return nn(e,'"')},tn=S,un=function(e){return tn(e)?pn(e):String(e)},on=function(e,n){return n||(n=sn),"["+e.reduce(function(e,r){return e+n(r)+", "},"").slice(0,-2)+"]"},sn=function(e){return s(e)?rn(e):m(e)?on(e):un(e)},cn=function(e){return Reflect.ownKeys(e)},ln=function(e,n){return(n?cn:Object.keys)(e)},an=function(e,n,r){ln(e,r).forEach((r,u,i)=>n(r,e[r],u,i))},fn=function(e,n,r,u){var i=null!=r?r:"";return an(e,function(){i=n.call(this,i,...arguments)},u),i},pn=function(e,n){return n||(n=sn),"{"+fn(e,function(e,r,u){return e+r+":"+n(u)+", "},"",!0).slice(0,-2)+"}"},dn=function(e,n){return null==n&&(n=1),n<=0?"[object Object]":pn(e,e=>vn(e,n-1))},hn=function(e,n){return null==n&&(n=1),n<=0?"[object Array]":on(e,e=>vn(e,n-1))},vn=function(e,n){return void 0===e?"undefined":null===e?"null":b()?A(e,n):S(e)?dn(e,maxNumLevels):m(e)?hn(e,maxNumLevels):un(e)},mn=function(e,n,r,u){if(0===arguments.length)return new w("Unexpected value received");u||(u={});var i,{expected:o}=u;return i=o?"Received "+vn(e)+", expected one of "+vn(o):"Unexpected value received: "+vn(e),r&&(i+=' for "'+r+'"'),null!=n&&(i+=" (index "+n+")"),u.fromFn||(u.fromFn=mn),new w(i,u)},gn=g(globalThis.TypeError),yn=function(e){return null==e?e:e.constructor},wn=function(e,n,r,u){if(0===arguments.length)return new gn("Unexpected type received");u||(u={});var i,{type:o,expected:s}=u;return null==o&&(o=yn(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+=" ("+vn(e)+")"),s||(i+=")"),r&&(i+=' for "'+r+'"'),null!=n&&(i+=" (index "+n+")"),u.fromFn||(u.fromFn=wn),new gn(i,u)},bn=function(e){var n=e.stdio;if(n){if(!m(n)){if(!s(n))throw wn(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 mn(n,"stdio");n=["overlapped","overlapped","overlapped"]}e.stdio=n}}else n=e.stdio=[null,null,null];return n},xn=function(e,n,r){var u=new y(e,r);return n&&Object.assign(u,n),u},En=function(e,n){var r=n.length;e.length=r;for(var u=0;u<r;u++)e[u]=n[u];return e},Fn=function(e){return function(){return!e.apply(this,arguments)}},An=function(e,n){return En(e,e.filter(Fn(n)))},On=function(e){return An(e,e=>null==e)},Sn=E("child_process"),_n=e(function(){return"win32"===process.platform}),jn=function(e,n,r){if(r||(r={}),n(e))throw e;if(r.nullOnErr)return null;var u=r.onErr;if(void 0!==u)return ge(u);throw e},In=function(e,n,r){r||(r={}),r.dir&&(r.cwd=r.dir);var u=bn(r);if(null==u[0]){var i=r.allowInput,o=r.input;if(i&&o)throw xn("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 xn("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 xn("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&&On(n);try{var f=Sn().execFileSync(e,n,r);null!=f&&!1!==r.trim&&(f=f.trim());var p=r.map??r.mapFn;return p&&(f=p(f)),f}catch(e){if(_n())return jn(e,e=>"ENOENT"===e.code,r);throw e}},kn=function(e,n){return n||(n={}),null==n.captureOutput&&(n.captureOutput=!1),n.shell=!0,n.filterExtensions=!1,In("npm",e,n)},Nn=function(e,n,r){return kn(["install",e,n?"-g":null],r)},qn=E("path"),Rn=qn().sep,Tn=function(e,n,r){var u=qn().resolve,i=n?u(n,e):u(e);return r?i+Rn:i},Cn=function(e){return require(Tn(e))},Pn=class{constructor(){this.store={}}get(e,n){return X(this.store,e,n)}remove(e){return delete this.store[e]}delete(e){return this.remove(e)}},Mn=new Pn,Ln=function(e){return e[e.length-1]},Dn=_,Wn=function(e,n,r){return e=ze(e,{global:!0}),null!=r&&(n=Dn(r,n)),e.lastIndex=n,e},Kn=function(e,n,r){return e=null!=r?Wn(e,r,n):Ge(e),Array.from(n.matchAll(e))},Bn=function(e,n,r){return null!=r&&(n=n.slice(0,r)),Ln(Kn(e,n))||null},Un=function(e,n){var r=Bn(e,n);return r&&n.length===r.index+r[0].length?r:null},Yn=function(e,n){if(s(n))return e.endsWith(n);if(R(n))return!!Un(n,e);throw wn(n,1,"matchThis")},zn=function(e){return Yn(e,Rn)?e:e+Rn},Jn=function(e,n,r){if(b()){var u=qn().join(e,n);return r?zn(u):u}throw ne()},Vn=function(e,n){return e.endsWith(n)?e:Jn(e,n)},Gn=E("module"),Qn=function(e){return e=Vn(e,"node_modules"),Gn().createRequire(e)},$n=function(e,n){return Mn.get(e,()=>Qn(e))(n)},Hn=function(e,n,r){return Object.keys(n).forEach(u=>X(e,u,n[u],r)),e},Xn=function(e,n,r){return n?Hn(e,n,r):e},Zn=function(e,n){return e.endsWith(n)?e.substring(0,e.length-n.length):e},er=function(e,n){var r=Un(n,e);return r?e.slice(0,r.index):e},nr=function(e,n){if(s(n))return Zn(e,n);if(R(n))return er(e,n);throw wn(n,1)},rr=nr,tr=function(e,n){return[e.slice(0,n),e.slice(n)]},ur=function(e){e=rr(e.trim(),";");var n=Math.max(e.lastIndexOf(";"),e.lastIndexOf("\n"));return tr(e,n+1)},ir=function(e,n){return e.startsWith(n)?e:n+e},or=function(e){var[n,r]=ur(e);return n+ir(r.trim(),"return ")},sr=function(e){return Ot("node-repl-await").processTopLevelAwait(e)},cr=function(e){return sr(e)??e},lr=Ze,ar=function(e,n){return""===e?e:(!1!==n&&(e=zn(e)),lr(e,"\\","/"))},fr=function(e,n){return l(e,n).slice()},pr=fr,dr=function(){var e=require.main?.filename;return e||(null!=process._eval?null:pr(process.argv)[1])},hr=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},vr=function(e){return e.split(".")[0]},mr=function(e){return qn().win32.basename(e)},gr=function(e){return vr(mr(e))},yr=function(e,n,r,u){e||(e=dr()??"_console.js");var i=hr(gr(e));return n&&(i+="_repl"),i+(r&&u?.dynamic?".dypkg.json":".pkg.js")},wr=function(e,n){return e=qn().dirname(e),!1===n?e:zn(e)},br=function(e,n,r,u){var i,o=yr(e,n,r,u);return i=e?wr(e):"./",Tn(i+o)},xr=function(e){return'require("'+ar(br(),!1)+'");\n'+e},Er=function(e,n){return Ze(e,n,"")},Fr=function(e,n){return n.forEach(n=>e=Er(e,n)),e},Ar=function(e){return Fr(e,["\r","\n"])},Or=function(e,n){return Ot("astring").generate(e,n)},Sr=function(e,n){return e.stack=n+"\n"+e.stack,e},_r=function(e,n,r){r||(r={}),r.ecmaVersion||(r.ecmaVersion=2024),!1!==n&&(r.sourceType="module"),null==r.allowAwaitOutsideFunction&&(r.allowAwaitOutsideFunction=!0),null==r.allowReturnOutsideFunction&&(r.allowReturnOutsideFunction=!0);var u=Ot("acorn");try{return u.parse(e,r)}catch(n){throw Sr(n,"Acorn parsing error: "+e)}},jr=function(e,n,r){return Or(_r(e,n,r))},Ir=function(e){return Ar(jr(e))},kr=function(e,n,r){return(n||r)&&(n||(n={}),r&&Xn(n,r),n.ensureReturn&&(e=or(e)),n.topLevelAwait&&(e=cr(e)),n.useTitan&&(e=xr(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=Ir(e))),e},Nr=function(e){return s(e)?e:un(e)},qr=function(e){var n=e.indexOf("{");return-1===n||e.slice(0,n).includes("=>")},Rr=function(e,n,r,u,i){return k(e,n,r,u,(n,r)=>null===n?null:(n.input=e,void 0!==r&&(n.index+=r),n),i)},Tr=function(e,n){return e.splice(e.length,0,...n),n},Cr=function(e,n){return Tr(e,n),e},Pr=Cr,Mr=class extends Array{constructor(e,n,r,u,i){if(-1===n)throw xn("RegexResult index cannot be -1. For empty result, use bare null.");if(null==e)throw xn("RegexResult matchString cannot be null. For empty result, use bare null.");super(),this[0]=e,u&&Pr(this,u),this.index=n,this.input=r,i&&(this.groups=i)}fromParts(e){var n=e;return new Mr(n.match,n.index,n.input,n.captures,n.groups)}},Lr=function(e,n,r,u,i){return new Mr(e,n,r,u,i)},Dr=function(e,n,r,u,i){return-1===n||null==e?null:Lr(e,n,r,u,i)},Wr=Er,Kr=function(e,n){return ze(e,Wr(e.flags,n))},Br=function(e){return Kr(e,"g")},Ur=We(function(e){return e.global?Br(e):e},0),Yr=function(e,n,r){return(e=null!=r?Wn(e,r,n):Ur(e)).exec(n)},zr=function(e,n,r,u,i){return Rr(e,e=>{if(s(n)){var r=e.indexOf(n);return Dr(n,r,e)}return Yr(n,e)},r,u,i)},Jr=function(e){return e.index+e[0].length},Vr=function(e,n){var r=zr(e,n);return null===r[0]?null:e.slice(Jr(r))},Gr=function(e,n){return e.startsWith(n)?e.substring(n.length):e},Qr=function(e,n){var r=Yr(e,n);return r&&0===r.index?r:null},$r=function(e,n){var r=Qr(n,e);return r?e.slice(r[0].length):e},Hr=function(e,n){if(s(n))return Gr(e,n);if(R(n))return $r(e,n);throw wn(n,1)},Xr=Hr,Zr=function(e){var n=Vr(e,"=>").trim();return Xr(rr(n,"}"),"{")},et=function(e){return Vr(e,"{").slice(0,-1)},nt=function(e){var n=Nr(e);return qr(n)?Zr(n):et(n)},rt=function(e){return null==e?"":s(e)?e:M(e)?nt(e):String(e)},tt=function(e,n){var r=n?.basic?null:{topLevelAwait:!0,useTitan:!0},u=kr(rt(e),n,r);return In("node",[n?.mode??"-p",u],n)},ut=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 "+vn(e)+")"),xn(i,null,ee(u,ut))},it=function(e,n,r){if(null==e)throw ut(e,n,r,{fromFn:it});return e},ot=function(e,n){return process.kill(e,it(n,0,"signalName"))},st=function(e){return ot(e,"SIGINT")},ct=function(){return st(process.pid)},lt=ct,at=function(e){if("Y"===(e=e.toUpperCase()))return!0;if("N"===e)return!1;throw mn(e,0,"char")},ft=function(e){null==e&&(e="Are you sure? [y/n]: "),process.stdout.write(e);var n=tt(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))})},{mode:"-e",basic:!0,stdio:["inherit","pipe"]});if("^C"===n)throw process.stdout.write(n),lt(),xn("Prompt was cancelled via interrupt.");return console.log(n),at(n)},pt=function(e){return m(e)?e:s(e)?e.split("."):[e]},dt=function(e,n,r,u,i,o){var s=r;return ke(e,n,u,i,o,(e,n,r)=>r(e,n,ge(s)))},ht=function(e,n){var r=n,u=globalThis.config;u||(u=globalThis.config={});var i,o=pt(e);return o.length>1?i=dt(u,o,r):(i=ge(r),u[o[0]]=i),i},vt=function(e,n){return ht("node.require.customDirs",r=>(r||(r=[]),!1!==n&&(e=Vn(e,"node_modules")),r.includes(e)||r.push(e),r)),e},mt=vt,gt=ke,yt=function(e){var n=globalThis.config;if(n){var r=pt(e);return r.length>1?gt(n,r):n[r[0]]}},wt=function(e,n,r){if(null!=e)return e;var u=yt(n);return null!=u?u:r},bt=E("fs"),xt=function(e){return!!bt().lstatSync(e,{throwIfNoEntry:!1})},Et=function(e){var n=wr(e,!1);return xt(n)||(n!==e&&Et(n),bt().mkdirSync(n)),e},Ft=function(e){return Et(e),bt().mkdirSync(e),e},At=function(e){return xt(e)?e:Ft(e)},Ot=function(e,n){if(h(e))return require(e);if(v(e))return Cn(e);try{return require(e)}catch(e){}var r=__dirname,u=process.mainModule?.path;if(u!==r)try{return $n(u,e)}catch(e){}var i=process.cwd();if(i!==u&&i!==r)try{return $n(i,e)}catch(e){}var o=yt("node.require.customDirs");if(o)for(var s of o)try{return $n(s,e)}catch(e){}var c=wt(n?.autoInstall,"node.require.autoInstall"),l=wt(n?.promptInstall,"node.require.promptInstall",!0);if(c||l){var a=c||l;!0===a&&(a="./node_modules"),a=Tn(a);var f=!1;if(c?(f=!0,console.log('Auto-installing "'+e+'" from npm to "'+a+'"...')):(f=ft('Npm package "'+e+'" is required. Install now? (Y/N) '))&&console.log('Installing "'+e+'" from npm to "'+a+'"...'),f){a=At(a),Nn(e,!1,{cwd:a});try{return mt(a),$n(a,e)}catch(e){console.error("Failed to load from auto-install dir: ",a)}}}throw xn('Module not found: "'+e+'"',{checked:{moduleDir:r,scriptDir:u,cwd:i}})},St=function(e){return bt().readFileSync(e,"utf8")},jt=St,It=function(e){return JSON.parse(jt(e))},kt={env:{parseArgs:p,args:r,setConfig:ht,getConfig:yt,resolveConfig:wt},node:{parseArgs:f,args:n,pause:function(e){null!=e&&(e=String(e)),Ot("press-any-key-sync")(e)},require:Ot,_basicRequire:d,is:b,display:A,util:F,_builtInModule:E,requireBuiltIn:x,child_process:Sn,requireLocal:Cn,path:qn,_requireFromDir:$n,_requireDirCache:Mn,_createRequire:Qn,module:Gn,promptYNSync:ft,run:tt,getScriptPath:dr,positionalArgs:pr,sigint:lt,interrupt:ct,ensureRequireDir:mt,addRequireDir:vt,fs:bt,loadPackageJSON:function(e){var n=e??"./";return n.endsWith("package.json")||(n=Jn(n,"package.json")),xt(n)?It(n):{}}},cli:{parseArgs:a,resolveArgs:l,splitArgs:c,positionalArgs:fr},f:{one:e,memoize:We,MemoizedFunction:De,createClass:ae,ensureConstructor:B,createConstructor:K,isArrowFn:D,isArrow:L,is:M,wrap:W,retThis:U,setName:re,not:Fn,body:nt,isArrowString:qr,_getArrowFnBody:Zr,_getNormalFnBody:et},s:{is:s,isAny:o,isPrimitive:u,isObject:i,toLiteral:rn,quote:nn,escape:en,replaceAll:Ze,apply:N,withIndices:k,chars:Ke,from:un,endsWith:Yn,resolveIndex:Dn,removeTrailing:rr,removeFromEnd:nr,_removeStringFromEnd:Zn,_removeRegexFromEnd:er,splitAtIndex:tr,ensureStartsWith:ir,replace:lr,decapitalize:hr,removeLineBreaks:Ar,removeMulti:Fr,removeAll:Er,resolve:rt,ensure:Nr,after:Vr,match:zr,_matchWithIndices:Rr,remove:Wr,removeLeading:Xr,removeFromStart:Hr,_removeStringFromStart:Gr,_removeRegexFromStart:$r},npm:{isBuiltIn:h,isFile:v,install:Nn,_runCommand:kn},os:{run:In,_resolveStdio:bn},a:{is:m,wrapIndices:I,wrapIndex:j,resolveIndex:_,ensure:T,pick:he,create:de,fill:pe,resolveIndices:fe,push:Ae,add:Fe,splitLast:Ie,splitTail:je,toLiteral:on,display:hn,removeNullish:On,removeByFilter:An,replaceContents:En,last:Ln,pushMulti:Pr,addMulti:Cr,pushThroughMulti:Tr},err:{value:mn,ValueError:w,Error:y,Enhanced:g,nyi:ne,NYIError:H,defaultFromFn:ee,type:wn,TypeError:gn,create:xn,prepend:Sr,req:ut},v:{display:vn,constructorMatches:O,toLiteral:sn,isPrimitive:Y,resolve:ge,type:yn,req:it},macro:{config:function(e){}},o:{is:S,display:dn,toLiteral:pn,constructorMatches:q,isAny:z,setHidden:$,addNonEnumerable:Q,defineProperty:G,weakAssign:V,merge:J,safeEnsure:Z,ensure:X,hideKey:le,makeNonEnumerable:ce,ensureCustom:ye,get:ve,set:me,createEmpty:_e,remove:Te,isPure:tn,reduce:fn,each:an,keys:ln,allKeys:cn,Cache:Pn,setDefaults:Xn,ensureMulti:Hn,resolveKeys:pt,diveGet:gt},re:{is:R,ensureGlobal:Ge,global:Ve,addFlag:Je,copy:ze,updateFlagString:Ye,parseFlagString:Be,createFlagString:Ue,createEscaped:Xe,create:$e,resolveFlags:Qe,escape:He,matchEnd:Un,matchLast:Bn,matchAll:Kn,setStartIndex:Wn,safeCreateResult:Dr,createResult:Lr,RegexResult:Mr,match:Yr,ensureLocal:Ur,local:Br,removeFlag:Kr,resultEndIndex:Jr,matchStart:Qr},class:{create:se,setName:te,addStatics:ue,setDisplay:oe},p:{asyncJoint:P,is:C},sym:{display:ie,value:Se},map:{Cache:Ee,ensure:xe,get:we,set:be,MultiCache:Le,diveEnsure:Re,createEmpty:qe,diveDelete:Me,remove:Pe},args:{ensureArray:Oe},tree:{ensure:Ne,dive:ke,remove:Ce,setCustom:dt},win:{is:_n},shell:{_handleError:jn},path:{abs:Tn,sep:Rn,ensureEndsWith:Vn,join:Jn,ensureTrailingSlash:zn,fws:ar,baseName:gr,_removeExtsFromFile:vr,file:mr,dir:wr},js:{enhance:kr,ensureReturn:or,splitLastExpression:ur,enableAwait:cr,_nodeEnableAwait:sr,useTitan:xr,inline:Ir,removeComments:jr,fromAST:Or,parse:_r},titan:{getPackagePath:br,getPackageName:yr},proc:{interrupt:st,signal:ot},bool:{fromYN:at},fs:{ensureDir:At,exists:xt,mkdir:Ft,ensureParent:Et,loadJSON:It,loadText:jt,load:St}};globalThis.t?Object.keys(kt).forEach(function(e){if(t[e]){var n=kt[e];Object.keys(n).forEach(function(r){t[e][r]=n[r]})}else t[e]=kt[e]}):globalThis.t=Object.assign({},kt),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){return e instanceof String},o=function(e){return u(e)||i(e)},s=o,c=function(e,n){const r=[];let t="",u="outside",i=!1;for(let o=0;o<e.length;o++){const s=e[o];switch(u){case"outside":'"'===s?i?(t+=s,i=!1):(n&&(t+=s),u="insideQuote"):"\\"===s?i=!0:" "===s?(t.length>0&&(r.push(t),t=""),i=!1):(t+=s,i=!1);break;case"insideQuote":'"'!==s||i?"\\"!==s||i?(t+=s,i=!1):i=!0:(n&&(t+=s),u="outside")}}return t.length>0&&r.push(t),r},l=function(e,n){var t=e;return null==t?r():s(t)?c(t,n):t},a=function(e,n){for(var r=l(e,n),t=[],u=!1,i=r.length,o=0;o<i;o++){var s=r[o];if(!u){var c=s[0];let e;if("-"===c)if("-"===s[1]){if(2===s.length){u=!0;continue}e=2}else e=1;else"/"===c&&(e=1);if(e){var a,f,p=s.slice(e),d=p.indexOf("=");if(-1!==d)a=p.slice(0,d),f=p.slice(d+1);else{a=p;var h=r[o+1];null==h||"-"===h[0]?f=!0:(f=h,o++)}t[a]=f;continue}}t.push(s)}return t},f=a,p=f,d=function(e){return require(e)},h=function(e){return!!e.startsWith("node:")||d("node:module").isBuiltin(e)},v=function(e){return e.startsWith(".")},m=function(e){return Array.isArray(e)},g=function(e){return class extends e{constructor(e,n){super(e,n);var r=this.constructor.name;r&&(this.name=r)}}},y=g(globalThis.Error),w=class extends y{constructor(e,n){super(e??"Unexpected value",n)}},b=e(function(){return"undefined"==typeof window}),x=function(e){return require("node:"+e)},E=function(n){return e(()=>x(n))},F=E("util"),A=function(e,n){return n||(n={}),null==n.colors&&(n.colors=!0),F().inspect(e,n)},O=function(e,n){return null!=e&&e.constructor===n},S=function(e){return O(e,Object)},_=function(e,n){return n<0?e.length+n:n},j=_,I=function(e,n,r,t){return void 0!==n&&(null===n||0===n?n=void 0:(n=j(e,n),t&&0==t.inclusiveStart&&n++)),void 0!==r&&(null===r||r===e.length?r=void 0:(r=j(e,r),t&&t.inclusiveEnd&&r++)),[n,r]},k=function(e,n,r,t,u,i){if(r||null!=t){[r,t]=I(e,r,t,i);var o=e.slice(r,t),s=n(o);return u?u(s,r,t,o,e):s}return n(e)},N=function(e,n,r,t,u){return k(e,n,r,t,(n,r,t)=>(void 0!==r?e.slice(0,r):"")+(n||"")+(void 0!==t?e.slice(t):""),u)},q=O,R=function(e){return q(e,RegExp)},T=function(e){return m(e)?e:[e]},C=function(e){return e instanceof Promise},P=function(e,n){var r=e;return C(r)?r.then(n):n(r)},M=function(e){return"function"==typeof e},L=function(e){return M(e)&&null==e.prototype},D=L,W=function(e){return function(){return e.apply(this,arguments)}},K=function(e,n){var r;return r=n?function(){this.super=n;var r=e.apply(this,arguments);return P(r,()=>(delete this.super,r))}:D(e)?W(e):e,r._isConstructor=!0,r},B=function(e,n){return e._isConstructor?e:K(e,n)},U=function(){return this},Y=function(e){var n=typeof e;return"object"!==n&&"function"!==n||null===e},z=function(e){return!Y(e)},J=function(e,n,r){return!1===r?Object.keys(n).forEach(r=>{void 0===e[r]&&(e[r]=n[r])}):Object.assign(e,n),e},V=function(e,n){return J(e,n,!1)},G=function(e,n,r,t){return r||(r={}),t&&V(r,t),null==r.enumerable&&(r.enumerable=!0),null==r.configurable&&(r.configurable=!0),Object.defineProperty(e,n,r)},Q=function(e,n,r,t){return G(e,n,{value:r,writable:!0,enumerable:!1},t),r},$=Q,H=class extends y{constructor(e,n){super(e??"Not yet implemented",n)}},X=function(e,n,r,t){var u=e[n];if(void 0===u){var i=r;!1!==t&&M(i)&&(i=i(e,n)),e[n]=u=i}return u},Z=function(e,n,r,t){return e||(e={}),X(e,n,r,t),e},ee=function(e,n){return Z(e,"fromFn",n,!1)},ne=function(e,n){return new H(e,ee(n,ne))},re=function(e,n){Object.defineProperty(e,"name",{value:n,configurable:!0}),$(e,"displayName",n)},te=re,ue=function(e,n){return Object.assign(e,n)},ie=b()?require("util").inspect.custom:Symbol("Display"),oe=function(e,n){e.prototype[ie]=n},se=function(e,n,r,t,u,i){i||(i={}),s(n)&&(n=null);var o,c,l,a=r;a&&(m(a)?([c,l]=a,c&&(c=B(c))):o=B(a,n));var f=i.bareFn;i.singleton&&(f=function(){return null==h.default&&(h.default=new h(...arguments)),h.default});var p,d=c||o||n||U;function h(){if(!new.target&&f&&!(this instanceof h))return f.apply(this,arguments);var e=this;return P(d.apply(e,arguments),r=>{if(r&&z(r)&&(e=r,c)){if(!new.target)throw ne('Prototype repair is NYI for class instantiation without "new".');if(!n)throw ne("instanceFn is not yet supported when extendsClass is null.");var t=Object.getPrototypeOf(this);Object.getPrototypeOf(e)!==t&&Object.setPrototypeOf(e,t)}return l?P(l.apply(e,arguments),()=>e):e})}return e&&te(h,e),t?(p=t,n&&Object.setPrototypeOf(t,n.prototype)):p=n?Object.create(n.prototype):{},$(p,"constructor",h),h.prototype=p,u&&ue(h,u),i.display&&oe(h,i.display),i.implements&&T(i.implements).forEach(e=>e(h)),h},ce=function(e,n){Object.defineProperty(e,n,{enumerable:!1})},le=ce,ae=function(e,n,r,t,u){var i=Symbol();return se(e,Function,[function(){var e=function(){return e[i].apply(this,arguments)};return e},function(){var e=n.apply(this,arguments);if(!e)throw new Error("Constructor must return a function.");this[i]=e,le(this,i)}],r,t,u)},fe=function(e,n,r,t){return n=null==n?0:_(e,n),r=null==r?e.length:_(e,r),t&&(0==t.inclusiveStart&&n++,t.inclusiveEnd&&r++),[n,r]},pe=function(e,n,r,t){var u=n;if([r,t]=fe(e,r,t),M(u))for(var i=r;i<t;i++)e[i]=u(i,e);else e.fill(u,r,t);return e},de=function(e,n){var r=new Array(e||0);return arguments.length>1&&pe(r,n),r},he=function(e,n){return de(n.length,r=>e[n[r]])},ve=function(e,n){return e[n]},me=function(e,n,r){return e[n]=r},ge=function(e,n,r){var t=e;return M(t)?t.apply(r,n):t},ye=function(e,n,r,t,u){t||(t=ve);var i=t(e,n);return void 0===i&&(i=ge(r,[e,n]),u||(u=me),u(e,n,i)),i},we=function(e,n){return e.get(n)},be=function(e,n,r){return e.set(n,r)},xe=function(e,n,r){return ye(e,n,r,we,be)},Ee=class{constructor(){this.store=new Map}get(e,n){return xe(this.store,e,n)}remove(e){return this.store.delete(e)}delete(e){return this.remove(e)}},Fe=function(e,n){return e.push(n),e},Ae=Fe,Oe=function(e){var n=e;return Array.isArray(n)?n:Array.from(n)},Se=Symbol("Value"),_e=function(){return{}},je=function(e){return[e.slice(0,-1),e[e.length-1]]},Ie=je,ke=function(e,n,r,t,u,i){r||(r=ve),null==t&&(t=_e),null==u&&(u=me),null==i&&(i=r);for(var[o,s]=Ie(n),c=e,l=o.length,a=0;a<l;a++){var f=o[a],p=r(c,f);if(void 0===p){if(!t)return;p=ye(c,f,t,r,u)}c=p}if(i)return i(c,s,u)},Ne=function(e,n,r,t,u,i){return ke(e,n,t,u,i,(e,n)=>ye(e,n,r,t,i))},qe=function(){return new Map},Re=function(e,n,r){return Ne(e,n,r,we,qe,be)},Te=function(e,n){return delete e[n],e},Ce=function(e,n,r,t){return ke(e,n,r,!1,!1,t||Te)},Pe=function(e,n){return e.delete(n)},Me=function(e,n){return Ce(e,n,we,Pe)},Le=class{constructor(){this.store=new Map}get(e,n){return e=Ae(Oe(e),Se),Re(this.store,e,n)}remove(e){return e=Ae(Oe(e),Se),Me(this.store,e)}delete(e){return this.remove(e)}},De=ae("MemoizedFunction",function(e,n){if(this.base=e,null!=n)if(1===(n=T(n)).length){this.cache=new Ee;var r=n[0];this._cacheKeyFormatter=e=>e[r]}else this.cache=new Le,this._cacheKeyFormatter=e=>he(e,n);else this.cache=new Le,this._cacheKeyFormatter=e=>e;var t=this;return function(){var n=t._cacheKeyFormatter(arguments);return t.cache.get(n,()=>e.apply(this,arguments))}},{remove(e){return this.cache.remove(this._cacheKeyFormatter(e))}}),We=function(e,n){return new De(e,n)},Ke=function(e){return new Set(e)},Be=function(e){var n={};if(e){var r=Ke(e);r.has("g")&&(n.global=!0),r.has("i")&&(n.caseInsensitive=!0),r.has("y")&&(n.sticky=!0)}return n},Ue=function(e){var n="";return e.global&&(n+="g"),(e.caseInsensitive||0==e.caseSensitive)&&(n+="i"),e.sticky&&(n+="y"),n},Ye=function(e,n){var r=Be(e);return Ue(Object.assign(r,n))},ze=function(e,n){var r=n,t=void 0;return s(r)?t=r:S(r)&&(t=Ye(e.flags,r)),new RegExp(e,t)},Je=function(e,n){return ze(e,e.flags+n)},Ve=function(e){return Je(e,"g")},Ge=We(function(e){return e.global?e:Ve(e)},0),Qe=function(e){var n=e;return null==n?void 0:s(n)?n:Ue(n)},$e=function(e,n){return new RegExp(e,Qe(n))},He=function(e){return e.replace(/[-[\]{}()*+!<=:?.\/\\^$|#\s,]/g,"\\$&")},Xe=function(e,n){return $e(He(e),n)},Ze=function(e,n,r,t,u,i){return N(e,function(e){return e.replaceAll?(R(n)&&(n=Ge(n)),e.replaceAll(n,r)):(n=s(n)?Xe(n,"g"):Ge(n),this.replace(n,r))},t,u,i)},en=function(e,n,r){return Ze(e,n,(r??"\\")+n)},nn=function(e,n,r){return null==n&&(n='"'),!1!==r&&(e=en(e,n,r)),n+e+n},rn=function(e){return nn(e,'"')},tn=S,un=function(e){return tn(e)?pn(e):String(e)},on=function(e,n){return n||(n=sn),"["+e.reduce(function(e,r){return e+n(r)+", "},"").slice(0,-2)+"]"},sn=function(e){return s(e)?rn(e):m(e)?on(e):un(e)},cn=function(e){return Reflect.ownKeys(e)},ln=function(e,n){return(n?cn:Object.keys)(e)},an=function(e,n,r){ln(e,r).forEach((r,t,u)=>n(r,e[r],t,u))},fn=function(e,n,r,t){var u=null!=r?r:"";return an(e,function(){u=n.call(this,u,...arguments)},t),u},pn=function(e,n){return n||(n=sn),"{"+fn(e,function(e,r,t){return e+r+":"+n(t)+", "},"",!0).slice(0,-2)+"}"},dn=function(e,n){return null==n&&(n=1),n<=0?"[object Object]":pn(e,e=>vn(e,n-1))},hn=function(e,n){return null==n&&(n=1),n<=0?"[object Array]":on(e,e=>vn(e,n-1))},vn=function(e,n){return void 0===e?"undefined":null===e?"null":b()?A(e,n):S(e)?dn(e,maxNumLevels):m(e)?hn(e,maxNumLevels):un(e)},mn=function(e,n,r,t){if(0===arguments.length)return new w("Unexpected value received");t||(t={});var u,{expected:i}=t;return u=i?"Received "+vn(e)+", expected one of "+vn(i):"Unexpected value received: "+vn(e),r&&(u+=' for "'+r+'"'),null!=n&&(u+=" (index "+n+")"),t.fromFn||(t.fromFn=mn),new w(u,t)},gn=g(globalThis.TypeError),yn=function(e){return null==e?e:e.constructor},wn=function(e,n,r,t){if(0===arguments.length)return new gn("Unexpected type received");t||(t={});var u,{type:i,expected:o}=t;return null==i&&(i=yn(e)),i&&i.name&&(i=i.name),o?(o.name&&(o=o.name),u="Expected "+o+", received "):u="Unexpected type received (",u+=i,null!=e&&(u+=" ("+vn(e)+")"),o||(u+=")"),r&&(u+=' for "'+r+'"'),null!=n&&(u+=" (index "+n+")"),t.fromFn||(t.fromFn=wn),new gn(u,t)},bn=function(e){var n=e.stdio;if(n){if(!m(n)){if(!s(n))throw wn(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 mn(n,"stdio");n=["overlapped","overlapped","overlapped"]}e.stdio=n}}else n=e.stdio=[null,null,null];return n},xn=function(e,n,r){var t=new y(e,r);return n&&Object.assign(t,n),t},En=function(e,n){var r=n.length;e.length=r;for(var t=0;t<r;t++)e[t]=n[t];return e},Fn=function(e){return function(){return!e.apply(this,arguments)}},An=function(e,n){return En(e,e.filter(Fn(n)))},On=function(e){return An(e,e=>null==e)},Sn=E("child_process"),_n=e(function(){return"win32"===process.platform}),jn=function(e,n,r){if(r||(r={}),n(e))throw e;if(r.nullOnErr)return null;var t=r.onErr;if(void 0!==t)return ge(t);throw e},In=function(e,n,r){r||(r={}),r.dir&&(r.cwd=r.dir);var t=bn(r);if(null==t[0]){var u=r.allowInput,i=r.input;if(u&&i)throw xn("allowInput (user) and input (programmatic) cannot be used simultaneously for synchronous child processes.");u&&(t[0]="inherit")}if(null==t[1]){var o=r.captureOutput??!1,s=r.showOutput;if(o&&s)throw xn("captureOutput and showOutput cannot be used simultaneously for synchronous child processes.");o?t[1]="pipe":(null==s&&(s=!0),t[1]=s?"inherit":"ignore")}if(null==t[2]){var c=r.captureErr??!1,l=r.showErr;if(c&&l)throw xn("captureErr and showErr cannot be used simultaneously for synchronous child processes.");c?t[2]="pipe":(null==l&&(l=!0),t[2]=l?"inherit":"ignore")}r.encoding||(r.encoding="utf8"),n&&On(n);try{var a=Sn().execFileSync(e,n,r);null!=a&&!1!==r.trim&&(a=a.trim());var f=r.map??r.mapFn;return f&&(a=f(a)),a}catch(e){if(_n())return jn(e,e=>"ENOENT"===e.code,r);throw e}},kn=function(e,n){return n||(n={}),null==n.captureOutput&&(n.captureOutput=!1),n.shell=!0,n.filterExtensions=!1,In("npm",e,n)},Nn=function(e,n,r){return kn(["install",e,n?"-g":null],r)},qn=E("path"),Rn=qn().sep,Tn=function(e,n,r){var t=qn().resolve,u=n?t(n,e):t(e);return r?u+Rn:u},Cn=function(e){return require(Tn(e))},Pn=class{constructor(){this.store={}}get(e,n){return X(this.store,e,n)}remove(e){return delete this.store[e]}delete(e){return this.remove(e)}},Mn=new Pn,Ln=function(e){return e[e.length-1]},Dn=_,Wn=function(e,n,r){return e=ze(e,{global:!0}),null!=r&&(n=Dn(r,n)),e.lastIndex=n,e},Kn=function(e,n,r){return e=null!=r?Wn(e,r,n):Ge(e),Array.from(n.matchAll(e))},Bn=function(e,n,r){return null!=r&&(n=n.slice(0,r)),Ln(Kn(e,n))||null},Un=function(e,n){var r=Bn(e,n);return r&&n.length===r.index+r[0].length?r:null},Yn=function(e,n){if(s(n))return e.endsWith(n);if(R(n))return!!Un(n,e);throw wn(n,1,"matchThis")},zn=function(e){return Yn(e,Rn)?e:e+Rn},Jn=function(e,n,r){if(b()){var t=qn().join(e,n);return r?zn(t):t}throw ne()},Vn=function(e,n){return e.endsWith(n)?e:Jn(e,n)},Gn=E("module"),Qn=function(e){return e=Vn(e,"node_modules"),Gn().createRequire(e)},$n=function(e,n){return Mn.get(e,()=>Qn(e))(n)},Hn=function(e,n,r){return Object.keys(n).forEach(t=>X(e,t,n[t],r)),e},Xn=function(e,n,r){return n?Hn(e,n,r):e},Zn=function(e,n){return e.endsWith(n)?e.substring(0,e.length-n.length):e},er=function(e,n){var r=Un(n,e);return r?e.slice(0,r.index):e},nr=function(e,n){if(s(n))return Zn(e,n);if(R(n))return er(e,n);throw wn(n,1)},rr=nr,tr=function(e,n){return[e.slice(0,n),e.slice(n)]},ur=function(e){e=rr(e.trim(),";");var n=Math.max(e.lastIndexOf(";"),e.lastIndexOf("\n"));return tr(e,n+1)},ir=function(e,n){return e.startsWith(n)?e:n+e},or=function(e){var[n,r]=ur(e);return n+ir(r.trim(),"return ")},sr=function(e){return Ot("node-repl-await").processTopLevelAwait(e)},cr=function(e){return sr(e)??e},lr=Ze,ar=function(e,n){return""===e?e:(!1!==n&&(e=zn(e)),lr(e,"\\","/"))},fr=function(e,n){return l(e,n).slice()},pr=fr,dr=function(){var e=require.main?.filename;return e||(null!=process._eval?null:pr(process.argv)[1])},hr=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},vr=function(e){return e.split(".")[0]},mr=function(e){return qn().win32.basename(e)},gr=function(e){return vr(mr(e))},yr=function(e,n,r,t){e||(e=dr()??"_console.js");var u=hr(gr(e));return n&&(u+="_repl"),u+(r&&t?.dynamic?".dypkg.json":".pkg.js")},wr=function(e,n){return e=qn().dirname(e),!1===n?e:zn(e)},br=function(e,n,r,t){var u,i=yr(e,n,r,t);return u=e?wr(e):"./",Tn(u+i)},xr=function(e){return'require("'+ar(br(),!1)+'");\n'+e},Er=function(e,n){return Ze(e,n,"")},Fr=function(e,n){return n.forEach(n=>e=Er(e,n)),e},Ar=function(e){return Fr(e,["\r","\n"])},Or=function(e,n){return Ot("astring").generate(e,n)},Sr=function(e,n){return e.stack=n+"\n"+e.stack,e},_r=function(e,n,r){r||(r={}),r.ecmaVersion||(r.ecmaVersion=2024),!1!==n&&(r.sourceType="module"),null==r.allowAwaitOutsideFunction&&(r.allowAwaitOutsideFunction=!0),null==r.allowReturnOutsideFunction&&(r.allowReturnOutsideFunction=!0);var t=Ot("acorn");try{return t.parse(e,r)}catch(n){throw Sr(n,"Acorn parsing error: "+e)}},jr=function(e,n,r){return Or(_r(e,n,r))},Ir=function(e){return Ar(jr(e))},kr=function(e,n,r){return(n||r)&&(n||(n={}),r&&Xn(n,r),n.ensureReturn&&(e=or(e)),n.topLevelAwait&&(e=cr(e)),n.useTitan&&(e=xr(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=Ir(e))),e},Nr=function(e){return s(e)?e:un(e)},qr=function(e){var n=e.indexOf("{");return-1===n||e.slice(0,n).includes("=>")},Rr=function(e,n,r,t,u){return k(e,n,r,t,(n,r)=>null===n?null:(n.input=e,void 0!==r&&(n.index+=r),n),u)},Tr=function(e,n){return e.splice(e.length,0,...n),n},Cr=function(e,n){return Tr(e,n),e},Pr=Cr,Mr=class extends Array{constructor(e,n,r,t,u){if(-1===n)throw xn("RegexResult index cannot be -1. For empty result, use bare null.");if(null==e)throw xn("RegexResult matchString cannot be null. For empty result, use bare null.");super(),this[0]=e,t&&Pr(this,t),this.index=n,this.input=r,u&&(this.groups=u)}fromParts(e){var n=e;return new Mr(n.match,n.index,n.input,n.captures,n.groups)}},Lr=function(e,n,r,t,u){return new Mr(e,n,r,t,u)},Dr=function(e,n,r,t,u){return-1===n||null==e?null:Lr(e,n,r,t,u)},Wr=Er,Kr=function(e,n){return ze(e,Wr(e.flags,n))},Br=function(e){return Kr(e,"g")},Ur=We(function(e){return e.global?Br(e):e},0),Yr=function(e,n,r){return(e=null!=r?Wn(e,r,n):Ur(e)).exec(n)},zr=function(e,n,r,t,u){return Rr(e,e=>{if(s(n)){var r=e.indexOf(n);return Dr(n,r,e)}return Yr(n,e)},r,t,u)},Jr=function(e){return e.index+e[0].length},Vr=function(e,n){var r=zr(e,n);return null===r[0]?null:e.slice(Jr(r))},Gr=function(e,n){return e.startsWith(n)?e.substring(n.length):e},Qr=function(e,n){var r=Yr(e,n);return r&&0===r.index?r:null},$r=function(e,n){var r=Qr(n,e);return r?e.slice(r[0].length):e},Hr=function(e,n){if(s(n))return Gr(e,n);if(R(n))return $r(e,n);throw wn(n,1)},Xr=Hr,Zr=function(e){var n=Vr(e,"=>").trim();return Xr(rr(n,"}"),"{")},et=function(e){return Vr(e,"{").slice(0,-1)},nt=function(e){var n=Nr(e);return qr(n)?Zr(n):et(n)},rt=function(e){return null==e?"":s(e)?e:M(e)?nt(e):String(e)},tt=function(e,n){var r=n?.basic?null:{topLevelAwait:!0,useTitan:!0},t=kr(rt(e),n,r);return In("node",[n?.mode??"-p",t],n)},ut=function(e,n,r,t){var u="Required argument";return r&&(u+=' "'+r+'"'),null!=n&&(u+=" (index "+n+")"),u+=" missing",arguments.length>0&&(u+=" (received "+vn(e)+")"),xn(u,null,ee(t,ut))},it=function(e,n,r){if(null==e)throw ut(e,n,r,{fromFn:it});return e},ot=function(e,n){return process.kill(e,it(n,0,"signalName"))},st=function(e){return ot(e,"SIGINT")},ct=function(){return st(process.pid)},lt=ct,at=function(e){if("Y"===(e=e.toUpperCase()))return!0;if("N"===e)return!1;throw mn(e,0,"char")},ft=function(e){null==e&&(e="Are you sure? [y/n]: "),process.stdout.write(e);var n=tt(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))})},{mode:"-e",basic:!0,stdio:["inherit","pipe"]});if("^C"===n)throw process.stdout.write(n),lt(),xn("Prompt was cancelled via interrupt.");return console.log(n),at(n)},pt=function(e){return m(e)?e:s(e)?e.split("."):[e]},dt=function(e,n,r,t,u,i){var o=r;return ke(e,n,t,u,i,(e,n,r)=>r(e,n,ge(o)))},ht=function(e,n){var r=n,t=globalThis.config;t||(t=globalThis.config={});var u,i=pt(e);return i.length>1?u=dt(t,i,r):(u=ge(r),t[i[0]]=u),u},vt=function(e,n){return ht("node.require.customDirs",r=>(r||(r=[]),!1!==n&&(e=Vn(e,"node_modules")),r.includes(e)||r.push(e),r)),e},mt=vt,gt=ke,yt=function(e){var n=globalThis.config;if(n){var r=pt(e);return r.length>1?gt(n,r):n[r[0]]}},wt=function(e,n,r){if(null!=e)return e;var t=yt(n);return null!=t?t:r},bt=E("fs"),xt=function(e){return!!bt().lstatSync(e,{throwIfNoEntry:!1})},Et=function(e){var n=wr(e,!1);return xt(n)||(n!==e&&Et(n),bt().mkdirSync(n)),e},Ft=function(e){return Et(e),bt().mkdirSync(e),e},At=function(e){return xt(e)?e:Ft(e)},Ot=function(e,n){if(h(e))return require(e);if(v(e))return Cn(e);try{return require(e)}catch(e){}var r=__dirname,t=process.mainModule?.path;if(t!==r)try{return $n(t,e)}catch(e){}var u=process.cwd();if(u!==t&&u!==r)try{return $n(u,e)}catch(e){}var i=yt("node.require.customDirs");if(i)for(var o of i)try{return $n(o,e)}catch(e){}var s=wt(n?.autoInstall,"node.require.autoInstall"),c=wt(n?.promptInstall,"node.require.promptInstall",!0);if(s||c){var l=s||c;!0===l&&(l="./node_modules"),l=Tn(l);var a=!1;if(s?(a=!0,console.log('Auto-installing "'+e+'" from npm to "'+l+'"...')):(a=ft('Npm package "'+e+'" is required. Install now? (Y/N) '))&&console.log('Installing "'+e+'" from npm to "'+l+'"...'),a){l=At(l),Nn(e,!1,{cwd:l});try{return mt(l),$n(l,e)}catch(e){console.error("Failed to load from auto-install dir: ",l)}}}throw xn('Module not found: "'+e+'"',{checked:{moduleDir:r,scriptDir:t,cwd:u}})},St=function(e){return bt().readFileSync(e,"utf8")},_t=St,jt=function(e){return JSON.parse(_t(e))},It={env:{parseArgs:p,args:r,setConfig:ht,getConfig:yt,resolveConfig:wt},node:{parseArgs:f,args:n,pause:function(e){null!=e&&(e=String(e)),Ot("press-any-key-sync")(e)},require:Ot,_basicRequire:d,is:b,display:A,util:F,_builtInModule:E,requireBuiltIn:x,child_process:Sn,requireLocal:Cn,path:qn,_requireFromDir:$n,_requireDirCache:Mn,_createRequire:Qn,module:Gn,promptYNSync:ft,run:tt,getScriptPath:dr,positionalArgs:pr,sigint:lt,interrupt:ct,ensureRequireDir:mt,addRequireDir:vt,fs:bt,loadPackageJSON:function(e){var n=e??"./";return n.endsWith("package.json")||(n=Jn(n,"package.json")),xt(n)?jt(n):{}}},cli:{parseArgs:a,resolveArgs:l,splitArgs:c,positionalArgs:fr},f:{one:e,memoize:We,MemoizedFunction:De,createClass:ae,ensureConstructor:B,createConstructor:K,isArrowFn:D,isArrow:L,is:M,wrap:W,retThis:U,setName:re,not:Fn,body:nt,isArrowString:qr,_getArrowFnBody:Zr,_getNormalFnBody:et},s:{is:s,isAny:o,isPrimitive:u,isObject:i,toLiteral:rn,quote:nn,escape:en,replaceAll:Ze,apply:N,withIndices:k,chars:Ke,from:un,endsWith:Yn,resolveIndex:Dn,removeTrailing:rr,removeFromEnd:nr,_removeStringFromEnd:Zn,_removeRegexFromEnd:er,splitAtIndex:tr,ensureStartsWith:ir,replace:lr,decapitalize:hr,removeLineBreaks:Ar,removeMulti:Fr,removeAll:Er,resolve:rt,ensure:Nr,after:Vr,match:zr,_matchWithIndices:Rr,remove:Wr,removeLeading:Xr,removeFromStart:Hr,_removeStringFromStart:Gr,_removeRegexFromStart:$r},npm:{isBuiltIn:h,isFile:v,install:Nn,_runCommand:kn},os:{run:In,_resolveStdio:bn},a:{is:m,wrapIndices:I,wrapIndex:j,resolveIndex:_,ensure:T,pick:he,create:de,fill:pe,resolveIndices:fe,push:Ae,add:Fe,splitLast:Ie,splitTail:je,toLiteral:on,display:hn,removeNullish:On,removeByFilter:An,replaceContents:En,last:Ln,pushMulti:Pr,addMulti:Cr,pushThroughMulti:Tr},err:{value:mn,ValueError:w,Error:y,Enhanced:g,nyi:ne,NYIError:H,defaultFromFn:ee,type:wn,TypeError:gn,create:xn,prepend:Sr,req:ut},v:{display:vn,constructorMatches:O,toLiteral:sn,isPrimitive:Y,resolve:ge,type:yn,req:it},macro:{config:function(e){}},o:{is:S,display:dn,toLiteral:pn,constructorMatches:q,isAny:z,setHidden:$,addNonEnumerable:Q,defineProperty:G,weakAssign:V,merge:J,safeEnsure:Z,ensure:X,hideKey:le,makeNonEnumerable:ce,ensureCustom:ye,get:ve,set:me,createEmpty:_e,remove:Te,isPure:tn,reduce:fn,each:an,keys:ln,allKeys:cn,Cache:Pn,setDefaults:Xn,ensureMulti:Hn,resolveKeys:pt,diveGet:gt},re:{is:R,ensureGlobal:Ge,global:Ve,addFlag:Je,copy:ze,updateFlagString:Ye,parseFlagString:Be,createFlagString:Ue,createEscaped:Xe,create:$e,resolveFlags:Qe,escape:He,matchEnd:Un,matchLast:Bn,matchAll:Kn,setStartIndex:Wn,safeCreateResult:Dr,createResult:Lr,RegexResult:Mr,match:Yr,ensureLocal:Ur,local:Br,removeFlag:Kr,resultEndIndex:Jr,matchStart:Qr},class:{create:se,setName:te,addStatics:ue,setDisplay:oe},p:{asyncJoint:P,is:C},sym:{display:ie,value:Se},map:{Cache:Ee,ensure:xe,get:we,set:be,MultiCache:Le,diveEnsure:Re,createEmpty:qe,diveDelete:Me,remove:Pe},args:{ensureArray:Oe},tree:{ensure:Ne,dive:ke,remove:Ce,setCustom:dt},win:{is:_n},shell:{_handleError:jn},path:{abs:Tn,sep:Rn,ensureEndsWith:Vn,join:Jn,ensureTrailingSlash:zn,fws:ar,baseName:gr,_removeExtsFromFile:vr,file:mr,dir:wr},js:{enhance:kr,ensureReturn:or,splitLastExpression:ur,enableAwait:cr,_nodeEnableAwait:sr,useTitan:xr,inline:Ir,removeComments:jr,fromAST:Or,parse:_r},titan:{getPackagePath:br,getPackageName:yr},proc:{interrupt:st,signal:ot},bool:{fromYN:at},fs:{ensureDir:At,exists:xt,mkdir:Ft,ensureParent:Et,loadJSON:jt,loadText:_t,load:St}};globalThis.t?Object.keys(It).forEach(function(e){if(t[e]){var n=It[e];Object.keys(n).forEach(function(r){t[e][r]=n[r]})}else t[e]=It[e]}):globalThis.t=Object.assign({},It),globalThis.exports&&(exports.default=globalThis.t);
|
package/cli.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require("./cli.pkg.js"),t.node.onError(r=>{console.log(r)}),args=t.cli.parseArgs(),params=async function(...r){return t.cli.paramsFrom(args,r)};var r=t.node.pause;pause=function(){args.np||r()},args.cwd&&process.chdir(args.cwd),env=process.env,args.np||t.node.beforeExit(pause),require("./script.min.js");
|
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 e instanceof String},i=function(e){return n(e)||r(e)},u=i,o=function(e){return Array.isArray(e)},s=function(e){return o(e)?e:[e]},a=function(e){return e instanceof Promise},l=function(e,n){var r=e;return a(r)?r.then(n):n(r)},c=function(e){return"function"==typeof e},f=function(e){return c(e)&&null==e.prototype},h=f,p=function(e){return function(){return e.apply(this,arguments)}},d=function(e,n){var r;return r=n?function(){this.super=n;var r=e.apply(this,arguments);return l(r,()=>(delete this.super,r))}:h(e)?p(e):e,r._isConstructor=!0,r},v=function(e,n){return e._isConstructor?e:d(e,n)},m=function(){return this},y=function(e){var n=typeof e;return"object"!==n&&"function"!==n||null===e},g=function(e){return!y(e)},w=function(e,n,r){return!1===r?Object.keys(n).forEach(r=>{void 0===e[r]&&(e[r]=n[r])}):Object.assign(e,n),e},b=function(e,n){return w(e,n,!1)},E=function(e,n,r,i){return r||(r={}),i&&b(r,i),null==r.enumerable&&(r.enumerable=!0),null==r.configurable&&(r.configurable=!0),Object.defineProperty(e,n,r)},x=function(e,n,r,i){return E(e,n,{value:r,writable:!0,enumerable:!1},i),r},_=x,k=function(e){return class extends e{constructor(e,n){super(e,n);var r=this.constructor.name;r&&(this.name=r)}}},A=k(globalThis.Error),L=class extends A{constructor(e,n){super(e??"Not yet implemented",n)}},F=function(e,n,r,i){var u=e[n];if(void 0===u){var o=r;!1!==i&&c(o)&&(o=o(e,n)),e[n]=u=o}return u},O=function(e,n,r,i){return e||(e={}),F(e,n,r,i),e},S=function(e,n){return O(e,"fromFn",n,!1)},T=function(e,n){return new L(e,S(n,T))},C=function(e,n){Object.defineProperty(e,"name",{value:n,configurable:!0}),_(e,"displayName",n)},I=C,j=function(e,n){return Object.assign(e,n)},R=function(e){var n,r=!1;return function(){return r||(r=!0,n=e.apply(this,arguments)),n}},P=R(function(){return"undefined"==typeof window}),N=P()?require("util").inspect.custom:Symbol("Display"),q=function(e,n){e.prototype[N]=n},M=function(e,n,r,i,a,c){c||(c={}),u(n)&&(n=null);var f,h,p,d=r;d&&(o(d)?([h,p]=d,h&&(h=v(h))):f=v(d,n));var y=c.bareFn;c.singleton&&(y=function(){return null==E.default&&(E.default=new E(...arguments)),E.default});var w,b=h||f||n||m;function E(){if(!new.target&&y&&!(this instanceof E))return y.apply(this,arguments);var e=this;return l(b.apply(e,arguments),r=>{if(r&&g(r)&&(e=r,h)){if(!new.target)throw T('Prototype repair is NYI for class instantiation without "new".');if(!n)throw T("instanceFn is not yet supported when extendsClass is null.");var i=Object.getPrototypeOf(this);Object.getPrototypeOf(e)!==i&&Object.setPrototypeOf(e,i)}return p?l(p.apply(e,arguments),()=>e):e})}return e&&I(E,e),i?(w=i,n&&Object.setPrototypeOf(i,n.prototype)):w=n?Object.create(n.prototype):{},_(w,"constructor",E),E.prototype=w,a&&j(E,a),c.display&&q(E,c.display),c.implements&&s(c.implements).forEach(e=>e(E)),E},D=function(e,n){Object.defineProperty(e,n,{enumerable:!1})},B=D,W=function(e,n,r,i,u){var o=Symbol();return M(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,B(this,o)}],r,i,u)},H=function(e){return n=>n===e},K=function(e){return Reflect.ownKeys(e)},Y=function(e,n){return(n?K:Object.keys)(e)},U=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},V=function(e){return e instanceof Set},z=function(e){return V(e)?e:o(e)?new Set(e):new Set([e])},G=z,Q=function(e,n){var r=[],i=[];return e.forEach((u,o)=>(n(u,o,e)?r:i).push(u)),[r,i]},J=function(e,n,r,i){var u=n;if(c(u))throw T();var o=Y(e,i),s=G(u),[a,l]=Q(o,e=>s.has(e));return[U(e,a,r),!0===r?e:U(e,l,!1)]},$=function(e,n,r){var i=Y(e,r).filter(r=>n(e[r],r,e));return J(e,i,!1,r)},X=function(e,n){return n<e?n:e},Z=function(e,n){return X(e,n)},ee=function*(e,n){null==e&&(e=0),n=null==n?this.length:Z(n,this.length);for(var r=e;r<n;r++)yield this[r]},te=function(e,n,r){return null==n&&null==r?e[Symbol.iterator].call(e):ee.call(e,n,r)},ne=function(e,n){return n<0?e.length+n:n},re=function(e,n,r,i){return n=null==n?0:ne(e,n),r=null==r?e.length:ne(e,r),i&&(0==i.inclusiveStart&&n++,i.inclusiveEnd&&r++),[n,r]},ie=function(e,n,r,i){[r,i]=re(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},ue=function(e,n){return n?ie(Y(e,n),n=>[n,e[n]]):Object.entries(e)},oe=function(e){return te(ue(this,e))},se=function(e,n){var r=e[Symbol.iterator];return r?r.call(e):oe.call(e,n)},ae=function(e){return se(e,!0)},le=function(e,n){return null!=e&&e.constructor===n},ce=function(e){return le(e,Object)},fe=ce,he=function(e,n,r,i){return E(e,n,{get:r},i)},pe=function(e,n,r,i){return E(e,n,{value:r,writable:!0},i),r},de=function(e,n,r){he(e,n,function(){if(this===e)return null;var i=r.call(this);return pe(this,n,i),i})},ve=class extends A{constructor(e,n){super(e??"Unexpected value",n)}},me=function(e){return require("node:"+e)},ye=function(e){return R(()=>me(e))},ge=ye("util"),we=function(e,n){return n||(n={}),null==n.colors&&(n.colors=!0),ge().inspect(e,n)},be=ne,Ee=function(e,n,r,i){return void 0!==n&&(null===n||0===n?n=void 0:(n=be(e,n),i&&0==i.inclusiveStart&&n++)),void 0!==r&&(null===r||r===e.length?r=void 0:(r=be(e,r),i&&i.inclusiveEnd&&r++)),[n,r]},xe=function(e,n,r,i,u,o){if(r||null!=i){[r,i]=Ee(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)},_e=function(e,n,r,i,u){return xe(e,n,r,i,(n,r,i)=>(void 0!==r?e.slice(0,r):"")+(n||"")+(void 0!==i?e.slice(i):""),u)},ke=le,Ae=function(e){return ke(e,RegExp)},Le=function(e,n,r,i){var u=n;if([r,i]=re(e,r,i),c(u))for(var o=r;o<i;o++)e[o]=u(o,e);else e.fill(u,r,i);return e},Fe=function(e,n){var r=new Array(e||0);return arguments.length>1&&Le(r,n),r},Oe=function(e,n){return Fe(n.length,r=>e[n[r]])},Se=function(e,n){return e[n]},Te=function(e,n,r){return e[n]=r},Ce=function(e,n,r){var i=e;return c(i)?i.apply(r,n):i},Ie=function(e,n,r,i,u){i||(i=Se);var o=i(e,n);return void 0===o&&(o=Ce(r,[e,n]),u||(u=Te),u(e,n,o)),o},je=function(e,n){return e.get(n)},Re=function(e,n,r){return e.set(n,r)},Pe=function(e,n,r){return Ie(e,n,r,je,Re)},Ne=class{constructor(){this.store=new Map}get(e,n){return Pe(this.store,e,n)}remove(e){return this.store.delete(e)}delete(e){return this.remove(e)}},qe=function(e,n){return e.push(n),e},Me=qe,De=function(e){var n=e;return Array.isArray(n)?n:Array.from(n)},Be=Symbol("Value"),We=function(){return{}},He=function(e){return[e.slice(0,-1),e[e.length-1]]},Ke=He,Ye=function(e,n,r,i,u,o){r||(r=Se),null==i&&(i=We),null==u&&(u=Te),null==o&&(o=r);for(var[s,a]=Ke(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=Ie(l,h,i,r,u)}l=p}if(o)return o(l,a,u)},Ue=function(e,n,r,i,u,o){return Ye(e,n,i,u,o,(e,n)=>Ie(e,n,r,i,o))},Ve=function(){return new Map},ze=function(e,n,r){return Ue(e,n,r,je,Ve,Re)},Ge=function(e,n){return delete e[n],e},Qe=function(e,n,r,i){return Ye(e,n,r,!1,!1,i||Ge)},Je=function(e,n){return e.delete(n)},$e=function(e,n){return Qe(e,n,je,Je)},Xe=class{constructor(){this.store=new Map}get(e,n){return e=Me(De(e),Be),ze(this.store,e,n)}remove(e){return e=Me(De(e),Be),$e(this.store,e)}delete(e){return this.remove(e)}},Ze=W("MemoizedFunction",function(e,n){if(this.base=e,null!=n)if(1===(n=s(n)).length){this.cache=new Ne;var r=n[0];this._cacheKeyFormatter=e=>e[r]}else this.cache=new Xe,this._cacheKeyFormatter=e=>Oe(e,n);else this.cache=new Xe,this._cacheKeyFormatter=e=>e;var i=this;return function(){var n=i._cacheKeyFormatter(arguments);return i.cache.get(n,()=>e.apply(this,arguments))}},{remove(e){return this.cache.remove(this._cacheKeyFormatter(e))}}),et=function(e,n){return new Ze(e,n)},tt=function(e){return new Set(e)},nt=function(e){var n={};if(e){var r=tt(e);r.has("g")&&(n.global=!0),r.has("i")&&(n.caseInsensitive=!0),r.has("y")&&(n.sticky=!0)}return n},rt=function(e){var n="";return e.global&&(n+="g"),(e.caseInsensitive||0==e.caseSensitive)&&(n+="i"),e.sticky&&(n+="y"),n},it=function(e,n){var r=nt(e);return rt(Object.assign(r,n))},ut=function(e,n){var r=n,i=void 0;return u(r)?i=r:ce(r)&&(i=it(e.flags,r)),new RegExp(e,i)},ot=function(e,n){return ut(e,e.flags+n)},st=function(e){return ot(e,"g")},at=et(function(e){return e.global?e:st(e)},0),lt=function(e){var n=e;return null==n?void 0:u(n)?n:rt(n)},ct=function(e,n){return new RegExp(e,lt(n))},ft=function(e){return e.replace(/[-[\]{}()*+!<=:?.\/\\^$|#\s,]/g,"\\$&")},ht=function(e,n){return ct(ft(e),n)},pt=function(e,n,r,i,o,s){return _e(e,function(e){return e.replaceAll?(Ae(n)&&(n=at(n)),e.replaceAll(n,r)):(n=u(n)?ht(n,"g"):at(n),this.replace(n,r))},i,o,s)},dt=function(e,n,r){return pt(e,n,(r??"\\")+n)},vt=function(e,n,r){return null==n&&(n='"'),!1!==r&&(e=dt(e,n,r)),n+e+n},mt=function(e){return vt(e,'"')},yt=function(e){return fe(e)?xt(e):String(e)},gt=function(e,n){return n||(n=wt),"["+e.reduce(function(e,r){return e+n(r)+", "},"").slice(0,-2)+"]"},wt=function(e){return u(e)?mt(e):o(e)?gt(e):yt(e)},bt=function(e,n,r){Y(e,r).forEach((r,i,u)=>n(r,e[r],i,u))},Et=function(e,n,r,i){var u=null!=r?r:"";return bt(e,function(){u=n.call(this,u,...arguments)},i),u},xt=function(e,n){return n||(n=wt),"{"+Et(e,function(e,r,i){return e+r+":"+n(i)+", "},"",!0).slice(0,-2)+"}"},kt=function(e,n){return null==n&&(n=1),n<=0?"[object Object]":xt(e,e=>Lt(e,n-1))},At=function(e,n){return null==n&&(n=1),n<=0?"[object Array]":gt(e,e=>Lt(e,n-1))},Lt=function(e,n){return void 0===e?"undefined":null===e?"null":P()?we(e,n):ce(e)?kt(e,maxNumLevels):o(e)?At(e,maxNumLevels):yt(e)},Ft=function(e,n,r,i){if(0===arguments.length)return new ve("Unexpected value received");i||(i={});var u,{expected:o}=i;return u=o?"Received "+Lt(e)+", expected one of "+Lt(o):"Unexpected value received: "+Lt(e),r&&(u+=' for "'+r+'"'),null!=n&&(u+=" (index "+n+")"),i.fromFn||(i.fromFn=Ft),new ve(u,i)},Ot=function(e,n,r){var i=new A(e,r);return n&&Object.assign(i,n),i},St=function*(e,n){yield*e,yield*n},Tt=function(e){return e?" "+e:""},Ct=function(e){return u(e)?e:e.toString()},It=W("Interface",function(e,n,r){r||(r={}),C(this,e),n?[this.stubs,this.defaults]=$(n,H(!0),!0):(this.stubs={},this.defaults={});var i=r.implements?s(r.implements):null,u=this;return function(e){var n=e;return i&&i.forEach(e=>e(n)),u.decorate(n),u.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),ae(this.defaults)))if(void 0===n[u])if(fe(o))if(o.value)n[u]=o.value;else{if(!o.setup)throw Ft(o,null,"defaultVal");if(!r)throw o.setup(),T("setupFn is NYI for instances");de(n,u,o.setup)}else n[u]=o;return i},assert(e){var n=e,r=null!=n.prototype,i=n.prototype||n,u=St(ae(this.stubs),ae(this.defaults));for(var[o]of u){var s;if(void 0===i[o])throw s=r?"Class"+Tt(n.name):"Object "+Lt(n),s+=" does not satisfy interface "+this.name+' (missing key "'+Ct(o)+'")',Ot(s)}return n},validate(e){try{return this.assert(e),!0}catch(e){return!1}}},{is(e){return e instanceof this}}),jt=function(e,n,r){return new It(e,n,r)},Rt=Symbol("Cleanup"),Pt=jt("Handle",{remove:!0,[Rt](){this.remove()}}),Nt=e(class{constructor(e){this.handles=e}remove(){this.handles.forEach(e=>e.remove())}add(e){return this.handles.push(e),this}},Pt),qt=function(e){return 1===e.length&&o(e[0])?e[0]:array},Mt=function(...e){return new Nt(qt(e))},Dt=Mt,Bt=Dt,Wt=function(e){var n,r,i=e;return null!=i&&(n=i.detail??i.data??i,g(i)&&(r=i)),[n,r,i]},Ht=function(e){return It.is(e)},Kt=Ht,Yt=k(globalThis.TypeError),Ut=function(e){return null==e?e:e.constructor},Vt=function(e,n,r,i){if(0===arguments.length)return new Yt("Unexpected type received");i||(i={});var u,{type:o,expected:s}=i;return null==o&&(o=Ut(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+=" ("+Lt(e)+")"),s||(u+=")"),r&&(u+=' for "'+r+'"'),null!=n&&(u+=" (index "+n+")"),i.fromFn||(i.fromFn=Vt),new Yt(u,i)},zt=function(e,n,r){if(!Kt(n))throw Vt(n,1);return n.decorate(e),r&&r.call(e,e,n),n.assert(e),e},Gt=jt,Qt=Symbol("EventTarget"),Jt=function(e){return require(e)},$t=function(e){return!!e.startsWith("node:")||Jt("node:module").isBuiltin(e)},Xt=function(e){return e.startsWith(".")},Zt=function(e){var n=e.stdio;if(n){if(!o(n)){if(!u(n))throw Vt(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 Ft(n,"stdio");n=["overlapped","overlapped","overlapped"]}e.stdio=n}}else n=e.stdio=[null,null,null];return n},en=function(e,n){var r=n.length;e.length=r;for(var i=0;i<r;i++)e[i]=n[i];return e},tn=function(e){return function(){return!e.apply(this,arguments)}},nn=function(e,n){return en(e,e.filter(tn(n)))},rn=function(e){return nn(e,e=>null==e)},un=ye("child_process"),on=R(function(){return"win32"===process.platform}),sn=function(e,n,r){if(r||(r={}),n(e))throw e;if(r.nullOnErr)return null;var i=r.onErr;if(void 0!==i)return Ce(i);throw e},an=function(e,n,r){r||(r={}),r.dir&&(r.cwd=r.dir);var i=Zt(r);if(null==i[0]){var u=r.allowInput,o=r.input;if(u&&o)throw Ot("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 Ot("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 Ot("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&&rn(n);try{var f=un().execFileSync(e,n,r);null!=f&&!1!==r.trim&&(f=f.trim());var h=r.map??r.mapFn;return h&&(f=h(f)),f}catch(e){if(on())return sn(e,e=>"ENOENT"===e.code,r);throw e}},ln=function(e,n){return n||(n={}),null==n.captureOutput&&(n.captureOutput=!1),n.shell=!0,n.filterExtensions=!1,an("npm",e,n)},cn=function(e,n,r){return ln(["install",e,n?"-g":null],r)},fn=ye("path"),hn=fn().sep,pn=function(e,n,r){var i=fn().resolve,u=n?i(n,e):i(e);return r?u+hn:u},dn=function(e){return require(pn(e))},vn=class{constructor(){this.store={}}get(e,n){return F(this.store,e,n)}remove(e){return delete this.store[e]}delete(e){return this.remove(e)}},mn=new vn,yn=function(e){return e[e.length-1]},gn=ne,wn=function(e,n,r){return e=ut(e,{global:!0}),null!=r&&(n=gn(r,n)),e.lastIndex=n,e},bn=function(e,n,r){return e=null!=r?wn(e,r,n):at(e),Array.from(n.matchAll(e))},En=function(e,n,r){return null!=r&&(n=n.slice(0,r)),yn(bn(e,n))||null},xn=function(e,n){var r=En(e,n);return r&&n.length===r.index+r[0].length?r:null},_n=function(e,n){if(u(n))return e.endsWith(n);if(Ae(n))return!!xn(n,e);throw Vt(n,1,"matchThis")},kn=function(e){return _n(e,hn)?e:e+hn},An=function(e,n,r){if(P()){var i=fn().join(e,n);return r?kn(i):i}throw T()},Ln=function(e,n){return e.endsWith(n)?e:An(e,n)},Fn=ye("module"),On=function(e){return e=Ln(e,"node_modules"),Fn().createRequire(e)},Sn=function(e,n){return mn.get(e,()=>On(e))(n)},Tn=function(e,n,r){return Object.keys(n).forEach(i=>F(e,i,n[i],r)),e},Cn=function(e,n,r){return n?Tn(e,n,r):e},In=function(e,n){return e.endsWith(n)?e.substring(0,e.length-n.length):e},jn=function(e,n){var r=xn(n,e);return r?e.slice(0,r.index):e},Rn=function(e,n){if(u(n))return In(e,n);if(Ae(n))return jn(e,n);throw Vt(n,1)},Pn=Rn,Nn=function(e,n){return[e.slice(0,n),e.slice(n)]},qn=function(e){e=Pn(e.trim(),";");var n=Math.max(e.lastIndexOf(";"),e.lastIndexOf("\n"));return Nn(e,n+1)},Mn=function(e,n){return e.startsWith(n)?e:n+e},Dn=function(e){var[n,r]=qn(e);return n+Mn(r.trim(),"return ")},Bn=function(e){return ai("node-repl-await").processTopLevelAwait(e)},Wn=function(e){return Bn(e)??e},Hn=pt,Kn=function(e,n){return""===e?e:(!1!==n&&(e=kn(e)),Hn(e,"\\","/"))},Yn=R(function(){return process.argv.slice(2)}),Un=Yn,Vn=function(e,n){const r=[];let i="",u="outside",o=!1;for(let s=0;s<e.length;s++){const a=e[s];switch(u){case"outside":'"'===a?o?(i+=a,o=!1):(n&&(i+=a),u="insideQuote"):"\\"===a?o=!0:" "===a?(i.length>0&&(r.push(i),i=""),o=!1):(i+=a,o=!1);break;case"insideQuote":'"'!==a||o?"\\"!==a||o?(i+=a,o=!1):o=!0:(n&&(i+=a),u="outside")}}return i.length>0&&r.push(i),r},zn=function(e,n){var r=e;return null==r?Un():u(r)?Vn(r,n):r},Gn=function(e,n){return zn(e,n).slice()},Qn=Gn,Jn=function(){var e=require.main?.filename;return e||(null!=process._eval?null:Qn(process.argv)[1])},$n=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},Xn=function(e){return e.split(".")[0]},Zn=function(e){return fn().win32.basename(e)},er=function(e){return Xn(Zn(e))},tr=function(e,n,r,i){e||(e=Jn()??"_console.js");var u=$n(er(e));return n&&(u+="_repl"),u+(r&&i?.dynamic?".dypkg.json":".pkg.js")},nr=function(e,n){return e=fn().dirname(e),!1===n?e:kn(e)},rr=function(e,n,r,i){var u,o=tr(e,n,r,i);return u=e?nr(e):"./",pn(u+o)},ir=function(e){return'require("'+Kn(rr(),!1)+'");\n'+e},ur=function(e,n){return pt(e,n,"")},or=function(e,n){return n.forEach(n=>e=ur(e,n)),e},sr=function(e){return or(e,["\r","\n"])},ar=function(e,n){return ai("astring").generate(e,n)},lr=function(e,n){return e.stack=n+"\n"+e.stack,e},cr=function(e,n,r){r||(r={}),r.ecmaVersion||(r.ecmaVersion=2024),!1!==n&&(r.sourceType="module"),null==r.allowAwaitOutsideFunction&&(r.allowAwaitOutsideFunction=!0),null==r.allowReturnOutsideFunction&&(r.allowReturnOutsideFunction=!0);var i=ai("acorn");try{return i.parse(e,r)}catch(n){throw lr(n,"Acorn parsing error: "+e)}},fr=function(e,n,r){return ar(cr(e,n,r))},hr=function(e){return sr(fr(e))},pr=function(e,n,r){return(n||r)&&(n||(n={}),r&&Cn(n,r),n.ensureReturn&&(e=Dn(e)),n.topLevelAwait&&(e=Wn(e)),n.useTitan&&(e=ir(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=hr(e))),e},dr=function(e){return u(e)?e:yt(e)},vr=function(e){var n=e.indexOf("{");return-1===n||e.slice(0,n).includes("=>")},mr=function(e,n,r,i,u){return xe(e,n,r,i,(n,r)=>null===n?null:(n.input=e,void 0!==r&&(n.index+=r),n),u)},yr=function(e,n){return e.splice(e.length,0,...n),n},gr=function(e,n){return yr(e,n),e},wr=gr,br=class extends Array{constructor(e,n,r,i,u){if(-1===n)throw Ot("RegexResult index cannot be -1. For empty result, use bare null.");if(null==e)throw Ot("RegexResult matchString cannot be null. For empty result, use bare null.");super(),this[0]=e,i&&wr(this,i),this.index=n,this.input=r,u&&(this.groups=u)}fromParts(e){var n=e;return new br(n.match,n.index,n.input,n.captures,n.groups)}},Er=function(e,n,r,i,u){return new br(e,n,r,i,u)},xr=function(e,n,r,i,u){return-1===n||null==e?null:Er(e,n,r,i,u)},_r=ur,kr=function(e,n){return ut(e,_r(e.flags,n))},Ar=function(e){return kr(e,"g")},Lr=et(function(e){return e.global?Ar(e):e},0),Fr=function(e,n,r){return(e=null!=r?wn(e,r,n):Lr(e)).exec(n)},Or=function(e,n,r,i,o){return mr(e,e=>{if(u(n)){var r=e.indexOf(n);return xr(n,r,e)}return Fr(n,e)},r,i,o)},Sr=function(e){return e.index+e[0].length},Tr=function(e,n){var r=Or(e,n);return null===r[0]?null:e.slice(Sr(r))},Cr=function(e,n){return e.startsWith(n)?e.substring(n.length):e},Ir=function(e,n){var r=Fr(e,n);return r&&0===r.index?r:null},jr=function(e,n){var r=Ir(n,e);return r?e.slice(r[0].length):e},Rr=function(e,n){if(u(n))return Cr(e,n);if(Ae(n))return jr(e,n);throw Vt(n,1)},Pr=Rr,Nr=function(e){var n=Tr(e,"=>").trim();return Pr(Pn(n,"}"),"{")},qr=function(e){return Tr(e,"{").slice(0,-1)},Mr=function(e){var n=dr(e);return vr(n)?Nr(n):qr(n)},Dr=function(e){return null==e?"":u(e)?e:c(e)?Mr(e):String(e)},Br=function(e,n){var r=n?.basic?null:{topLevelAwait:!0,useTitan:!0},i=pr(Dr(e),n,r);return an("node",[n?.mode??"-p",i],n)},Wr=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 "+Lt(e)+")"),Ot(u,null,S(i,Wr))},Hr=function(e,n,r){if(null==e)throw Wr(e,n,r,{fromFn:Hr});return e},Kr=function(e,n){return process.kill(e,Hr(n,0,"signalName"))},Yr=function(e){return Kr(e,"SIGINT")},Ur=function(){return Yr(process.pid)},Vr=Ur,zr=function(e){if("Y"===(e=e.toUpperCase()))return!0;if("N"===e)return!1;throw Ft(e,0,"char")},Gr=function(e){null==e&&(e="Are you sure? [y/n]: "),process.stdout.write(e);var n=Br(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))})},{mode:"-e",basic:!0,stdio:["inherit","pipe"]});if("^C"===n)throw process.stdout.write(n),Vr(),Ot("Prompt was cancelled via interrupt.");return console.log(n),zr(n)},Qr=function(e){return o(e)?e:u(e)?e.split("."):[e]},Jr=function(e,n,r,i,u,o){var s=r;return Ye(e,n,i,u,o,(e,n,r)=>r(e,n,Ce(s)))},$r=function(e,n){var r=n,i=globalThis.config;i||(i=globalThis.config={});var u,o=Qr(e);return o.length>1?u=Jr(i,o,r):(u=Ce(r),i[o[0]]=u),u},Xr=function(e,n){return $r("node.require.customDirs",r=>(r||(r=[]),!1!==n&&(e=Ln(e,"node_modules")),r.includes(e)||r.push(e),r)),e},Zr=Xr,ei=Ye,ti=function(e){var n=globalThis.config;if(n){var r=Qr(e);return r.length>1?ei(n,r):n[r[0]]}},ni=function(e,n,r){if(null!=e)return e;var i=ti(n);return null!=i?i:r},ri=ye("fs"),ii=function(e){return!!ri().lstatSync(e,{throwIfNoEntry:!1})},ui=function(e){var n=nr(e,!1);return ii(n)||(n!==e&&ui(n),ri().mkdirSync(n)),e},oi=function(e){return ui(e),ri().mkdirSync(e),e},si=function(e){return ii(e)?e:oi(e)},ai=function(e,n){if($t(e))return require(e);if(Xt(e))return dn(e);try{return require(e)}catch(e){}var r=__dirname,i=process.mainModule?.path;if(i!==r)try{return Sn(i,e)}catch(e){}var u=process.cwd();if(u!==i&&u!==r)try{return Sn(u,e)}catch(e){}var o=ti("node.require.customDirs");if(o)for(var s of o)try{return Sn(s,e)}catch(e){}var a=ni(n?.autoInstall,"node.require.autoInstall"),l=ni(n?.promptInstall,"node.require.promptInstall",!0);if(a||l){var c=a||l;!0===c&&(c="./node_modules"),c=pn(c);var f=!1;if(a?(f=!0,console.log('Auto-installing "'+e+'" from npm to "'+c+'"...')):(f=Gr('Npm package "'+e+'" is required. Install now? (Y/N) '))&&console.log('Installing "'+e+'" from npm to "'+c+'"...'),f){c=si(c),cn(e,!1,{cwd:c});try{return Zr(c),Sn(c,e)}catch(e){console.error("Failed to load from auto-install dir: ",c)}}}throw Ot('Module not found: "'+e+'"',{checked:{moduleDir:r,scriptDir:i,cwd:u}})},li=R(function(){if(!globalThis.CustomEvent||!globalThis.EventTarget||!globalThis.Event){var e=ai("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}}),ci=li().EventTarget,fi=function(e){var n=Qt,r=e[n];return void 0===r&&(r=new ci,_(e,n,r)),r},hi=Gt("EventInterface",{addEventListener(e,n,r){fi(this).addEventListener(e,n,r)},on(e,n){this.addEventListener(e,n)},removeEventListener(e,n){fi(this).removeEventListener(e,n)},off(e,n){this.removeEventListener(e,n)},dispatchEvent(e){return fi(this).dispatchEvent(e)}}),pi=hi,di=function(e){return zt(e,pi)},vi=function(e){return!(!e.addEventListener&&!e.on)},mi=function(e){return vi(e)||di(e),e},yi=function(e,n,r){return e[n]=r,e},gi=function(e,n,r){return yi(e||{},n,r)},wi=function(e,n,r,i){return Ti(e,n,r,gi(i,"once",!0))},bi=function(e,n){return function(){var r=n.apply(this,arguments);return e.apply(this,arguments),r}},Ei=bi,xi=function(e,n,r){return e[n]=Ei(e[n],r)},_i=e(class{constructor(e){this._remover=e}remove(){this._remover()}removeOn(e,n,r){r&&mi(e);var i=wi(target,n,()=>this.remove());return xi(this,"remove",()=>i.remove()),this}},Pt),ki=class extends _i{constructor(e,n){super(e),this.handleEvent=n}},Ai=function(e,n){return new ki(e,n)},Li=function(e,n,r){(e.removeEventListener||e.off).call(e,n,r)},Fi=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},Oi=function(e,n){return Fi(e,0,n)},Si=Oi,Ti=function(e,n,r,i){if(i?.valueFirst){var u=r;r=function(e){var[n,r]=Wt(e);return Si(arguments,n),arguments[1]=r,u.apply(this,arguments)}}var o=e.addEventListener;return o||(e.on?o=i?.once?e.once:e.on:(di(e),o=e.addEventListener)),o.call(e,n,r,i),Ai(()=>Li(e,n,r),r)},Ci=function(e,n,r,i){return Bt(n.map(n=>Ti(e,n,r,i)))},Ii=function(){return globalThis.repl?.repl},ji=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,yi([],n,e))))}},Ri=async function(){}.constructor,Pi=function(e){return le(e,Ri)},Ni=function(e){return Pi(e)?e:async function(){return e.apply(this,arguments)}},qi=R(function(){return ai("node:stream")}),Mi=P()&&qi().Writable,Di=function(e,n){return n||(n={}),null==n.objectMode&&(n.objectMode=!0),e?n.write=ji(Ni(e),0):n.write||(n.write=(e,n,r)=>r()),new Mi(n)},Bi=function(){},Wi=async function(e){var n=Ii();if(n){var r,i=n.eval,u=n.output;n.output=Di(Bi),n.eval=Bi;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()},Hi=ye("readline"),Ki=/\r?\n/,Yi=function(e){return null==e||void 0!==e.length&&0===e.length},Ui=function(e,n){return nn(e,Yi)},Vi=function(e,n){return e.splice(n,1),e},zi=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},Gi=function(e,n,r,i){return[n,r]=re(e,n,r,i),e.slice(n,r)},Qi=function(e,n){return Fe(n,e).join("")},Ji=function(e){return e?e[0]:null},$i=function(e,n){var r=null==n?-1:n.index;if(-1===r)return[e];var i=Nn(e,r);return i[1]=i[1].slice(n[0].length),i},Xi=function(e,n,r,i,u){return $i(e,Or(e,n,r,i,u))},Zi=function(e){return isNaN(e)?null:e},eu=function(e){return null==e?null:Zi(Number(e))},tu=eu,nu=function(e){return tu(e)??e},ru=function(e,n){null==n&&(n="=");var r={};return e.forEach(function(e){var[i,u]=Xi(e,n);null!=u&&(u=nu(u.trim())),r[i.trim()]=u}),r},iu=O,uu=class extends Array{constructor(e){var n,r=e;null!=r&&(o(r)?n=r:u(r)&&(n=r.split(Ki))),n?(super(n.length),Object.assign(this,n)):super(...arguments)}condense(e){return this.trim().removeEmpty(),e&&this.removeComments(e),this}trim(){return this.apply(e=>e.trim())}removeEmpty(){return Ui(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()?(Vi(this,n),n--):this[n]=r)}return this}removeFirst(){return this.shift(),this}removeLast(){return this.pop(),this}apply(e){return ie(this,e)}join(){return super.join("\n")}toObj(e){return ru(this,e)}mapToObj(e,n){return zi(this,e,n)}between(e,n,r){return r=iu(r,"inclusiveEnd",!0),Gi(this,e,n,r)}normalize(){if(this.length>0&&(""===this[0].trim()&&this.shift(),this.length>0&&(""===yn(this).trim()&&this.pop(),this.length>0))){var e=this.find(e=>""!==e.trim()),n=Ji(Fr(/^\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 T()}indent(e,n){var r=Qi(n??"\t",e??1);return this.apply(e=>r+e)}static is(e){return le(e,this)}static fromChunks(e){return e.map(e=>Pn(e,Ki)).flatMap(e=>su(e,!1))}},ou=function(e,n){var r=new uu(e);return n&&r.condense(),r},su=function(e,n,r){var i=e.split(Ki);return n?ou(i,r):i},au=function(e){return ri().readFileSync(e,"utf8")},lu=au,cu=function(e,n){return su(lu(e),!0,n)},fu=function(e){var n=typeof e;return"number"===n||"bigint"===n},hu=function(e){return e instanceof Buffer},pu=function(e){return ArrayBuffer.isView(e)},du=pu,vu=function(e){return hu(e)||du(e)||u(e)},mu=function(e){return e.constructor===ArrayBuffer},yu=function(e){return vu(e)?e:mu(e)?Buffer.from(e):yt(e)},gu=function(e){return fu(e)?String(e):yu(e)},wu=function(e,n){return ui(e),ri().appendFileSync(e,gu(n)),e},bu=function(e,n){return wu(e,"\n"+n)},Eu=bu,xu=function(e){return pt(e,"\n","\\n")},_u=xu,ku=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},Au="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",Lu=function(e){return ku(e,Au)},Fu=function(e,n){for(var r=dr(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},Ou=function(e){return Fu(e,Au)},Su=function(e,n){return Object.keys(e).map((r,i)=>n(r,e[r],i,e))},Tu=function(e){return e.slice()},Cu=function(e,n){return e.includes(n)||e.push(n),e},Iu=class{constructor(e,n,r,i){(n=o(n)?Tu(n):[n]).forEach(i),e&&Cu(n,e),this.members=n,this._enableFn=r,this._disableFn=i}enable(e){this.members.forEach(n=>{n!==e&&this._disableFn(n)}),this._enableFn(e)}disableAll(){this.members.forEach(e=>this._disableFn(e))}},ju=function(e,n,r,i){return new Iu(e,n,r,i)},Ru=function(e,n,r){return new Promise(function(i,u){var o=Bt([wi(e,n||"load",e=>{o.remove(),i(e)}),wi(e,r||"error",e=>{o.remove(),u(e)})])})},Pu=M("CLI",P()&&Hi().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=ii(e.historyPath)?cu(e.historyPath):[];e.history=n.reverse()}var r={inputWasRaw:e.input.isRaw},i=Hi().createInterface(e);return i.options=e,i.internal=r,i},function(){var e=this.options;this.rl=Hi(),e.historyPath&&this.on("history",n=>Eu(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=Hn(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 Ce(r);return this.prompt(e),i&&this.write(_u(dr(i))),this.awaitLine()},async promptMultiline(e,n,r,i){if(null==n&&(n="... "),null==r)r=e=>""===e,i||(i=e=>(e.pop(),e));else if(u(r)){var o=r;r=e=>e.endsWith(o)}for(var s=await this.promptLine(e),a=[s];!r(s,a.length,a);)s=await this.promptLine(n),a.push(s);return i&&i(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,r){var i=n;r||(r={});var u=0;function s(){return u++,Lu(u)}if(fe(i))i=Su(i,(e,n,r)=>[s(),e,n]);else{if(!o(i))throw Vt(i);i=i.map((e,n)=>{if(null==e)return null;if(o(e)){var r=e[0];if(null==r)r=s();else if((r=dr(r)).length>1)throw Ot("Input key must be a single character:",e);var i=e.length;if(1===i)return[r,r,r];if(2===i){var u=e[1];return[r,u,u]}if(3===i)return[r,e[1],e[2]];throw Ot("Unexpected array length in choices: "+i)}return[s(),e,e]}),rn(i)}if(i.length>35)throw Ot("promptSelect only supports up to 35 options.");var a=r.displayFn||((e,n)=>"["+e+"] "+n);this.quickDisableHistory(()=>{for(var e=0;e<i.length;e++){var[n,r,u]=i[e];this.write(a(n,r,u,i)+"\n")}});var l=zi(i,e=>[e[0],e]),f=await this.promptKey(e,Object.keys(l)),h=l[f];if(null==h)throw Ft(h,"choice");var p=h[2];return c(p)&&(p=await p(h)),r.asObj?{key:f,name:h[1],value:p}:r.asIndex?Ou(f)-1:p},blockExcept(e,n){e=s(e).map(e=>String(e).toLowerCase()),0!=n&&Cu(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=ju(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=Bi,this._historyNext=Bi},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 Ru(this,"line")},newLine(){this.write("\n")},newline(){return this.newLine()},onKey(e,n,r){var i=e,u=this.input;if(this.rl.emitKeypressEvents(u),u.isTTY&&u.setRawMode(!0),i){var s=n;if(o(i)){var a=i.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(i).toLowerCase();n=(e,n)=>{e||(e=n.name),e.toLowerCase()===l&&s.call(this,e,n)}}}return Ti(u,"keypress",n,r)},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)}}),Nu=function(e,n){return Wi(async function(){var r=new Pu(n);try{var i=await e(r)}finally{r.close()}return i})},qu=function(e,n){return Nu(n=>n.promptLine(e),n)},Mu=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 qu(a+": ")),!l))throw Hr(void 0,o,a)}i[a]=l}return i},Du={node:{onError:function(e){return Ci(process,["uncaughtException","unhandledRejection"],e)},is:P,display:we,util:ge,_builtInModule:ye,requireBuiltIn:me,require:ai,_basicRequire:Jt,child_process:un,requireLocal:dn,path:fn,_requireFromDir:Sn,_requireDirCache:mn,_createRequire:On,module:Fn,promptYNSync:Gr,run:Br,getScriptPath:Jn,positionalArgs:Qn,args:Yn,sigint:Vr,interrupt:Ur,ensureRequireDir:Zr,addRequireDir:Xr,fs:ri,pause:function(e){null!=e&&(e=String(e)),ai("press-any-key-sync")(e)},beforeExit:function(e){return Ti(process,"beforeExit",e)},prompt:qu,quickCLI:Nu,quickDisableREPL:Wi,getREPL:Ii,CLI:Pu,readline:Hi},ev:{onAny:Ci,multiHandle:Bt,on:Ti,resolveValue:Wt,enable:di,EventInterface:pi,Interface:hi,_ensureHasTarget:fi,targetSym:Qt,EventTarget:ci,polyfill:li,handle:Ai,ListenerHandle:ki,ensureEnabled:mi,can:vi,once:wi,off:Li,promise:Ru},o:{multiHandle:Dt,isAny:g,setHidden:_,addNonEnumerable:x,defineProperty:E,weakAssign:b,merge:w,safeEnsure:O,ensure:F,hideKey:B,makeNonEnumerable:D,filterSplit:$,keys:Y,allKeys:K,split:J,pick:U,iterateAll:ae,iterate:se,iterator:oe,entries:ue,isPure:fe,is:ce,setProtoLazy:de,setGetter:he,forceSet:pe,display:kt,toLiteral:xt,constructorMatches:ke,ensureCustom:Ie,get:Se,set:Te,createEmpty:We,remove:Ge,reduce:Et,each:bt,addInterface:zt,Cache:vn,setDefaults:Cn,ensureMulti:Tn,resolveKeys:Qr,diveGet:ei,safeSet:gi,touch:yi,fromLines:ru,safeDefault:iu,mapArr:Su,mutex:ju,_Mutex:Iu},handle:{createMulti:Mt,MultiHandle:Nt,HandleInterface:Pt,Handle:_i},class:{addInterface:e,create:M,setName:I,addStatics:j,setDisplay:q,isInterface:Kt,interface:Gt},ifc:{create:jt,Interface:It,is:Ht},f:{createClass:W,ensureConstructor:v,createConstructor:d,isArrowFn:h,isArrow:f,is:c,wrap:p,retThis:m,setName:C,one:R,eq:H,memoize:et,MemoizedFunction:Ze,not:tn,body:Mr,isArrowString:vr,_getArrowFnBody:Nr,_getNormalFnBody:qr,hookAfterMethod:xi,hookAfter:Ei,injectAfter:bi,callbackify:ji,ensureAsync:Ni,isAsync:Pi,AsyncFunction:Ri,noop:Bi},s:{is:u,isAny:i,isPrimitive:n,isObject:r,toLiteral:mt,quote:vt,escape:dt,replaceAll:pt,apply:_e,withIndices:xe,chars:tt,from:yt,spaceBefore:Tt,fromKey:Ct,endsWith:_n,resolveIndex:gn,removeTrailing:Pn,removeFromEnd:Rn,_removeStringFromEnd:In,_removeRegexFromEnd:jn,splitAtIndex:Nn,ensureStartsWith:Mn,replace:Hn,decapitalize:$n,removeLineBreaks:sr,removeMulti:or,removeAll:ur,resolve:Dr,ensure:dr,after:Tr,match:Or,_matchWithIndices:mr,remove:_r,removeLeading:Pr,removeFromStart:Rr,_removeStringFromStart:Cr,_removeRegexFromStart:jr,splitLines:su,lines:ou,LinesArray:uu,repeat:Qi,splitFirst:Xi,_splitByMatch:$i,escapeLineBreaks:_u,escapeNewLines:xu},a:{is:o,ensure:s,filterSplit:Q,iterate:te,iterator:ee,apply:ie,resolveIndices:re,resolveIndex:ne,wrapIndices:Ee,wrapIndex:be,pick:Oe,create:Fe,fill:Le,push:Me,add:qe,splitLast:Ke,splitTail:He,toLiteral:gt,display:At,unboxArgs:qt,removeNullish:rn,removeByFilter:nn,replaceContents:en,last:yn,pushMulti:wr,addMulti:gr,pushThroughMulti:yr,removeEmpty:Ui,removeIndex:Vi,mapToObj:zi,slice:Gi,copy:Tu,ensureContains:Cu},p:{asyncJoint:l,is:a},v:{isPrimitive:y,constructorMatches:le,display:Lt,toLiteral:wt,resolve:Ce,type:Ut,req:Hr,isEmpty:Yi,nullIfNaN:Zi},err:{nyi:T,NYIError:L,Error:A,Enhanced:k,defaultFromFn:S,value:Ft,ValueError:ve,create:Ot,type:Vt,TypeError:Yt,prepend:lr,req:Wr},sym:{display:N,value:Be,cleanup:Rt},macro:{config:function(e){}},set:{resolve:G,ensure:z,is:V},n:{cap:Z,least:X,tryCoerce:nu,tryParse:tu,ensure:eu,is:fu,toBase36:Lu,toCustomBase:ku,_base36Digits:Au,fromBase36:Ou,fromCustomBase:Fu},re:{is:Ae,ensureGlobal:at,global:st,addFlag:ot,copy:ut,updateFlagString:it,parseFlagString:nt,createFlagString:rt,createEscaped:ht,create:ct,resolveFlags:lt,escape:ft,matchEnd:xn,matchLast:En,matchAll:bn,setStartIndex:wn,safeCreateResult:xr,createResult:Er,RegexResult:br,match:Fr,ensureLocal:Lr,local:Ar,removeFlag:kr,resultEndIndex:Sr,matchStart:Ir,newline:Ki,text:Ji},map:{Cache:Ne,ensure:Pe,get:je,set:Re,MultiCache:Xe,diveEnsure:ze,createEmpty:Ve,diveDelete:$e,remove:Je},args:{ensureArray:De,unshift:Si,prepend:Oi,insert:Fi},tree:{ensure:Ue,dive:Ye,remove:Qe,setCustom:Jr},gen:{join:St},npm:{isBuiltIn:$t,isFile:Xt,install:cn,_runCommand:ln},os:{run:an,_resolveStdio:Zt},win:{is:on},shell:{_handleError:sn},path:{abs:pn,sep:hn,ensureEndsWith:Ln,join:An,ensureTrailingSlash:kn,fws:Kn,baseName:er,_removeExtsFromFile:Xn,file:Zn,dir:nr},js:{enhance:pr,ensureReturn:Dn,splitLastExpression:qn,enableAwait:Wn,_nodeEnableAwait:Bn,useTitan:ir,inline:hr,removeComments:fr,fromAST:ar,parse:cr},titan:{getPackagePath:rr,getPackageName:tr},cli:{positionalArgs:Gn,resolveArgs:zn,splitArgs:Vn,parseArgs:function(e,n){for(var r=zn(e,n),i=[],u=!1,o=r.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},paramsFrom:async function(e,n,r){var i=await Mu(e,n,r);Object.assign(globalThis,i)},validateParams:Mu},env:{args:Un,setConfig:$r,getConfig:ti,resolveConfig:ni},proc:{interrupt:Yr,signal:Kr},bool:{fromYN:zr},fs:{ensureDir:si,exists:ii,mkdir:oi,ensureParent:ui,loadLines:cu,loadText:lu,load:au,appendLine:Eu,addLine:bu,append:wu,formatRaw:gu},stream:{nodeWritable:Di,NodeWritableStream:Mi,_useNode:qi},bin:{ensureByteSafe:yu,isByteSafe:vu,isNodeBuffer:hu,isTA:du},ab:{isTA:pu,is:mu}};globalThis.t?Object.keys(Du).forEach(function(e){if(t[e]){var n=Du[e];Object.keys(n).forEach(function(r){t[e][r]=n[r]})}else t[e]=Du[e]}):globalThis.t=Object.assign({},Du),globalThis.exports&&(exports.default=globalThis.t);
|
|
1
|
+
var e=function(e,t){return t(e)},n=function(e){return"string"==typeof e},r=function(e){return e instanceof String},i=function(e){return n(e)||r(e)},u=i,o=function(e){return Array.isArray(e)},s=function(e){return o(e)?e:[e]},a=function(e){return e instanceof Promise},l=function(e,t){var n=e;return a(n)?n.then(t):t(n)},c=function(e){return"function"==typeof e},f=function(e){return c(e)&&null==e.prototype},h=f,p=function(e){return function(){return e.apply(this,arguments)}},d=function(e,t){var n;return n=t?function(){this.super=t;var n=e.apply(this,arguments);return l(n,()=>(delete this.super,n))}:h(e)?p(e):e,n._isConstructor=!0,n},v=function(e,t){return e._isConstructor?e:d(e,t)},m=function(){return this},y=function(e){var t=typeof e;return"object"!==t&&"function"!==t||null===e},g=function(e){return!y(e)},w=function(e,t,n){return!1===n?Object.keys(t).forEach(n=>{void 0===e[n]&&(e[n]=t[n])}):Object.assign(e,t),e},b=function(e,t){return w(e,t,!1)},E=function(e,t,n,r){return n||(n={}),r&&b(n,r),null==n.enumerable&&(n.enumerable=!0),null==n.configurable&&(n.configurable=!0),Object.defineProperty(e,t,n)},x=function(e,t,n,r){return E(e,t,{value:n,writable:!0,enumerable:!1},r),n},_=x,k=function(e){return class extends e{constructor(e,t){super(e,t);var n=this.constructor.name;n&&(this.name=n)}}},A=k(globalThis.Error),L=class extends A{constructor(e,t){super(e??"Not yet implemented",t)}},F=function(e,t,n,r){var i=e[t];if(void 0===i){var u=n;!1!==r&&c(u)&&(u=u(e,t)),e[t]=i=u}return i},O=function(e,t,n,r){return e||(e={}),F(e,t,n,r),e},S=function(e,t){return O(e,"fromFn",t,!1)},T=function(e,t){return new L(e,S(t,T))},C=function(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0}),_(e,"displayName",t)},I=C,j=function(e,t){return Object.assign(e,t)},R=function(e){var t,n=!1;return function(){return n||(n=!0,t=e.apply(this,arguments)),t}},P=R(function(){return"undefined"==typeof window}),N=P()?require("util").inspect.custom:Symbol("Display"),q=function(e,t){e.prototype[N]=t},M=function(e,t,n,r,i,a){a||(a={}),u(t)&&(t=null);var c,f,h,p=n;p&&(o(p)?([f,h]=p,f&&(f=v(f))):c=v(p,t));var d=a.bareFn;a.singleton&&(d=function(){return null==b.default&&(b.default=new b(...arguments)),b.default});var y,w=f||c||t||m;function b(){if(!new.target&&d&&!(this instanceof b))return d.apply(this,arguments);var e=this;return l(w.apply(e,arguments),n=>{if(n&&g(n)&&(e=n,f)){if(!new.target)throw T('Prototype repair is NYI for class instantiation without "new".');if(!t)throw T("instanceFn is not yet supported when extendsClass is null.");var r=Object.getPrototypeOf(this);Object.getPrototypeOf(e)!==r&&Object.setPrototypeOf(e,r)}return h?l(h.apply(e,arguments),()=>e):e})}return e&&I(b,e),r?(y=r,t&&Object.setPrototypeOf(r,t.prototype)):y=t?Object.create(t.prototype):{},_(y,"constructor",b),b.prototype=y,i&&j(b,i),a.display&&q(b,a.display),a.implements&&s(a.implements).forEach(e=>e(b)),b},D=function(e,t){Object.defineProperty(e,t,{enumerable:!1})},B=D,W=function(e,t,n,r,i){var u=Symbol();return M(e,Function,[function(){var e=function(){return e[u].apply(this,arguments)};return e},function(){var e=t.apply(this,arguments);if(!e)throw new Error("Constructor must return a function.");this[u]=e,B(this,u)}],n,r,i)},H=function(e){return t=>t===e},K=function(e){return Reflect.ownKeys(e)},Y=function(e,t){return(t?K:Object.keys)(e)},U=function(e,t,n){var r={};for(var i of t)Object.hasOwn(e,i)&&(r[i]=e[i],!0===n&&delete e[i]);return r},V=function(e){return e instanceof Set},z=function(e){return V(e)?e:o(e)?new Set(e):new Set([e])},G=z,Q=function(e,t){var n=[],r=[];return e.forEach((i,u)=>(t(i,u,e)?n:r).push(i)),[n,r]},J=function(e,t,n,r){var i=t;if(c(i))throw T();var u=Y(e,r),o=G(i),[s,a]=Q(u,e=>o.has(e));return[U(e,s,n),!0===n?e:U(e,a,!1)]},$=function(e,t,n){var r=Y(e,n).filter(n=>t(e[n],n,e));return J(e,r,!1,n)},X=function(e,t){return t<e?t:e},Z=function(e,t){return X(e,t)},ee=function*(e,t){null==e&&(e=0),t=null==t?this.length:Z(t,this.length);for(var n=e;n<t;n++)yield this[n]},te=function(e,t,n){return null==t&&null==n?e[Symbol.iterator].call(e):ee.call(e,t,n)},ne=function(e,t){return t<0?e.length+t:t},re=function(e,t,n,r){return t=null==t?0:ne(e,t),n=null==n?e.length:ne(e,n),r&&(0==r.inclusiveStart&&t++,r.inclusiveEnd&&n++),[t,n]},ie=function(e,t,n,r){[n,r]=re(e,n,r);for(var i=n;i<r;i++){var u=t(e[i],i,e);void 0!==u&&(e[i]=u)}return e},ue=function(e,t){return t?ie(Y(e,t),t=>[t,e[t]]):Object.entries(e)},oe=function(e){return te(ue(this,e))},se=function(e,t){var n=e[Symbol.iterator];return n?n.call(e):oe.call(e,t)},ae=function(e){return se(e,!0)},le=function(e,t){return null!=e&&e.constructor===t},ce=function(e){return le(e,Object)},fe=ce,he=function(e,t,n,r){return E(e,t,{get:n},r)},pe=function(e,t,n,r){return E(e,t,{value:n,writable:!0},r),n},de=function(e,t,n){he(e,t,function(){if(this===e)return null;var r=n.call(this);return pe(this,t,r),r})},ve=class extends A{constructor(e,t){super(e??"Unexpected value",t)}},me=function(e){return require("node:"+e)},ye=function(e){return R(()=>me(e))},ge=ye("util"),we=function(e,t){return t||(t={}),null==t.colors&&(t.colors=!0),ge().inspect(e,t)},be=ne,Ee=function(e,t,n,r){return void 0!==t&&(null===t||0===t?t=void 0:(t=be(e,t),r&&0==r.inclusiveStart&&t++)),void 0!==n&&(null===n||n===e.length?n=void 0:(n=be(e,n),r&&r.inclusiveEnd&&n++)),[t,n]},xe=function(e,t,n,r,i,u){if(n||null!=r){[n,r]=Ee(e,n,r,u);var o=e.slice(n,r),s=t(o);return i?i(s,n,r,o,e):s}return t(e)},_e=function(e,t,n,r,i){return xe(e,t,n,r,(t,n,r)=>(void 0!==n?e.slice(0,n):"")+(t||"")+(void 0!==r?e.slice(r):""),i)},ke=le,Ae=function(e){return ke(e,RegExp)},Le=function(e,t,n,r){var i=t;if([n,r]=re(e,n,r),c(i))for(var u=n;u<r;u++)e[u]=i(u,e);else e.fill(i,n,r);return e},Fe=function(e,t){var n=new Array(e||0);return arguments.length>1&&Le(n,t),n},Oe=function(e,t){return Fe(t.length,n=>e[t[n]])},Se=function(e,t){return e[t]},Te=function(e,t,n){return e[t]=n},Ce=function(e,t,n){var r=e;return c(r)?r.apply(n,t):r},Ie=function(e,t,n,r,i){r||(r=Se);var u=r(e,t);return void 0===u&&(u=Ce(n,[e,t]),i||(i=Te),i(e,t,u)),u},je=function(e,t){return e.get(t)},Re=function(e,t,n){return e.set(t,n)},Pe=function(e,t,n){return Ie(e,t,n,je,Re)},Ne=class{constructor(){this.store=new Map}get(e,t){return Pe(this.store,e,t)}remove(e){return this.store.delete(e)}delete(e){return this.remove(e)}},qe=function(e,t){return e.push(t),e},Me=qe,De=function(e){var t=e;return Array.isArray(t)?t:Array.from(t)},Be=Symbol("Value"),We=function(){return{}},He=function(e){return[e.slice(0,-1),e[e.length-1]]},Ke=He,Ye=function(e,t,n,r,i,u){n||(n=Se),null==r&&(r=We),null==i&&(i=Te),null==u&&(u=n);for(var[o,s]=Ke(t),a=e,l=o.length,c=0;c<l;c++){var f=o[c],h=n(a,f);if(void 0===h){if(!r)return;h=Ie(a,f,r,n,i)}a=h}if(u)return u(a,s,i)},Ue=function(e,t,n,r,i,u){return Ye(e,t,r,i,u,(e,t)=>Ie(e,t,n,r,u))},Ve=function(){return new Map},ze=function(e,t,n){return Ue(e,t,n,je,Ve,Re)},Ge=function(e,t){return delete e[t],e},Qe=function(e,t,n,r){return Ye(e,t,n,!1,!1,r||Ge)},Je=function(e,t){return e.delete(t)},$e=function(e,t){return Qe(e,t,je,Je)},Xe=class{constructor(){this.store=new Map}get(e,t){return e=Me(De(e),Be),ze(this.store,e,t)}remove(e){return e=Me(De(e),Be),$e(this.store,e)}delete(e){return this.remove(e)}},Ze=W("MemoizedFunction",function(e,t){if(this.base=e,null!=t)if(1===(t=s(t)).length){this.cache=new Ne;var n=t[0];this._cacheKeyFormatter=e=>e[n]}else this.cache=new Xe,this._cacheKeyFormatter=e=>Oe(e,t);else this.cache=new Xe,this._cacheKeyFormatter=e=>e;var r=this;return function(){var t=r._cacheKeyFormatter(arguments);return r.cache.get(t,()=>e.apply(this,arguments))}},{remove(e){return this.cache.remove(this._cacheKeyFormatter(e))}}),et=function(e,t){return new Ze(e,t)},tt=function(e){return new Set(e)},nt=function(e){var t={};if(e){var n=tt(e);n.has("g")&&(t.global=!0),n.has("i")&&(t.caseInsensitive=!0),n.has("y")&&(t.sticky=!0)}return t},rt=function(e){var t="";return e.global&&(t+="g"),(e.caseInsensitive||0==e.caseSensitive)&&(t+="i"),e.sticky&&(t+="y"),t},it=function(e,t){var n=nt(e);return rt(Object.assign(n,t))},ut=function(e,t){var n=t,r=void 0;return u(n)?r=n:ce(n)&&(r=it(e.flags,n)),new RegExp(e,r)},ot=function(e,t){return ut(e,e.flags+t)},st=function(e){return ot(e,"g")},at=et(function(e){return e.global?e:st(e)},0),lt=function(e){var t=e;return null==t?void 0:u(t)?t:rt(t)},ct=function(e,t){return new RegExp(e,lt(t))},ft=function(e){return e.replace(/[-[\]{}()*+!<=:?.\/\\^$|#\s,]/g,"\\$&")},ht=function(e,t){return ct(ft(e),t)},pt=function(e,t,n,r,i,o){return _e(e,function(e){return e.replaceAll?(Ae(t)&&(t=at(t)),e.replaceAll(t,n)):(t=u(t)?ht(t,"g"):at(t),this.replace(t,n))},r,i,o)},dt=function(e,t,n){return pt(e,t,(n??"\\")+t)},vt=function(e,t,n){return null==t&&(t='"'),!1!==n&&(e=dt(e,t,n)),t+e+t},mt=function(e){return vt(e,'"')},yt=function(e){return fe(e)?xt(e):String(e)},gt=function(e,t){return t||(t=wt),"["+e.reduce(function(e,n){return e+t(n)+", "},"").slice(0,-2)+"]"},wt=function(e){return u(e)?mt(e):o(e)?gt(e):yt(e)},bt=function(e,t,n){Y(e,n).forEach((n,r,i)=>t(n,e[n],r,i))},Et=function(e,t,n,r){var i=null!=n?n:"";return bt(e,function(){i=t.call(this,i,...arguments)},r),i},xt=function(e,t){return t||(t=wt),"{"+Et(e,function(e,n,r){return e+n+":"+t(r)+", "},"",!0).slice(0,-2)+"}"},_t=function(e,t){return null==t&&(t=1),t<=0?"[object Object]":xt(e,e=>At(e,t-1))},kt=function(e,t){return null==t&&(t=1),t<=0?"[object Array]":gt(e,e=>At(e,t-1))},At=function(e,t){return void 0===e?"undefined":null===e?"null":P()?we(e,t):ce(e)?_t(e,maxNumLevels):o(e)?kt(e,maxNumLevels):yt(e)},Lt=function(e,t,n,r){if(0===arguments.length)return new ve("Unexpected value received");r||(r={});var i,{expected:u}=r;return i=u?"Received "+At(e)+", expected one of "+At(u):"Unexpected value received: "+At(e),n&&(i+=' for "'+n+'"'),null!=t&&(i+=" (index "+t+")"),r.fromFn||(r.fromFn=Lt),new ve(i,r)},Ft=function(e,t,n){var r=new A(e,n);return t&&Object.assign(r,t),r},Ot=function*(e,t){yield*e,yield*t},St=function(e){return e?" "+e:""},Tt=function(e){return u(e)?e:e.toString()},Ct=W("Interface",function(e,t,n){n||(n={}),C(this,e),t?[this.stubs,this.defaults]=$(t,H(!0),!0):(this.stubs={},this.defaults={});var r=n.implements?s(n.implements):null,i=this;return function(e){var t=e;return r&&r.forEach(e=>e(t)),i.decorate(t),i.assert(t),t}},{decorate(e){var t,n,r=e;for(var[i,u]of(r.prototype?(t=r.prototype,n=!0):(t=r,n=!1),ae(this.defaults)))if(void 0===t[i])if(fe(u))if(u.value)t[i]=u.value;else{if(!u.setup)throw Lt(u,null,"defaultVal");if(!n)throw u.setup(),T("setupFn is NYI for instances");de(t,i,u.setup)}else t[i]=u;return r},assert(e){var t=e,n=null!=t.prototype,r=t.prototype||t,i=Ot(ae(this.stubs),ae(this.defaults));for(var[u]of i){var o;if(void 0===r[u])throw o=n?"Class"+St(t.name):"Object "+At(t),o+=" does not satisfy interface "+this.name+' (missing key "'+Tt(u)+'")',Ft(o)}return t},validate(e){try{return this.assert(e),!0}catch(e){return!1}}},{is(e){return e instanceof this}}),It=function(e,t,n){return new Ct(e,t,n)},jt=Symbol("Cleanup"),Rt=It("Handle",{remove:!0,[jt](){this.remove()}}),Pt=e(class{constructor(e){this.handles=e}remove(){this.handles.forEach(e=>e.remove())}add(e){return this.handles.push(e),this}},Rt),Nt=function(e){return 1===e.length&&o(e[0])?e[0]:array},qt=function(...e){return new Pt(Nt(e))},Mt=qt,Dt=Mt,Bt=function(e){var t,n,r=e;return null!=r&&(t=r.detail??r.data??r,g(r)&&(n=r)),[t,n,r]},Wt=function(e){return Ct.is(e)},Ht=Wt,Kt=k(globalThis.TypeError),Yt=function(e){return null==e?e:e.constructor},Ut=function(e,t,n,r){if(0===arguments.length)return new Kt("Unexpected type received");r||(r={});var i,{type:u,expected:o}=r;return null==u&&(u=Yt(e)),u&&u.name&&(u=u.name),o?(o.name&&(o=o.name),i="Expected "+o+", received "):i="Unexpected type received (",i+=u,null!=e&&(i+=" ("+At(e)+")"),o||(i+=")"),n&&(i+=' for "'+n+'"'),null!=t&&(i+=" (index "+t+")"),r.fromFn||(r.fromFn=Ut),new Kt(i,r)},Vt=function(e,t,n){if(!Ht(t))throw Ut(t,1);return t.decorate(e),n&&n.call(e,e,t),t.assert(e),e},zt=It,Gt=Symbol("EventTarget"),Qt=function(e){return require(e)},Jt=function(e){return!!e.startsWith("node:")||Qt("node:module").isBuiltin(e)},$t=function(e){return e.startsWith(".")},Xt=function(e){var t=e.stdio;if(t){if(!o(t)){if(!u(t))throw Ut(t,"stdio");if("pipe"===t)t=["pipe","pipe","pipe"];else if("inherit"===t)t=["inherit","inherit","inherit"];else if("ignore"===t)t=["ignore","ignore","ignore"];else{if("overlapped"!==t)throw Lt(t,"stdio");t=["overlapped","overlapped","overlapped"]}e.stdio=t}}else t=e.stdio=[null,null,null];return t},Zt=function(e,t){var n=t.length;e.length=n;for(var r=0;r<n;r++)e[r]=t[r];return e},en=function(e){return function(){return!e.apply(this,arguments)}},tn=function(e,t){return Zt(e,e.filter(en(t)))},nn=function(e){return tn(e,e=>null==e)},rn=ye("child_process"),un=R(function(){return"win32"===process.platform}),on=function(e,t,n){if(n||(n={}),t(e))throw e;if(n.nullOnErr)return null;var r=n.onErr;if(void 0!==r)return Ce(r);throw e},sn=function(e,t,n){n||(n={}),n.dir&&(n.cwd=n.dir);var r=Xt(n);if(null==r[0]){var i=n.allowInput,u=n.input;if(i&&u)throw Ft("allowInput (user) and input (programmatic) cannot be used simultaneously for synchronous child processes.");i&&(r[0]="inherit")}if(null==r[1]){var o=n.captureOutput??!1,s=n.showOutput;if(o&&s)throw Ft("captureOutput and showOutput cannot be used simultaneously for synchronous child processes.");o?r[1]="pipe":(null==s&&(s=!0),r[1]=s?"inherit":"ignore")}if(null==r[2]){var a=n.captureErr??!1,l=n.showErr;if(a&&l)throw Ft("captureErr and showErr cannot be used simultaneously for synchronous child processes.");a?r[2]="pipe":(null==l&&(l=!0),r[2]=l?"inherit":"ignore")}n.encoding||(n.encoding="utf8"),t&&nn(t);try{var c=rn().execFileSync(e,t,n);null!=c&&!1!==n.trim&&(c=c.trim());var f=n.map??n.mapFn;return f&&(c=f(c)),c}catch(e){if(un())return on(e,e=>"ENOENT"===e.code,n);throw e}},an=function(e,t){return t||(t={}),null==t.captureOutput&&(t.captureOutput=!1),t.shell=!0,t.filterExtensions=!1,sn("npm",e,t)},ln=function(e,t,n){return an(["install",e,t?"-g":null],n)},cn=ye("path"),fn=cn().sep,hn=function(e,t,n){var r=cn().resolve,i=t?r(t,e):r(e);return n?i+fn:i},pn=function(e){return require(hn(e))},dn=class{constructor(){this.store={}}get(e,t){return F(this.store,e,t)}remove(e){return delete this.store[e]}delete(e){return this.remove(e)}},vn=new dn,mn=function(e){return e[e.length-1]},yn=ne,gn=function(e,t,n){return e=ut(e,{global:!0}),null!=n&&(t=yn(n,t)),e.lastIndex=t,e},wn=function(e,t,n){return e=null!=n?gn(e,n,t):at(e),Array.from(t.matchAll(e))},bn=function(e,t,n){return null!=n&&(t=t.slice(0,n)),mn(wn(e,t))||null},En=function(e,t){var n=bn(e,t);return n&&t.length===n.index+n[0].length?n:null},xn=function(e,t){if(u(t))return e.endsWith(t);if(Ae(t))return!!En(t,e);throw Ut(t,1,"matchThis")},_n=function(e){return xn(e,fn)?e:e+fn},kn=function(e,t,n){if(P()){var r=cn().join(e,t);return n?_n(r):r}throw T()},An=function(e,t){return e.endsWith(t)?e:kn(e,t)},Ln=ye("module"),Fn=function(e){return e=An(e,"node_modules"),Ln().createRequire(e)},On=function(e,t){return vn.get(e,()=>Fn(e))(t)},Sn=function(e,t,n){return Object.keys(t).forEach(r=>F(e,r,t[r],n)),e},Tn=function(e,t,n){return t?Sn(e,t,n):e},Cn=function(e,t){return e.endsWith(t)?e.substring(0,e.length-t.length):e},In=function(e,t){var n=En(t,e);return n?e.slice(0,n.index):e},jn=function(e,t){if(u(t))return Cn(e,t);if(Ae(t))return In(e,t);throw Ut(t,1)},Rn=jn,Pn=function(e,t){return[e.slice(0,t),e.slice(t)]},Nn=function(e){e=Rn(e.trim(),";");var t=Math.max(e.lastIndexOf(";"),e.lastIndexOf("\n"));return Pn(e,t+1)},qn=function(e,t){return e.startsWith(t)?e:t+e},Mn=function(e){var[t,n]=Nn(e);return t+qn(n.trim(),"return ")},Dn=function(e){return si("node-repl-await").processTopLevelAwait(e)},Bn=function(e){return Dn(e)??e},Wn=pt,Hn=function(e,t){return""===e?e:(!1!==t&&(e=_n(e)),Wn(e,"\\","/"))},Kn=R(function(){return process.argv.slice(2)}),Yn=Kn,Un=function(e,t){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):(t&&(r+=s),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:(t&&(r+=s),i="outside")}}return r.length>0&&n.push(r),n},Vn=function(e,t){var n=e;return null==n?Yn():u(n)?Un(n,t):n},zn=function(e,t){return Vn(e,t).slice()},Gn=zn,Qn=function(){var e=require.main?.filename;return e||(null!=process._eval?null:Gn(process.argv)[1])},Jn=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},$n=function(e){return e.split(".")[0]},Xn=function(e){return cn().win32.basename(e)},Zn=function(e){return $n(Xn(e))},er=function(e,t,n,r){e||(e=Qn()??"_console.js");var i=Jn(Zn(e));return t&&(i+="_repl"),i+(n&&r?.dynamic?".dypkg.json":".pkg.js")},tr=function(e,t){return e=cn().dirname(e),!1===t?e:_n(e)},nr=function(e,t,n,r){var i,u=er(e,t,n,r);return i=e?tr(e):"./",hn(i+u)},rr=function(e){return'require("'+Hn(nr(),!1)+'");\n'+e},ir=function(e,t){return pt(e,t,"")},ur=function(e,t){return t.forEach(t=>e=ir(e,t)),e},or=function(e){return ur(e,["\r","\n"])},sr=function(e,t){return si("astring").generate(e,t)},ar=function(e,t){return e.stack=t+"\n"+e.stack,e},lr=function(e,t,n){n||(n={}),n.ecmaVersion||(n.ecmaVersion=2024),!1!==t&&(n.sourceType="module"),null==n.allowAwaitOutsideFunction&&(n.allowAwaitOutsideFunction=!0),null==n.allowReturnOutsideFunction&&(n.allowReturnOutsideFunction=!0);var r=si("acorn");try{return r.parse(e,n)}catch(t){throw ar(t,"Acorn parsing error: "+e)}},cr=function(e,t,n){return sr(lr(e,t,n))},fr=function(e){return or(cr(e))},hr=function(e,t,n){return(t||n)&&(t||(t={}),n&&Tn(t,n),t.ensureReturn&&(e=Mn(e)),t.topLevelAwait&&(e=Bn(e)),t.useTitan&&(e=rr(e)),t.keepAlive&&(e="\nsetInterval(()=>{}, 100000);\n"+e),(t.logErrors||t.keepAlive)&&(e="process.on('uncaughtException', console.error);\nprocess.on('unhandledRejection', console.error);\n"+e),t.inline&&(e=fr(e))),e},pr=function(e){return u(e)?e:yt(e)},dr=function(e){var t=e.indexOf("{");return-1===t||e.slice(0,t).includes("=>")},vr=function(e,t,n,r,i){return xe(e,t,n,r,(t,n)=>null===t?null:(t.input=e,void 0!==n&&(t.index+=n),t),i)},mr=function(e,t){return e.splice(e.length,0,...t),t},yr=function(e,t){return mr(e,t),e},gr=yr,wr=class extends Array{constructor(e,t,n,r,i){if(-1===t)throw Ft("RegexResult index cannot be -1. For empty result, use bare null.");if(null==e)throw Ft("RegexResult matchString cannot be null. For empty result, use bare null.");super(),this[0]=e,r&&gr(this,r),this.index=t,this.input=n,i&&(this.groups=i)}fromParts(e){var t=e;return new wr(t.match,t.index,t.input,t.captures,t.groups)}},br=function(e,t,n,r,i){return new wr(e,t,n,r,i)},Er=function(e,t,n,r,i){return-1===t||null==e?null:br(e,t,n,r,i)},xr=ir,_r=function(e,t){return ut(e,xr(e.flags,t))},kr=function(e){return _r(e,"g")},Ar=et(function(e){return e.global?kr(e):e},0),Lr=function(e,t,n){return(e=null!=n?gn(e,n,t):Ar(e)).exec(t)},Fr=function(e,t,n,r,i){return vr(e,e=>{if(u(t)){var n=e.indexOf(t);return Er(t,n,e)}return Lr(t,e)},n,r,i)},Or=function(e){return e.index+e[0].length},Sr=function(e,t){var n=Fr(e,t);return null===n[0]?null:e.slice(Or(n))},Tr=function(e,t){return e.startsWith(t)?e.substring(t.length):e},Cr=function(e,t){var n=Lr(e,t);return n&&0===n.index?n:null},Ir=function(e,t){var n=Cr(t,e);return n?e.slice(n[0].length):e},jr=function(e,t){if(u(t))return Tr(e,t);if(Ae(t))return Ir(e,t);throw Ut(t,1)},Rr=jr,Pr=function(e){var t=Sr(e,"=>").trim();return Rr(Rn(t,"}"),"{")},Nr=function(e){return Sr(e,"{").slice(0,-1)},qr=function(e){var t=pr(e);return dr(t)?Pr(t):Nr(t)},Mr=function(e){return null==e?"":u(e)?e:c(e)?qr(e):String(e)},Dr=function(e,t){var n=t?.basic?null:{topLevelAwait:!0,useTitan:!0},r=hr(Mr(e),t,n);return sn("node",[t?.mode??"-p",r],t)},Br=function(e,t,n,r){var i="Required argument";return n&&(i+=' "'+n+'"'),null!=t&&(i+=" (index "+t+")"),i+=" missing",arguments.length>0&&(i+=" (received "+At(e)+")"),Ft(i,null,S(r,Br))},Wr=function(e,t,n){if(null==e)throw Br(e,t,n,{fromFn:Wr});return e},Hr=function(e,t){return process.kill(e,Wr(t,0,"signalName"))},Kr=function(e){return Hr(e,"SIGINT")},Yr=function(){return Kr(process.pid)},Ur=Yr,Vr=function(e){if("Y"===(e=e.toUpperCase()))return!0;if("N"===e)return!1;throw Lt(e,0,"char")},zr=function(e){null==e&&(e="Are you sure? [y/n]: "),process.stdout.write(e);var t=Dr(function(){const e=process.stdin,t=process.stdout;e.setRawMode(!0),e.setEncoding("utf8"),e.on("data",e=>{var n=e.toUpperCase();"Y"===n||"N"===n?(t.write(e),process.exit(0)):""===e&&(t.write("^C"),process.exit(0))})},{mode:"-e",basic:!0,stdio:["inherit","pipe"]});if("^C"===t)throw process.stdout.write(t),Ur(),Ft("Prompt was cancelled via interrupt.");return console.log(t),Vr(t)},Gr=function(e){return o(e)?e:u(e)?e.split("."):[e]},Qr=function(e,t,n,r,i,u){var o=n;return Ye(e,t,r,i,u,(e,t,n)=>n(e,t,Ce(o)))},Jr=function(e,t){var n=t,r=globalThis.config;r||(r=globalThis.config={});var i,u=Gr(e);return u.length>1?i=Qr(r,u,n):(i=Ce(n),r[u[0]]=i),i},$r=function(e,t){return Jr("node.require.customDirs",n=>(n||(n=[]),!1!==t&&(e=An(e,"node_modules")),n.includes(e)||n.push(e),n)),e},Xr=$r,Zr=Ye,ei=function(e){var t=globalThis.config;if(t){var n=Gr(e);return n.length>1?Zr(t,n):t[n[0]]}},ti=function(e,t,n){if(null!=e)return e;var r=ei(t);return null!=r?r:n},ni=ye("fs"),ri=function(e){return!!ni().lstatSync(e,{throwIfNoEntry:!1})},ii=function(e){var t=tr(e,!1);return ri(t)||(t!==e&&ii(t),ni().mkdirSync(t)),e},ui=function(e){return ii(e),ni().mkdirSync(e),e},oi=function(e){return ri(e)?e:ui(e)},si=function(e,t){if(Jt(e))return require(e);if($t(e))return pn(e);try{return require(e)}catch(e){}var n=__dirname,r=process.mainModule?.path;if(r!==n)try{return On(r,e)}catch(e){}var i=process.cwd();if(i!==r&&i!==n)try{return On(i,e)}catch(e){}var u=ei("node.require.customDirs");if(u)for(var o of u)try{return On(o,e)}catch(e){}var s=ti(t?.autoInstall,"node.require.autoInstall"),a=ti(t?.promptInstall,"node.require.promptInstall",!0);if(s||a){var l=s||a;!0===l&&(l="./node_modules"),l=hn(l);var c=!1;if(s?(c=!0,console.log('Auto-installing "'+e+'" from npm to "'+l+'"...')):(c=zr('Npm package "'+e+'" is required. Install now? (Y/N) '))&&console.log('Installing "'+e+'" from npm to "'+l+'"...'),c){l=oi(l),ln(e,!1,{cwd:l});try{return Xr(l),On(l,e)}catch(e){console.error("Failed to load from auto-install dir: ",l)}}}throw Ft('Module not found: "'+e+'"',{checked:{moduleDir:n,scriptDir:r,cwd:i}})},ai=R(function(){if(!globalThis.CustomEvent||!globalThis.EventTarget||!globalThis.Event){var e=si("event-target-shim");globalThis.Event||(globalThis.Event=e.Event),globalThis.CustomEvent||(globalThis.CustomEvent=class extends globalThis.Event{constructor(e,t){super(e,t),t?.detail&&(this.detail=t.detail)}}),globalThis.EventTarget||(globalThis.EventTarget=e.EventTarget)}return{Event:Event,CustomEvent:CustomEvent,EventTarget:EventTarget}}),li=ai().EventTarget,ci=function(e){var t=Gt,n=e[t];return void 0===n&&(n=new li,_(e,t,n)),n},fi=zt("EventInterface",{addEventListener(e,t,n){ci(this).addEventListener(e,t,n)},on(e,t){this.addEventListener(e,t)},removeEventListener(e,t){ci(this).removeEventListener(e,t)},off(e,t){this.removeEventListener(e,t)},dispatchEvent(e){return ci(this).dispatchEvent(e)}}),hi=fi,pi=function(e){return Vt(e,hi)},di=function(e){return!(!e.addEventListener&&!e.on)},vi=function(e){return di(e)||pi(e),e},mi=function(e,t,n){return e[t]=n,e},yi=function(e,t,n){return mi(e||{},t,n)},gi=function(e,t,n,r){return Si(e,t,n,yi(r,"once",!0))},wi=function(e,t){return function(){var n=t.apply(this,arguments);return e.apply(this,arguments),n}},bi=wi,Ei=function(e,t,n){return e[t]=bi(e[t],n)},xi=e(class{constructor(e){this._remover=e}remove(){this._remover()}removeOn(e,t,n){n&&vi(e);var r=gi(target,t,()=>this.remove());return Ei(this,"remove",()=>r.remove()),this}},Rt),_i=class extends xi{constructor(e,t){super(e),this.handleEvent=t}},ki=function(e,t){return new _i(e,t)},Ai=function(e,t,n){(e.removeEventListener||e.off).call(e,t,n)},Li=function(e,t,n){for(var r=e.length-1;r>=t;r--)e[r+1]=e[r];return e[t]=n,e.length++,e},Fi=function(e,t){return Li(e,0,t)},Oi=Fi,Si=function(e,t,n,r){if(r?.valueFirst){var i=n;n=function(e){var[t,n]=Bt(e);return Oi(arguments,t),arguments[1]=n,i.apply(this,arguments)}}var u=e.addEventListener;return u||(e.on?u=r?.once?e.once:e.on:(pi(e),u=e.addEventListener)),u.call(e,t,n,r),ki(()=>Ai(e,t,n),n)},Ti=function(e,t,n,r){return Dt(t.map(t=>Si(e,t,n,r)))},Ci=function(){return globalThis.repl?.repl},Ii=function(e,t){return null==t&&(t=1),function(){var n=Array.from(arguments),r=n.pop(),i=e.apply(this,n);0===t?(i.then(e=>r(null,e)),i.catch(r)):(i.then(r),i.catch(e=>r.apply(null,mi([],t,e))))}},ji=async function(){}.constructor,Ri=function(e){return le(e,ji)},Pi=function(e){return Ri(e)?e:async function(){return e.apply(this,arguments)}},Ni=R(function(){return si("node:stream")}),qi=P()&&Ni().Writable,Mi=function(e,t){return t||(t={}),null==t.objectMode&&(t.objectMode=!0),e?t.write=Ii(Pi(e),0):t.write||(t.write=(e,t,n)=>n()),new qi(t)},Di=function(){},Bi=async function(e){var t=Ci();if(t){var n,r=t.eval,i=t.output;t.output=Mi(Di),t.eval=Di;try{t.quickDisableHistory?await t.quickDisableHistory(async function(){n=await e(),t._line()}):n=await e()}finally{t.output=i,t.eval=r}return n}return e()},Wi=ye("readline"),Hi=/\r?\n/,Ki=function(e){return null==e||void 0!==e.length&&0===e.length},Yi=function(e,t){return tn(e,Ki)},Ui=function(e,t){return e.splice(t,1),e},Vi=function(e,t,n){for(var r={},i=e.length,u=0;u<i;u++){var o=t(e[u],u,e);if(o){var[s,a]=o;n?(r[s]||(r[s]=[]),r[s].push(a)):r[s]=a}}return r},zi=function(e,t,n,r){return[t,n]=re(e,t,n,r),e.slice(t,n)},Gi=function(e,t){return Fe(t,e).join("")},Qi=function(e){return e?e[0]:null},Ji=function(e,t){var n=null==t?-1:t.index;if(-1===n)return[e];var r=Pn(e,n);return r[1]=r[1].slice(t[0].length),r},$i=function(e,t,n,r,i){return Ji(e,Fr(e,t,n,r,i))},Xi=function(e){return isNaN(e)?null:e},Zi=function(e){return null==e?null:Xi(Number(e))},eu=Zi,tu=function(e){return eu(e)??e},nu=function(e,t){null==t&&(t="=");var n={};return e.forEach(function(e){var[r,i]=$i(e,t);null!=i&&(i=tu(i.trim())),n[r.trim()]=i}),n},ru=O,iu=class extends Array{constructor(e){var t,n=e;null!=n&&(o(n)?t=n:u(n)&&(t=n.split(Hi))),t?(super(t.length),Object.assign(this,t)):super(...arguments)}condense(e){return this.trim().removeEmpty(),e&&this.removeComments(e),this}trim(){return this.apply(e=>e.trim())}removeEmpty(){return Yi(this)}removeComments(e){for(var t=0;t<this.length;t++){var n=this[t],r=n.indexOf(e);-1!==r&&(""===(n=n.slice(0,r)).trim()?(Ui(this,t),t--):this[t]=n)}return this}removeFirst(){return this.shift(),this}removeLast(){return this.pop(),this}apply(e){return ie(this,e)}join(){return super.join("\n")}toObj(e){return nu(this,e)}mapToObj(e,t){return Vi(this,e,t)}between(e,t,n){return n=ru(n,"inclusiveEnd",!0),zi(this,e,t,n)}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()),t=Qi(Lr(/^\s*/,e));if(t){var n=t.length;this.apply(e=>{if(e.startsWith(t))return e.slice(n)})}}return this}deindent(e,t,n){throw T()}indent(e,t){var n=Gi(t??"\t",e??1);return this.apply(e=>n+e)}static is(e){return le(e,this)}static fromChunks(e){return e.map(e=>Rn(e,Hi)).flatMap(e=>ou(e,!1))}},uu=function(e,t){var n=new iu(e);return t&&n.condense(),n},ou=function(e,t,n){var r=e.split(Hi);return t?uu(r,n):r},su=function(e){return ni().readFileSync(e,"utf8")},au=su,lu=function(e,t){return ou(au(e),!0,t)},cu=function(e){var t=typeof e;return"number"===t||"bigint"===t},fu=function(e){return e instanceof Buffer},hu=function(e){return ArrayBuffer.isView(e)},pu=hu,du=function(e){return fu(e)||pu(e)||u(e)},vu=function(e){return e.constructor===ArrayBuffer},mu=function(e){return du(e)?e:vu(e)?Buffer.from(e):yt(e)},yu=function(e){return cu(e)?String(e):mu(e)},gu=function(e,t){return ii(e),ni().appendFileSync(e,yu(t)),e},wu=function(e,t){return gu(e,"\n"+t)},bu=wu,Eu=function(e){return pt(e,"\n","\\n")},xu=Eu,_u=function(e,t){if(0===e)return t[0];for(var n=t.length,r="";e>0;){var i=e%n;r=t.charAt(i)+r,e=Math.floor(e/n)}return r},ku="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",Au=function(e){return _u(e,ku)},Lu=function(e,t){for(var n=pr(e),r=t.length,i=0,u=0;u<n.length;u++){var o=n[u],s=t.indexOf(o);if(-1===s)throw'Error: "'+o+'" not found in base charset "'+t+'"';i=i*r+s}return i},Fu=function(e){return Lu(e,ku)},Ou=function(e,t){return Object.keys(e).map((n,r)=>t(n,e[n],r,e))},Su=function(e){return e.slice()},Tu=function(e,t){return e.includes(t)||e.push(t),e},Cu=class{constructor(e,t,n,r){(t=o(t)?Su(t):[t]).forEach(r),e&&Tu(t,e),this.members=t,this._enableFn=n,this._disableFn=r}enable(e){this.members.forEach(t=>{t!==e&&this._disableFn(t)}),this._enableFn(e)}disableAll(){this.members.forEach(e=>this._disableFn(e))}},Iu=function(e,t,n,r){return new Cu(e,t,n,r)},ju=function(e,t,n){return new Promise(function(r,i){var u=Dt([gi(e,t||"load",e=>{u.remove(),r(e)}),gi(e,n||"error",e=>{u.remove(),i(e)})])})},Ru=M("CLI",P()&&Wi().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 t=ri(e.historyPath)?lu(e.historyPath):[];e.history=t.reverse()}var n={inputWasRaw:e.input.isRaw},r=Wi().createInterface(e);return r.options=e,r.internal=n,r},function(){var e=this.options;this.rl=Wi(),e.historyPath&&this.on("history",t=>bu(e.historyPath,t[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,t){(!this._blockExcept||t&&this._blockExcept.includes(t.name))&&super._ttyWrite.apply(this,arguments)},_addHistory(){return this._historyDisabled||null!=this._mask||super._addHistory(),this.line},_writeToOutput(e){if(!this._muted){var t=this._mask;if(null!=t){if(this._isRefresh){var n=this._prompt;e.startsWith(n)&&(super._writeToOutput(n),e=e.slice(n.length))}this._isPrompt||(e=Wn(e,/[^\r\n]/,t))}super._writeToOutput(e)}},async promptLine(e){return this.prompt(e),this.awaitLine()},async prefillPrompt(e,t){var n=t,r=await Ce(n);return this.prompt(e),r&&this.write(xu(pr(r))),this.awaitLine()},async promptMultiline(e,t,n,r){if(null==t&&(t="... "),null==n)n=e=>""===e,r||(r=e=>(e.pop(),e));else if(u(n)){var i=n;n=e=>e.endsWith(i)}for(var o=await this.promptLine(e),s=[o];!n(o,s.length,s);)o=await this.promptLine(t),s.push(o);return r&&r(s),s.join("\n")},async promptKey(e,t){this.prompt(e);var n=await this.quickBlockExcept(t,!1,()=>this.awaitKey(t));return this.newLine(),n},async promptYN(e){return"y"===(await this.promptKey(e,["y","n"])).toLowerCase()},async promptSelect(e,t,n){var r=t;n||(n={});var i=0;function u(){return i++,Au(i)}if(fe(r))r=Ou(r,(e,t,n)=>[u(),e,t]);else{if(!o(r))throw Ut(r);r=r.map((e,t)=>{if(null==e)return null;if(o(e)){var n=e[0];if(null==n)n=u();else if((n=pr(n)).length>1)throw Ft("Input key must be a single character:",e);var r=e.length;if(1===r)return[n,n,n];if(2===r){var i=e[1];return[n,i,i]}if(3===r)return[n,e[1],e[2]];throw Ft("Unexpected array length in choices: "+r)}return[u(),e,e]}),nn(r)}if(r.length>35)throw Ft("promptSelect only supports up to 35 options.");var s=n.displayFn||((e,t)=>"["+e+"] "+t);this.quickDisableHistory(()=>{for(var e=0;e<r.length;e++){var[t,n,i]=r[e];this.write(s(t,n,i,r)+"\n")}});var a=Vi(r,e=>[e[0],e]),l=await this.promptKey(e,Object.keys(a)),f=a[l];if(null==f)throw Lt(f,"choice");var h=f[2];return c(h)&&(h=await h(f)),n.asObj?{key:l,name:f[1],value:h}:n.asIndex?Fu(l)-1:h},blockExcept(e,t){e=s(e).map(e=>String(e).toLowerCase()),0!=t&&Tu(e,"return"),this._blockExcept=e},unblock(){delete this._blockExcept},async quickBlockExcept(e,t,n){var r=this._blockExcept;this.blockExcept(e,t);var i=await n();return r?this.blockExcept(r):this.unblock(),i},disable(){this.pause(),this.mute()},enable(){this._mutex?this._mutex.enable(this):this._enable()},_enable(){this.resume(),this.unmute()},mutex(e){var t=Iu(this,e,e=>e._enable(),e=>e.disable());this.pause(),this.resume(),t.members.forEach(e=>e._mutex=t)},mask(e){this._mask=e},unmask(){delete this._mask},mute(){this._muted=!0},unmute(){delete this._muted},disableHistory(){this._historyDisabled=!0,this._historyPrev=Di,this._historyNext=Di},enableHistory(){delete this._historyDisabled,delete this._historyPrev,delete this._historyNext},async quickDisableHistory(e){var t=this._historyDisabled;this.disableHistory();try{var n=await e()}finally{return t||this.enableHistory(),n}},awaitLine(){return ju(this,"line")},newLine(){this.write("\n")},newline(){return this.newLine()},onKey(e,t,n){var r=e,i=this.input;if(this.rl.emitKeypressEvents(i),i.isTTY&&i.setRawMode(!0),r){var u=t;if(o(r)){var s=r.map(e=>String(e).toLowerCase());t=(e,t)=>{e||(e=t.name),s.includes(e.toLowerCase())&&u.call(this,e,t)}}else{var a=String(r).toLowerCase();t=(e,t)=>{e||(e=t.name),e.toLowerCase()===a&&u.call(this,e,t)}}}return Si(i,"keypress",t,n)},async awaitKey(e){return new Promise(t=>{var n=this.onKey(e,e=>{n.remove(),t(e)})})},moveCursor(e,t){return this._moveCursor(e,t)},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)}}),Pu=function(e,t){return Bi(async function(){var n=new Ru(t);try{var r=await e(n)}finally{n.close()}return r})},Nu=function(e,t){return Pu(t=>t.promptLine(e),t)},qu=async function(e,t,n){for(var r={},i=t.length,u=0;u<i;u++){var o,s=t[u];if(s.endsWith("?")&&(s=s.slice(0,-1),o=!0),void 0===(a=e[s])){var a=e[u];if(void 0===a&&!o&&(!1!==n?.prompt&&(a=await Nu(s+": ")),!a))throw Wr(void 0,u,s)}r[s]=a}return r},Mu={node:{onError:function(e){return Ti(process,["uncaughtException","unhandledRejection"],e)},is:P,display:we,util:ge,_builtInModule:ye,requireBuiltIn:me,require:si,_basicRequire:Qt,child_process:rn,requireLocal:pn,path:cn,_requireFromDir:On,_requireDirCache:vn,_createRequire:Fn,module:Ln,promptYNSync:zr,run:Dr,getScriptPath:Qn,positionalArgs:Gn,args:Kn,sigint:Ur,interrupt:Yr,ensureRequireDir:Xr,addRequireDir:$r,fs:ni,pause:function(e){null!=e&&(e=String(e)),si("press-any-key-sync")(e)},beforeExit:function(e){return Si(process,"beforeExit",e)},prompt:Nu,quickCLI:Pu,quickDisableREPL:Bi,getREPL:Ci,CLI:Ru,readline:Wi},ev:{onAny:Ti,multiHandle:Dt,on:Si,resolveValue:Bt,enable:pi,EventInterface:hi,Interface:fi,_ensureHasTarget:ci,targetSym:Gt,EventTarget:li,polyfill:ai,handle:ki,ListenerHandle:_i,ensureEnabled:vi,can:di,once:gi,off:Ai,promise:ju},o:{multiHandle:Mt,isAny:g,setHidden:_,addNonEnumerable:x,defineProperty:E,weakAssign:b,merge:w,safeEnsure:O,ensure:F,hideKey:B,makeNonEnumerable:D,filterSplit:$,keys:Y,allKeys:K,split:J,pick:U,iterateAll:ae,iterate:se,iterator:oe,entries:ue,isPure:fe,is:ce,setProtoLazy:de,setGetter:he,forceSet:pe,display:_t,toLiteral:xt,constructorMatches:ke,ensureCustom:Ie,get:Se,set:Te,createEmpty:We,remove:Ge,reduce:Et,each:bt,addInterface:Vt,Cache:dn,setDefaults:Tn,ensureMulti:Sn,resolveKeys:Gr,diveGet:Zr,safeSet:yi,touch:mi,fromLines:nu,safeDefault:ru,mapArr:Ou,mutex:Iu,_Mutex:Cu},handle:{createMulti:qt,MultiHandle:Pt,HandleInterface:Rt,Handle:xi},class:{addInterface:e,create:M,setName:I,addStatics:j,setDisplay:q,isInterface:Ht,interface:zt},ifc:{create:It,Interface:Ct,is:Wt},f:{createClass:W,ensureConstructor:v,createConstructor:d,isArrowFn:h,isArrow:f,is:c,wrap:p,retThis:m,setName:C,one:R,eq:H,memoize:et,MemoizedFunction:Ze,not:en,body:qr,isArrowString:dr,_getArrowFnBody:Pr,_getNormalFnBody:Nr,hookAfterMethod:Ei,hookAfter:bi,injectAfter:wi,callbackify:Ii,ensureAsync:Pi,isAsync:Ri,AsyncFunction:ji,noop:Di},s:{is:u,isAny:i,isPrimitive:n,isObject:r,toLiteral:mt,quote:vt,escape:dt,replaceAll:pt,apply:_e,withIndices:xe,chars:tt,from:yt,spaceBefore:St,fromKey:Tt,endsWith:xn,resolveIndex:yn,removeTrailing:Rn,removeFromEnd:jn,_removeStringFromEnd:Cn,_removeRegexFromEnd:In,splitAtIndex:Pn,ensureStartsWith:qn,replace:Wn,decapitalize:Jn,removeLineBreaks:or,removeMulti:ur,removeAll:ir,resolve:Mr,ensure:pr,after:Sr,match:Fr,_matchWithIndices:vr,remove:xr,removeLeading:Rr,removeFromStart:jr,_removeStringFromStart:Tr,_removeRegexFromStart:Ir,splitLines:ou,lines:uu,LinesArray:iu,repeat:Gi,splitFirst:$i,_splitByMatch:Ji,escapeLineBreaks:xu,escapeNewLines:Eu},a:{is:o,ensure:s,filterSplit:Q,iterate:te,iterator:ee,apply:ie,resolveIndices:re,resolveIndex:ne,wrapIndices:Ee,wrapIndex:be,pick:Oe,create:Fe,fill:Le,push:Me,add:qe,splitLast:Ke,splitTail:He,toLiteral:gt,display:kt,unboxArgs:Nt,removeNullish:nn,removeByFilter:tn,replaceContents:Zt,last:mn,pushMulti:gr,addMulti:yr,pushThroughMulti:mr,removeEmpty:Yi,removeIndex:Ui,mapToObj:Vi,slice:zi,copy:Su,ensureContains:Tu},p:{asyncJoint:l,is:a},v:{isPrimitive:y,constructorMatches:le,display:At,toLiteral:wt,resolve:Ce,type:Yt,req:Wr,isEmpty:Ki,nullIfNaN:Xi},err:{nyi:T,NYIError:L,Error:A,Enhanced:k,defaultFromFn:S,value:Lt,ValueError:ve,create:Ft,type:Ut,TypeError:Kt,prepend:ar,req:Br},sym:{display:N,value:Be,cleanup:jt},macro:{config:function(e){}},set:{resolve:G,ensure:z,is:V},n:{cap:Z,least:X,tryCoerce:tu,tryParse:eu,ensure:Zi,is:cu,toBase36:Au,toCustomBase:_u,_base36Digits:ku,fromBase36:Fu,fromCustomBase:Lu},re:{is:Ae,ensureGlobal:at,global:st,addFlag:ot,copy:ut,updateFlagString:it,parseFlagString:nt,createFlagString:rt,createEscaped:ht,create:ct,resolveFlags:lt,escape:ft,matchEnd:En,matchLast:bn,matchAll:wn,setStartIndex:gn,safeCreateResult:Er,createResult:br,RegexResult:wr,match:Lr,ensureLocal:Ar,local:kr,removeFlag:_r,resultEndIndex:Or,matchStart:Cr,newline:Hi,text:Qi},map:{Cache:Ne,ensure:Pe,get:je,set:Re,MultiCache:Xe,diveEnsure:ze,createEmpty:Ve,diveDelete:$e,remove:Je},args:{ensureArray:De,unshift:Oi,prepend:Fi,insert:Li},tree:{ensure:Ue,dive:Ye,remove:Qe,setCustom:Qr},gen:{join:Ot},npm:{isBuiltIn:Jt,isFile:$t,install:ln,_runCommand:an},os:{run:sn,_resolveStdio:Xt},win:{is:un},shell:{_handleError:on},path:{abs:hn,sep:fn,ensureEndsWith:An,join:kn,ensureTrailingSlash:_n,fws:Hn,baseName:Zn,_removeExtsFromFile:$n,file:Xn,dir:tr},js:{enhance:hr,ensureReturn:Mn,splitLastExpression:Nn,enableAwait:Bn,_nodeEnableAwait:Dn,useTitan:rr,inline:fr,removeComments:cr,fromAST:sr,parse:lr},titan:{getPackagePath:nr,getPackageName:er},cli:{positionalArgs:zn,resolveArgs:Vn,splitArgs:Un,parseArgs:function(e,t){for(var n=Vn(e,t),r=[],i=!1,u=n.length,o=0;o<u;o++){var s=n[o];if(!i){var a=s[0];let e;if("-"===a)if("-"===s[1]){if(2===s.length){i=!0;continue}e=2}else e=1;else"/"===a&&(e=1);if(e){var l,c,f=s.slice(e),h=f.indexOf("=");if(-1!==h)l=f.slice(0,h),c=f.slice(h+1);else{l=f;var p=n[o+1];null==p||"-"===p[0]?c=!0:(c=p,o++)}r[l]=c;continue}}r.push(s)}return r},paramsFrom:async function(e,t,n){var r=await qu(e,t,n);Object.assign(globalThis,r)},validateParams:qu},env:{args:Yn,setConfig:Jr,getConfig:ei,resolveConfig:ti},proc:{interrupt:Kr,signal:Hr},bool:{fromYN:Vr},fs:{ensureDir:oi,exists:ri,mkdir:ui,ensureParent:ii,loadLines:lu,loadText:au,load:su,appendLine:bu,addLine:wu,append:gu,formatRaw:yu},stream:{nodeWritable:Mi,NodeWritableStream:qi,_useNode:Ni},bin:{ensureByteSafe:mu,isByteSafe:du,isNodeBuffer:fu,isTA:pu},ab:{isTA:hu,is:vu}};globalThis.t?Object.keys(Mu).forEach(function(e){if(t[e]){var n=Mu[e];Object.keys(n).forEach(function(r){t[e][r]=n[r]})}else t[e]=Mu[e]}):globalThis.t=Object.assign({},Mu),globalThis.exports&&(exports.default=globalThis.t);
|
package/custom.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require("./custom.pkg.js"),module.exports=function(i){i&&(globalThis.__titanfiberOptions=i),require("./script.min.js")};
|
package/eval.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
throw require("./eval.pkg.js"),new Error("nyi");
|
package/eval.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,i=function(e){return"string"==typeof e},u=function(e){return e instanceof String},o=function(e){return i(e)||u(e)},a=o,s=function(e,n){const r=[];let i="",u="outside",o=!1;for(let a=0;a<e.length;a++){const s=e[a];switch(u){case"outside":'"'===s?o?(i+=s,o=!1):(n&&(i+=s),u="insideQuote"):"\\"===s?o=!0:" "===s?(i.length>0&&(r.push(i),i=""),o=!1):(i+=s,o=!1);break;case"insideQuote":'"'!==s||o?"\\"!==s||o?(i+=s,o=!1):o=!0:(n&&(i+=s),u="outside")}}return i.length>0&&r.push(i),r},l=function(e,n){var i=e;return null==i?r():a(i)?s(i,n):i},c=function(e,n){return l(e,n).slice()},f=c,p=function(){var e=require.main?.filename;return e||(null!=process._eval?null:f(process.argv)[1])},d=function(e){return require("node:"+e)},h=function(n){return e(()=>d(n))},v=h("fs"),m=function(e){return v().readFileSync(e,"utf8")},g=m,y=function(e,n){return v().statSync(e,n)},w=function(e,n){return v().lstatSync(e,n)},b=function(e,n,r){return(n?y:w)(e,r)},x=function(e,n){return b(e,n).ino},O=function(e){return!!v().lstatSync(e,{throwIfNoEntry:!1})},T=function(e){return class extends e{constructor(e,n){super(e,n);var r=this.constructor.name;r&&(this.name=r)}}},E=T(globalThis.Error),S=class extends E{constructor(e,n){super(e??"Not yet implemented",n)}},A=function(e){return"function"==typeof e},j=function(e,n,r,i){var u=e[n];if(void 0===u){var o=r;!1!==i&&A(o)&&(o=o(e,n)),e[n]=u=o}return u},N=function(e,n,r,i){return e||(e={}),j(e,n,r,i),e},k=function(e,n){return N(e,"fromFn",n,!1)},F=function(e,n){return new S(e,k(n,F))},I=h("os"),_=h("path"),D=_().sep,C=function(){return I().tmpdir()+D},P=function(e){if(e)throw F();return C()},L=function(){return P()+"Titan/"},M=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},R=function(e){return e.split(".")[0]},q=function(e){return _().win32.basename(e)},G=function(e){return R(q(e))},B=function(e,n,r,i){e||(e=p()??"_console.js");var u=M(G(e));return n&&(u+="_repl"),u+(r&&i?.dynamic?".dypkg.json":".pkg.js")},W=function(e,n){return null!=e&&e.constructor===n},K=W,J=function(e){return K(e,RegExp)},U=function(e){return e[e.length-1]},Y=function(e){return W(e,Object)},z=function(e){return new Set(e)},V=function(e){var n={};if(e){var r=z(e);r.has("g")&&(n.global=!0),r.has("i")&&(n.caseInsensitive=!0),r.has("y")&&(n.sticky=!0)}return n},H=function(e){var n="";return e.global&&(n+="g"),(e.caseInsensitive||0==e.caseSensitive)&&(n+="i"),e.sticky&&(n+="y"),n},Q=function(e,n){var r=V(e);return H(Object.assign(r,n))},$=function(e,n){var r=n,i=void 0;return a(r)?i=r:Y(r)&&(i=Q(e.flags,r)),new RegExp(e,i)},X=function(e,n){return n<0?e.length+n:n},Z=X,ee=function(e,n,r){return e=$(e,{global:!0}),null!=r&&(n=Z(r,n)),e.lastIndex=n,e},ne=function(e){return Array.isArray(e)},re=function(e){return ne(e)?e:[e]},te=function(e){return e instanceof Promise},ie=function(e,n){var r=e;return te(r)?r.then(n):n(r)},ue=function(e){return A(e)&&null==e.prototype},oe=ue,ae=function(e){return function(){return e.apply(this,arguments)}},se=function(e,n){var r;return r=n?function(){this.super=n;var r=e.apply(this,arguments);return ie(r,()=>(delete this.super,r))}:oe(e)?ae(e):e,r._isConstructor=!0,r},le=function(e,n){return e._isConstructor?e:se(e,n)},ce=function(){return this},fe=function(e){var n=typeof e;return"object"!==n&&"function"!==n||null===e},pe=function(e){return!fe(e)},de=function(e,n,r){return!1===r?Object.keys(n).forEach(r=>{void 0===e[r]&&(e[r]=n[r])}):Object.assign(e,n),e},he=function(e,n){return de(e,n,!1)},ve=function(e,n,r,i){return r||(r={}),i&&he(r,i),null==r.enumerable&&(r.enumerable=!0),null==r.configurable&&(r.configurable=!0),Object.defineProperty(e,n,r)},me=function(e,n,r,i){return ve(e,n,{value:r,writable:!0,enumerable:!1},i),r},ge=me,ye=function(e,n){Object.defineProperty(e,"name",{value:n,configurable:!0}),ge(e,"displayName",n)},we=ye,be=function(e,n){return Object.assign(e,n)},xe=function(e){},Oe=e(function(){return xe("node.is")??"undefined"==typeof window}),Te=Oe()?require("util").inspect.custom:Symbol("Display"),Ee=function(e,n){e.prototype[Te]=n},Se=function(e,n,r,i,u,o){o||(o={}),a(n)&&(n=null);var s,l,c,f=r;f&&(ne(f)?([l,c]=f,l&&(l=le(l))):s=le(f,n));var p=o.bareFn;o.singleton&&(p=function(){return null==v.default&&(v.default=new v(...arguments)),v.default});var d,h=l||s||n||ce;function v(){if(!new.target&&p&&!(this instanceof v))return p.apply(this,arguments);var e=this;return ie(h.apply(e,arguments),r=>{if(r&&pe(r)&&(e=r,l)){if(!new.target)throw F('Prototype repair is NYI for class instantiation without "new".');if(!n)throw F("instanceFn is not yet supported when extendsClass is null.");var i=Object.getPrototypeOf(this);Object.getPrototypeOf(e)!==i&&Object.setPrototypeOf(e,i)}return c?ie(c.apply(e,arguments),()=>e):e})}return e&&we(v,e),i?(d=i,n&&Object.setPrototypeOf(i,n.prototype)):d=n?Object.create(n.prototype):{},ge(d,"constructor",v),v.prototype=d,u&&be(v,u),o.display&&Ee(v,o.display),o.implements&&re(o.implements).forEach(e=>e(v)),v},Ae=function(e,n){Object.defineProperty(e,n,{enumerable:!1})},je=Ae,Ne=function(e,n,r,i,u){var o=Symbol();return Se(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,je(this,o)}],r,i,u)},ke=function(e,n,r,i){return n=null==n?0:X(e,n),r=null==r?e.length:X(e,r),i&&(0==i.inclusiveStart&&n++,i.inclusiveEnd&&r++),[n,r]},Fe=function(e,n,r,i){var u=n;if([r,i]=ke(e,r,i),A(u))for(var o=r;o<i;o++)e[o]=u(o,e);else e.fill(u,r,i);return e},Ie=function(e,n){var r=new Array(e||0);return arguments.length>1&&Fe(r,n),r},_e=function(e,n){return Ie(n.length,r=>e[n[r]])},De=function(e,n){return e[n]},Ce=function(e,n,r){return e[n]=r},Pe=function(e,n,r){var i=e;return A(i)?i.apply(r,n):i},Le=function(e,n,r,i,u){i||(i=De);var o=i(e,n);return void 0===o&&(o=Pe(r,[e,n]),u||(u=Ce),u(e,n,o)),o},Me=function(e,n){return e.get(n)},Re=function(e,n,r){return e.set(n,r)},qe=function(e,n,r){return Le(e,n,r,Me,Re)},Ge=class{constructor(){this.store=new Map}get(e,n){return qe(this.store,e,n)}remove(e){return this.store.delete(e)}delete(e){return this.remove(e)}},Be=function(e,n){return e.push(n),e},We=Be,Ke=function(e){var n=e;return Array.isArray(n)?n:Array.from(n)},Je=Symbol("Value"),Ue=function(){return{}},Ye=function(e){return[e.slice(0,-1),e[e.length-1]]},ze=Ye,Ve=function(e,n,r,i,u,o){r||(r=De),null==i&&(i=Ue),null==u&&(u=Ce),null==o&&(o=r);for(var[a,s]=ze(n),l=e,c=a.length,f=0;f<c;f++){var p=a[f],d=r(l,p);if(void 0===d){if(!i)return;d=Le(l,p,i,r,u)}l=d}if(o)return o(l,s,u)},He=function(e,n,r,i,u,o){return Ve(e,n,i,u,o,(e,n)=>Le(e,n,r,i,o))},Qe=function(){return new Map},$e=function(e,n,r){return He(e,n,r,Me,Qe,Re)},Xe=function(e,n){return delete e[n],e},Ze=function(e,n,r,i){return Ve(e,n,r,!1,!1,i||Xe)},en=function(e,n){return e.delete(n)},nn=function(e,n){return Ze(e,n,Me,en)},rn=class{constructor(){this.store=new Map}get(e,n){return e=We(Ke(e),Je),$e(this.store,e,n)}remove(e){return e=We(Ke(e),Je),nn(this.store,e)}delete(e){return this.remove(e)}},tn=Ne("MemoizedFunction",function(e,n){if(this.base=e,null!=n)if(1===(n=re(n)).length){this.cache=new Ge;var r=n[0];this._cacheKeyFormatter=e=>e[r]}else this.cache=new rn,this._cacheKeyFormatter=e=>_e(e,n);else this.cache=new rn,this._cacheKeyFormatter=e=>e;var i=this;return function(){var n=i._cacheKeyFormatter(arguments);return i.cache.get(n,()=>e.apply(this,arguments))}},{remove(e){return this.cache.remove(this._cacheKeyFormatter(e))}}),un=function(e,n){return new tn(e,n)},on=function(e,n){return $(e,e.flags+n)},an=function(e){return on(e,"g")},sn=un(function(e){return e.global?e:an(e)},0),ln=function(e,n,r){return e=null!=r?ee(e,r,n):sn(e),Array.from(n.matchAll(e))},cn=function(e,n,r){return null!=r&&(n=n.slice(0,r)),U(ln(e,n))||null},fn=function(e,n){var r=cn(e,n);return r&&n.length===r.index+r[0].length?r:null},pn=T(globalThis.TypeError),dn=function(e){return null==e?e:e.constructor},hn=h("util"),vn=function(e,n){return n||(n={}),null==n.colors&&(n.colors=!0),hn().inspect(e,n)},mn=X,gn=function(e,n,r,i){return void 0!==n&&(null===n||0===n?n=void 0:(n=mn(e,n),i&&0==i.inclusiveStart&&n++)),void 0!==r&&(null===r||r===e.length?r=void 0:(r=mn(e,r),i&&i.inclusiveEnd&&r++)),[n,r]},yn=function(e,n,r,i,u,o){if(r||null!=i){[r,i]=gn(e,r,i,o);var a=e.slice(r,i),s=n(a);return u?u(s,r,i,a,e):s}return n(e)},wn=function(e,n,r,i,u){return yn(e,n,r,i,(n,r,i)=>(void 0!==r?e.slice(0,r):"")+(n||"")+(void 0!==i?e.slice(i):""),u)},bn=function(e){var n=e;return null==n?void 0:a(n)?n:H(n)},xn=function(e,n){return new RegExp(e,bn(n))},On=function(e){return e.replace(/[-[\]{}()*+!<=:?.\/\\^$|#\s,]/g,"\\$&")},Tn=function(e,n){return xn(On(e),n)},En=function(e,n,r,i,u,o){return wn(e,function(e){return e.replaceAll?(J(n)&&(n=sn(n)),e.replaceAll(n,r)):(n=a(n)?Tn(n,"g"):sn(n),this.replace(n,r))},i,u,o)},Sn=function(e,n,r){return En(e,n,(r??"\\")+n)},An=function(e,n,r){return null==n&&(n='"'),!1!==r&&(e=Sn(e,n,r)),n+e+n},jn=function(e){return An(e,'"')},Nn=Y,kn=function(e){return Nn(e)?Ln(e):String(e)},Fn=function(e,n){return n||(n=In),"["+e.reduce(function(e,r){return e+n(r)+", "},"").slice(0,-2)+"]"},In=function(e){return a(e)?jn(e):ne(e)?Fn(e):kn(e)},_n=function(e){return Reflect.ownKeys(e)},Dn=function(e,n){return(n?_n:Object.keys)(e)},Cn=function(e,n,r){Dn(e,r).forEach((r,i,u)=>n(r,e[r],i,u))},Pn=function(e,n,r,i){var u=null!=r?r:"";return Cn(e,function(){u=n.call(this,u,...arguments)},i),u},Ln=function(e,n){return n||(n=In),"{"+Pn(e,function(e,r,i){return e+r+":"+n(i)+", "},"",!0).slice(0,-2)+"}"},Mn=function(e,n){return null==n&&(n=1),n<=0?"[object Object]":Ln(e,e=>qn(e,n-1))},Rn=function(e,n){return null==n&&(n=1),n<=0?"[object Array]":Fn(e,e=>qn(e,n-1))},qn=function(e,n){return void 0===e?"undefined":null===e?"null":Oe()?vn(e,n):Y(e)?Mn(e,maxNumLevels):ne(e)?Rn(e,maxNumLevels):kn(e)},Gn=function(e,n,r,i){if(0===arguments.length)return new pn("Unexpected type received");i||(i={});var u,{type:o,expected:a}=i;return null==o&&(o=dn(e)),o&&o.name&&(o=o.name),a?(a.name&&(a=a.name),u="Expected "+a+", received "):u="Unexpected type received (",u+=o,null!=e&&(u+=" ("+qn(e)+")"),a||(u+=")"),r&&(u+=' for "'+r+'"'),null!=n&&(u+=" (index "+n+")"),i.fromFn||(i.fromFn=Gn),new pn(u,i)},Bn=function(e,n){if(a(n))return e.endsWith(n);if(J(n))return!!fn(n,e);throw Gn(n,1,"matchThis")},Wn=function(e){return Bn(e,D)?e:e+D},Kn=function(e,n){return e=_().dirname(e),!1===n?e:Wn(e)},Jn=function(e,n,r){var i=_().resolve,u=n?i(n,e):i(e);return r?u+D:u},Un=function(e,n,r,i){var u,o=B(e,n,r,i);return u=e?Kn(e):"./",Jn(u+o)},Yn=function(e,n,r){var i=new E(e,r);return n&&Object.assign(i,n),i},zn=e(function(){var e=process.env.TITAN_PATH;if(!e)throw Yn("Environment variable TITAN_PATH is not set.");return Wn(e)}),Vn=e(function(){return zn()+"Compiled/"}),Hn=function(){return new Date},Qn=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 "+qn(e)+")"),Yn(u,null,k(i,Qn))},$n=function(e){return new Date(e.getTime())},Xn=function(e){return new Date(e,null)},Zn=function(e){var n=new Date(e);return isNaN(n.getTime())?null:n},er=function(e){return isNaN(e)?null:e},nr=function(e){return null==e?null:er(Number(e))},rr=nr,tr=function(e){var n=typeof e;return"number"===n||"bigint"===n},ir=function(e,n){if(null==e)throw Qn(e,0);if(e.constructor===Date)return n?$n(e):e;if(a(e)){var r=rr(e);return null!=r?Xn(r):Zn(e)||null}return tr(e)?Xn(e):void 0},ur=function(e,n){return null==e?Hn():ir(e,n)},or=function(e){return ur(e,!0)},ar=or,sr=function(){var e=Vn()+"LastCompileTime.txt";return O(e)?ar(m(e)):null},lr=function(e){return b(e).mtime},cr=function(e,n,r){return e=ir(e),n=ir(n),!1===r?e<n:e<=n},fr=function(e){var n=sr();if(n){var r=lr(e);if(cr(r,n))return!0}return!1},pr=function(e){var n=p();return n?Kn(n,e):null},dr=function(e){return JSON.parse(g(e))},hr=function(e,n,r,i,u){return ve(e,n,{get:r,set:i},u)},vr=hr,mr=function(e,n,r,i){return ve(e,n,{value:r,writable:!0},i)},gr=function(e,n,r,i){vr(e,n,function(){var i=r(n,e);return this[n]=i,i},function(e){mr(this,n,e,i)},i)},yr=function(e,n){var r=e.globals,i=e.shortNamesToGlobals;Object.keys(i).forEach(e=>{for(var u=i[e],o=u.length,a=0;a<o;a++){var s=u[a],l=globalThis[s];l||(l=globalThis[s]={});var c=r[s];Object.keys(c).forEach(r=>{var i=n[e][r];l[r]=i})}}),n._meta||(n._meta={}),n._meta.globals=e.globals},wr=function e(n,r,i){const u=_();if(n)n=u.resolve(pr(),n);else{var o=p();if(!o)throw new Error("Cannot find package name because scriptPath does not exist.");var a=u.dirname(o),s=u.basename(o).split(".")[0];s=s[0].toLowerCase()+s.slice(1),n=u.join(a,s+".pkg.json")}for(var l=dr(n),c=gr,f=l.itemsInOrder,d=f.length,h=0;h<d;h++){let e=f[h],[n,i,u]=e,o=r[n];o||(o=r[n]={}),Object.hasOwn(o,i)||c(o,i,function(){let t=r;return eval("("+u+")")})}l.globals&&yr(l,r)},br=function(e){return require(e)},xr=function(e){return!!e.startsWith("node:")||br("node:module").isBuiltin(e)},Or=function(e){return e.startsWith(".")},Tr=class extends E{constructor(e,n){super(e??"Unexpected value",n)}},Er=function(e,n,r,i){if(0===arguments.length)return new Tr("Unexpected value received");i||(i={});var u,{expected:o}=i;return u=o?"Received "+qn(e)+", expected one of "+qn(o):"Unexpected value received: "+qn(e),r&&(u+=' for "'+r+'"'),null!=n&&(u+=" (index "+n+")"),i.fromFn||(i.fromFn=Er),new Tr(u,i)},Sr=function(e){var n=e.stdio;if(n){if(!ne(n)){if(!a(n))throw Gn(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 Er(n,"stdio");n=["overlapped","overlapped","overlapped"]}e.stdio=n}}else n=e.stdio=[null,null,null];return n},Ar=function(e,n){var r=n.length;e.length=r;for(var i=0;i<r;i++)e[i]=n[i];return e},jr=function(e){return function(){return!e.apply(this,arguments)}},Nr=function(e,n){return Ar(e,e.filter(jr(n)))},kr=function(e){return Nr(e,e=>null==e)},Fr=h("child_process"),Ir=e(function(){return"win32"===process.platform}),_r=function(e,n,r){if(r||(r={}),n(e))throw e;if(r.nullOnErr)return null;var i=r.onErr;if(void 0!==i)return Pe(i);throw e},Dr=function(e,n,r){r||(r={}),r.dir&&(r.cwd=r.dir);var i=Sr(r);if(null==i[0]){var u=r.allowInput,o=r.input;if(u&&o)throw Yn("allowInput (user) and input (programmatic) cannot be used simultaneously for synchronous child processes.");u&&(i[0]="inherit")}if(null==i[1]){var a=r.captureOutput??!1,s=r.showOutput;if(a&&s)throw Yn("captureOutput and showOutput cannot be used simultaneously for synchronous child processes.");a?i[1]="pipe":(null==s&&(s=!0),i[1]=s?"inherit":"ignore")}if(null==i[2]){var l=r.captureErr??!1,c=r.showErr;if(l&&c)throw Yn("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&&kr(n);try{var f=Fr().execFileSync(e,n,r);null!=f&&!1!==r.trim&&(f=f.trim());var p=r.map??r.mapFn;return p&&(f=p(f)),f}catch(e){if(Ir())return _r(e,e=>"ENOENT"===e.code,r);throw e}},Cr=function(e,n){return n||(n={}),null==n.captureOutput&&(n.captureOutput=!1),n.shell=!0,n.filterExtensions=!1,Dr("npm",e,n)},Pr=function(e,n,r){return Cr(["install",e,n?"-g":null],r)},Lr=function(e){return require(Jn(e))},Mr=class{constructor(){this.store={}}get(e,n){return j(this.store,e,n)}remove(e){return delete this.store[e]}delete(e){return this.remove(e)}},Rr=new Mr,qr=function(e,n,r){if(Oe()){var i=_().join(e,n);return r?Wn(i):i}throw F()},Gr=function(e,n){return e.endsWith(n)?e:qr(e,n)},Br=h("module"),Wr=function(e){return e=Gr(e,"node_modules"),Br().createRequire(e)},Kr=function(e,n){return Rr.get(e,()=>Wr(e))(n)},Jr=function(e,n,r){return Object.keys(n).forEach(i=>j(e,i,n[i],r)),e},Ur=function(e,n,r){return n?Jr(e,n,r):e},Yr=function(e,n){return e.endsWith(n)?e.substring(0,e.length-n.length):e},zr=function(e,n){var r=fn(n,e);return r?e.slice(0,r.index):e},Vr=function(e,n){if(a(n))return Yr(e,n);if(J(n))return zr(e,n);throw Gn(n,1)},Hr=Vr,Qr=function(e,n){return[e.slice(0,n),e.slice(n)]},$r=function(e){e=Hr(e.trim(),";");var n=Math.max(e.lastIndexOf(";"),e.lastIndexOf("\n"));return Qr(e,n+1)},Xr=function(e,n){return e.startsWith(n)?e:n+e},Zr=function(e){var[n,r]=$r(e);return n+Xr(r.trim(),"return ")},et=function(e){return ri("node-repl-await").processTopLevelAwait(e)},nt=function(e){return et(e)??e},rt=En,tt=function(e,n){return""===e?e:(!1!==n&&(e=Wn(e)),rt(e,"\\","/"))},it=function(e){return'require("'+tt(Un(),!1)+'");\n'+e},ut=function(e,n){return En(e,n,"")},ot=function(e,n){return n.forEach(n=>e=ut(e,n)),e},at=function(e){return ot(e,["\r","\n"])},st=function(e){return at(oi(e))},lt=function(e,n,r){return(n||r)&&(n||(n={}),r&&Ur(n,r),n.ensureReturn&&(e=Zr(e)),n.topLevelAwait&&(e=nt(e)),n.useTitan&&(e=it(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=st(e))),e},ct=function(e){return a(e)?e:kn(e)},ft=function(e){var n=e.indexOf("{");return-1===n||e.slice(0,n).includes("=>")},pt=function(e,n,r,i,u){return yn(e,n,r,i,(n,r)=>null===n?null:(n.input=e,void 0!==r&&(n.index+=r),n),u)},dt=function(e,n){return e.splice(e.length,0,...n),n},ht=function(e,n){return dt(e,n),e},vt=ht,mt=class extends Array{constructor(e,n,r,i,u){if(-1===n)throw Yn("RegexResult index cannot be -1. For empty result, use bare null.");if(null==e)throw Yn("RegexResult matchString cannot be null. For empty result, use bare null.");super(),this[0]=e,i&&vt(this,i),this.index=n,this.input=r,u&&(this.groups=u)}fromParts(e){var n=e;return new mt(n.match,n.index,n.input,n.captures,n.groups)}},gt=function(e,n,r,i,u){return new mt(e,n,r,i,u)},yt=function(e,n,r,i,u){return-1===n||null==e?null:gt(e,n,r,i,u)},wt=ut,bt=function(e,n){return $(e,wt(e.flags,n))},xt=function(e){return bt(e,"g")},Ot=un(function(e){return e.global?xt(e):e},0),Tt=function(e,n,r){return(e=null!=r?ee(e,r,n):Ot(e)).exec(n)},Et=function(e,n,r,i,u){return pt(e,e=>{if(a(n)){var r=e.indexOf(n);return yt(n,r,e)}return Tt(n,e)},r,i,u)},St=function(e){return e.index+e[0].length},At=function(e,n){var r=Et(e,n);return null===r[0]?null:e.slice(St(r))},jt=function(e,n){return e.startsWith(n)?e.substring(n.length):e},Nt=function(e,n){var r=Tt(e,n);return r&&0===r.index?r:null},kt=function(e,n){var r=Nt(n,e);return r?e.slice(r[0].length):e},Ft=function(e,n){if(a(n))return jt(e,n);if(J(n))return kt(e,n);throw Gn(n,1)},It=Ft,Dt=function(e){var n=At(e,"=>").trim();return It(Hr(n,"}"),"{")},Ct=function(e){return At(e,"{").slice(0,-1)},Pt=function(e){var n=ct(e);return ft(n)?Dt(n):Ct(n)},Lt=function(e){return null==e?"":a(e)?e:A(e)?Pt(e):String(e)},Mt=function(e,n){var r=n?.basic?null:{topLevelAwait:!0,useTitan:!0},i=lt(Lt(e),n,r);return Dr("node",[n?.mode??"-p",i],n)},Rt=function(e,n,r){if(null==e)throw Qn(e,n,r,{fromFn:Rt});return e},qt=function(e,n){return process.kill(e,Rt(n,0,"signalName"))},Gt=function(e){return qt(e,"SIGINT")},Bt=function(){return Gt(process.pid)},Wt=Bt,Kt=function(e){if("Y"===(e=e.toUpperCase()))return!0;if("N"===e)return!1;throw Er(e,0,"char")},Jt=function(e){null==e&&(e="Are you sure? [y/n]: "),process.stdout.write(e);var n=Mt(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))})},{mode:"-e",basic:!0,stdio:["inherit","pipe"]});if("^C"===n)throw process.stdout.write(n),Wt(),Yn("Prompt was cancelled via interrupt.");return console.log(n),Kt(n)},Ut=function(e){return ne(e)?e:a(e)?e.split("."):[e]},Yt=function(e,n,r,i,u,o){var a=r;return Ve(e,n,i,u,o,(e,n,r)=>r(e,n,Pe(a)))},zt=function(e,n){var r=n,i=globalThis.config;i||(i=globalThis.config={});var u,o=Ut(e);return o.length>1?u=Yt(i,o,r):(u=Pe(r),i[o[0]]=u),u},Vt=function(e,n){return zt("node.require.customDirs",r=>(r||(r=[]),!1!==n&&(e=Gr(e,"node_modules")),r.includes(e)||r.push(e),r)),e},Ht=Vt,Qt=Ve,$t=function(e){var n=globalThis.config;if(n){var r=Ut(e);return r.length>1?Qt(n,r):n[r[0]]}},Xt=function(e,n,r){if(null!=e)return e;var i=$t(n);return null!=i?i:r},Zt=function(e){var n=Kn(e,!1);return O(n)||(n!==e&&Zt(n),v().mkdirSync(n)),e},ei=function(e){return Zt(e),v().mkdirSync(e),e},ni=function(e){return O(e)?e:ei(e)},ri=function(e,n){if(xr(e))return require(e);if(Or(e))return Lr(e);try{return require(e)}catch(e){}var r=__dirname,i=process.mainModule?.path;if(i!==r)try{return Kr(i,e)}catch(e){}var u=process.cwd();if(u!==i&&u!==r)try{return Kr(u,e)}catch(e){}var o=$t("node.require.customDirs");if(o)for(var a of o)try{return Kr(a,e)}catch(e){}var s=Xt(n?.autoInstall,"node.require.autoInstall"),l=Xt(n?.promptInstall,"node.require.promptInstall",!0);if(s||l){var c=s||l;!0===c&&(c="./node_modules"),c=Jn(c);var f=!1;if(s?(f=!0,console.log('Auto-installing "'+e+'" from npm to "'+c+'"...')):(f=Jt('Npm package "'+e+'" is required. Install now? (Y/N) '))&&console.log('Installing "'+e+'" from npm to "'+c+'"...'),f){c=ni(c),Pr(e,!1,{cwd:c});try{return Ht(c),Kr(c,e)}catch(e){console.error("Failed to load from auto-install dir: ",c)}}}throw Yn('Module not found: "'+e+'"',{checked:{moduleDir:r,scriptDir:i,cwd:u}})},ti=function(e,n){return ri("astring").generate(e,n)},ii=function(e,n){return e.stack=n+"\n"+e.stack,e},ui=function(e,n,r){r||(r={}),r.ecmaVersion||(r.ecmaVersion=2024),!1!==n&&(r.sourceType="module"),null==r.allowAwaitOutsideFunction&&(r.allowAwaitOutsideFunction=!0),null==r.allowReturnOutsideFunction&&(r.allowReturnOutsideFunction=!0);var i=ri("acorn");try{return i.parse(e,r)}catch(n){throw ii(n,"Acorn parsing error: "+e)}},oi=function(e,n,r){return ti(ui(e,n,r))},ai=/(['"])(.*?)\1/,si=an(ai),li=function(e){return e.replace(si,"")},ci=li,fi=function(e){return globalThis.structuredClone(e)},pi=fi,di=un,hi=/\r?\n/,vi=function(e){return null==e||void 0!==e.length&&0===e.length},mi=function(e,n){return Nr(e,vi)},gi=function(e,n){return e.splice(n,1),e},yi=function(e,n,r,i){[r,i]=ke(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},wi=function(e,n,r){for(var i={},u=e.length,o=0;o<u;o++){var a=n(e[o],o,e);if(a){var[s,l]=a;r?(i[s]||(i[s]=[]),i[s].push(l)):i[s]=l}}return i},bi=function(e,n,r,i){return[n,r]=ke(e,n,r,i),e.slice(n,r)},xi=function(e,n){return Ie(n,e).join("")},Oi=function(e){return e?e[0]:null},Ti=function(e,n){var r=null==n?-1:n.index;if(-1===r)return[e];var i=Qr(e,r);return i[1]=i[1].slice(n[0].length),i},Ei=function(e,n,r,i,u){return Ti(e,Et(e,n,r,i,u))},Si=nr,Ai=function(e){return Si(e)??e},ji=function(e,n){null==n&&(n="=");var r={};return e.forEach(function(e){var[i,u]=Ei(e,n);null!=u&&(u=Ai(u.trim())),r[i.trim()]=u}),r},Ni=N,ki=class extends Array{constructor(e){var n,r=e;null!=r&&(ne(r)?n=r:a(r)&&(n=r.split(hi))),n?(super(n.length),Object.assign(this,n)):super(...arguments)}condense(e){return this.trim().removeEmpty(),e&&this.removeComments(e),this}trim(){return this.apply(e=>e.trim())}removeEmpty(){return mi(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()?(gi(this,n),n--):this[n]=r)}return this}removeFirst(){return this.shift(),this}removeLast(){return this.pop(),this}apply(e){return yi(this,e)}join(){return super.join("\n")}toObj(e){return ji(this,e)}mapToObj(e,n){return wi(this,e,n)}between(e,n,r){return r=Ni(r,"inclusiveEnd",!0),bi(this,e,n,r)}normalize(){if(this.length>0&&(""===this[0].trim()&&this.shift(),this.length>0&&(""===U(this).trim()&&this.pop(),this.length>0))){var e=this.find(e=>""!==e.trim()),n=Oi(Tt(/^\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 F()}indent(e,n){var r=xi(n??"\t",e??1);return this.apply(e=>r+e)}static is(e){return W(e,this)}static fromChunks(e){return e.map(e=>Hr(e,hi)).flatMap(e=>Ii(e,!1))}},Fi=function(e,n){var r=new ki(e);return n&&r.condense(),r},Ii=function(e,n,r){var i=e.split(hi);return n?Fi(i,r):i},_i=function(e,n){return Ii(g(e),!0,n)},Di=function(e,n){return Ot(e).test(n)},Ci=function(e,n){return J(n)?Di(n,e):e.includes(n)},Pi=function(e,n,r,i){null==e&&(e=""),null==n&&(n="");var u={},o=(r,i)=>u[e+r+n]=i;return i&&Cn(i,o),r&&Cn(r,o),u},Li=function(e,n){return Cn(n,(n,r)=>e=En(e,n,r)),e},Mi=function(e,n,r,i){var u,o,s=i?.paramIdentifier??"$";if(s)if(a(s)){if(!Ci(e,s))return e;u=s}else{if(!ne(s))throw Gn(s,1,"paramIdentifier");if([u,o]=s,!Ci(e,u)&&!Ci(e,o))return e}var l=Pi(u,o,n,r);return Li(e,l)},Ri=function(e){return a(e)?e:String(e)},qi=globalThis.process?.env.windir,Gi=function(e){if(e)throw F();return I().homedir()+D},Bi=function(e){return Gi(e)+"Desktop/"},Wi={PROGRAMFILES:globalThis.process?.env.ProgramFiles,WINDIR:qi,SYSTEM32:qi&&qi+"System32",TEMP:C(),DESKTOP:Bi()},Ki=function(e,n){return Mi(Ri(e),n,Wi)},Ji=function(){return zn()+"Source/SourceMap.txt"},Ui=function(e){return e?Ki(e,{TITAN:zn()}):Ji()},Yi=function(e,n,r,i,u){return yn(e,n,r,i,(e,n)=>-1===e?-1:void 0===n?e:n+e,u)},zi=function(e,n){return Array.prototype.findIndex.call(e,n)},Vi=function(e,n,r,i,u){var o=a(n);return o&&null==i&&!u?e.indexOf(n,r):Yi(e,e=>o?e.indexOf(n):J(n)?e.search(n):zi(e,n),r,i,u)},Hi=function(e,n,r,i,u){var o=Vi(e,n,r,i,u);return-1===o?null:e.slice(r,o)},Qi=function(e){var n=e[0];return n===n.toUpperCase()},$i=function(e,n){var r=[],i=[];return e.forEach((u,o)=>(n(u,o,e)?r:i).push(u)),[r,i]},Xi=di(function(e){var n=_i(Ui(e),!0),r={};return n.forEach(e=>{var n=Hi(e,"=").split(",").map(e=>e.trim()),[i,u]=$i(n,e=>!Qi(e)),o=i[0];if(!o)throw Yn('No shortName in SourceMap line: "'+e+'"');u.forEach(e=>{r[e]=o})}),r},0),Zi=e(function(e){var n=Object.keys(e);return xn("\\b("+n.join("|")+")\\.(\\w+)","g")}),eu=/\bt\.(\w+)\.(\w+)/g,nu=function(e,n){n||(n={});var r={},i=r.t={};if(n.enableGlobals){var u;u=n.additionalGlobals?pi(n.additionalGlobals):{},r.globals=u;var o=Xi(),a=Zi(o),s=ln(a,e).filter(n=>{var r=n[1],i=n[2],u=e[n.index-1];if("."===u||"_"===u)return!1;var o=globalThis[r];return!o||void 0===o[i]});for(var[l,c,f]of s)u[c]||(u[c]={}),u[c][f]=!0;var p=s.map(([e,n,r])=>{var i=o[n];if(!i)throw Yn("No short name found for global: "+n);return"t."+i+"."+r+";"}).join(" ");e+="\n"+p}for(var[l,d,f]of s=e.matchAll(eu))i[d]||(i[d]={}),i[d][f]=!0;return r},ru=function(e,n){return e=oi(e),e=ci(e),nu(e,n)},tu=function(e,n){return nu(e,n)},iu=function(e,n,r){if(n){if("js"===(n=n.toLowerCase()))return ru(e,r);if("html"===n)return tu(e,r)}return nu(e,r)},uu=function(e,n){return n in e},ou=uu,au=function(e,n){for(var r of(Rt(n,1),Object.keys(e))){if(!ou(n,r))return!1;var i=e[r];if(i&&i.constructor===Object&&!au(i,n[r]))return!1}return!0},su=function(e,n){if(!au(n.t,e))return!0;if(n.globals){var r=e._meta?.globals;if(!r)return!0;if(!au(n.globals,r))return!0}return!1},lu=function(e,n,r,i){var u,o,a,s;i||(i={}),e&&(e=Jn(e)),u=i.packagePath?Jn(i.packagePath):Un(e,!1,!0,i);var l,c=O(u);c?(o=fr(u))?a="New compile":(null==n&&(n=g(e)),s=iu(n,"js",i),(l=su(r,s))&&(a="New deps")):a="No package";var f={needsPack:!!a,scriptPath:e,packagePath:u};return a&&(f.reasonText=a),null!=c&&(f.exists=c),null!=o&&(f.newCompile=o),null!=l&&(f.newDeps=l),n&&(f.sourceText=n),s&&(f.shallowDeps=s),f},cu=function(e){return Bn(e,D)},fu=function(e){var n=e.lastIndexOf(D);return-1===n?null:e.slice(0,n+1)},pu=function(e,n,r){if(cu(e))return r?[e,null]:e;var i,u,o=fu(e),a=n(q(e),o,e);return r?[i,u]=a:i=a,null!=i&&(e=o?o+i:i),r?[e,u]:e},du=function(e,n,r,i,u){return pt(e,e=>{if(J(n))return cn(n,e);if(a(n)){var r=e.lastIndexOf(n);return-1!==r?new mt(n,r):null}throw Gn(n,1)},r,i,u)},hu=function(e,n,r,i,u){return Ti(e,du(e,n,r,i,u))},vu=function(e){return pu(e,e=>hu(e,"."),!0)},mu=function(e,n){var r=vu(e)[1];return r?!1!==n?r.toLowerCase():r:null},gu={},yu=di(function(e){e=Ui(e);var n=Kn(e)+"../Compiled/",r=_i(e,"//"),i=gu;for(var u of r){var o=u.indexOf("="),a=u.slice(0,o).trim();a=a.split(",").map(e=>e.trim()).filter(e=>!Qi(e));var s=u.slice(o+1).trim(),l=qr(n,s).replaceAll("\\","/");for(var c of a)i[c]=l}return i},0),wu=function(e,n){var r=n?.fileType;if(r){if("js"===(r=r.toLowerCase()))return ru(e,n);if("html"===r)return tu(e,n)}return nu(e,n)},bu=function*(e,n){var r=0;for(var i of e)n(i,r++,e)&&(yield i)},xu=function(e){return e.slice()},Ou=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},Tu=function(e,n){return Ou(e,e.length,n)},Eu=Tu,Su=function(e,n){return e.call(this,...n,function n(){return U(arguments)!==n&&Eu(arguments,n),e.apply(this,arguments)})},Au=function(e){e||(e={});var n=e.getKeys;n||(n=function(e){return Object.keys(e)});var r=e.recurseIf;if(!r){var i=this.constructor;r=e=>W(e,i)||Nn(e)||ne(e)}var u=e.leavesOnly??e.leafsOnly??!1,o=this;return Su(function*(e,i,a,s){var l=n(e,i,a);if(l)for(var c=l.length,f=0;f<c;f++){var p=l[f],d=e[p],h=xu(i);h.push(p);var v=null,m={value:d,key:p,object:e,path:h,level:a,isLeaf:v,root:o},g=r(d,m);m.isLeaf=v=!g,u&&!v||(yield m),g&&(yield*s(d,h,a+1,s))}},[this,[],0])},ju=function(e,n){return Au.call(e,n)},Nu=function(e,n){1===arguments.length&&(n=!0);var r={};for(var i of e)r[i]=n;return r},ku=function(e,n,r,i){var u=ui(e,n,i);ri("acorn-walk").full(u,r)},Fu=function(e,n,r,i){var u;if(a(r))u=e=>e.type===r;else if(ne(r)){var o=Nu(r);u=e=>o[e.type]}else u=r;var s=[];return ku(e,n,function(e){u.apply(this,arguments)&&s.push(e)},i),s},Iu=ti,_u=function(e){var n,r,i,u=e,o=a(u)?ui(u).body[0]:u,s=o.type;if("VariableDeclaration"===s){n="variable";var l=o.declarations[0];r=l.id.name,i=l.init?l.init.raw??ti(l.init):"undefined"}else"FunctionDeclaration"===s?n="function":"ClassDeclaration"===s&&(n="class"),r=o.id.name;var c={type:n,name:r};return i&&(c.value=i),c.text=Iu(o),c.node=o,c},Du=function(e){return Fu(e,!0,["ExportNamedDeclaration","ExportDefaultDeclaration"]).map(function(e){var n=e.declaration;if(n){var r=_u(n);return r.node=e,r}return{node:e}})},Cu=function(e,n){n||(n={});var r=n.enableGlobals,i=yu(n.sourceMap),u={},o=[];return function e(n,a){var s=bu(ju(n),e=>e.isLeaf);for(var l of s){var[c,f]=l.path,p=u[c];if(p||(p=u[c]={}),null==p[f]){var d=i[c];if(d){var h=tt(d)+f+".js";if(!O(h)){var v='Titan compiled value "t.'+c+"."+f+'" does not exist';throw a&&(v+=' (called by "'+a+'")'),Yn(v+=".")}var g=m(h),y=Du(g)[0];p[f]=y;var w="t."+c+"."+f;e(wu(g,{fileType:"js",enableGlobals:r}).t,w),o.push([c,f])}else console.log('Skipping unmapped module "'+c+'"'),p[f]=!1}}}(e.t),{t:u,globals:e.globals,order:o}},Pu=function(e,n){n||(n={});var r=n.deps??iu(e,n.fileType,n),{t:i,globals:u,order:o}=Cu(r,n),a={};if(a.t=r.t,u&&n.enableGlobals){a.globals=u;var s=Xi(),l=Object.keys(u),c=wi(l,e=>[s[e],e],!0);a.shortNamesToGlobals=c}return a.itemsInOrder=o.map(([e,n])=>{var r=i[e][n];return[e,n,"variable"===r.type?r.value:"("+r.text+")"]}),a},Lu=function(e,n,r){return null==r&&(r=!0),Su(function(e,n,i){Cn(e,function(e,u){if(ou(n,e)){var o=n[e];r?Y(o)&&Y(u)?i(u,o):n[e]=u:Y(o)&&i(u,o)}else n[e]=u})},[e,n]),n},Mu=Lu,Ru=function(e){return Object.assign({},e)},qu=function(e,n){if(n){var r={};return e.forEach((e,i,u)=>r[n(e,i,u)]=!0),r}return Ru(e)},Gu=function(e,n){Mu(n.t,e.t,!1);var r=n.globals;if(r){var i=e.globals;i?Mu(r,i,!1):e.globals=r,e.shortNamesToGlobals=n.shortNamesToGlobals}var u=qu(e.itemsInOrder,e=>e[0]+"."+e[1]);return n.itemsInOrder.forEach(n=>{u[n[0]+"."+n[1]]||e.itemsInOrder.push(n)}),e},Bu=function(e){return e instanceof Buffer},Wu=function(e){return ArrayBuffer.isView(e)},Ku=Wu,Ju=function(e){return Bu(e)||Ku(e)||a(e)},Uu=function(e){return e.constructor===ArrayBuffer},Yu=function(e){return Ju(e)?e:Uu(e)?Buffer.from(e):kn(e)},zu=function(e){return tr(e)?String(e):Yu(e)},Vu=function(e,n){return Zt(e),v().writeFileSync(e,zu(n)),e},Hu=function(e,n){var r;return n||(n={}),r=n.condensed?0:null!=n.whitespace?n.whitespace:"\t",JSON.stringify(e,n.replacer,r)},Qu=function(e,n,r){return Vu(e,Hu(n,r))},$u=function(e,n,r){r||(r={}),r.deps||r.fileType||!n||(r.fileType=mu(n));var i=Pu(e,r),u=r.packagePath||Un(n,r.repl,!0,r);if(r.dynamic&&(r.packageExists??O(u))&&!(r.newCompile??fr(u))){var o=dr(u);i=Gu(o,i)}return Qu(u,i),u},Xu=function(e,n,r,i){var u=lu(e,n,r,i);return u.needsPack&&(i.onPack&&i.onPack(u.reasonText),n=u.sourceText??g(e),i.packagePath=u.packagePath,i.packageExists=u.exists,i.newCompile=u.newCompile,i.deps=u.shallowDeps,$u(n,e,i),wr(u.packagePath,r,i)),r},Zu={node:{getScriptPath:p,positionalArgs:f,args:n,fs:v,_builtInModule:h,requireBuiltIn:d,os:I,path:_,is:Oe,display:vn,util:hn,getScriptDir:pr,require:ri,_basicRequire:br,child_process:Fr,requireLocal:Lr,_requireFromDir:Kr,_requireDirCache:Rr,_createRequire:Wr,module:Br,promptYNSync:Jt,run:Mt,sigint:Wt,interrupt:Bt,ensureRequireDir:Ht,addRequireDir:Vt},cli:{positionalArgs:c,resolveArgs:l,splitArgs:s},env:{args:r,setConfig:zt,getConfig:$t,resolveConfig:Xt},f:{one:e,is:A,memoize:un,MemoizedFunction:tn,createClass:Ne,ensureConstructor:le,createConstructor:se,isArrowFn:oe,isArrow:ue,wrap:ae,retThis:ce,setName:ye,not:jr,body:Pt,isArrowString:ft,_getArrowFnBody:Dt,_getNormalFnBody:Ct,cache:di,recurse:Su},s:{is:a,isAny:o,isPrimitive:i,isObject:u,decapitalize:M,endsWith:Bn,chars:z,resolveIndex:Z,toLiteral:jn,quote:An,escape:Sn,replaceAll:En,apply:wn,withIndices:yn,from:kn,removeTrailing:Hr,removeFromEnd:Vr,_removeStringFromEnd:Yr,_removeRegexFromEnd:zr,splitAtIndex:Qr,ensureStartsWith:Xr,replace:rt,removeLineBreaks:at,removeMulti:ot,removeAll:ut,resolve:Lt,ensure:ct,after:At,match:Et,_matchWithIndices:pt,remove:wt,removeLeading:It,removeFromStart:Ft,_removeStringFromStart:jt,_removeRegexFromStart:kt,removeQuotes:li,splitLines:Ii,lines:Fi,LinesArray:ki,repeat:xi,splitFirst:Ei,_splitByMatch:Ti,replaceParams:Mi,contains:Ci,_createParamsObj:Pi,_replaceByObj:Li,before:Hi,index:Vi,_indexWithIndices:Yi,indexOfFn:zi,isCapitalized:Qi,splitLast:hu,matchLast:du},fs:{loadText:g,load:m,getID:x,stat:b,deepStat:y,shallowStat:w,exists:O,getModifiedDate:lr,loadJSON:dr,ensureDir:ni,mkdir:ei,ensureParent:Zt,loadLines:_i,writeJSON:Qu,write:Vu,formatRaw:zu},titan:{getTempDir:L,getPackagePath:Un,getPackageName:B,hasNewCompile:fr,getLastCompileTime:sr,getCompiledDir:Vn,locate:zn,_loadDynamicDeps:wr,_trackGlobals:yr,autoPackAndLoadJSON:Xu,needsToPack:lu,getShallowDeps:iu,getDepsFromJS:ru,_getDepsBasic:nu,loadGlobalsMap:Xi,_resolveSourceMapPath:Ui,locateSourceMap:Ji,_getGlobalsRegex:Zi,depsRegex:eu,getDepsFromHTML:tu,jsonHasNewDeps:su,packTextToJSONFile:$u,packTextToJSON:Pu,_getAllDeps:Cu,loadSourceMap:yu,sourceMap:gu,getDeps:wu,addNewItemsToJSON:Gu},path:{getTempDir:P,_getDefaultTempDir:C,sep:D,baseName:G,_removeExtsFromFile:R,file:q,dir:Kn,ensureTrailingSlash:Wn,abs:Jn,ensureEndsWith:Gr,join:qr,fws:tt,resolveVars:Ki,string:Ri,_defaultParams:Wi,windir:qi,getDesktop:Bi,getUserDir:Gi,ext:mu,splitExt:vu,ignoreDir:pu,isDir:cu,dirPart:fu},err:{nyi:F,NYIError:S,Error:E,Enhanced:T,defaultFromFn:k,type:Gn,TypeError:pn,create:Yn,req:Qn,value:Er,ValueError:Tr,prepend:ii},o:{safeEnsure:N,ensure:j,constructorMatches:K,is:Y,isAny:pe,setHidden:ge,addNonEnumerable:me,defineProperty:ve,weakAssign:he,merge:de,hideKey:je,makeNonEnumerable:Ae,ensureCustom:Le,get:De,set:Ce,createEmpty:Ue,remove:Xe,display:Mn,toLiteral:Ln,isPure:Nn,reduce:Pn,each:Cn,keys:Dn,allKeys:_n,setLazy:gr,setGetterAndSetter:vr,addGetterAndSetter:hr,replaceGetterAndSetter:mr,Cache:Mr,setDefaults:Ur,ensureMulti:Jr,resolveKeys:Ut,diveGet:Qt,deepCopy:pi,fromLines:ji,safeDefault:Ni,hasKey:ou,has:uu,fromKeys:Nu,fromArray:Ru},re:{is:J,matchEnd:fn,matchLast:cn,matchAll:ln,setStartIndex:ee,copy:$,updateFlagString:Q,parseFlagString:V,createFlagString:H,ensureGlobal:sn,global:an,addFlag:on,createEscaped:Tn,create:xn,resolveFlags:bn,escape:On,safeCreateResult:yt,createResult:gt,RegexResult:mt,match:Tt,ensureLocal:Ot,local:xt,removeFlag:bt,resultEndIndex:St,matchStart:Nt,quotes:si,quote:ai,newline:hi,text:Oi,test:Di},v:{constructorMatches:W,isPrimitive:fe,resolve:Pe,type:dn,display:qn,toLiteral:In,nullIfNaN:er,req:Rt,isEmpty:vi},a:{last:U,resolveIndex:X,is:ne,ensure:re,pick:_e,create:Ie,fill:Fe,resolveIndices:ke,push:We,add:Be,splitLast:ze,splitTail:Ye,wrapIndices:gn,wrapIndex:mn,toLiteral:Fn,display:Rn,removeNullish:kr,removeByFilter:Nr,replaceContents:Ar,pushMulti:vt,addMulti:ht,pushThroughMulti:dt,removeEmpty:mi,removeIndex:gi,apply:yi,mapToObj:wi,slice:bi,filterSplit:$i,copy:xu,toObj:qu},class:{create:Se,setName:we,addStatics:be,setDisplay:Ee},p:{asyncJoint:ie,is:te},sym:{display:Te,value:Je},macro:{config:xe},map:{Cache:Ge,ensure:qe,get:Me,set:Re,MultiCache:rn,diveEnsure:$e,createEmpty:Qe,diveDelete:nn,remove:en},args:{ensureArray:Ke,push:Eu,append:Tu,insert:Ou},tree:{ensure:He,dive:Ve,remove:Ze,setCustom:Yt,copy:fi,isSubsetOf:au,iterate:ju,iterator:Au,merge:Mu,join:Lu},d:{from:ar,create:or,resolve:ur,now:Hn,ensure:ir,copy:$n,fromYear:Xn,_resolveNative:Zn,isBefore:cr},n:{fromString:rr,ensure:nr,is:tr,tryCoerce:Ai,tryParse:Si},js:{removeComments:oi,fromAST:ti,enhance:lt,ensureReturn:Zr,splitLastExpression:$r,enableAwait:nt,_nodeEnableAwait:et,useTitan:it,inline:st,parse:ui,removeQuotes:ci,getExports:Du,getNodes:Fu,eachNode:ku,parseDeclaration:_u,fromASTNode:Iu},npm:{isBuiltIn:xr,isFile:Or,install:Pr,_runCommand:Cr},os:{run:Dr,_resolveStdio:Sr},win:{is:Ir},shell:{_handleError:_r},proc:{interrupt:Gt,signal:qt},bool:{fromYN:Kt},gen:{filter:bu},bin:{ensureByteSafe:Yu,isByteSafe:Ju,isNodeBuffer:Bu,isTA:Ku},ab:{isTA:Wu,is:Uu},json:{stringify:Hu}};globalThis.t?Object.keys(Zu).forEach(function(e){if(t[e]){var n=Zu[e];Object.keys(n).forEach(function(r){t[e][r]=n[r]})}else t[e]=Zu[e]}):globalThis.t=Object.assign({},Zu),globalThis.exports&&(exports.default=globalThis.t);
|
|
1
|
+
var t_f_one=function(t){var e,r=!1;return function(){return r||(r=!0,e=t.apply(this,arguments)),e}},t_node_args=t_f_one(function(){return process.argv.slice(2)}),t_env_args=t_node_args,t_s_isPrimitive=function(t){return"string"==typeof t},t_s_isObject=function(t){return t instanceof String},t_s_isAny=function(t){return t_s_isPrimitive(t)||t_s_isObject(t)},t_s_is=t_s_isAny,t_cli_splitArgs=function(t,e){const r=[];let _="",n="outside",s=!1;for(let i=0;i<t.length;i++){const a=t[i];switch(n){case"outside":'"'===a?s?(_+=a,s=!1):(e&&(_+=a),n="insideQuote"):"\\"===a?s=!0:" "===a?(_.length>0&&(r.push(_),_=""),s=!1):(_+=a,s=!1);break;case"insideQuote":'"'!==a||s?"\\"!==a||s?(_+=a,s=!1):s=!0:(e&&(_+=a),n="outside")}}return _.length>0&&r.push(_),r},t_cli_resolveArgs=function(t,e){var r=t;return null==r?t_env_args():t_s_is(r)?t_cli_splitArgs(r,e):r},t_cli_positionalArgs=function(t,e){return t_cli_resolveArgs(t,e).slice()},t_node_positionalArgs=t_cli_positionalArgs,t_node_getScriptPath=function(){var t=require.main?.filename;return t||(null!=process._eval?null:t_node_positionalArgs(process.argv)[1])},t_node_requireBuiltIn=function(t){return require("node:"+t)},t_node__builtInModule=function(t){return t_f_one(()=>t_node_requireBuiltIn(t))},t_node_fs=t_node__builtInModule("fs"),t_fs_load=function(t){return t_node_fs().readFileSync(t,"utf8")},t_fs_loadText=t_fs_load,t_fs_deepStat=function(t,e){return t_node_fs().statSync(t,e)},t_fs_shallowStat=function(t,e){return t_node_fs().lstatSync(t,e)},t_fs_stat=function(t,e,r){return(e?t_fs_deepStat:t_fs_shallowStat)(t,r)},t_fs_getID=function(t,e){return t_fs_stat(t,e).ino},t_fs_exists=function(t){return!!t_node_fs().lstatSync(t,{throwIfNoEntry:!1})},t_err_Enhanced=function(t){return class extends t{constructor(t,e){super(t,e);var r=this.constructor.name;r&&(this.name=r)}}},t_err_Error=t_err_Enhanced(globalThis.Error),t_err_NYIError=class extends t_err_Error{constructor(t,e){super(t??"Not yet implemented",e)}},t_f_is=function(t){return"function"==typeof t},t_o_ensure=function(t,e,r,_){var n=t[e];if(void 0===n){var s=r;!1!==_&&t_f_is(s)&&(s=s(t,e)),t[e]=n=s}return n},t_o_safeEnsure=function(t,e,r,_){return t||(t={}),t_o_ensure(t,e,r,_),t},t_err_defaultFromFn=function(t,e){return t_o_safeEnsure(t,"fromFn",e,!1)},t_err_nyi=function(t,e){return new t_err_NYIError(t,t_err_defaultFromFn(e,t_err_nyi))},t_node_os=t_node__builtInModule("os"),t_node_path=t_node__builtInModule("path"),t_path_sep=t_node_path().sep,t_path__getDefaultTempDir=function(){return t_node_os().tmpdir()+t_path_sep},t_path_getTempDir=function(t){if(t)throw t_err_nyi();return t_path__getDefaultTempDir()},t_titan_getTempDir=function(){return t_path_getTempDir()+"Titan/"},t_s_decapitalize=function(t){return t.charAt(0).toLowerCase()+t.slice(1)},t_path__removeExtsFromFile=function(t){return t.split(".")[0]},t_path_file=function(t){return t_node_path().win32.basename(t)},t_path_baseName=function(t){return t_path__removeExtsFromFile(t_path_file(t))},t_titan_getPackageName=function(t,e,r,_){t||(t=t_node_getScriptPath()??"_console.js");var n=t_s_decapitalize(t_path_baseName(t));return e&&(n+="_repl"),n+(r&&_?.dynamic?".dypkg.json":".pkg.js")},t_v_constructorMatches=function(t,e){return null!=t&&t.constructor===e},t_o_constructorMatches=t_v_constructorMatches,t_re_is=function(t){return t_o_constructorMatches(t,RegExp)},t_a_last=function(t){return t[t.length-1]},t_o_is=function(t){return t_v_constructorMatches(t,Object)},t_s_chars=function(t){return new Set(t)},t_re_parseFlagString=function(t){var e={};if(t){var r=t_s_chars(t);r.has("g")&&(e.global=!0),r.has("i")&&(e.caseInsensitive=!0),r.has("y")&&(e.sticky=!0)}return e},t_re_createFlagString=function(t){var e="";return t.global&&(e+="g"),(t.caseInsensitive||0==t.caseSensitive)&&(e+="i"),t.sticky&&(e+="y"),e},t_re_updateFlagString=function(t,e){var r=t_re_parseFlagString(t);return t_re_createFlagString(Object.assign(r,e))},t_re_copy=function(t,e){var r=e,_=void 0;return t_s_is(r)?_=r:t_o_is(r)&&(_=t_re_updateFlagString(t.flags,r)),new RegExp(t,_)},t_a_resolveIndex=function(t,e){return e<0?t.length+e:e},t_s_resolveIndex=t_a_resolveIndex,t_re_setStartIndex=function(t,e,r){return t=t_re_copy(t,{global:!0}),null!=r&&(e=t_s_resolveIndex(r,e)),t.lastIndex=e,t},t_a_is=function(t){return Array.isArray(t)},t_a_ensure=function(t){return t_a_is(t)?t:[t]},t_p_is=function(t){return t instanceof Promise},t_p_asyncJoint=function(t,e){var r=t;return t_p_is(r)?r.then(e):e(r)},t_f_isArrow=function(t){return t_f_is(t)&&null==t.prototype},t_f_isArrowFn=t_f_isArrow,t_f_wrap=function(t){return function(){return t.apply(this,arguments)}},t_f_createConstructor=function(t,e){var r;return r=e?function(){this.super=e;var r=t.apply(this,arguments);return t_p_asyncJoint(r,()=>(delete this.super,r))}:t_f_isArrowFn(t)?t_f_wrap(t):t,r._isConstructor=!0,r},t_f_ensureConstructor=function(t,e){return t._isConstructor?t:t_f_createConstructor(t,e)},t_f_retThis=function(){return this},t_v_isPrimitive=function(t){var e=typeof t;return"object"!==e&&"function"!==e||null===t},t_o_isAny=function(t){return!t_v_isPrimitive(t)},t_o_merge=function(t,e,r){return!1===r?Object.keys(e).forEach(r=>{void 0===t[r]&&(t[r]=e[r])}):Object.assign(t,e),t},t_o_weakAssign=function(t,e){return t_o_merge(t,e,!1)},t_o_defineProperty=function(t,e,r,_){return r||(r={}),_&&t_o_weakAssign(r,_),null==r.enumerable&&(r.enumerable=!0),null==r.configurable&&(r.configurable=!0),Object.defineProperty(t,e,r)},t_o_addNonEnumerable=function(t,e,r,_){return t_o_defineProperty(t,e,{value:r,writable:!0,enumerable:!1},_),r},t_o_setHidden=t_o_addNonEnumerable,t_f_setName=function(t,e){Object.defineProperty(t,"name",{value:e,configurable:!0}),t_o_setHidden(t,"displayName",e)},t_class_setName=t_f_setName,t_class_addStatics=function(t,e){return Object.assign(t,e)},t_macro_config=function(t){},t_node_is=t_f_one(function(){return t_macro_config("node.is")??"undefined"==typeof window}),t_sym_display=t_node_is()?require("util").inspect.custom:Symbol("Display"),t_class_setDisplay=function(t,e){t.prototype[t_sym_display]=e},t_class_create=function(t,e,r,_,n,s){s||(s={}),t_s_is(e)&&(e=null);var i,a,o,u=r;u&&(t_a_is(u)?([a,o]=u,a&&(a=t_f_ensureConstructor(a))):i=t_f_ensureConstructor(u,e));var l=s.bareFn;s.singleton&&(l=function(){return null==p.default&&(p.default=new p(...arguments)),p.default});var c,f=a||i||e||t_f_retThis;function p(){if(!new.target&&l&&!(this instanceof p))return l.apply(this,arguments);var t=this;return t_p_asyncJoint(f.apply(t,arguments),r=>{if(r&&t_o_isAny(r)&&(t=r,a)){if(!new.target)throw t_err_nyi('Prototype repair is NYI for class instantiation without "new".');if(!e)throw t_err_nyi("instanceFn is not yet supported when extendsClass is null.");var _=Object.getPrototypeOf(this);Object.getPrototypeOf(t)!==_&&Object.setPrototypeOf(t,_)}return o?t_p_asyncJoint(o.apply(t,arguments),()=>t):t})}return t&&t_class_setName(p,t),_?(c=_,e&&Object.setPrototypeOf(_,e.prototype)):c=e?Object.create(e.prototype):{},t_o_setHidden(c,"constructor",p),p.prototype=c,n&&t_class_addStatics(p,n),s.display&&t_class_setDisplay(p,s.display),s.implements&&t_a_ensure(s.implements).forEach(t=>t(p)),p},t_o_makeNonEnumerable=function(t,e){Object.defineProperty(t,e,{enumerable:!1})},t_o_hideKey=t_o_makeNonEnumerable,t_f_createClass=function(t,e,r,_,n){var s=Symbol();return t_class_create(t,Function,[function(){var t=function(){return t[s].apply(this,arguments)};return t},function(){var t=e.apply(this,arguments);if(!t)throw new Error("Constructor must return a function.");this[s]=t,t_o_hideKey(this,s)}],r,_,n)},t_a_resolveIndices=function(t,e,r,_){return e=null==e?0:t_a_resolveIndex(t,e),r=null==r?t.length:t_a_resolveIndex(t,r),_&&(0==_.inclusiveStart&&e++,_.inclusiveEnd&&r++),[e,r]},t_a_fill=function(t,e,r,_){var n=e;if([r,_]=t_a_resolveIndices(t,r,_),t_f_is(n))for(var s=r;s<_;s++)t[s]=n(s,t);else t.fill(n,r,_);return t},t_a_create=function(t,e){var r=new Array(t||0);return arguments.length>1&&t_a_fill(r,e),r},t_a_pick=function(t,e){return t_a_create(e.length,r=>t[e[r]])},t_o_get=function(t,e){return t[e]},t_o_set=function(t,e,r){return t[e]=r},t_v_resolve=function(t,e,r){var _=t;return t_f_is(_)?_.apply(r,e):_},t_o_ensureCustom=function(t,e,r,_,n){_||(_=t_o_get);var s=_(t,e);return void 0===s&&(s=t_v_resolve(r,[t,e]),n||(n=t_o_set),n(t,e,s)),s},t_map_get=function(t,e){return t.get(e)},t_map_set=function(t,e,r){return t.set(e,r)},t_map_ensure=function(t,e,r){return t_o_ensureCustom(t,e,r,t_map_get,t_map_set)},t_map_Cache=class{constructor(){this.store=new Map}get(t,e){return t_map_ensure(this.store,t,e)}remove(t){return this.store.delete(t)}delete(t){return this.remove(t)}},t_a_add=function(t,e){return t.push(e),t},t_a_push=t_a_add,t_args_ensureArray=function(t){var e=t;return Array.isArray(e)?e:Array.from(e)},t_sym_value=Symbol("Value"),t_o_createEmpty=function(){return{}},t_a_splitTail=function(t){return[t.slice(0,-1),t[t.length-1]]},t_a_splitLast=t_a_splitTail,t_tree_dive=function(t,e,r,_,n,s){r||(r=t_o_get),null==_&&(_=t_o_createEmpty),null==n&&(n=t_o_set),null==s&&(s=r);for(var[i,a]=t_a_splitLast(e),o=t,u=i.length,l=0;l<u;l++){var c=i[l],f=r(o,c);if(void 0===f){if(!_)return;f=t_o_ensureCustom(o,c,_,r,n)}o=f}if(s)return s(o,a,n)},t_tree_ensure=function(t,e,r,_,n,s){return t_tree_dive(t,e,_,n,s,(t,e)=>t_o_ensureCustom(t,e,r,_,s))},t_map_createEmpty=function(){return new Map},t_map_diveEnsure=function(t,e,r){return t_tree_ensure(t,e,r,t_map_get,t_map_createEmpty,t_map_set)},t_o_remove=function(t,e){return delete t[e],t},t_tree_remove=function(t,e,r,_){return t_tree_dive(t,e,r,!1,!1,_||t_o_remove)},t_map_remove=function(t,e){return t.delete(e)},t_map_diveDelete=function(t,e){return t_tree_remove(t,e,t_map_get,t_map_remove)},t_map_MultiCache=class{constructor(){this.store=new Map}get(t,e){return t=t_a_push(t_args_ensureArray(t),t_sym_value),t_map_diveEnsure(this.store,t,e)}remove(t){return t=t_a_push(t_args_ensureArray(t),t_sym_value),t_map_diveDelete(this.store,t)}delete(t){return this.remove(t)}},t_f_MemoizedFunction=t_f_createClass("MemoizedFunction",function(t,e){if(this.base=t,null!=e)if(1===(e=t_a_ensure(e)).length){this.cache=new t_map_Cache;var r=e[0];this._cacheKeyFormatter=t=>t[r]}else this.cache=new t_map_MultiCache,this._cacheKeyFormatter=t=>t_a_pick(t,e);else this.cache=new t_map_MultiCache,this._cacheKeyFormatter=t=>t;var _=this;return function(){var e=_._cacheKeyFormatter(arguments);return _.cache.get(e,()=>t.apply(this,arguments))}},{remove(t){return this.cache.remove(this._cacheKeyFormatter(t))}}),t_f_memoize=function(t,e){return new t_f_MemoizedFunction(t,e)},t_re_addFlag=function(t,e){return t_re_copy(t,t.flags+e)},t_re_global=function(t){return t_re_addFlag(t,"g")},t_re_ensureGlobal=t_f_memoize(function(t){return t.global?t:t_re_global(t)},0),t_re_matchAll=function(t,e,r){return t=null!=r?t_re_setStartIndex(t,r,e):t_re_ensureGlobal(t),Array.from(e.matchAll(t))},t_re_matchLast=function(t,e,r){return null!=r&&(e=e.slice(0,r)),t_a_last(t_re_matchAll(t,e))||null},t_re_matchEnd=function(t,e){var r=t_re_matchLast(t,e);return r&&e.length===r.index+r[0].length?r:null},t_err_TypeError=t_err_Enhanced(globalThis.TypeError),t_v_type=function(t){return null==t?t:t.constructor},t_node_util=t_node__builtInModule("util"),t_node_display=function(t,e){return e||(e={}),null==e.colors&&(e.colors=!0),t_node_util().inspect(t,e)},t_a_wrapIndex=t_a_resolveIndex,t_a_wrapIndices=function(t,e,r,_){return void 0!==e&&(null===e||0===e?e=void 0:(e=t_a_wrapIndex(t,e),_&&0==_.inclusiveStart&&e++)),void 0!==r&&(null===r||r===t.length?r=void 0:(r=t_a_wrapIndex(t,r),_&&_.inclusiveEnd&&r++)),[e,r]},t_s_withIndices=function(t,e,r,_,n,s){if(r||null!=_){[r,_]=t_a_wrapIndices(t,r,_,s);var i=t.slice(r,_),a=e(i);return n?n(a,r,_,i,t):a}return e(t)},t_s_apply=function(t,e,r,_,n){return t_s_withIndices(t,e,r,_,(e,r,_)=>(void 0!==r?t.slice(0,r):"")+(e||"")+(void 0!==_?t.slice(_):""),n)},t_re_resolveFlags=function(t){var e=t;return null==e?void 0:t_s_is(e)?e:t_re_createFlagString(e)},t_re_create=function(t,e){return new RegExp(t,t_re_resolveFlags(e))},t_re_escape=function(t){return t.replace(/[-[\]{}()*+!<=:?.\/\\^$|#\s,]/g,"\\$&")},t_re_createEscaped=function(t,e){return t_re_create(t_re_escape(t),e)},t_s_replaceAll=function(t,e,r,_,n,s){return t_s_apply(t,function(t){return t.replaceAll?(t_re_is(e)&&(e=t_re_ensureGlobal(e)),t.replaceAll(e,r)):(e=t_s_is(e)?t_re_createEscaped(e,"g"):t_re_ensureGlobal(e),this.replace(e,r))},_,n,s)},t_s_escape=function(t,e,r){return t_s_replaceAll(t,e,(r??"\\")+e)},t_s_quote=function(t,e,r){return null==e&&(e='"'),!1!==r&&(t=t_s_escape(t,e,r)),e+t+e},t_s_toLiteral=function(t){return t_s_quote(t,'"')},t_o_isPure=t_o_is,t_s_from=function(t){return t_o_isPure(t)?t_o_toLiteral(t):String(t)},t_a_toLiteral=function(t,e){return e||(e=t_v_toLiteral),"["+t.reduce(function(t,r){return t+e(r)+", "},"").slice(0,-2)+"]"},t_v_toLiteral=function(t){return t_s_is(t)?t_s_toLiteral(t):t_a_is(t)?t_a_toLiteral(t):t_s_from(t)},t_o_allKeys=function(t){return Reflect.ownKeys(t)},t_o_keys=function(t,e){return(e?t_o_allKeys:Object.keys)(t)},t_o_each=function(t,e,r){t_o_keys(t,r).forEach((r,_,n)=>e(r,t[r],_,n))},t_o_reduce=function(t,e,r,_){var n=null!=r?r:"";return t_o_each(t,function(){n=e.call(this,n,...arguments)},_),n},t_o_toLiteral=function(t,e){return e||(e=t_v_toLiteral),"{"+t_o_reduce(t,function(t,r,_){return t+r+":"+e(_)+", "},"",!0).slice(0,-2)+"}"},t_o_display=function(t,e){return null==e&&(e=1),e<=0?"[object Object]":t_o_toLiteral(t,t=>t_v_display(t,e-1))},t_a_display=function(t,e){return null==e&&(e=1),e<=0?"[object Array]":t_a_toLiteral(t,t=>t_v_display(t,e-1))},t_v_display=function(t,e){return void 0===t?"undefined":null===t?"null":t_node_is()?t_node_display(t,e):t_o_is(t)?t_o_display(t,maxNumLevels):t_a_is(t)?t_a_display(t,maxNumLevels):t_s_from(t)},t_err_type=function(t,e,r,_){if(0===arguments.length)return new t_err_TypeError("Unexpected type received");_||(_={});var n,{type:s,expected:i}=_;return null==s&&(s=t_v_type(t)),s&&s.name&&(s=s.name),i?(i.name&&(i=i.name),n="Expected "+i+", received "):n="Unexpected type received (",n+=s,null!=t&&(n+=" ("+t_v_display(t)+")"),i||(n+=")"),r&&(n+=' for "'+r+'"'),null!=e&&(n+=" (index "+e+")"),_.fromFn||(_.fromFn=t_err_type),new t_err_TypeError(n,_)},t_s_endsWith=function(t,e){if(t_s_is(e))return t.endsWith(e);if(t_re_is(e))return!!t_re_matchEnd(e,t);throw t_err_type(e,1,"matchThis")},t_path_ensureTrailingSlash=function(t){return t_s_endsWith(t,t_path_sep)?t:t+t_path_sep},t_path_dir=function(t,e){return t=t_node_path().dirname(t),!1===e?t:t_path_ensureTrailingSlash(t)},t_path_abs=function(t,e,r){var _=t_node_path().resolve,n=e?_(e,t):_(t);return r?n+t_path_sep:n},t_titan_getPackagePath=function(t,e,r,_){var n,s=t_titan_getPackageName(t,e,r,_);return n=t?t_path_dir(t):"./",t_path_abs(n+s)},t_err_create=function(t,e,r){var _=new t_err_Error(t,r);return e&&Object.assign(_,e),_},t_titan_locate=t_f_one(function(){var t=process.env.TITAN_PATH;if(!t)throw t_err_create("Environment variable TITAN_PATH is not set.");return t_path_ensureTrailingSlash(t)}),t_titan_getCompiledDir=t_f_one(function(){return t_titan_locate()+"Compiled/"}),t_d_now=function(){return new Date},t_err_req=function(t,e,r,_){var n="Required argument";return r&&(n+=' "'+r+'"'),null!=e&&(n+=" (index "+e+")"),n+=" missing",arguments.length>0&&(n+=" (received "+t_v_display(t)+")"),t_err_create(n,null,t_err_defaultFromFn(_,t_err_req))},t_d_copy=function(t){return new Date(t.getTime())},t_d_fromYear=function(t){return new Date(t,null)},t_d__resolveNative=function(t){var e=new Date(t);return isNaN(e.getTime())?null:e},t_v_nullIfNaN=function(t){return isNaN(t)?null:t},t_n_ensure=function(t){return null==t?null:t_v_nullIfNaN(Number(t))},t_n_fromString=t_n_ensure,t_n_is=function(t){var e=typeof t;return"number"===e||"bigint"===e},t_d_ensure=function(t,e){if(null==t)throw t_err_req(t,0);if(t.constructor===Date)return e?t_d_copy(t):t;if(t_s_is(t)){var r=t_n_fromString(t);return null!=r?t_d_fromYear(r):t_d__resolveNative(t)||null}return t_n_is(t)?t_d_fromYear(t):void 0},t_d_resolve=function(t,e){return null==t?t_d_now():t_d_ensure(t,e)},t_d_create=function(t){return t_d_resolve(t,!0)},t_d_from=t_d_create,t_titan_getLastCompileTime=function(){var t=t_titan_getCompiledDir()+"LastCompileTime.txt";return t_fs_exists(t)?t_d_from(t_fs_load(t)):null},t_fs_getModifiedDate=function(t){return t_fs_stat(t).mtime},t_d_isBefore=function(t,e,r){return t=t_d_ensure(t),e=t_d_ensure(e),!1===r?t<e:t<=e},t_titan_hasNewCompile=function(t){var e=t_titan_getLastCompileTime();if(e){var r=t_fs_getModifiedDate(t);if(t_d_isBefore(r,e))return!0}return!1},t_node_getScriptDir=function(t){var e=t_node_getScriptPath();return e?t_path_dir(e,t):null},t_fs_loadJSON=function(t){return JSON.parse(t_fs_loadText(t))},t_o_addGetterAndSetter=function(t,e,r,_,n){return t_o_defineProperty(t,e,{get:r,set:_},n)},t_o_setGetterAndSetter=t_o_addGetterAndSetter,t_o_replaceGetterAndSetter=function(t,e,r,_){return t_o_defineProperty(t,e,{value:r,writable:!0},_)},t_o_setLazy=function(t,e,r,_){t_o_setGetterAndSetter(t,e,function(){var _=r(e,t);return this[e]=_,_},function(t){t_o_replaceGetterAndSetter(this,e,t,_)},_)},t_titan__trackGlobals=function(t,e){var r=t.globals,_=t.shortNamesToGlobals;Object.keys(_).forEach(t=>{for(var n=_[t],s=n.length,i=0;i<s;i++){var a=n[i],o=globalThis[a];o||(o=globalThis[a]={});var u=r[a];Object.keys(u).forEach(r=>{var _=e[t][r];o[r]=_})}}),e._meta||(e._meta={}),e._meta.globals=t.globals},t_titan__loadDynamicDeps=function _loadDynamicDeps(dynPackagePath,localT,options){const path=t_node_path();if(dynPackagePath)dynPackagePath=path.resolve(t_node_getScriptDir(),dynPackagePath);else{var scriptPath=t_node_getScriptPath();if(!scriptPath)throw new Error("Cannot find package name because scriptPath does not exist.");var dir=path.dirname(scriptPath),baseName=path.basename(scriptPath).split(".")[0];baseName=baseName[0].toLowerCase()+baseName.slice(1),dynPackagePath=path.join(dir,baseName+".pkg.json")}for(var packageObj=t_fs_loadJSON(dynPackagePath),setLazy=t_o_setLazy,items=packageObj.itemsInOrder,numItems=items.length,i=0;i<numItems;i++){let item=items[i],[shortName,itemName,evalText]=item,tModObj=localT[shortName];tModObj||(tModObj=localT[shortName]={}),Object.hasOwn(tModObj,itemName)||setLazy(tModObj,itemName,function(){let t=localT;return eval("("+evalText+")")})}packageObj.globals&&t_titan__trackGlobals(packageObj,localT)},t_node__basicRequire=function(t){return require(t)},t_npm_isBuiltIn=function(t){return!!t.startsWith("node:")||t_node__basicRequire("node:module").isBuiltin(t)},t_npm_isFile=function(t){return t.startsWith(".")},t_err_ValueError=class extends t_err_Error{constructor(t,e){super(t??"Unexpected value",e)}},t_err_value=function(t,e,r,_){if(0===arguments.length)return new t_err_ValueError("Unexpected value received");_||(_={});var n,{expected:s}=_;return n=s?"Received "+t_v_display(t)+", expected one of "+t_v_display(s):"Unexpected value received: "+t_v_display(t),r&&(n+=' for "'+r+'"'),null!=e&&(n+=" (index "+e+")"),_.fromFn||(_.fromFn=t_err_value),new t_err_ValueError(n,_)},t_os__resolveStdio=function(t){var e=t.stdio;if(e){if(!t_a_is(e)){if(!t_s_is(e))throw t_err_type(e,"stdio");if("pipe"===e)e=["pipe","pipe","pipe"];else if("inherit"===e)e=["inherit","inherit","inherit"];else if("ignore"===e)e=["ignore","ignore","ignore"];else{if("overlapped"!==e)throw t_err_value(e,"stdio");e=["overlapped","overlapped","overlapped"]}t.stdio=e}}else e=t.stdio=[null,null,null];return e},t_a_replaceContents=function(t,e){var r=e.length;t.length=r;for(var _=0;_<r;_++)t[_]=e[_];return t},t_f_not=function(t){return function(){return!t.apply(this,arguments)}},t_a_removeByFilter=function(t,e){return t_a_replaceContents(t,t.filter(t_f_not(e)))},t_a_removeNullish=function(t){return t_a_removeByFilter(t,t=>null==t)},t_node_child_process=t_node__builtInModule("child_process"),t_win_is=t_f_one(function(){return"win32"===process.platform}),t_shell__handleError=function(t,e,r){if(r||(r={}),e(t))throw t;if(r.nullOnErr)return null;var _=r.onErr;if(void 0!==_)return t_v_resolve(_);throw t},t_os_run=function(t,e,r){r||(r={}),r.dir&&(r.cwd=r.dir);var _=t_os__resolveStdio(r);if(null==_[0]){var n=r.allowInput,s=r.input;if(n&&s)throw t_err_create("allowInput (user) and input (programmatic) cannot be used simultaneously for synchronous child processes.");n&&(_[0]="inherit")}if(null==_[1]){var i=r.captureOutput??!1,a=r.showOutput;if(i&&a)throw t_err_create("captureOutput and showOutput cannot be used simultaneously for synchronous child processes.");i?_[1]="pipe":(null==a&&(a=!0),_[1]=a?"inherit":"ignore")}if(null==_[2]){var o=r.captureErr??!1,u=r.showErr;if(o&&u)throw t_err_create("captureErr and showErr cannot be used simultaneously for synchronous child processes.");o?_[2]="pipe":(null==u&&(u=!0),_[2]=u?"inherit":"ignore")}r.encoding||(r.encoding="utf8"),e&&t_a_removeNullish(e);try{var l=t_node_child_process().execFileSync(t,e,r);null!=l&&!1!==r.trim&&(l=l.trim());var c=r.map??r.mapFn;return c&&(l=c(l)),l}catch(t){if(t_win_is())return t_shell__handleError(t,t=>"ENOENT"===t.code,r);throw t}},t_npm__runCommand=function(t,e){return e||(e={}),null==e.captureOutput&&(e.captureOutput=!1),e.shell=!0,e.filterExtensions=!1,t_os_run("npm",t,e)},t_npm_install=function(t,e,r){return t_npm__runCommand(["install",t,e?"-g":null],r)},t_node_requireLocal=function(t){return require(t_path_abs(t))},t_o_Cache=class{constructor(){this.store={}}get(t,e){return t_o_ensure(this.store,t,e)}remove(t){return delete this.store[t]}delete(t){return this.remove(t)}},t_node__requireDirCache=new t_o_Cache,t_path_join=function(t,e,r){if(t_node_is()){var _=t_node_path().join(t,e);return r?t_path_ensureTrailingSlash(_):_}throw t_err_nyi()},t_path_ensureEndsWith=function(t,e){return t.endsWith(e)?t:t_path_join(t,e)},t_node_module=t_node__builtInModule("module"),t_node__createRequire=function(t){return t=t_path_ensureEndsWith(t,"node_modules"),t_node_module().createRequire(t)},t_node__requireFromDir=function(t,e){return t_node__requireDirCache.get(t,()=>t_node__createRequire(t))(e)},t_o_ensureMulti=function(t,e,r){return Object.keys(e).forEach(_=>t_o_ensure(t,_,e[_],r)),t},t_o_setDefaults=function(t,e,r){return e?t_o_ensureMulti(t,e,r):t},t_s__removeStringFromEnd=function(t,e){return t.endsWith(e)?t.substring(0,t.length-e.length):t},t_s__removeRegexFromEnd=function(t,e){var r=t_re_matchEnd(e,t);return r?t.slice(0,r.index):t},t_s_removeFromEnd=function(t,e){if(t_s_is(e))return t_s__removeStringFromEnd(t,e);if(t_re_is(e))return t_s__removeRegexFromEnd(t,e);throw t_err_type(e,1)},t_s_removeTrailing=t_s_removeFromEnd,t_s_splitAtIndex=function(t,e){return[t.slice(0,e),t.slice(e)]},t_js_splitLastExpression=function(t){t=t_s_removeTrailing(t.trim(),";");var e=Math.max(t.lastIndexOf(";"),t.lastIndexOf("\n"));return t_s_splitAtIndex(t,e+1)},t_s_ensureStartsWith=function(t,e){return t.startsWith(e)?t:e+t},t_js_ensureReturn=function(t){var[e,r]=t_js_splitLastExpression(t);return e+t_s_ensureStartsWith(r.trim(),"return ")},t_js__nodeEnableAwait=function(t){return t_node_require("node-repl-await").processTopLevelAwait(t)},t_js_enableAwait=function(t){return t_js__nodeEnableAwait(t)??t},t_s_replace=t_s_replaceAll,t_path_fws=function(t,e){return""===t?t:(!1!==e&&(t=t_path_ensureTrailingSlash(t)),t_s_replace(t,"\\","/"))},t_js_useTitan=function(t){return'require("'+t_path_fws(t_titan_getPackagePath(),!1)+'");\n'+t},t_s_removeAll=function(t,e){return t_s_replaceAll(t,e,"")},t_s_removeMulti=function(t,e){return e.forEach(e=>t=t_s_removeAll(t,e)),t},t_s_removeLineBreaks=function(t){return t_s_removeMulti(t,["\r","\n"])},t_js_inline=function(t){return t_s_removeLineBreaks(t_js_removeComments(t))},t_js_enhance=function(t,e,r){return(e||r)&&(e||(e={}),r&&t_o_setDefaults(e,r),e.ensureReturn&&(t=t_js_ensureReturn(t)),e.topLevelAwait&&(t=t_js_enableAwait(t)),e.useTitan&&(t=t_js_useTitan(t)),e.keepAlive&&(t="\nsetInterval(()=>{}, 100000);\n"+t),(e.logErrors||e.keepAlive)&&(t="process.on('uncaughtException', console.error);\nprocess.on('unhandledRejection', console.error);\n"+t),e.inline&&(t=t_js_inline(t))),t},t_s_ensure=function(t){return t_s_is(t)?t:t_s_from(t)},t_f_isArrowString=function(t){var e=t.indexOf("{");return-1===e||t.slice(0,e).includes("=>")},t_s__matchWithIndices=function(t,e,r,_,n){return t_s_withIndices(t,e,r,_,(e,r)=>null===e?null:(e.input=t,void 0!==r&&(e.index+=r),e),n)},t_a_pushThroughMulti=function(t,e){return t.splice(t.length,0,...e),e},t_a_addMulti=function(t,e){return t_a_pushThroughMulti(t,e),t},t_a_pushMulti=t_a_addMulti,t_re_RegexResult=class extends Array{constructor(t,e,r,_,n){if(-1===e)throw t_err_create("RegexResult index cannot be -1. For empty result, use bare null.");if(null==t)throw t_err_create("RegexResult matchString cannot be null. For empty result, use bare null.");super(),this[0]=t,_&&t_a_pushMulti(this,_),this.index=e,this.input=r,n&&(this.groups=n)}fromParts(t){var e=t;return new t_re_RegexResult(e.match,e.index,e.input,e.captures,e.groups)}},t_re_createResult=function(t,e,r,_,n){return new t_re_RegexResult(t,e,r,_,n)},t_re_safeCreateResult=function(t,e,r,_,n){return-1===e||null==t?null:t_re_createResult(t,e,r,_,n)},t_s_remove=t_s_removeAll,t_re_removeFlag=function(t,e){return t_re_copy(t,t_s_remove(t.flags,e))},t_re_local=function(t){return t_re_removeFlag(t,"g")},t_re_ensureLocal=t_f_memoize(function(t){return t.global?t_re_local(t):t},0),t_re_match=function(t,e,r){return(t=null!=r?t_re_setStartIndex(t,r,e):t_re_ensureLocal(t)).exec(e)},t_s_match=function(t,e,r,_,n){return t_s__matchWithIndices(t,t=>{if(t_s_is(e)){var r=t.indexOf(e);return t_re_safeCreateResult(e,r,t)}return t_re_match(e,t)},r,_,n)},t_re_resultEndIndex=function(t){return t.index+t[0].length},t_s_after=function(t,e){var r=t_s_match(t,e);return null===r[0]?null:t.slice(t_re_resultEndIndex(r))},t_s__removeStringFromStart=function(t,e){return t.startsWith(e)?t.substring(e.length):t},t_re_matchStart=function(t,e){var r=t_re_match(t,e);return r&&0===r.index?r:null},t_s__removeRegexFromStart=function(t,e){var r=t_re_matchStart(e,t);return r?t.slice(r[0].length):t},t_s_removeFromStart=function(t,e){if(t_s_is(e))return t_s__removeStringFromStart(t,e);if(t_re_is(e))return t_s__removeRegexFromStart(t,e);throw t_err_type(e,1)},t_s_removeLeading=t_s_removeFromStart,t_f__getArrowFnBody=function(t){var e=t_s_after(t,"=>").trim();return t_s_removeLeading(t_s_removeTrailing(e,"}"),"{")},t_f__getNormalFnBody=function(t){return t_s_after(t,"{").slice(0,-1)},t_f_body=function(t){var e=t_s_ensure(t);return t_f_isArrowString(e)?t_f__getArrowFnBody(e):t_f__getNormalFnBody(e)},t_s_resolve=function(t){return null==t?"":t_s_is(t)?t:t_f_is(t)?t_f_body(t):String(t)},t_node_run=function(t,e){var r=e?.basic?null:{topLevelAwait:!0,useTitan:!0},_=t_js_enhance(t_s_resolve(t),e,r);return t_os_run("node",[e?.mode??"-p",_],e)},t_v_req=function(t,e,r){if(null==t)throw t_err_req(t,e,r,{fromFn:t_v_req});return t},t_proc_signal=function(t,e){return process.kill(t,t_v_req(e,0,"signalName"))},t_proc_interrupt=function(t){return t_proc_signal(t,"SIGINT")},t_node_interrupt=function(){return t_proc_interrupt(process.pid)},t_node_sigint=t_node_interrupt,t_bool_fromYN=function(t){if("Y"===(t=t.toUpperCase()))return!0;if("N"===t)return!1;throw t_err_value(t,0,"char")},t_node_promptYNSync=function(t){null==t&&(t="Are you sure? [y/n]: "),process.stdout.write(t);var e=t_node_run(function(){const t=process.stdin,e=process.stdout;t.setRawMode(!0),t.setEncoding("utf8"),t.on("data",t=>{var r=t.toUpperCase();"Y"===r||"N"===r?(e.write(t),process.exit(0)):""===t&&(e.write("^C"),process.exit(0))})},{mode:"-e",basic:!0,stdio:["inherit","pipe"]});if("^C"===e)throw process.stdout.write(e),t_node_sigint(),t_err_create("Prompt was cancelled via interrupt.");return console.log(e),t_bool_fromYN(e)},t_o_resolveKeys=function(t){return t_a_is(t)?t:t_s_is(t)?t.split("."):[t]},t_tree_setCustom=function(t,e,r,_,n,s){var i=r;return t_tree_dive(t,e,_,n,s,(t,e,r)=>r(t,e,t_v_resolve(i)))},t_env_setConfig=function(t,e){var r=e,_=globalThis.config;_||(_=globalThis.config={});var n,s=t_o_resolveKeys(t);return s.length>1?n=t_tree_setCustom(_,s,r):(n=t_v_resolve(r),_[s[0]]=n),n},t_node_addRequireDir=function(t,e){return t_env_setConfig("node.require.customDirs",r=>(r||(r=[]),!1!==e&&(t=t_path_ensureEndsWith(t,"node_modules")),r.includes(t)||r.push(t),r)),t},t_node_ensureRequireDir=t_node_addRequireDir,t_o_diveGet=t_tree_dive,t_env_getConfig=function(t){var e=globalThis.config;if(e){var r=t_o_resolveKeys(t);return r.length>1?t_o_diveGet(e,r):e[r[0]]}},t_env_resolveConfig=function(t,e,r){if(null!=t)return t;var _=t_env_getConfig(e);return null!=_?_:r},t_fs_ensureParent=function(t){var e=t_path_dir(t,!1);return t_fs_exists(e)||(e!==t&&t_fs_ensureParent(e),t_node_fs().mkdirSync(e)),t},t_fs_mkdir=function(t){return t_fs_ensureParent(t),t_node_fs().mkdirSync(t),t},t_fs_ensureDir=function(t){return t_fs_exists(t)?t:t_fs_mkdir(t)},t_node_require=function(t,e){if(t_npm_isBuiltIn(t))return require(t);if(t_npm_isFile(t))return t_node_requireLocal(t);try{return require(t)}catch(t){}var r=__dirname,_=process.mainModule?.path;if(_!==r)try{return t_node__requireFromDir(_,t)}catch(t){}var n=process.cwd();if(n!==_&&n!==r)try{return t_node__requireFromDir(n,t)}catch(t){}var s=t_env_getConfig("node.require.customDirs");if(s)for(var i of s)try{return t_node__requireFromDir(i,t)}catch(t){}var a=t_env_resolveConfig(e?.autoInstall,"node.require.autoInstall"),o=t_env_resolveConfig(e?.promptInstall,"node.require.promptInstall",!0);if(a||o){var u=a||o;!0===u&&(u="./node_modules"),u=t_path_abs(u);var l=!1;if(a?(l=!0,console.log('Auto-installing "'+t+'" from npm to "'+u+'"...')):(l=t_node_promptYNSync('Npm package "'+t+'" is required. Install now? (Y/N) '))&&console.log('Installing "'+t+'" from npm to "'+u+'"...'),l){u=t_fs_ensureDir(u),t_npm_install(t,!1,{cwd:u});try{return t_node_ensureRequireDir(u),t_node__requireFromDir(u,t)}catch(t){console.error("Failed to load from auto-install dir: ",u)}}}throw t_err_create('Module not found: "'+t+'"',{checked:{moduleDir:r,scriptDir:_,cwd:n}})},t_js_fromAST=function(t,e){return t_node_require("astring").generate(t,e)},t_err_prepend=function(t,e){return t.stack=e+"\n"+t.stack,t},t_js_parse=function(t,e,r){r||(r={}),r.ecmaVersion||(r.ecmaVersion=2024),!1!==e&&(r.sourceType="module"),null==r.allowAwaitOutsideFunction&&(r.allowAwaitOutsideFunction=!0),null==r.allowReturnOutsideFunction&&(r.allowReturnOutsideFunction=!0);var _=t_node_require("acorn");try{return _.parse(t,r)}catch(e){throw t_err_prepend(e,"Acorn parsing error: "+t)}},t_js_removeComments=function(t,e,r){return t_js_fromAST(t_js_parse(t,e,r))},t_re_quote=/(['"])(.*?)\1/,t_re_quotes=t_re_global(t_re_quote),t_s_removeQuotes=function(t){return t.replace(t_re_quotes,"")},t_js_removeQuotes=t_s_removeQuotes,t_tree_copy=function(t){return globalThis.structuredClone(t)},t_o_deepCopy=t_tree_copy,t_f_cache=t_f_memoize,t_re_newline=/\r?\n/,t_v_isEmpty=function(t){return null==t||void 0!==t.length&&0===t.length},t_a_removeEmpty=function(t,e){return t_a_removeByFilter(t,t_v_isEmpty)},t_a_removeIndex=function(t,e){return t.splice(e,1),t},t_a_apply=function(t,e,r,_){[r,_]=t_a_resolveIndices(t,r,_);for(var n=r;n<_;n++){var s=e(t[n],n,t);void 0!==s&&(t[n]=s)}return t},t_a_mapToObj=function(t,e,r){for(var _={},n=t.length,s=0;s<n;s++){var i=e(t[s],s,t);if(i){var[a,o]=i;r?(_[a]||(_[a]=[]),_[a].push(o)):_[a]=o}}return _},t_a_slice=function(t,e,r,_){return[e,r]=t_a_resolveIndices(t,e,r,_),t.slice(e,r)},t_s_repeat=function(t,e){return t_a_create(e,t).join("")},t_re_text=function(t){return t?t[0]:null},t_s__splitByMatch=function(t,e){var r=null==e?-1:e.index;if(-1===r)return[t];var _=t_s_splitAtIndex(t,r);return _[1]=_[1].slice(e[0].length),_},t_s_splitFirst=function(t,e,r,_,n){return t_s__splitByMatch(t,t_s_match(t,e,r,_,n))},t_n_tryParse=t_n_ensure,t_n_tryCoerce=function(t){return t_n_tryParse(t)??t},t_o_fromLines=function(t,e){null==e&&(e="=");var r={};return t.forEach(function(t){var[_,n]=t_s_splitFirst(t,e);null!=n&&(n=t_n_tryCoerce(n.trim())),r[_.trim()]=n}),r},t_o_safeDefault=t_o_safeEnsure,t_s_LinesArray=class extends Array{constructor(t){var e,r=t;null!=r&&(t_a_is(r)?e=r:t_s_is(r)&&(e=r.split(t_re_newline))),e?(super(e.length),Object.assign(this,e)):super(...arguments)}condense(t){return this.trim().removeEmpty(),t&&this.removeComments(t),this}trim(){return this.apply(t=>t.trim())}removeEmpty(){return t_a_removeEmpty(this)}removeComments(t){for(var e=0;e<this.length;e++){var r=this[e],_=r.indexOf(t);-1!==_&&(""===(r=r.slice(0,_)).trim()?(t_a_removeIndex(this,e),e--):this[e]=r)}return this}removeFirst(){return this.shift(),this}removeLast(){return this.pop(),this}apply(t){return t_a_apply(this,t)}join(){return super.join("\n")}toObj(t){return t_o_fromLines(this,t)}mapToObj(t,e){return t_a_mapToObj(this,t,e)}between(t,e,r){return r=t_o_safeDefault(r,"inclusiveEnd",!0),t_a_slice(this,t,e,r)}normalize(){if(this.length>0&&(""===this[0].trim()&&this.shift(),this.length>0&&(""===t_a_last(this).trim()&&this.pop(),this.length>0))){var t=this.find(t=>""!==t.trim()),e=t_re_text(t_re_match(/^\s*/,t));if(e){var r=e.length;this.apply(t=>{if(t.startsWith(e))return t.slice(r)})}}return this}deindent(t,e,r){throw t_err_nyi()}indent(t,e){var r=t_s_repeat(e??"\t",t??1);return this.apply(t=>r+t)}static is(t){return t_v_constructorMatches(t,this)}static fromChunks(t){return t.map(t=>t_s_removeTrailing(t,t_re_newline)).flatMap(t=>t_s_splitLines(t,!1))}},t_s_lines=function(t,e){var r=new t_s_LinesArray(t);return e&&r.condense(),r},t_s_splitLines=function(t,e,r){var _=t.split(t_re_newline);return e?t_s_lines(_,r):_},t_fs_loadLines=function(t,e){return t_s_splitLines(t_fs_loadText(t),!0,e)},t_re_test=function(t,e){return t_re_ensureLocal(t).test(e)},t_s_contains=function(t,e){return t_re_is(e)?t_re_test(e,t):t.includes(e)},t_s__createParamsObj=function(t,e,r,_){null==t&&(t=""),null==e&&(e="");var n={},s=(r,_)=>n[t+r+e]=_;return _&&t_o_each(_,s),r&&t_o_each(r,s),n},t_s__replaceByObj=function(t,e){return t_o_each(e,(e,r)=>t=t_s_replaceAll(t,e,r)),t},t_s_replaceParams=function(t,e,r,_){var n,s,i=_?.paramIdentifier??"$";if(i)if(t_s_is(i)){if(!t_s_contains(t,i))return t;n=i}else{if(!t_a_is(i))throw t_err_type(i,1,"paramIdentifier");if([n,s]=i,!t_s_contains(t,n)&&!t_s_contains(t,s))return t}var a=t_s__createParamsObj(n,s,e,r);return t_s__replaceByObj(t,a)},t_path_string=function(t){return t_s_is(t)?t:String(t)},t_path_windir=globalThis.process?.env.windir,t_path_getUserDir=function(t){if(t)throw t_err_nyi();return t_node_os().homedir()+t_path_sep},t_path_getDesktop=function(t){return t_path_getUserDir(t)+"Desktop/"},t_path__defaultParams={PROGRAMFILES:globalThis.process?.env.ProgramFiles,WINDIR:t_path_windir,SYSTEM32:t_path_windir&&t_path_windir+"System32",TEMP:t_path__getDefaultTempDir(),DESKTOP:t_path_getDesktop()},t_path_resolveVars=function(t,e){return t_s_replaceParams(t_path_string(t),e,t_path__defaultParams)},t_titan_locateSourceMap=function(){return t_titan_locate()+"Source/SourceMap.txt"},t_titan__resolveSourceMapPath=function(t){return t?t_path_resolveVars(t,{TITAN:t_titan_locate()}):t_titan_locateSourceMap()},t_s__indexWithIndices=function(t,e,r,_,n){return t_s_withIndices(t,e,r,_,(t,e)=>-1===t?-1:void 0===e?t:e+t,n)},t_s_indexOfFn=function(t,e){return Array.prototype.findIndex.call(t,e)},t_s_index=function(t,e,r,_,n){var s=t_s_is(e);return s&&null==_&&!n?t.indexOf(e,r):t_s__indexWithIndices(t,t=>s?t.indexOf(e):t_re_is(e)?t.search(e):t_s_indexOfFn(t,e),r,_,n)},t_s_before=function(t,e,r,_,n){var s=t_s_index(t,e,r,_,n);return-1===s?null:t.slice(r,s)},t_s_isCapitalized=function(t){var e=t[0];return e===e.toUpperCase()},t_a_filterSplit=function(t,e){var r=[],_=[];return t.forEach((n,s)=>(e(n,s,t)?r:_).push(n)),[r,_]},t_titan_loadGlobalsMap=t_f_cache(function(t){var e=t_fs_loadLines(t_titan__resolveSourceMapPath(t),!0),r={};return e.forEach(t=>{var e=t_s_before(t,"=").split(",").map(t=>t.trim()),[_,n]=t_a_filterSplit(e,t=>!t_s_isCapitalized(t)),s=_[0];if(!s)throw t_err_create('No shortName in SourceMap line: "'+t+'"');n.forEach(t=>{r[t]=s})}),r},0),t_titan__getGlobalsRegex=t_f_one(function(t){var e=Object.keys(t);return t_re_create("\\b("+e.join("|")+")\\.(\\w+)","g")}),t_titan_depsRegex=/\bt\.(\w+)\.(\w+)/g,t_titan__getDepsBasic=function(t,e){e||(e={});var r={},_=r.t={};if(e.enableGlobals){var n;n=e.additionalGlobals?t_o_deepCopy(e.additionalGlobals):{},r.globals=n;var s=t_titan_loadGlobalsMap(),i=t_titan__getGlobalsRegex(s),a=t_re_matchAll(i,t).filter(e=>{var r=e[1],_=e[2],n=t[e.index-1];if("."===n||"_"===n)return!1;var s=globalThis[r];return!s||void 0===s[_]});for(var[o,u,l]of a)n[u]||(n[u]={}),n[u][l]=!0;var c=a.map(([t,e,r])=>{var _=s[e];if(!_)throw t_err_create("No short name found for global: "+e);return"t."+_+"."+r+";"}).join(" ");t+="\n"+c}for(var[o,f,l]of a=t.matchAll(t_titan_depsRegex))_[f]||(_[f]={}),_[f][l]=!0;return r},t_titan_getDepsFromJS=function(t,e){return t=t_js_removeComments(t),t=t_js_removeQuotes(t),t_titan__getDepsBasic(t,e)},t_titan_getDepsFromHTML=function(t,e){return t_titan__getDepsBasic(t,e)},t_titan_getShallowDeps=function(t,e,r){if(e){if("js"===(e=e.toLowerCase()))return t_titan_getDepsFromJS(t,r);if("html"===e)return t_titan_getDepsFromHTML(t,r)}return t_titan__getDepsBasic(t,r)},t_o_has=function(t,e){return e in t},t_o_hasKey=t_o_has,t_tree_isSubsetOf=function(t,e){for(var r of(t_v_req(e,1),Object.keys(t))){if(!t_o_hasKey(e,r))return!1;var _=t[r];if(_&&_.constructor===Object&&!t_tree_isSubsetOf(_,e[r]))return!1}return!0},t_titan_jsonHasNewDeps=function(t,e){if(!t_tree_isSubsetOf(e.t,t))return!0;if(e.globals){var r=t._meta?.globals;if(!r)return!0;if(!t_tree_isSubsetOf(e.globals,r))return!0}return!1},t_titan_needsToPack=function(t,e,r,_){var n,s,i,a;_||(_={}),t&&(t=t_path_abs(t)),n=_.packagePath?t_path_abs(_.packagePath):t_titan_getPackagePath(t,!1,!0,_);var o,u=t_fs_exists(n);u?(s=t_titan_hasNewCompile(n))?i="New compile":(null==e&&(e=t_fs_loadText(t)),a=t_titan_getShallowDeps(e,"js",_),(o=t_titan_jsonHasNewDeps(r,a))&&(i="New deps")):i="No package";var l={needsPack:!!i,scriptPath:t,packagePath:n};return i&&(l.reasonText=i),null!=u&&(l.exists=u),null!=s&&(l.newCompile=s),null!=o&&(l.newDeps=o),e&&(l.sourceText=e),a&&(l.shallowDeps=a),l},t_path_isDir=function(t){return t_s_endsWith(t,t_path_sep)},t_path_dirPart=function(t){var e=t.lastIndexOf(t_path_sep);return-1===e?null:t.slice(0,e+1)},t_path_ignoreDir=function(t,e,r){if(t_path_isDir(t))return r?[t,null]:t;var _,n,s=t_path_dirPart(t),i=e(t_path_file(t),s,t);return r?[_,n]=i:_=i,null!=_&&(t=s?s+_:_),r?[t,n]:t},t_s_matchLast=function(t,e,r,_,n){return t_s__matchWithIndices(t,t=>{if(t_re_is(e))return t_re_matchLast(e,t);if(t_s_is(e)){var r=t.lastIndexOf(e);return-1!==r?new t_re_RegexResult(e,r):null}throw t_err_type(e,1)},r,_,n)},t_s_splitLast=function(t,e,r,_,n){return t_s__splitByMatch(t,t_s_matchLast(t,e,r,_,n))},t_path_splitExt=function(t){return t_path_ignoreDir(t,t=>t_s_splitLast(t,"."),!0)},t_path_ext=function(t,e){var r=t_path_splitExt(t)[1];return r?!1!==e?r.toLowerCase():r:null},t_titan_sourceMap={},t_titan_loadSourceMap=t_f_cache(function(t){t=t_titan__resolveSourceMapPath(t);var e=t_path_dir(t)+"../Compiled/",r=t_fs_loadLines(t,"//"),_=t_titan_sourceMap;for(var n of r){var s=n.indexOf("="),i=n.slice(0,s).trim();i=i.split(",").map(t=>t.trim()).filter(t=>!t_s_isCapitalized(t));var a=n.slice(s+1).trim(),o=t_path_join(e,a).replaceAll("\\","/");for(var u of i)_[u]=o}return _},0),t_titan_getDeps=function(t,e){var r=e?.fileType;if(r){if("js"===(r=r.toLowerCase()))return t_titan_getDepsFromJS(t,e);if("html"===r)return t_titan_getDepsFromHTML(t,e)}return t_titan__getDepsBasic(t,e)},t_gen_filter=function*(t,e){var r=0;for(var _ of t)e(_,r++,t)&&(yield _)},t_a_copy=function(t){return t.slice()},t_args_insert=function(t,e,r){for(var _=t.length-1;_>=e;_--)t[_+1]=t[_];return t[e]=r,t.length++,t},t_args_append=function(t,e){return t_args_insert(t,t.length,e)},t_args_push=t_args_append,t_f_recurse=function(t,e){return t.call(this,...e,function e(){return t_a_last(arguments)!==e&&t_args_push(arguments,e),t.apply(this,arguments)})},t_tree_iterator=function(t){t||(t={});var e=t.getKeys;e||(e=function(t){return Object.keys(t)});var r=t.recurseIf;if(!r){var _=this.constructor;r=t=>t_v_constructorMatches(t,_)||t_o_isPure(t)||t_a_is(t)}var n=t.leavesOnly??t.leafsOnly??!1,s=this;return t_f_recurse(function*(t,_,i,a){var o=e(t,_,i);if(o)for(var u=o.length,l=0;l<u;l++){var c=o[l],f=t[c],p=t_a_copy(_);p.push(c);var d=null,m={value:f,key:c,object:t,path:p,level:i,isLeaf:d,root:s},h=r(f,m);m.isLeaf=d=!h,n&&!d||(yield m),h&&(yield*a(f,p,i+1,a))}},[this,[],0])},t_tree_iterate=function(t,e){return t_tree_iterator.call(t,e)},t_o_fromKeys=function(t,e){1===arguments.length&&(e=!0);var r={};for(var _ of t)r[_]=e;return r},t_js_eachNode=function(t,e,r,_){var n=t_js_parse(t,e,_);t_node_require("acorn-walk").full(n,r)},t_js_getNodes=function(t,e,r,_){var n;if(t_s_is(r))n=t=>t.type===r;else if(t_a_is(r)){var s=t_o_fromKeys(r);n=t=>s[t.type]}else n=r;var i=[];return t_js_eachNode(t,e,function(t){n.apply(this,arguments)&&i.push(t)},_),i},t_js_fromASTNode=t_js_fromAST,t_js_parseDeclaration=function(t){var e,r,_,n=t,s=t_s_is(n)?t_js_parse(n).body[0]:n,i=s.type;if("VariableDeclaration"===i){e="variable";var a=s.declarations[0];r=a.id.name,_=a.init?a.init.raw??t_js_fromAST(a.init):"undefined"}else"FunctionDeclaration"===i?e="function":"ClassDeclaration"===i&&(e="class"),r=s.id.name;var o={type:e,name:r};return _&&(o.value=_),o.text=t_js_fromASTNode(s),o.node=s,o},t_js_getExports=function(t){return t_js_getNodes(t,!0,["ExportNamedDeclaration","ExportDefaultDeclaration"]).map(function(t){var e=t.declaration;if(e){var r=t_js_parseDeclaration(e);return r.node=t,r}return{node:t}})},t_titan__getAllDeps=function(t,e){e||(e={});var r=e.enableGlobals,_=t_titan_loadSourceMap(e.sourceMap),n={},s=[];return function t(e,i){var a=t_gen_filter(t_tree_iterate(e),t=>t.isLeaf);for(var o of a){var[u,l]=o.path,c=n[u];if(c||(c=n[u]={}),null==c[l]){var f=_[u];if(f){var p=t_path_fws(f)+l+".js";if(!t_fs_exists(p)){var d='Titan compiled value "t.'+u+"."+l+'" does not exist';throw i&&(d+=' (called by "'+i+'")'),t_err_create(d+=".")}var m=t_fs_load(p),h=t_js_getExports(m)[0];c[l]=h;var v="t."+u+"."+l;t(t_titan_getDeps(m,{fileType:"js",enableGlobals:r}).t,v),s.push([u,l])}else console.log('Skipping unmapped module "'+u+'"'),c[l]=!1}}}(t.t),{t:n,globals:t.globals,order:s}},t_titan_packTextToJSON=function(t,e){e||(e={});var r=e.deps??t_titan_getShallowDeps(t,e.fileType,e),{t:_,globals:n,order:s}=t_titan__getAllDeps(r,e),i={};if(i.t=r.t,n&&e.enableGlobals){i.globals=n;var a=t_titan_loadGlobalsMap(),o=Object.keys(n),u=t_a_mapToObj(o,t=>[a[t],t],!0);i.shortNamesToGlobals=u}return i.itemsInOrder=s.map(([t,e])=>{var r=_[t][e];return[t,e,"variable"===r.type?r.value:"("+r.text+")"]}),i},t_tree_join=function(t,e,r){return null==r&&(r=!0),t_f_recurse(function(t,e,_){t_o_each(t,function(t,n){if(t_o_hasKey(e,t)){var s=e[t];r?t_o_is(s)&&t_o_is(n)?_(n,s):e[t]=n:t_o_is(s)&&_(n,s)}else e[t]=n})},[t,e]),e},t_tree_merge=t_tree_join,t_o_fromArray=function(t){return Object.assign({},t)},t_a_toObj=function(t,e){if(e){var r={};return t.forEach((t,_,n)=>r[e(t,_,n)]=!0),r}return t_o_fromArray(t)},t_titan_addNewItemsToJSON=function(t,e){t_tree_merge(e.t,t.t,!1);var r=e.globals;if(r){var _=t.globals;_?t_tree_merge(r,_,!1):t.globals=r,t.shortNamesToGlobals=e.shortNamesToGlobals}var n=t_a_toObj(t.itemsInOrder,t=>t[0]+"."+t[1]);return e.itemsInOrder.forEach(e=>{n[e[0]+"."+e[1]]||t.itemsInOrder.push(e)}),t},t_bin_isNodeBuffer=function(t){return t instanceof Buffer},t_ab_isTA=function(t){return ArrayBuffer.isView(t)},t_bin_isTA=t_ab_isTA,t_bin_isByteSafe=function(t){return t_bin_isNodeBuffer(t)||t_bin_isTA(t)||t_s_is(t)},t_ab_is=function(t){return t.constructor===ArrayBuffer},t_bin_ensureByteSafe=function(t){return t_bin_isByteSafe(t)?t:t_ab_is(t)?Buffer.from(t):t_s_from(t)},t_fs_formatRaw=function(t){return t_n_is(t)?String(t):t_bin_ensureByteSafe(t)},t_fs_write=function(t,e){return t_fs_ensureParent(t),t_node_fs().writeFileSync(t,t_fs_formatRaw(e)),t},t_json_stringify=function(t,e){var r;return e||(e={}),r=e.condensed?0:null!=e.whitespace?e.whitespace:"\t",JSON.stringify(t,e.replacer,r)},t_fs_writeJSON=function(t,e,r){return t_fs_write(t,t_json_stringify(e,r))},t_titan_packTextToJSONFile=function(t,e,r){r||(r={}),r.deps||r.fileType||!e||(r.fileType=t_path_ext(e));var _=t_titan_packTextToJSON(t,r),n=r.packagePath||t_titan_getPackagePath(e,r.repl,!0,r);if(r.dynamic&&(r.packageExists??t_fs_exists(n))&&!(r.newCompile??t_titan_hasNewCompile(n))){var s=t_fs_loadJSON(n);_=t_titan_addNewItemsToJSON(s,_)}return t_fs_writeJSON(n,_),n},t_titan_autoPackAndLoadJSON=function(t,e,r,_){var n=t_titan_needsToPack(t,e,r,_);return n.needsPack&&(_.onPack&&_.onPack(n.reasonText),e=n.sourceText??t_fs_loadText(t),_.packagePath=n.packagePath,_.packageExists=n.exists,_.newCompile=n.newCompile,_.deps=n.shallowDeps,t_titan_packTextToJSONFile(e,t,_),t_titan__loadDynamicDeps(n.packagePath,r,_)),r},newItems={node:{getScriptPath:t_node_getScriptPath,positionalArgs:t_node_positionalArgs,args:t_node_args,fs:t_node_fs,_builtInModule:t_node__builtInModule,requireBuiltIn:t_node_requireBuiltIn,os:t_node_os,path:t_node_path,is:t_node_is,display:t_node_display,util:t_node_util,getScriptDir:t_node_getScriptDir,require:t_node_require,_basicRequire:t_node__basicRequire,child_process:t_node_child_process,requireLocal:t_node_requireLocal,_requireFromDir:t_node__requireFromDir,_requireDirCache:t_node__requireDirCache,_createRequire:t_node__createRequire,module:t_node_module,promptYNSync:t_node_promptYNSync,run:t_node_run,sigint:t_node_sigint,interrupt:t_node_interrupt,ensureRequireDir:t_node_ensureRequireDir,addRequireDir:t_node_addRequireDir},cli:{positionalArgs:t_cli_positionalArgs,resolveArgs:t_cli_resolveArgs,splitArgs:t_cli_splitArgs},env:{args:t_env_args,setConfig:t_env_setConfig,getConfig:t_env_getConfig,resolveConfig:t_env_resolveConfig},f:{one:t_f_one,is:t_f_is,memoize:t_f_memoize,MemoizedFunction:t_f_MemoizedFunction,createClass:t_f_createClass,ensureConstructor:t_f_ensureConstructor,createConstructor:t_f_createConstructor,isArrowFn:t_f_isArrowFn,isArrow:t_f_isArrow,wrap:t_f_wrap,retThis:t_f_retThis,setName:t_f_setName,not:t_f_not,body:t_f_body,isArrowString:t_f_isArrowString,_getArrowFnBody:t_f__getArrowFnBody,_getNormalFnBody:t_f__getNormalFnBody,cache:t_f_cache,recurse:t_f_recurse},s:{is:t_s_is,isAny:t_s_isAny,isPrimitive:t_s_isPrimitive,isObject:t_s_isObject,decapitalize:t_s_decapitalize,endsWith:t_s_endsWith,chars:t_s_chars,resolveIndex:t_s_resolveIndex,toLiteral:t_s_toLiteral,quote:t_s_quote,escape:t_s_escape,replaceAll:t_s_replaceAll,apply:t_s_apply,withIndices:t_s_withIndices,from:t_s_from,removeTrailing:t_s_removeTrailing,removeFromEnd:t_s_removeFromEnd,_removeStringFromEnd:t_s__removeStringFromEnd,_removeRegexFromEnd:t_s__removeRegexFromEnd,splitAtIndex:t_s_splitAtIndex,ensureStartsWith:t_s_ensureStartsWith,replace:t_s_replace,removeLineBreaks:t_s_removeLineBreaks,removeMulti:t_s_removeMulti,removeAll:t_s_removeAll,resolve:t_s_resolve,ensure:t_s_ensure,after:t_s_after,match:t_s_match,_matchWithIndices:t_s__matchWithIndices,remove:t_s_remove,removeLeading:t_s_removeLeading,removeFromStart:t_s_removeFromStart,_removeStringFromStart:t_s__removeStringFromStart,_removeRegexFromStart:t_s__removeRegexFromStart,removeQuotes:t_s_removeQuotes,splitLines:t_s_splitLines,lines:t_s_lines,LinesArray:t_s_LinesArray,repeat:t_s_repeat,splitFirst:t_s_splitFirst,_splitByMatch:t_s__splitByMatch,replaceParams:t_s_replaceParams,contains:t_s_contains,_createParamsObj:t_s__createParamsObj,_replaceByObj:t_s__replaceByObj,before:t_s_before,index:t_s_index,_indexWithIndices:t_s__indexWithIndices,indexOfFn:t_s_indexOfFn,isCapitalized:t_s_isCapitalized,splitLast:t_s_splitLast,matchLast:t_s_matchLast},fs:{loadText:t_fs_loadText,load:t_fs_load,getID:t_fs_getID,stat:t_fs_stat,deepStat:t_fs_deepStat,shallowStat:t_fs_shallowStat,exists:t_fs_exists,getModifiedDate:t_fs_getModifiedDate,loadJSON:t_fs_loadJSON,ensureDir:t_fs_ensureDir,mkdir:t_fs_mkdir,ensureParent:t_fs_ensureParent,loadLines:t_fs_loadLines,writeJSON:t_fs_writeJSON,write:t_fs_write,formatRaw:t_fs_formatRaw},titan:{getTempDir:t_titan_getTempDir,getPackagePath:t_titan_getPackagePath,getPackageName:t_titan_getPackageName,hasNewCompile:t_titan_hasNewCompile,getLastCompileTime:t_titan_getLastCompileTime,getCompiledDir:t_titan_getCompiledDir,locate:t_titan_locate,_loadDynamicDeps:t_titan__loadDynamicDeps,_trackGlobals:t_titan__trackGlobals,autoPackAndLoadJSON:t_titan_autoPackAndLoadJSON,needsToPack:t_titan_needsToPack,getShallowDeps:t_titan_getShallowDeps,getDepsFromJS:t_titan_getDepsFromJS,_getDepsBasic:t_titan__getDepsBasic,loadGlobalsMap:t_titan_loadGlobalsMap,_resolveSourceMapPath:t_titan__resolveSourceMapPath,locateSourceMap:t_titan_locateSourceMap,_getGlobalsRegex:t_titan__getGlobalsRegex,depsRegex:t_titan_depsRegex,getDepsFromHTML:t_titan_getDepsFromHTML,jsonHasNewDeps:t_titan_jsonHasNewDeps,packTextToJSONFile:t_titan_packTextToJSONFile,packTextToJSON:t_titan_packTextToJSON,_getAllDeps:t_titan__getAllDeps,loadSourceMap:t_titan_loadSourceMap,sourceMap:t_titan_sourceMap,getDeps:t_titan_getDeps,addNewItemsToJSON:t_titan_addNewItemsToJSON},path:{getTempDir:t_path_getTempDir,_getDefaultTempDir:t_path__getDefaultTempDir,sep:t_path_sep,baseName:t_path_baseName,_removeExtsFromFile:t_path__removeExtsFromFile,file:t_path_file,dir:t_path_dir,ensureTrailingSlash:t_path_ensureTrailingSlash,abs:t_path_abs,ensureEndsWith:t_path_ensureEndsWith,join:t_path_join,fws:t_path_fws,resolveVars:t_path_resolveVars,string:t_path_string,_defaultParams:t_path__defaultParams,windir:t_path_windir,getDesktop:t_path_getDesktop,getUserDir:t_path_getUserDir,ext:t_path_ext,splitExt:t_path_splitExt,ignoreDir:t_path_ignoreDir,isDir:t_path_isDir,dirPart:t_path_dirPart},err:{nyi:t_err_nyi,NYIError:t_err_NYIError,Error:t_err_Error,Enhanced:t_err_Enhanced,defaultFromFn:t_err_defaultFromFn,type:t_err_type,TypeError:t_err_TypeError,create:t_err_create,req:t_err_req,value:t_err_value,ValueError:t_err_ValueError,prepend:t_err_prepend},o:{safeEnsure:t_o_safeEnsure,ensure:t_o_ensure,constructorMatches:t_o_constructorMatches,is:t_o_is,isAny:t_o_isAny,setHidden:t_o_setHidden,addNonEnumerable:t_o_addNonEnumerable,defineProperty:t_o_defineProperty,weakAssign:t_o_weakAssign,merge:t_o_merge,hideKey:t_o_hideKey,makeNonEnumerable:t_o_makeNonEnumerable,ensureCustom:t_o_ensureCustom,get:t_o_get,set:t_o_set,createEmpty:t_o_createEmpty,remove:t_o_remove,display:t_o_display,toLiteral:t_o_toLiteral,isPure:t_o_isPure,reduce:t_o_reduce,each:t_o_each,keys:t_o_keys,allKeys:t_o_allKeys,setLazy:t_o_setLazy,setGetterAndSetter:t_o_setGetterAndSetter,addGetterAndSetter:t_o_addGetterAndSetter,replaceGetterAndSetter:t_o_replaceGetterAndSetter,Cache:t_o_Cache,setDefaults:t_o_setDefaults,ensureMulti:t_o_ensureMulti,resolveKeys:t_o_resolveKeys,diveGet:t_o_diveGet,deepCopy:t_o_deepCopy,fromLines:t_o_fromLines,safeDefault:t_o_safeDefault,hasKey:t_o_hasKey,has:t_o_has,fromKeys:t_o_fromKeys,fromArray:t_o_fromArray},re:{is:t_re_is,matchEnd:t_re_matchEnd,matchLast:t_re_matchLast,matchAll:t_re_matchAll,setStartIndex:t_re_setStartIndex,copy:t_re_copy,updateFlagString:t_re_updateFlagString,parseFlagString:t_re_parseFlagString,createFlagString:t_re_createFlagString,ensureGlobal:t_re_ensureGlobal,global:t_re_global,addFlag:t_re_addFlag,createEscaped:t_re_createEscaped,create:t_re_create,resolveFlags:t_re_resolveFlags,escape:t_re_escape,safeCreateResult:t_re_safeCreateResult,createResult:t_re_createResult,RegexResult:t_re_RegexResult,match:t_re_match,ensureLocal:t_re_ensureLocal,local:t_re_local,removeFlag:t_re_removeFlag,resultEndIndex:t_re_resultEndIndex,matchStart:t_re_matchStart,quotes:t_re_quotes,quote:t_re_quote,newline:t_re_newline,text:t_re_text,test:t_re_test},v:{constructorMatches:t_v_constructorMatches,isPrimitive:t_v_isPrimitive,resolve:t_v_resolve,type:t_v_type,display:t_v_display,toLiteral:t_v_toLiteral,nullIfNaN:t_v_nullIfNaN,req:t_v_req,isEmpty:t_v_isEmpty},a:{last:t_a_last,resolveIndex:t_a_resolveIndex,is:t_a_is,ensure:t_a_ensure,pick:t_a_pick,create:t_a_create,fill:t_a_fill,resolveIndices:t_a_resolveIndices,push:t_a_push,add:t_a_add,splitLast:t_a_splitLast,splitTail:t_a_splitTail,wrapIndices:t_a_wrapIndices,wrapIndex:t_a_wrapIndex,toLiteral:t_a_toLiteral,display:t_a_display,removeNullish:t_a_removeNullish,removeByFilter:t_a_removeByFilter,replaceContents:t_a_replaceContents,pushMulti:t_a_pushMulti,addMulti:t_a_addMulti,pushThroughMulti:t_a_pushThroughMulti,removeEmpty:t_a_removeEmpty,removeIndex:t_a_removeIndex,apply:t_a_apply,mapToObj:t_a_mapToObj,slice:t_a_slice,filterSplit:t_a_filterSplit,copy:t_a_copy,toObj:t_a_toObj},class:{create:t_class_create,setName:t_class_setName,addStatics:t_class_addStatics,setDisplay:t_class_setDisplay},p:{asyncJoint:t_p_asyncJoint,is:t_p_is},sym:{display:t_sym_display,value:t_sym_value},macro:{config:t_macro_config},map:{Cache:t_map_Cache,ensure:t_map_ensure,get:t_map_get,set:t_map_set,MultiCache:t_map_MultiCache,diveEnsure:t_map_diveEnsure,createEmpty:t_map_createEmpty,diveDelete:t_map_diveDelete,remove:t_map_remove},args:{ensureArray:t_args_ensureArray,push:t_args_push,append:t_args_append,insert:t_args_insert},tree:{ensure:t_tree_ensure,dive:t_tree_dive,remove:t_tree_remove,setCustom:t_tree_setCustom,copy:t_tree_copy,isSubsetOf:t_tree_isSubsetOf,iterate:t_tree_iterate,iterator:t_tree_iterator,merge:t_tree_merge,join:t_tree_join},d:{from:t_d_from,create:t_d_create,resolve:t_d_resolve,now:t_d_now,ensure:t_d_ensure,copy:t_d_copy,fromYear:t_d_fromYear,_resolveNative:t_d__resolveNative,isBefore:t_d_isBefore},n:{fromString:t_n_fromString,ensure:t_n_ensure,is:t_n_is,tryCoerce:t_n_tryCoerce,tryParse:t_n_tryParse},js:{removeComments:t_js_removeComments,fromAST:t_js_fromAST,enhance:t_js_enhance,ensureReturn:t_js_ensureReturn,splitLastExpression:t_js_splitLastExpression,enableAwait:t_js_enableAwait,_nodeEnableAwait:t_js__nodeEnableAwait,useTitan:t_js_useTitan,inline:t_js_inline,parse:t_js_parse,removeQuotes:t_js_removeQuotes,getExports:t_js_getExports,getNodes:t_js_getNodes,eachNode:t_js_eachNode,parseDeclaration:t_js_parseDeclaration,fromASTNode:t_js_fromASTNode},npm:{isBuiltIn:t_npm_isBuiltIn,isFile:t_npm_isFile,install:t_npm_install,_runCommand:t_npm__runCommand},os:{run:t_os_run,_resolveStdio:t_os__resolveStdio},win:{is:t_win_is},shell:{_handleError:t_shell__handleError},proc:{interrupt:t_proc_interrupt,signal:t_proc_signal},bool:{fromYN:t_bool_fromYN},gen:{filter:t_gen_filter},bin:{ensureByteSafe:t_bin_ensureByteSafe,isByteSafe:t_bin_isByteSafe,isNodeBuffer:t_bin_isNodeBuffer,isTA:t_bin_isTA},ab:{isTA:t_ab_isTA,is:t_ab_is},json:{stringify:t_json_stringify}};globalThis.t?Object.keys(newItems).forEach(function(e){if(t[e]){var r=newItems[e];Object.keys(r).forEach(function(_){t[e][_]=r[_]})}else t[e]=newItems[e]}):globalThis.t=Object.assign({},newItems),globalThis.exports&&(exports.default=globalThis.t);
|
package/harness.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require("./harness.pkg.js"),module.exports=t.titan.harness;
|
package/harness.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 e instanceof String},i=function(e){return n(e)||r(e)},u=i,o=function(e){return Array.isArray(e)},a=function(e){return o(e)?e:[e]},l=function(e){return e instanceof Promise},s=function(e,n){var r=e;return l(r)?r.then(n):n(r)},c=function(e){return"function"==typeof e},f=function(e){return c(e)&&null==e.prototype},p=f,v=function(e){return function(){return e.apply(this,arguments)}},h=function(e,n){var r;return r=n?function(){this.super=n;var r=e.apply(this,arguments);return s(r,()=>(delete this.super,r))}:p(e)?v(e):e,r._isConstructor=!0,r},d=function(e,n){return e._isConstructor?e:h(e,n)},m=function(){return this},g=function(e){var n=typeof e;return"object"!==n&&"function"!==n||null===e},y=function(e){return!g(e)},b=function(e,n,r){return!1===r?Object.keys(n).forEach(r=>{void 0===e[r]&&(e[r]=n[r])}):Object.assign(e,n),e},w=function(e,n){return b(e,n,!1)},E=function(e,n,r,i){return r||(r={}),i&&w(r,i),null==r.enumerable&&(r.enumerable=!0),null==r.configurable&&(r.configurable=!0),Object.defineProperty(e,n,r)},x=function(e,n,r,i){return E(e,n,{value:r,writable:!0,enumerable:!1},i),r},T=x,O=function(e){return class extends e{constructor(e,n){super(e,n);var r=this.constructor.name;r&&(this.name=r)}}},S=O(globalThis.Error),_=class extends S{constructor(e,n){super(e??"Not yet implemented",n)}},A=function(e,n,r,i){var u=e[n];if(void 0===u){var o=r;!1!==i&&c(o)&&(o=o(e,n)),e[n]=u=o}return u},N=function(e,n,r,i){return e||(e={}),A(e,n,r,i),e},j=function(e,n){return N(e,"fromFn",n,!1)},I=function(e,n){return new _(e,j(n,I))},F=function(e,n){Object.defineProperty(e,"name",{value:n,configurable:!0}),T(e,"displayName",n)},k=F,C=function(e,n){return Object.assign(e,n)},L=function(e){var n,r=!1;return function(){return r||(r=!0,n=e.apply(this,arguments)),n}},D=L(function(){return"undefined"==typeof window}),M=D()?require("util").inspect.custom:Symbol("Display"),P=function(e,n){e.prototype[M]=n},R=function(e,n,r,i,l,c){c||(c={}),u(n)&&(n=null);var f,p,v,h=r;h&&(o(h)?([p,v]=h,p&&(p=d(p))):f=d(h,n));var g=c.bareFn;c.singleton&&(g=function(){return null==E.default&&(E.default=new E(...arguments)),E.default});var b,w=p||f||n||m;function E(){if(!new.target&&g&&!(this instanceof E))return g.apply(this,arguments);var e=this;return s(w.apply(e,arguments),r=>{if(r&&y(r)&&(e=r,p)){if(!new.target)throw I('Prototype repair is NYI for class instantiation without "new".');if(!n)throw I("instanceFn is not yet supported when extendsClass is null.");var i=Object.getPrototypeOf(this);Object.getPrototypeOf(e)!==i&&Object.setPrototypeOf(e,i)}return v?s(v.apply(e,arguments),()=>e):e})}return e&&k(E,e),i?(b=i,n&&Object.setPrototypeOf(i,n.prototype)):b=n?Object.create(n.prototype):{},T(b,"constructor",E),E.prototype=b,l&&C(E,l),c.display&&P(E,c.display),c.implements&&a(c.implements).forEach(e=>e(E)),E},q=function(e,n){Object.defineProperty(e,n,{enumerable:!1})},B=q,G=function(e,n,r,i,u){var o=Symbol();return R(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,B(this,o)}],r,i,u)},K=function(e){return n=>n===e},W=function(e){return Reflect.ownKeys(e)},H=function(e,n){return(n?W:Object.keys)(e)},z=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},Y=function(e){return e instanceof Set},U=function(e){return Y(e)?e:o(e)?new Set(e):new Set([e])},V=U,Q=function(e,n){var r=[],i=[];return e.forEach((u,o)=>(n(u,o,e)?r:i).push(u)),[r,i]},$=function(e,n,r,i){var u=n;if(c(u))throw I();var o=H(e,i),a=V(u),[l,s]=Q(o,e=>a.has(e));return[z(e,l,r),!0===r?e:z(e,s,!1)]},J=function(e,n,r){var i=H(e,r).filter(r=>n(e[r],r,e));return $(e,i,!1,r)},X=function(e,n){return n<e?n:e},Z=function(e,n){return X(e,n)},ee=function*(e,n){null==e&&(e=0),n=null==n?this.length:Z(n,this.length);for(var r=e;r<n;r++)yield this[r]},ne=function(e,n,r){return null==n&&null==r?e[Symbol.iterator].call(e):ee.call(e,n,r)},te=function(e,n){return n<0?e.length+n:n},re=function(e,n,r,i){return n=null==n?0:te(e,n),r=null==r?e.length:te(e,r),i&&(0==i.inclusiveStart&&n++,i.inclusiveEnd&&r++),[n,r]},ie=function(e,n,r,i){[r,i]=re(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},ue=function(e,n){return n?ie(H(e,n),n=>[n,e[n]]):Object.entries(e)},oe=function(e){return ne(ue(this,e))},ae=function(e,n){var r=e[Symbol.iterator];return r?r.call(e):oe.call(e,n)},le=function(e){return ae(e,!0)},se=function(e,n){return null!=e&&e.constructor===n},ce=function(e){return se(e,Object)},fe=ce,pe=function(e,n,r,i){return E(e,n,{get:r},i)},ve=function(e,n,r,i){return E(e,n,{value:r,writable:!0},i),r},he=function(e,n,r){pe(e,n,function(){if(this===e)return null;var i=r.call(this);return ve(this,n,i),i})},de=class extends S{constructor(e,n){super(e??"Unexpected value",n)}},me=function(e){return require("node:"+e)},ge=function(e){return L(()=>me(e))},ye=ge("util"),be=function(e,n){return n||(n={}),null==n.colors&&(n.colors=!0),ye().inspect(e,n)},we=te,Ee=function(e,n,r,i){return void 0!==n&&(null===n||0===n?n=void 0:(n=we(e,n),i&&0==i.inclusiveStart&&n++)),void 0!==r&&(null===r||r===e.length?r=void 0:(r=we(e,r),i&&i.inclusiveEnd&&r++)),[n,r]},xe=function(e,n,r,i,u,o){if(r||null!=i){[r,i]=Ee(e,r,i,o);var a=e.slice(r,i),l=n(a);return u?u(l,r,i,a,e):l}return n(e)},Te=function(e,n,r,i,u){return xe(e,n,r,i,(n,r,i)=>(void 0!==r?e.slice(0,r):"")+(n||"")+(void 0!==i?e.slice(i):""),u)},Oe=se,Se=function(e){return Oe(e,RegExp)},_e=function(e,n,r,i){var u=n;if([r,i]=re(e,r,i),c(u))for(var o=r;o<i;o++)e[o]=u(o,e);else e.fill(u,r,i);return e},Ae=function(e,n){var r=new Array(e||0);return arguments.length>1&&_e(r,n),r},Ne=function(e,n){return Ae(n.length,r=>e[n[r]])},je=function(e,n){return e[n]},Ie=function(e,n,r){return e[n]=r},Fe=function(e,n,r){var i=e;return c(i)?i.apply(r,n):i},ke=function(e,n,r,i,u){i||(i=je);var o=i(e,n);return void 0===o&&(o=Fe(r,[e,n]),u||(u=Ie),u(e,n,o)),o},Ce=function(e,n){return e.get(n)},Le=function(e,n,r){return e.set(n,r)},De=function(e,n,r){return ke(e,n,r,Ce,Le)},Me=class{constructor(){this.store=new Map}get(e,n){return De(this.store,e,n)}remove(e){return this.store.delete(e)}delete(e){return this.remove(e)}},Pe=function(e,n){return e.push(n),e},Re=Pe,qe=function(e){var n=e;return Array.isArray(n)?n:Array.from(n)},Be=Symbol("Value"),Ge=function(){return{}},Ke=function(e){return[e.slice(0,-1),e[e.length-1]]},We=Ke,He=function(e,n,r,i,u,o){r||(r=je),null==i&&(i=Ge),null==u&&(u=Ie),null==o&&(o=r);for(var[a,l]=We(n),s=e,c=a.length,f=0;f<c;f++){var p=a[f],v=r(s,p);if(void 0===v){if(!i)return;v=ke(s,p,i,r,u)}s=v}if(o)return o(s,l,u)},ze=function(e,n,r,i,u,o){return He(e,n,i,u,o,(e,n)=>ke(e,n,r,i,o))},Ye=function(){return new Map},Ue=function(e,n,r){return ze(e,n,r,Ce,Ye,Le)},Ve=function(e,n){return delete e[n],e},Qe=function(e,n,r,i){return He(e,n,r,!1,!1,i||Ve)},$e=function(e,n){return e.delete(n)},Je=function(e,n){return Qe(e,n,Ce,$e)},Xe=class{constructor(){this.store=new Map}get(e,n){return e=Re(qe(e),Be),Ue(this.store,e,n)}remove(e){return e=Re(qe(e),Be),Je(this.store,e)}delete(e){return this.remove(e)}},Ze=G("MemoizedFunction",function(e,n){if(this.base=e,null!=n)if(1===(n=a(n)).length){this.cache=new Me;var r=n[0];this._cacheKeyFormatter=e=>e[r]}else this.cache=new Xe,this._cacheKeyFormatter=e=>Ne(e,n);else this.cache=new Xe,this._cacheKeyFormatter=e=>e;var i=this;return function(){var n=i._cacheKeyFormatter(arguments);return i.cache.get(n,()=>e.apply(this,arguments))}},{remove(e){return this.cache.remove(this._cacheKeyFormatter(e))}}),en=function(e,n){return new Ze(e,n)},nn=function(e){return new Set(e)},tn=function(e){var n={};if(e){var r=nn(e);r.has("g")&&(n.global=!0),r.has("i")&&(n.caseInsensitive=!0),r.has("y")&&(n.sticky=!0)}return n},rn=function(e){var n="";return e.global&&(n+="g"),(e.caseInsensitive||0==e.caseSensitive)&&(n+="i"),e.sticky&&(n+="y"),n},un=function(e,n){var r=tn(e);return rn(Object.assign(r,n))},on=function(e,n){var r=n,i=void 0;return u(r)?i=r:ce(r)&&(i=un(e.flags,r)),new RegExp(e,i)},an=function(e,n){return on(e,e.flags+n)},ln=function(e){return an(e,"g")},sn=en(function(e){return e.global?e:ln(e)},0),cn=function(e){var n=e;return null==n?void 0:u(n)?n:rn(n)},fn=function(e,n){return new RegExp(e,cn(n))},pn=function(e){return e.replace(/[-[\]{}()*+!<=:?.\/\\^$|#\s,]/g,"\\$&")},vn=function(e,n){return fn(pn(e),n)},hn=function(e,n,r,i,o,a){return Te(e,function(e){return e.replaceAll?(Se(n)&&(n=sn(n)),e.replaceAll(n,r)):(n=u(n)?vn(n,"g"):sn(n),this.replace(n,r))},i,o,a)},dn=function(e,n,r){return hn(e,n,(r??"\\")+n)},mn=function(e,n,r){return null==n&&(n='"'),!1!==r&&(e=dn(e,n,r)),n+e+n},gn=function(e){return mn(e,'"')},yn=function(e){return fe(e)?Tn(e):String(e)},bn=function(e,n){return n||(n=wn),"["+e.reduce(function(e,r){return e+n(r)+", "},"").slice(0,-2)+"]"},wn=function(e){return u(e)?gn(e):o(e)?bn(e):yn(e)},En=function(e,n,r){H(e,r).forEach((r,i,u)=>n(r,e[r],i,u))},xn=function(e,n,r,i){var u=null!=r?r:"";return En(e,function(){u=n.call(this,u,...arguments)},i),u},Tn=function(e,n){return n||(n=wn),"{"+xn(e,function(e,r,i){return e+r+":"+n(i)+", "},"",!0).slice(0,-2)+"}"},On=function(e,n){return null==n&&(n=1),n<=0?"[object Object]":Tn(e,e=>_n(e,n-1))},Sn=function(e,n){return null==n&&(n=1),n<=0?"[object Array]":bn(e,e=>_n(e,n-1))},_n=function(e,n){return void 0===e?"undefined":null===e?"null":D()?be(e,n):ce(e)?On(e,maxNumLevels):o(e)?Sn(e,maxNumLevels):yn(e)},An=function(e,n,r,i){if(0===arguments.length)return new de("Unexpected value received");i||(i={});var u,{expected:o}=i;return u=o?"Received "+_n(e)+", expected one of "+_n(o):"Unexpected value received: "+_n(e),r&&(u+=' for "'+r+'"'),null!=n&&(u+=" (index "+n+")"),i.fromFn||(i.fromFn=An),new de(u,i)},Nn=function(e,n,r){var i=new S(e,r);return n&&Object.assign(i,n),i},jn=function*(e,n){yield*e,yield*n},In=function(e){return e?" "+e:""},Fn=function(e){return u(e)?e:e.toString()},kn=G("Interface",function(e,n,r){r||(r={}),F(this,e),n?[this.stubs,this.defaults]=J(n,K(!0),!0):(this.stubs={},this.defaults={});var i=r.implements?a(r.implements):null,u=this;return function(e){var n=e;return i&&i.forEach(e=>e(n)),u.decorate(n),u.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),le(this.defaults)))if(void 0===n[u])if(fe(o))if(o.value)n[u]=o.value;else{if(!o.setup)throw An(o,null,"defaultVal");if(!r)throw o.setup(),I("setupFn is NYI for instances");he(n,u,o.setup)}else n[u]=o;return i},assert(e){var n=e,r=null!=n.prototype,i=n.prototype||n,u=jn(le(this.stubs),le(this.defaults));for(var[o]of u){var a;if(void 0===i[o])throw a=r?"Class"+In(n.name):"Object "+_n(n),a+=" does not satisfy interface "+this.name+' (missing key "'+Fn(o)+'")',Nn(a)}return n},validate(e){try{return this.assert(e),!0}catch(e){return!1}}},{is(e){return e instanceof this}}),Cn=function(e,n,r){return new kn(e,n,r)},Ln=Symbol("Cleanup"),Dn=Cn("Handle",{remove:!0,[Ln](){this.remove()}}),Mn=e(class{constructor(e){this.handles=e}remove(){this.handles.forEach(e=>e.remove())}add(e){return this.handles.push(e),this}},Dn),Pn=function(e){return 1===e.length&&o(e[0])?e[0]:array},Rn=function(...e){return new Mn(Pn(e))},qn=Rn,Bn=qn,Gn=function(e){var n,r,i=e;return null!=i&&(n=i.detail??i.data??i,y(i)&&(r=i)),[n,r,i]},Kn=function(e){return kn.is(e)},Wn=Kn,Hn=O(globalThis.TypeError),zn=function(e){return null==e?e:e.constructor},Yn=function(e,n,r,i){if(0===arguments.length)return new Hn("Unexpected type received");i||(i={});var u,{type:o,expected:a}=i;return null==o&&(o=zn(e)),o&&o.name&&(o=o.name),a?(a.name&&(a=a.name),u="Expected "+a+", received "):u="Unexpected type received (",u+=o,null!=e&&(u+=" ("+_n(e)+")"),a||(u+=")"),r&&(u+=' for "'+r+'"'),null!=n&&(u+=" (index "+n+")"),i.fromFn||(i.fromFn=Yn),new Hn(u,i)},Un=function(e,n,r){if(!Wn(n))throw Yn(n,1);return n.decorate(e),r&&r.call(e,e,n),n.assert(e),e},Vn=Cn,Qn=Symbol("EventTarget"),$n=function(e){return require(e)},Jn=function(e){return!!e.startsWith("node:")||$n("node:module").isBuiltin(e)},Xn=function(e){return e.startsWith(".")},Zn=function(e){var n=e.stdio;if(n){if(!o(n)){if(!u(n))throw Yn(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 An(n,"stdio");n=["overlapped","overlapped","overlapped"]}e.stdio=n}}else n=e.stdio=[null,null,null];return n},et=function(e,n){var r=n.length;e.length=r;for(var i=0;i<r;i++)e[i]=n[i];return e},nt=function(e){return function(){return!e.apply(this,arguments)}},tt=function(e,n){return et(e,e.filter(nt(n)))},rt=function(e){return tt(e,e=>null==e)},it=ge("child_process"),ut=L(function(){return"win32"===process.platform}),ot=function(e,n,r){if(r||(r={}),n(e))throw e;if(r.nullOnErr)return null;var i=r.onErr;if(void 0!==i)return Fe(i);throw e},at=function(e,n,r){r||(r={}),r.dir&&(r.cwd=r.dir);var i=Zn(r);if(null==i[0]){var u=r.allowInput,o=r.input;if(u&&o)throw Nn("allowInput (user) and input (programmatic) cannot be used simultaneously for synchronous child processes.");u&&(i[0]="inherit")}if(null==i[1]){var a=r.captureOutput??!1,l=r.showOutput;if(a&&l)throw Nn("captureOutput and showOutput cannot be used simultaneously for synchronous child processes.");a?i[1]="pipe":(null==l&&(l=!0),i[1]=l?"inherit":"ignore")}if(null==i[2]){var s=r.captureErr??!1,c=r.showErr;if(s&&c)throw Nn("captureErr and showErr cannot be used simultaneously for synchronous child processes.");s?i[2]="pipe":(null==c&&(c=!0),i[2]=c?"inherit":"ignore")}r.encoding||(r.encoding="utf8"),n&&rt(n);try{var f=it().execFileSync(e,n,r);null!=f&&!1!==r.trim&&(f=f.trim());var p=r.map??r.mapFn;return p&&(f=p(f)),f}catch(e){if(ut())return ot(e,e=>"ENOENT"===e.code,r);throw e}},lt=function(e,n){return n||(n={}),null==n.captureOutput&&(n.captureOutput=!1),n.shell=!0,n.filterExtensions=!1,at("npm",e,n)},st=function(e,n,r){return lt(["install",e,n?"-g":null],r)},ct=ge("path"),ft=ct().sep,pt=function(e,n,r){var i=ct().resolve,u=n?i(n,e):i(e);return r?u+ft:u},vt=function(e){return require(pt(e))},ht=class{constructor(){this.store={}}get(e,n){return A(this.store,e,n)}remove(e){return delete this.store[e]}delete(e){return this.remove(e)}},dt=new ht,mt=function(e){return e[e.length-1]},gt=te,yt=function(e,n,r){return e=on(e,{global:!0}),null!=r&&(n=gt(r,n)),e.lastIndex=n,e},bt=function(e,n,r){return e=null!=r?yt(e,r,n):sn(e),Array.from(n.matchAll(e))},wt=function(e,n,r){return null!=r&&(n=n.slice(0,r)),mt(bt(e,n))||null},Et=function(e,n){var r=wt(e,n);return r&&n.length===r.index+r[0].length?r:null},xt=function(e,n){if(u(n))return e.endsWith(n);if(Se(n))return!!Et(n,e);throw Yn(n,1,"matchThis")},Tt=function(e){return xt(e,ft)?e:e+ft},Ot=function(e,n,r){if(D()){var i=ct().join(e,n);return r?Tt(i):i}throw I()},St=function(e,n){return e.endsWith(n)?e:Ot(e,n)},At=ge("module"),Nt=function(e){return e=St(e,"node_modules"),At().createRequire(e)},jt=function(e,n){return dt.get(e,()=>Nt(e))(n)},It=function(e,n,r){return Object.keys(n).forEach(i=>A(e,i,n[i],r)),e},Ft=function(e,n,r){return n?It(e,n,r):e},kt=function(e,n){return e.endsWith(n)?e.substring(0,e.length-n.length):e},Ct=function(e,n){var r=Et(n,e);return r?e.slice(0,r.index):e},Lt=function(e,n){if(u(n))return kt(e,n);if(Se(n))return Ct(e,n);throw Yn(n,1)},Dt=Lt,Mt=function(e,n){return[e.slice(0,n),e.slice(n)]},Pt=function(e){e=Dt(e.trim(),";");var n=Math.max(e.lastIndexOf(";"),e.lastIndexOf("\n"));return Mt(e,n+1)},Rt=function(e,n){return e.startsWith(n)?e:n+e},qt=function(e){var[n,r]=Pt(e);return n+Rt(r.trim(),"return ")},Bt=function(e){return li("node-repl-await").processTopLevelAwait(e)},Gt=function(e){return Bt(e)??e},Kt=hn,Wt=function(e,n){return""===e?e:(!1!==n&&(e=Tt(e)),Kt(e,"\\","/"))},Ht=L(function(){return process.argv.slice(2)}),zt=Ht,Yt=function(e,n){const r=[];let i="",u="outside",o=!1;for(let a=0;a<e.length;a++){const l=e[a];switch(u){case"outside":'"'===l?o?(i+=l,o=!1):(n&&(i+=l),u="insideQuote"):"\\"===l?o=!0:" "===l?(i.length>0&&(r.push(i),i=""),o=!1):(i+=l,o=!1);break;case"insideQuote":'"'!==l||o?"\\"!==l||o?(i+=l,o=!1):o=!0:(n&&(i+=l),u="outside")}}return i.length>0&&r.push(i),r},Ut=function(e,n){var r=e;return null==r?zt():u(r)?Yt(r,n):r},Vt=function(e,n){return Ut(e,n).slice()},Qt=Vt,$t=function(){var e=require.main?.filename;return e||(null!=process._eval?null:Qt(process.argv)[1])},Jt=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},Xt=function(e){return e.split(".")[0]},Zt=function(e){return ct().win32.basename(e)},er=function(e){return Xt(Zt(e))},nr=function(e,n,r,i){e||(e=$t()??"_console.js");var u=Jt(er(e));return n&&(u+="_repl"),u+(r&&i?.dynamic?".dypkg.json":".pkg.js")},tr=function(e,n){return e=ct().dirname(e),!1===n?e:Tt(e)},rr=function(e,n,r,i){var u,o=nr(e,n,r,i);return u=e?tr(e):"./",pt(u+o)},ir=function(e){return'require("'+Wt(rr(),!1)+'");\n'+e},ur=function(e,n){return hn(e,n,"")},or=function(e,n){return n.forEach(n=>e=ur(e,n)),e},ar=function(e){return or(e,["\r","\n"])},lr=function(e,n){return li("astring").generate(e,n)},sr=function(e,n){return e.stack=n+"\n"+e.stack,e},cr=function(e,n,r){r||(r={}),r.ecmaVersion||(r.ecmaVersion=2024),!1!==n&&(r.sourceType="module"),null==r.allowAwaitOutsideFunction&&(r.allowAwaitOutsideFunction=!0),null==r.allowReturnOutsideFunction&&(r.allowReturnOutsideFunction=!0);var i=li("acorn");try{return i.parse(e,r)}catch(n){throw sr(n,"Acorn parsing error: "+e)}},fr=function(e,n,r){return lr(cr(e,n,r))},pr=function(e){return ar(fr(e))},vr=function(e,n,r){return(n||r)&&(n||(n={}),r&&Ft(n,r),n.ensureReturn&&(e=qt(e)),n.topLevelAwait&&(e=Gt(e)),n.useTitan&&(e=ir(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=pr(e))),e},hr=function(e){return u(e)?e:yn(e)},dr=function(e){var n=e.indexOf("{");return-1===n||e.slice(0,n).includes("=>")},mr=function(e,n,r,i,u){return xe(e,n,r,i,(n,r)=>null===n?null:(n.input=e,void 0!==r&&(n.index+=r),n),u)},gr=function(e,n){return e.splice(e.length,0,...n),n},yr=function(e,n){return gr(e,n),e},br=yr,wr=class extends Array{constructor(e,n,r,i,u){if(-1===n)throw Nn("RegexResult index cannot be -1. For empty result, use bare null.");if(null==e)throw Nn("RegexResult matchString cannot be null. For empty result, use bare null.");super(),this[0]=e,i&&br(this,i),this.index=n,this.input=r,u&&(this.groups=u)}fromParts(e){var n=e;return new wr(n.match,n.index,n.input,n.captures,n.groups)}},Er=function(e,n,r,i,u){return new wr(e,n,r,i,u)},xr=function(e,n,r,i,u){return-1===n||null==e?null:Er(e,n,r,i,u)},Tr=ur,Or=function(e,n){return on(e,Tr(e.flags,n))},Sr=function(e){return Or(e,"g")},_r=en(function(e){return e.global?Sr(e):e},0),Ar=function(e,n,r){return(e=null!=r?yt(e,r,n):_r(e)).exec(n)},Nr=function(e,n,r,i,o){return mr(e,e=>{if(u(n)){var r=e.indexOf(n);return xr(n,r,e)}return Ar(n,e)},r,i,o)},jr=function(e){return e.index+e[0].length},Ir=function(e,n){var r=Nr(e,n);return null===r[0]?null:e.slice(jr(r))},Fr=function(e,n){return e.startsWith(n)?e.substring(n.length):e},kr=function(e,n){var r=Ar(e,n);return r&&0===r.index?r:null},Cr=function(e,n){var r=kr(n,e);return r?e.slice(r[0].length):e},Lr=function(e,n){if(u(n))return Fr(e,n);if(Se(n))return Cr(e,n);throw Yn(n,1)},Dr=Lr,Mr=function(e){var n=Ir(e,"=>").trim();return Dr(Dt(n,"}"),"{")},Pr=function(e){return Ir(e,"{").slice(0,-1)},Rr=function(e){var n=hr(e);return dr(n)?Mr(n):Pr(n)},qr=function(e){return null==e?"":u(e)?e:c(e)?Rr(e):String(e)},Br=function(e,n){var r=n?.basic?null:{topLevelAwait:!0,useTitan:!0},i=vr(qr(e),n,r);return at("node",[n?.mode??"-p",i],n)},Gr=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 "+_n(e)+")"),Nn(u,null,j(i,Gr))},Kr=function(e,n,r){if(null==e)throw Gr(e,n,r,{fromFn:Kr});return e},Wr=function(e,n){return process.kill(e,Kr(n,0,"signalName"))},Hr=function(e){return Wr(e,"SIGINT")},zr=function(){return Hr(process.pid)},Yr=zr,Ur=function(e){if("Y"===(e=e.toUpperCase()))return!0;if("N"===e)return!1;throw An(e,0,"char")},Vr=function(e){null==e&&(e="Are you sure? [y/n]: "),process.stdout.write(e);var n=Br(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))})},{mode:"-e",basic:!0,stdio:["inherit","pipe"]});if("^C"===n)throw process.stdout.write(n),Yr(),Nn("Prompt was cancelled via interrupt.");return console.log(n),Ur(n)},Qr=function(e){return o(e)?e:u(e)?e.split("."):[e]},$r=function(e,n,r,i,u,o){var a=r;return He(e,n,i,u,o,(e,n,r)=>r(e,n,Fe(a)))},Jr=function(e,n){var r=n,i=globalThis.config;i||(i=globalThis.config={});var u,o=Qr(e);return o.length>1?u=$r(i,o,r):(u=Fe(r),i[o[0]]=u),u},Xr=function(e,n){return Jr("node.require.customDirs",r=>(r||(r=[]),!1!==n&&(e=St(e,"node_modules")),r.includes(e)||r.push(e),r)),e},Zr=Xr,ei=He,ni=function(e){var n=globalThis.config;if(n){var r=Qr(e);return r.length>1?ei(n,r):n[r[0]]}},ti=function(e,n,r){if(null!=e)return e;var i=ni(n);return null!=i?i:r},ri=ge("fs"),ii=function(e){return!!ri().lstatSync(e,{throwIfNoEntry:!1})},ui=function(e){var n=tr(e,!1);return ii(n)||(n!==e&&ui(n),ri().mkdirSync(n)),e},oi=function(e){return ui(e),ri().mkdirSync(e),e},ai=function(e){return ii(e)?e:oi(e)},li=function(e,n){if(Jn(e))return require(e);if(Xn(e))return vt(e);try{return require(e)}catch(e){}var r=__dirname,i=process.mainModule?.path;if(i!==r)try{return jt(i,e)}catch(e){}var u=process.cwd();if(u!==i&&u!==r)try{return jt(u,e)}catch(e){}var o=ni("node.require.customDirs");if(o)for(var a of o)try{return jt(a,e)}catch(e){}var l=ti(n?.autoInstall,"node.require.autoInstall"),s=ti(n?.promptInstall,"node.require.promptInstall",!0);if(l||s){var c=l||s;!0===c&&(c="./node_modules"),c=pt(c);var f=!1;if(l?(f=!0,console.log('Auto-installing "'+e+'" from npm to "'+c+'"...')):(f=Vr('Npm package "'+e+'" is required. Install now? (Y/N) '))&&console.log('Installing "'+e+'" from npm to "'+c+'"...'),f){c=ai(c),st(e,!1,{cwd:c});try{return Zr(c),jt(c,e)}catch(e){console.error("Failed to load from auto-install dir: ",c)}}}throw Nn('Module not found: "'+e+'"',{checked:{moduleDir:r,scriptDir:i,cwd:u}})},si=L(function(){if(!globalThis.CustomEvent||!globalThis.EventTarget||!globalThis.Event){var e=li("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}}),ci=si().EventTarget,fi=function(e){var n=Qn,r=e[n];return void 0===r&&(r=new ci,T(e,n,r)),r},pi=Vn("EventInterface",{addEventListener(e,n,r){fi(this).addEventListener(e,n,r)},on(e,n){this.addEventListener(e,n)},removeEventListener(e,n){fi(this).removeEventListener(e,n)},off(e,n){this.removeEventListener(e,n)},dispatchEvent(e){return fi(this).dispatchEvent(e)}}),vi=pi,hi=function(e){return Un(e,vi)},di=function(e){return!(!e.addEventListener&&!e.on)},mi=function(e){return di(e)||hi(e),e},gi=function(e,n,r){return e[n]=r,e},yi=function(e,n,r){return gi(e||{},n,r)},bi=function(e,n,r,i){return Ii(e,n,r,yi(i,"once",!0))},wi=function(e,n){return function(){var r=n.apply(this,arguments);return e.apply(this,arguments),r}},Ei=wi,xi=function(e,n,r){return e[n]=Ei(e[n],r)},Ti=e(class{constructor(e){this._remover=e}remove(){this._remover()}removeOn(e,n,r){r&&mi(e);var i=bi(target,n,()=>this.remove());return xi(this,"remove",()=>i.remove()),this}},Dn),Oi=class extends Ti{constructor(e,n){super(e),this.handleEvent=n}},Si=function(e,n){return new Oi(e,n)},_i=function(e,n,r){(e.removeEventListener||e.off).call(e,n,r)},Ai=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},Ni=function(e,n){return Ai(e,0,n)},ji=Ni,Ii=function(e,n,r,i){if(i?.valueFirst){var u=r;r=function(e){var[n,r]=Gn(e);return ji(arguments,n),arguments[1]=r,u.apply(this,arguments)}}var o=e.addEventListener;return o||(e.on?o=i?.once?e.once:e.on:(hi(e),o=e.addEventListener)),o.call(e,n,r,i),Si(()=>_i(e,n,r),r)},Fi=class extends Ti{constructor(e){super(()=>clearInterval(e))}stop(){this.remove()}},ki=function(e,n){return new Fi(setInterval(n,e))},Ci=function(){},Li=function(){return ki(1e9,Ci)},Di=function(){return Bn([Li(),Ii(process,"uncaughtException",console.error),Ii(process,"unhandledRejection",console.error)])},Mi=function(e){var n=pt(e);return delete require.cache[n],vt(n)},Pi=L(function(){var e=process.env.TITAN_PATH;if(!e)throw Nn("Environment variable TITAN_PATH is not set.");return Tt(e)}),Ri=L(function(){return Pi()+"Compiled/"}),qi=function(e){return ri().readFileSync(e,"utf8")},Bi=function(){return new Date},Gi=function(e){return new Date(e.getTime())},Ki=function(e){return new Date(e,null)},Wi=function(e){var n=new Date(e);return isNaN(n.getTime())?null:n},Hi=function(e){return isNaN(e)?null:e},zi=function(e){return null==e?null:Hi(Number(e))},Yi=zi,Ui=function(e){var n=typeof e;return"number"===n||"bigint"===n},Vi=function(e,n){if(null==e)throw Gr(e,0);if(e.constructor===Date)return n?Gi(e):e;if(u(e)){var r=Yi(e);return null!=r?Ki(r):Wi(e)||null}return Ui(e)?Ki(e):void 0},Qi=function(e,n){return null==e?Bi():Vi(e,n)},$i=function(e){return Qi(e,!0)},Ji=$i,Xi=function(){var e=Ri()+"LastCompileTime.txt";return ii(e)?Ji(qi(e)):null},Zi=function(e,n){return ri().statSync(e,n)},eu=function(e,n){return ri().lstatSync(e,n)},nu=function(e,n,r){return(n?Zi:eu)(e,r)},tu=function(e){return nu(e).mtime},ru=function(e,n,r){return e=Vi(e),n=Vi(n),!1===r?e<n:e<=n},iu=function(e){var n=Xi();if(n){var r=tu(e);if(ru(r,n))return!0}return!1},uu=/(['"])(.*?)\1/,ou=ln(uu),au=function(e){return e.replace(ou,"")},lu=au,su=function(e){return globalThis.structuredClone(e)},cu=su,fu=en,pu=/\r?\n/,vu=function(e){return null==e||void 0!==e.length&&0===e.length},hu=function(e,n){return tt(e,vu)},du=function(e,n){return e.splice(n,1),e},mu=function(e,n,r){for(var i={},u=e.length,o=0;o<u;o++){var a=n(e[o],o,e);if(a){var[l,s]=a;r?(i[l]||(i[l]=[]),i[l].push(s)):i[l]=s}}return i},gu=function(e,n,r,i){return[n,r]=re(e,n,r,i),e.slice(n,r)},yu=function(e,n){return Ae(n,e).join("")},bu=function(e){return e?e[0]:null},wu=function(e,n){var r=null==n?-1:n.index;if(-1===r)return[e];var i=Mt(e,r);return i[1]=i[1].slice(n[0].length),i},Eu=function(e,n,r,i,u){return wu(e,Nr(e,n,r,i,u))},xu=zi,Tu=function(e){return xu(e)??e},Ou=function(e,n){null==n&&(n="=");var r={};return e.forEach(function(e){var[i,u]=Eu(e,n);null!=u&&(u=Tu(u.trim())),r[i.trim()]=u}),r},Su=N,_u=class extends Array{constructor(e){var n,r=e;null!=r&&(o(r)?n=r:u(r)&&(n=r.split(pu))),n?(super(n.length),Object.assign(this,n)):super(...arguments)}condense(e){return this.trim().removeEmpty(),e&&this.removeComments(e),this}trim(){return this.apply(e=>e.trim())}removeEmpty(){return hu(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()?(du(this,n),n--):this[n]=r)}return this}removeFirst(){return this.shift(),this}removeLast(){return this.pop(),this}apply(e){return ie(this,e)}join(){return super.join("\n")}toObj(e){return Ou(this,e)}mapToObj(e,n){return mu(this,e,n)}between(e,n,r){return r=Su(r,"inclusiveEnd",!0),gu(this,e,n,r)}normalize(){if(this.length>0&&(""===this[0].trim()&&this.shift(),this.length>0&&(""===mt(this).trim()&&this.pop(),this.length>0))){var e=this.find(e=>""!==e.trim()),n=bu(Ar(/^\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 I()}indent(e,n){var r=yu(n??"\t",e??1);return this.apply(e=>r+e)}static is(e){return se(e,this)}static fromChunks(e){return e.map(e=>Dt(e,pu)).flatMap(e=>Nu(e,!1))}},Au=function(e,n){var r=new _u(e);return n&&r.condense(),r},Nu=function(e,n,r){var i=e.split(pu);return n?Au(i,r):i},ju=qi,Iu=function(e,n){return Nu(ju(e),!0,n)},Fu=function(e,n){return _r(e).test(n)},ku=function(e,n){return Se(n)?Fu(n,e):e.includes(n)},Cu=function(e,n,r,i){null==e&&(e=""),null==n&&(n="");var u={},o=(r,i)=>u[e+r+n]=i;return i&&En(i,o),r&&En(r,o),u},Lu=function(e,n){return En(n,(n,r)=>e=hn(e,n,r)),e},Du=function(e,n,r,i){var a,l,s=i?.paramIdentifier??"$";if(s)if(u(s)){if(!ku(e,s))return e;a=s}else{if(!o(s))throw Yn(s,1,"paramIdentifier");if([a,l]=s,!ku(e,a)&&!ku(e,l))return e}var c=Cu(a,l,n,r);return Lu(e,c)},Mu=function(e){return u(e)?e:String(e)},Pu=globalThis.process?.env.windir,Ru=ge("os"),qu=function(){return Ru().tmpdir()+ft},Bu=function(e){if(e)throw I();return Ru().homedir()+ft},Gu=function(e){return Bu(e)+"Desktop/"},Ku={PROGRAMFILES:globalThis.process?.env.ProgramFiles,WINDIR:Pu,SYSTEM32:Pu&&Pu+"System32",TEMP:qu(),DESKTOP:Gu()},Wu=function(e,n){return Du(Mu(e),n,Ku)},Hu=function(){return Pi()+"Source/SourceMap.txt"},zu=function(e){return e?Wu(e,{TITAN:Pi()}):Hu()},Yu=function(e,n,r,i,u){return xe(e,n,r,i,(e,n)=>-1===e?-1:void 0===n?e:n+e,u)},Uu=function(e,n){return Array.prototype.findIndex.call(e,n)},Vu=function(e,n,r,i,o){var a=u(n);return a&&null==i&&!o?e.indexOf(n,r):Yu(e,e=>a?e.indexOf(n):Se(n)?e.search(n):Uu(e,n),r,i,o)},Qu=function(e,n,r,i,u){var o=Vu(e,n,r,i,u);return-1===o?null:e.slice(r,o)},$u=function(e){var n=e[0];return n===n.toUpperCase()},Ju=fu(function(e){var n=Iu(zu(e),!0),r={};return n.forEach(e=>{var n=Qu(e,"=").split(",").map(e=>e.trim()),[i,u]=Q(n,e=>!$u(e)),o=i[0];if(!o)throw Nn('No shortName in SourceMap line: "'+e+'"');u.forEach(e=>{r[e]=o})}),r},0),Xu=L(function(e){var n=Object.keys(e);return fn("\\b("+n.join("|")+")\\.(\\w+)","g")}),Zu=/\bt\.(\w+)\.(\w+)/g,eo=function(e,n){n||(n={});var r={},i=r.t={};if(n.enableGlobals){var u;u=n.additionalGlobals?cu(n.additionalGlobals):{},r.globals=u;var o=Ju(),a=Xu(o),l=bt(a,e).filter(n=>{var r=n[1],i=n[2],u=e[n.index-1];if("."===u||"_"===u)return!1;var o=globalThis[r];return!o||void 0===o[i]});for(var[s,c,f]of l)u[c]||(u[c]={}),u[c][f]=!0;var p=l.map(([e,n,r])=>{var i=o[n];if(!i)throw Nn("No short name found for global: "+n);return"t."+i+"."+r+";"}).join(" ");e+="\n"+p}for(var[s,v,f]of l=e.matchAll(Zu))i[v]||(i[v]={}),i[v][f]=!0;return r},no=function(e,n){return e=fr(e),e=lu(e),eo(e,n)},to=function(e,n){return n in e},ro=to,io=function(e,n){for(var r of(Kr(n,1),Object.keys(e))){if(!ro(n,r))return!1;var i=e[r];if(i&&i.constructor===Object&&!io(i,n[r]))return!1}return!0},uo=function(e,n){return!io(n.t,e)||!(!n.globals||e._globals&&io(n.globals,e._globals))},oo=function(e){return xt(e,ft)},ao=function(e){var n=e.lastIndexOf(ft);return-1===n?null:e.slice(0,n+1)},lo=function(e,n,r){if(oo(e))return r?[e,null]:e;var i,u,o=ao(e),a=n(Zt(e),o,e);return r?[i,u]=a:i=a,null!=i&&(e=o?o+i:i),r?[e,u]:e},so=function(e,n,r,i,o){return mr(e,e=>{if(Se(n))return wt(n,e);if(u(n)){var r=e.lastIndexOf(n);return-1!==r?new wr(n,r):null}throw Yn(n,1)},r,i,o)},co=function(e,n,r,i,u){return wu(e,so(e,n,r,i,u))},fo=function(e){return lo(e,e=>co(e,"."),!0)},po=function(e,n){var r=fo(e)[1];return r?!1!==n?r.toLowerCase():r:null},vo=function(e,n){return eo(e,n)},ho=function(e,n){var r=n?.fileType;if(r){if("js"===(r=r.toLowerCase()))return no(e,n);if("html"===r)return vo(e,n)}return eo(e,n)},mo={},go=fu(function(e){e=zu(e);var n=tr(e)+"../Compiled/",r=Iu(e,"//"),i=mo;for(var u of r){var o=u.indexOf("="),a=u.slice(0,o).trim();a=a.split(",").map(e=>e.trim()).filter(e=>!$u(e));var l=u.slice(o+1).trim(),s=Ot(n,l).replaceAll("\\","/");for(var c of a)i[c]=s}return i},0),yo=function*(e,n){var r=0;for(var i of e)n(i,r++,e)&&(yield i)},bo=function(e){return e.slice()},wo=function(e,n){return Ai(e,e.length,n)},Eo=wo,xo=function(e,n){return e.call(this,...n,function n(){return mt(arguments)!==n&&Eo(arguments,n),e.apply(this,arguments)})},To=function(e){e||(e={});var n=e.getKeys;n||(n=function(e){return Object.keys(e)});var r=e.recurseIf;if(!r){var i=this.constructor;r=e=>se(e,i)||fe(e)||o(e)}var u=e.leavesOnly??e.leafsOnly??!1,a=this;return xo(function*(e,i,o,l){var s=n(e,i,o);if(s)for(var c=s.length,f=0;f<c;f++){var p=s[f],v=e[p],h=bo(i);h.push(p);var d=null,m={value:v,key:p,object:e,path:h,level:o,isLeaf:d,root:a},g=r(v,m);m.isLeaf=d=!g,u&&!d||(yield m),g&&(yield*l(v,h,o+1,l))}},[this,[],0])},Oo=function(e,n){return To.call(e,n)},So=function(e,n){1===arguments.length&&(n=!0);var r={};for(var i of e)r[i]=n;return r},_o=function(e,n,r,i){var u=cr(e,n,i);li("acorn-walk").full(u,r)},Ao=function(e,n,r,i){var a;if(u(r))a=e=>e.type===r;else if(o(r)){var l=So(r);a=e=>l[e.type]}else a=r;var s=[];return _o(e,n,function(e){a.apply(this,arguments)&&s.push(e)},i),s},No=lr,jo=function(e){var n,r,i,o=e,a=u(o)?cr(o).body[0]:o,l=a.type;if("VariableDeclaration"===l){n="variable";var s=a.declarations[0];r=s.id.name,i=s.init?s.init.raw??lr(s.init):"undefined"}else"FunctionDeclaration"===l?n="function":"ClassDeclaration"===l&&(n="class"),r=a.id.name;var c={type:n,name:r};return i&&(c.value=i),c.text=No(a),c.node=a,c},Io=function(e){return Ao(e,!0,["ExportNamedDeclaration","ExportDefaultDeclaration"]).map(function(e){var n=e.declaration;if(n){var r=jo(n);return r.node=e,r}return{node:e}})},Fo=function(e,n){n||(n={});var r=n.enableGlobals,i=go(n.sourceMap),u={},o=[];return function e(n,a){var l=yo(Oo(n),e=>e.isLeaf);for(var s of l){var[c,f]=s.path,p=u[c];if(p||(p=u[c]={}),null==p[f]){var v=i[c];if(v){var h=Wt(v)+f+".js";if(!ii(h)){var d='Titan compiled value "t.'+c+"."+f+'" does not exist';throw a&&(d+=' (called by "'+a+'")'),Nn(d+=".")}var m=qi(h),g=Io(m)[0];p[f]=g;var y="t."+c+"."+f;e(ho(m,{fileType:"js",enableGlobals:r}).t,y),o.push([c,f])}else console.log('Skipping unmapped module "'+c+'"'),p[f]=!1}}}(e.t),{t:u,globals:e.globals,order:o}},ko=function(e){return Au(e).normalize().join()},Co=ko,Lo=function(e,n){var r=e,i=c(r)?Rr(r):r;return!1!==n&&(i=ko(i)),i},Do=function(e,n,r){H(e,r).forEach(n)},Mo=function(e,n,r){return It(e||{},n,r)},Po=function(e,n,r){return n?Mo(e,n,r):e??{}},Ro=function(e,n,r){if(Object.hasOwn(e,n)){var i=e[n];return delete e[n],r?r(i,e,n):i}},qo=function(e,n){En(n,(n,r)=>Ro(e,n,r))},Bo=qo,Go=function(e,n,r){return null==(n=Po(n,r)).compress&&(n.compress={}),null==n.mangle&&(n.mangle={}),null==n.format&&(n.format={}),Bo(n,{isModule:e=>n.compress.module=e,originalQuotes:e=>n.format.quote_style=e?3:null,mangleEval:e=>n.mangle.eval=e,mangleExcept:e=>n.mangle.reserved=a(e)}),null==n.toplevel&&(n.toplevel=!0),null==n.compress.passes&&(n.compress.passes=1/0),e=fr(e),li("terser").minify_sync(e,n).code},Ko=function(e,n){n||(n={});var r=n.minify??!1,i=n.debug??!1,u=n.deps??ho(e,n),{t:o,globals:a,order:l}=Fo(u,n),s="//Flat references:\n";for(var[c,f]of l){var p=o[c][f],v="t_"+c+"_"+f,h="variable"===p.type?p.value:"("+p.text+")";h=h.replaceAll(Zu,(e,n,r)=>"t_"+n+"_"+r),s+="var "+v+" = "+h+"\n"}for(var[c,d]of(i&&(s+="//Debug functions:\n",s+=Co('\n function _isFn(value) {\n return typeof value === "function";\n }\n function _withName(value, name) {\n if(_isFn(value)) { Object.defineProperty(value, "name", {value:name}); }\n return value;\n }\n\n ')),s+="//New tree items:\n",s+="var newItems = {",ae(o))){for(var f of(s+="\n\t"+c+": {",Object.keys(d))){var m="t_"+c+"_"+f;i&&(m="_withName("+m+", 't."+c+"."+f+"')"),s+="\n\t\t"+f+": "+m+","}s+="\n\t},"}if(s+="\n}\n",s+="//Add items to t:\n",s+=ko("\n if(globalThis.t) {\n //If t already exists, integrate new items.\n Object.keys(newItems).forEach(function(modName) {\n if(t[modName]) {\n var newModule = newItems[modName];\n Object.keys(newModule).forEach(function(item) {\n t[modName][item] = newModule[item];\n });\n } else {\n t[modName] = newItems[modName];\n }\n });\n } else {\n globalThis.t = Object.assign({}, newItems);\n }\n "),n.enableGlobals&&a){s+="\n//Add weak global aliases:\n",s+=Lo("\n if(!t._globals) { t._globals = {}; }\n function _ensureGlobal(name) {\n if(!globalThis[name]) { globalThis[name] = {}; }\n if(!t._globals[name]) { t._globals[name] = {}; }\n }\n function _weakGlobalize(globalName, shortName, itemName) {\n var globalObj = globalThis[globalName];\n if(!globalObj[itemName]) { globalObj[itemName] = t[shortName][itemName]; }\n t._globals[globalName][itemName] = true;\n }\n ");var g=Ju();En(a,(e,n)=>{s+='\n_ensureGlobal("'+e+'");',Do(n,n=>{var r=g[e];s+='\n_weakGlobalize("'+e+'", "'+r+'", "'+n+'");'})})}if(s+="\n//Export t:",s+="\nif(globalThis.exports) { exports.default = globalThis.t; }",r){var y=ce(r)?r:null;s=Go(s,y,{mangleExcept:["t","_t"],mangleEval:!0})}return s},Wo=function(e){return e instanceof Buffer},Ho=function(e){return ArrayBuffer.isView(e)},zo=Ho,Yo=function(e){return Wo(e)||zo(e)||u(e)},Uo=function(e){return e.constructor===ArrayBuffer},Vo=function(e){return Yo(e)?e:Uo(e)?Buffer.from(e):yn(e)},Qo=function(e){return Ui(e)?String(e):Vo(e)},$o=function(e,n){return ui(e),ri().writeFileSync(e,Qo(n)),e},Jo=function(e,n,r){r||(r={}),r.fileType||!n||r.deps||(r.fileType=po(n));var i=Ko(e,r),u=r.packagePath||rr(n,r.repl);return $o(u,i),u},Xo={titan:{harness:function(e,n){n||(n=e,e=null);var r=e??{};null==r.minify&&(r.minify=!1),r.keepAlive&&Di();var i,u,o=r.packagePath||rr();if(o=pt(o),ii(o)){if(iu(o)&&(i="New compile"),!i){u=r.text??Rr(n);var a=no(u,r);require(o),uo(t,a)&&(i="New deps")}}else i="No package";return i&&(r.onPack&&r.onPack(i),null==u&&(u=r.text??Rr(n)),r.packagePath=o,Jo(u,$t(),r),Mi(o)),n()},getPackagePath:rr,getPackageName:nr,hasNewCompile:iu,getLastCompileTime:Xi,getCompiledDir:Ri,locate:Pi,getDepsFromJS:no,_getDepsBasic:eo,loadGlobalsMap:Ju,_resolveSourceMapPath:zu,locateSourceMap:Hu,_getGlobalsRegex:Xu,depsRegex:Zu,hasNewDeps:uo,packTextToFile:Jo,packText:Ko,getDeps:ho,getDepsFromHTML:vo,_getAllDeps:Fo,loadSourceMap:go,sourceMap:mo},node:{keepAlive:Di,is:D,display:be,util:ye,_builtInModule:ge,requireBuiltIn:me,require:li,_basicRequire:$n,child_process:it,requireLocal:vt,path:ct,_requireFromDir:jt,_requireDirCache:dt,_createRequire:Nt,module:At,promptYNSync:Vr,run:Br,getScriptPath:$t,positionalArgs:Qt,args:Ht,sigint:Yr,interrupt:zr,ensureRequireDir:Zr,addRequireDir:Xr,fs:ri,reloadRequireLocal:Mi,os:Ru},ev:{multiHandle:Bn,on:Ii,resolveValue:Gn,enable:hi,EventInterface:vi,Interface:pi,_ensureHasTarget:fi,targetSym:Qn,EventTarget:ci,polyfill:si,handle:Si,ListenerHandle:Oi,ensureEnabled:mi,can:di,once:bi,off:_i},o:{multiHandle:qn,isAny:y,setHidden:T,addNonEnumerable:x,defineProperty:E,weakAssign:w,merge:b,safeEnsure:N,ensure:A,hideKey:B,makeNonEnumerable:q,filterSplit:J,keys:H,allKeys:W,split:$,pick:z,iterateAll:le,iterate:ae,iterator:oe,entries:ue,isPure:fe,is:ce,setProtoLazy:he,setGetter:pe,forceSet:ve,display:On,toLiteral:Tn,constructorMatches:Oe,ensureCustom:ke,get:je,set:Ie,createEmpty:Ge,remove:Ve,reduce:xn,each:En,addInterface:Un,Cache:ht,setDefaults:Ft,ensureMulti:It,resolveKeys:Qr,diveGet:ei,safeSet:yi,touch:gi,deepCopy:cu,fromLines:Ou,safeDefault:Su,hasKey:ro,has:to,fromKeys:So,eachKey:Do,safeSetDefaults:Po,safeEnsureMulti:Mo,consumeOptions:Bo,consumeMulti:qo,consume:Ro},handle:{createMulti:Rn,MultiHandle:Mn,HandleInterface:Dn,Handle:Ti},class:{addInterface:e,create:R,setName:k,addStatics:C,setDisplay:P,isInterface:Wn,interface:Vn},ifc:{create:Cn,Interface:kn,is:Kn},f:{createClass:G,ensureConstructor:d,createConstructor:h,isArrowFn:p,isArrow:f,is:c,wrap:v,retThis:m,setName:F,one:L,eq:K,memoize:en,MemoizedFunction:Ze,not:nt,body:Rr,isArrowString:dr,_getArrowFnBody:Mr,_getNormalFnBody:Pr,hookAfterMethod:xi,hookAfter:Ei,injectAfter:wi,interval:ki,TimerHandle:Fi,noop:Ci,cache:fu,recurse:xo},s:{is:u,isAny:i,isPrimitive:n,isObject:r,toLiteral:gn,quote:mn,escape:dn,replaceAll:hn,apply:Te,withIndices:xe,chars:nn,from:yn,spaceBefore:In,fromKey:Fn,endsWith:xt,resolveIndex:gt,removeTrailing:Dt,removeFromEnd:Lt,_removeStringFromEnd:kt,_removeRegexFromEnd:Ct,splitAtIndex:Mt,ensureStartsWith:Rt,replace:Kt,decapitalize:Jt,removeLineBreaks:ar,removeMulti:or,removeAll:ur,resolve:qr,ensure:hr,after:Ir,match:Nr,_matchWithIndices:mr,remove:Tr,removeLeading:Dr,removeFromStart:Lr,_removeStringFromStart:Fr,_removeRegexFromStart:Cr,removeQuotes:au,splitLines:Nu,lines:Au,LinesArray:_u,repeat:yu,splitFirst:Eu,_splitByMatch:wu,replaceParams:Du,contains:ku,_createParamsObj:Cu,_replaceByObj:Lu,before:Qu,index:Vu,_indexWithIndices:Yu,indexOfFn:Uu,isCapitalized:$u,splitLast:co,matchLast:so,normalize:Co,normalizeMLS:ko,mls:Lo},a:{is:o,ensure:a,filterSplit:Q,iterate:ne,iterator:ee,apply:ie,resolveIndices:re,resolveIndex:te,wrapIndices:Ee,wrapIndex:we,pick:Ne,create:Ae,fill:_e,push:Re,add:Pe,splitLast:We,splitTail:Ke,toLiteral:bn,display:Sn,unboxArgs:Pn,removeNullish:rt,removeByFilter:tt,replaceContents:et,last:mt,pushMulti:br,addMulti:yr,pushThroughMulti:gr,removeEmpty:hu,removeIndex:du,mapToObj:mu,slice:gu,copy:bo},p:{asyncJoint:s,is:l},v:{isPrimitive:g,constructorMatches:se,display:_n,toLiteral:wn,resolve:Fe,type:zn,req:Kr,nullIfNaN:Hi,isEmpty:vu},err:{nyi:I,NYIError:_,Error:S,Enhanced:O,defaultFromFn:j,value:An,ValueError:de,create:Nn,type:Yn,TypeError:Hn,prepend:sr,req:Gr},sym:{display:M,value:Be,cleanup:Ln},macro:{config:function(e){}},set:{resolve:V,ensure:U,is:Y},n:{cap:Z,least:X,fromString:Yi,ensure:zi,is:Ui,tryCoerce:Tu,tryParse:xu},re:{is:Se,ensureGlobal:sn,global:ln,addFlag:an,copy:on,updateFlagString:un,parseFlagString:tn,createFlagString:rn,createEscaped:vn,create:fn,resolveFlags:cn,escape:pn,matchEnd:Et,matchLast:wt,matchAll:bt,setStartIndex:yt,safeCreateResult:xr,createResult:Er,RegexResult:wr,match:Ar,ensureLocal:_r,local:Sr,removeFlag:Or,resultEndIndex:jr,matchStart:kr,quotes:ou,quote:uu,newline:pu,text:bu,test:Fu},map:{Cache:Me,ensure:De,get:Ce,set:Le,MultiCache:Xe,diveEnsure:Ue,createEmpty:Ye,diveDelete:Je,remove:$e},args:{ensureArray:qe,unshift:ji,prepend:Ni,insert:Ai,push:Eo,append:wo},tree:{ensure:ze,dive:He,remove:Qe,setCustom:$r,copy:su,isSubsetOf:io,iterate:Oo,iterator:To},gen:{join:jn,filter:yo},npm:{isBuiltIn:Jn,isFile:Xn,install:st,_runCommand:lt},os:{run:at,_resolveStdio:Zn},win:{is:ut},shell:{_handleError:ot},path:{abs:pt,sep:ft,ensureEndsWith:St,join:Ot,ensureTrailingSlash:Tt,fws:Wt,baseName:er,_removeExtsFromFile:Xt,file:Zt,dir:tr,resolveVars:Wu,string:Mu,_defaultParams:Ku,windir:Pu,_getDefaultTempDir:qu,getDesktop:Gu,getUserDir:Bu,ext:po,splitExt:fo,ignoreDir:lo,isDir:oo,dirPart:ao},js:{enhance:vr,ensureReturn:qt,splitLastExpression:Pt,enableAwait:Gt,_nodeEnableAwait:Bt,useTitan:ir,inline:pr,removeComments:fr,fromAST:lr,parse:cr,removeQuotes:lu,getExports:Io,getNodes:Ao,eachNode:_o,parseDeclaration:jo,fromASTNode:No,minify:Go},cli:{positionalArgs:Vt,resolveArgs:Ut,splitArgs:Yt},env:{args:zt,setConfig:Jr,getConfig:ni,resolveConfig:ti,keepAlive:Li},proc:{interrupt:Hr,signal:Wr},bool:{fromYN:Ur},fs:{ensureDir:ai,exists:ii,mkdir:oi,ensureParent:ui,load:qi,getModifiedDate:tu,stat:nu,deepStat:Zi,shallowStat:eu,loadLines:Iu,loadText:ju,write:$o,formatRaw:Qo},d:{from:Ji,create:$i,resolve:Qi,now:Bi,ensure:Vi,copy:Gi,fromYear:Ki,_resolveNative:Wi,isBefore:ru},bin:{ensureByteSafe:Vo,isByteSafe:Yo,isNodeBuffer:Wo,isTA:zo},ab:{isTA:Ho,is:Uo}};globalThis.t?Object.keys(Xo).forEach(function(e){if(t[e]){var n=Xo[e];Object.keys(n).forEach(function(r){t[e][r]=n[r]})}else t[e]=Xo[e]}):globalThis.t=Object.assign({},Xo),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 e instanceof String},i=function(e){return n(e)||r(e)},u=i,o=function(e){return Array.isArray(e)},a=function(e){return o(e)?e:[e]},l=function(e){return e instanceof Promise},s=function(e,n){var t=e;return l(t)?t.then(n):n(t)},c=function(e){return"function"==typeof e},f=function(e){return c(e)&&null==e.prototype},p=f,v=function(e){return function(){return e.apply(this,arguments)}},h=function(e,n){var t;return t=n?function(){this.super=n;var t=e.apply(this,arguments);return s(t,()=>(delete this.super,t))}:p(e)?v(e):e,t._isConstructor=!0,t},d=function(e,n){return e._isConstructor?e:h(e,n)},m=function(){return this},g=function(e){var n=typeof e;return"object"!==n&&"function"!==n||null===e},y=function(e){return!g(e)},b=function(e,n,t){return!1===t?Object.keys(n).forEach(t=>{void 0===e[t]&&(e[t]=n[t])}):Object.assign(e,n),e},w=function(e,n){return b(e,n,!1)},E=function(e,n,t,r){return t||(t={}),r&&w(t,r),null==t.enumerable&&(t.enumerable=!0),null==t.configurable&&(t.configurable=!0),Object.defineProperty(e,n,t)},x=function(e,n,t,r){return E(e,n,{value:t,writable:!0,enumerable:!1},r),t},T=x,O=function(e){return class extends e{constructor(e,n){super(e,n);var t=this.constructor.name;t&&(this.name=t)}}},S=O(globalThis.Error),_=class extends S{constructor(e,n){super(e??"Not yet implemented",n)}},A=function(e,n,t,r){var i=e[n];if(void 0===i){var u=t;!1!==r&&c(u)&&(u=u(e,n)),e[n]=i=u}return i},N=function(e,n,t,r){return e||(e={}),A(e,n,t,r),e},j=function(e,n){return N(e,"fromFn",n,!1)},I=function(e,n){return new _(e,j(n,I))},F=function(e,n){Object.defineProperty(e,"name",{value:n,configurable:!0}),T(e,"displayName",n)},k=F,C=function(e,n){return Object.assign(e,n)},L=function(e){var n,t=!1;return function(){return t||(t=!0,n=e.apply(this,arguments)),n}},D=L(function(){return"undefined"==typeof window}),M=D()?require("util").inspect.custom:Symbol("Display"),P=function(e,n){e.prototype[M]=n},R=function(e,n,t,r,i,l){l||(l={}),u(n)&&(n=null);var c,f,p,v=t;v&&(o(v)?([f,p]=v,f&&(f=d(f))):c=d(v,n));var h=l.bareFn;l.singleton&&(h=function(){return null==w.default&&(w.default=new w(...arguments)),w.default});var g,b=f||c||n||m;function w(){if(!new.target&&h&&!(this instanceof w))return h.apply(this,arguments);var e=this;return s(b.apply(e,arguments),t=>{if(t&&y(t)&&(e=t,f)){if(!new.target)throw I('Prototype repair is NYI for class instantiation without "new".');if(!n)throw I("instanceFn is not yet supported when extendsClass is null.");var r=Object.getPrototypeOf(this);Object.getPrototypeOf(e)!==r&&Object.setPrototypeOf(e,r)}return p?s(p.apply(e,arguments),()=>e):e})}return e&&k(w,e),r?(g=r,n&&Object.setPrototypeOf(r,n.prototype)):g=n?Object.create(n.prototype):{},T(g,"constructor",w),w.prototype=g,i&&C(w,i),l.display&&P(w,l.display),l.implements&&a(l.implements).forEach(e=>e(w)),w},q=function(e,n){Object.defineProperty(e,n,{enumerable:!1})},B=q,G=function(e,n,t,r,i){var u=Symbol();return R(e,Function,[function(){var e=function(){return e[u].apply(this,arguments)};return e},function(){var e=n.apply(this,arguments);if(!e)throw new Error("Constructor must return a function.");this[u]=e,B(this,u)}],t,r,i)},K=function(e){return n=>n===e},W=function(e){return Reflect.ownKeys(e)},H=function(e,n){return(n?W:Object.keys)(e)},z=function(e,n,t){var r={};for(var i of n)Object.hasOwn(e,i)&&(r[i]=e[i],!0===t&&delete e[i]);return r},Y=function(e){return e instanceof Set},U=function(e){return Y(e)?e:o(e)?new Set(e):new Set([e])},V=U,Q=function(e,n){var t=[],r=[];return e.forEach((i,u)=>(n(i,u,e)?t:r).push(i)),[t,r]},$=function(e,n,t,r){var i=n;if(c(i))throw I();var u=H(e,r),o=V(i),[a,l]=Q(u,e=>o.has(e));return[z(e,a,t),!0===t?e:z(e,l,!1)]},J=function(e,n,t){var r=H(e,t).filter(t=>n(e[t],t,e));return $(e,r,!1,t)},X=function(e,n){return n<e?n:e},Z=function(e,n){return X(e,n)},ee=function*(e,n){null==e&&(e=0),n=null==n?this.length:Z(n,this.length);for(var t=e;t<n;t++)yield this[t]},ne=function(e,n,t){return null==n&&null==t?e[Symbol.iterator].call(e):ee.call(e,n,t)},te=function(e,n){return n<0?e.length+n:n},re=function(e,n,t,r){return n=null==n?0:te(e,n),t=null==t?e.length:te(e,t),r&&(0==r.inclusiveStart&&n++,r.inclusiveEnd&&t++),[n,t]},ie=function(e,n,t,r){[t,r]=re(e,t,r);for(var i=t;i<r;i++){var u=n(e[i],i,e);void 0!==u&&(e[i]=u)}return e},ue=function(e,n){return n?ie(H(e,n),n=>[n,e[n]]):Object.entries(e)},oe=function(e){return ne(ue(this,e))},ae=function(e,n){var t=e[Symbol.iterator];return t?t.call(e):oe.call(e,n)},le=function(e){return ae(e,!0)},se=function(e,n){return null!=e&&e.constructor===n},ce=function(e){return se(e,Object)},fe=ce,pe=function(e,n,t,r){return E(e,n,{get:t},r)},ve=function(e,n,t,r){return E(e,n,{value:t,writable:!0},r),t},he=function(e,n,t){pe(e,n,function(){if(this===e)return null;var r=t.call(this);return ve(this,n,r),r})},de=class extends S{constructor(e,n){super(e??"Unexpected value",n)}},me=function(e){return require("node:"+e)},ge=function(e){return L(()=>me(e))},ye=ge("util"),be=function(e,n){return n||(n={}),null==n.colors&&(n.colors=!0),ye().inspect(e,n)},we=te,Ee=function(e,n,t,r){return void 0!==n&&(null===n||0===n?n=void 0:(n=we(e,n),r&&0==r.inclusiveStart&&n++)),void 0!==t&&(null===t||t===e.length?t=void 0:(t=we(e,t),r&&r.inclusiveEnd&&t++)),[n,t]},xe=function(e,n,t,r,i,u){if(t||null!=r){[t,r]=Ee(e,t,r,u);var o=e.slice(t,r),a=n(o);return i?i(a,t,r,o,e):a}return n(e)},Te=function(e,n,t,r,i){return xe(e,n,t,r,(n,t,r)=>(void 0!==t?e.slice(0,t):"")+(n||"")+(void 0!==r?e.slice(r):""),i)},Oe=se,Se=function(e){return Oe(e,RegExp)},_e=function(e,n,t,r){var i=n;if([t,r]=re(e,t,r),c(i))for(var u=t;u<r;u++)e[u]=i(u,e);else e.fill(i,t,r);return e},Ae=function(e,n){var t=new Array(e||0);return arguments.length>1&&_e(t,n),t},Ne=function(e,n){return Ae(n.length,t=>e[n[t]])},je=function(e,n){return e[n]},Ie=function(e,n,t){return e[n]=t},Fe=function(e,n,t){var r=e;return c(r)?r.apply(t,n):r},ke=function(e,n,t,r,i){r||(r=je);var u=r(e,n);return void 0===u&&(u=Fe(t,[e,n]),i||(i=Ie),i(e,n,u)),u},Ce=function(e,n){return e.get(n)},Le=function(e,n,t){return e.set(n,t)},De=function(e,n,t){return ke(e,n,t,Ce,Le)},Me=class{constructor(){this.store=new Map}get(e,n){return De(this.store,e,n)}remove(e){return this.store.delete(e)}delete(e){return this.remove(e)}},Pe=function(e,n){return e.push(n),e},Re=Pe,qe=function(e){var n=e;return Array.isArray(n)?n:Array.from(n)},Be=Symbol("Value"),Ge=function(){return{}},Ke=function(e){return[e.slice(0,-1),e[e.length-1]]},We=Ke,He=function(e,n,t,r,i,u){t||(t=je),null==r&&(r=Ge),null==i&&(i=Ie),null==u&&(u=t);for(var[o,a]=We(n),l=e,s=o.length,c=0;c<s;c++){var f=o[c],p=t(l,f);if(void 0===p){if(!r)return;p=ke(l,f,r,t,i)}l=p}if(u)return u(l,a,i)},ze=function(e,n,t,r,i,u){return He(e,n,r,i,u,(e,n)=>ke(e,n,t,r,u))},Ye=function(){return new Map},Ue=function(e,n,t){return ze(e,n,t,Ce,Ye,Le)},Ve=function(e,n){return delete e[n],e},Qe=function(e,n,t,r){return He(e,n,t,!1,!1,r||Ve)},$e=function(e,n){return e.delete(n)},Je=function(e,n){return Qe(e,n,Ce,$e)},Xe=class{constructor(){this.store=new Map}get(e,n){return e=Re(qe(e),Be),Ue(this.store,e,n)}remove(e){return e=Re(qe(e),Be),Je(this.store,e)}delete(e){return this.remove(e)}},Ze=G("MemoizedFunction",function(e,n){if(this.base=e,null!=n)if(1===(n=a(n)).length){this.cache=new Me;var t=n[0];this._cacheKeyFormatter=e=>e[t]}else this.cache=new Xe,this._cacheKeyFormatter=e=>Ne(e,n);else this.cache=new Xe,this._cacheKeyFormatter=e=>e;var r=this;return function(){var n=r._cacheKeyFormatter(arguments);return r.cache.get(n,()=>e.apply(this,arguments))}},{remove(e){return this.cache.remove(this._cacheKeyFormatter(e))}}),en=function(e,n){return new Ze(e,n)},nn=function(e){return new Set(e)},tn=function(e){var n={};if(e){var t=nn(e);t.has("g")&&(n.global=!0),t.has("i")&&(n.caseInsensitive=!0),t.has("y")&&(n.sticky=!0)}return n},rn=function(e){var n="";return e.global&&(n+="g"),(e.caseInsensitive||0==e.caseSensitive)&&(n+="i"),e.sticky&&(n+="y"),n},un=function(e,n){var t=tn(e);return rn(Object.assign(t,n))},on=function(e,n){var t=n,r=void 0;return u(t)?r=t:ce(t)&&(r=un(e.flags,t)),new RegExp(e,r)},an=function(e,n){return on(e,e.flags+n)},ln=function(e){return an(e,"g")},sn=en(function(e){return e.global?e:ln(e)},0),cn=function(e){var n=e;return null==n?void 0:u(n)?n:rn(n)},fn=function(e,n){return new RegExp(e,cn(n))},pn=function(e){return e.replace(/[-[\]{}()*+!<=:?.\/\\^$|#\s,]/g,"\\$&")},vn=function(e,n){return fn(pn(e),n)},hn=function(e,n,t,r,i,o){return Te(e,function(e){return e.replaceAll?(Se(n)&&(n=sn(n)),e.replaceAll(n,t)):(n=u(n)?vn(n,"g"):sn(n),this.replace(n,t))},r,i,o)},dn=function(e,n,t){return hn(e,n,(t??"\\")+n)},mn=function(e,n,t){return null==n&&(n='"'),!1!==t&&(e=dn(e,n,t)),n+e+n},gn=function(e){return mn(e,'"')},yn=function(e){return fe(e)?Tn(e):String(e)},bn=function(e,n){return n||(n=wn),"["+e.reduce(function(e,t){return e+n(t)+", "},"").slice(0,-2)+"]"},wn=function(e){return u(e)?gn(e):o(e)?bn(e):yn(e)},En=function(e,n,t){H(e,t).forEach((t,r,i)=>n(t,e[t],r,i))},xn=function(e,n,t,r){var i=null!=t?t:"";return En(e,function(){i=n.call(this,i,...arguments)},r),i},Tn=function(e,n){return n||(n=wn),"{"+xn(e,function(e,t,r){return e+t+":"+n(r)+", "},"",!0).slice(0,-2)+"}"},On=function(e,n){return null==n&&(n=1),n<=0?"[object Object]":Tn(e,e=>_n(e,n-1))},Sn=function(e,n){return null==n&&(n=1),n<=0?"[object Array]":bn(e,e=>_n(e,n-1))},_n=function(e,n){return void 0===e?"undefined":null===e?"null":D()?be(e,n):ce(e)?On(e,maxNumLevels):o(e)?Sn(e,maxNumLevels):yn(e)},An=function(e,n,t,r){if(0===arguments.length)return new de("Unexpected value received");r||(r={});var i,{expected:u}=r;return i=u?"Received "+_n(e)+", expected one of "+_n(u):"Unexpected value received: "+_n(e),t&&(i+=' for "'+t+'"'),null!=n&&(i+=" (index "+n+")"),r.fromFn||(r.fromFn=An),new de(i,r)},Nn=function(e,n,t){var r=new S(e,t);return n&&Object.assign(r,n),r},jn=function*(e,n){yield*e,yield*n},In=function(e){return e?" "+e:""},Fn=function(e){return u(e)?e:e.toString()},kn=G("Interface",function(e,n,t){t||(t={}),F(this,e),n?[this.stubs,this.defaults]=J(n,K(!0),!0):(this.stubs={},this.defaults={});var r=t.implements?a(t.implements):null,i=this;return function(e){var n=e;return r&&r.forEach(e=>e(n)),i.decorate(n),i.assert(n),n}},{decorate(e){var n,t,r=e;for(var[i,u]of(r.prototype?(n=r.prototype,t=!0):(n=r,t=!1),le(this.defaults)))if(void 0===n[i])if(fe(u))if(u.value)n[i]=u.value;else{if(!u.setup)throw An(u,null,"defaultVal");if(!t)throw u.setup(),I("setupFn is NYI for instances");he(n,i,u.setup)}else n[i]=u;return r},assert(e){var n=e,t=null!=n.prototype,r=n.prototype||n,i=jn(le(this.stubs),le(this.defaults));for(var[u]of i){var o;if(void 0===r[u])throw o=t?"Class"+In(n.name):"Object "+_n(n),o+=" does not satisfy interface "+this.name+' (missing key "'+Fn(u)+'")',Nn(o)}return n},validate(e){try{return this.assert(e),!0}catch(e){return!1}}},{is(e){return e instanceof this}}),Cn=function(e,n,t){return new kn(e,n,t)},Ln=Symbol("Cleanup"),Dn=Cn("Handle",{remove:!0,[Ln](){this.remove()}}),Mn=e(class{constructor(e){this.handles=e}remove(){this.handles.forEach(e=>e.remove())}add(e){return this.handles.push(e),this}},Dn),Pn=function(e){return 1===e.length&&o(e[0])?e[0]:array},Rn=function(...e){return new Mn(Pn(e))},qn=Rn,Bn=qn,Gn=function(e){var n,t,r=e;return null!=r&&(n=r.detail??r.data??r,y(r)&&(t=r)),[n,t,r]},Kn=function(e){return kn.is(e)},Wn=Kn,Hn=O(globalThis.TypeError),zn=function(e){return null==e?e:e.constructor},Yn=function(e,n,t,r){if(0===arguments.length)return new Hn("Unexpected type received");r||(r={});var i,{type:u,expected:o}=r;return null==u&&(u=zn(e)),u&&u.name&&(u=u.name),o?(o.name&&(o=o.name),i="Expected "+o+", received "):i="Unexpected type received (",i+=u,null!=e&&(i+=" ("+_n(e)+")"),o||(i+=")"),t&&(i+=' for "'+t+'"'),null!=n&&(i+=" (index "+n+")"),r.fromFn||(r.fromFn=Yn),new Hn(i,r)},Un=function(e,n,t){if(!Wn(n))throw Yn(n,1);return n.decorate(e),t&&t.call(e,e,n),n.assert(e),e},Vn=Cn,Qn=Symbol("EventTarget"),$n=function(e){return require(e)},Jn=function(e){return!!e.startsWith("node:")||$n("node:module").isBuiltin(e)},Xn=function(e){return e.startsWith(".")},Zn=function(e){var n=e.stdio;if(n){if(!o(n)){if(!u(n))throw Yn(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 An(n,"stdio");n=["overlapped","overlapped","overlapped"]}e.stdio=n}}else n=e.stdio=[null,null,null];return n},et=function(e,n){var t=n.length;e.length=t;for(var r=0;r<t;r++)e[r]=n[r];return e},nt=function(e){return function(){return!e.apply(this,arguments)}},tt=function(e,n){return et(e,e.filter(nt(n)))},rt=function(e){return tt(e,e=>null==e)},it=ge("child_process"),ut=L(function(){return"win32"===process.platform}),ot=function(e,n,t){if(t||(t={}),n(e))throw e;if(t.nullOnErr)return null;var r=t.onErr;if(void 0!==r)return Fe(r);throw e},at=function(e,n,t){t||(t={}),t.dir&&(t.cwd=t.dir);var r=Zn(t);if(null==r[0]){var i=t.allowInput,u=t.input;if(i&&u)throw Nn("allowInput (user) and input (programmatic) cannot be used simultaneously for synchronous child processes.");i&&(r[0]="inherit")}if(null==r[1]){var o=t.captureOutput??!1,a=t.showOutput;if(o&&a)throw Nn("captureOutput and showOutput cannot be used simultaneously for synchronous child processes.");o?r[1]="pipe":(null==a&&(a=!0),r[1]=a?"inherit":"ignore")}if(null==r[2]){var l=t.captureErr??!1,s=t.showErr;if(l&&s)throw Nn("captureErr and showErr cannot be used simultaneously for synchronous child processes.");l?r[2]="pipe":(null==s&&(s=!0),r[2]=s?"inherit":"ignore")}t.encoding||(t.encoding="utf8"),n&&rt(n);try{var c=it().execFileSync(e,n,t);null!=c&&!1!==t.trim&&(c=c.trim());var f=t.map??t.mapFn;return f&&(c=f(c)),c}catch(e){if(ut())return ot(e,e=>"ENOENT"===e.code,t);throw e}},lt=function(e,n){return n||(n={}),null==n.captureOutput&&(n.captureOutput=!1),n.shell=!0,n.filterExtensions=!1,at("npm",e,n)},st=function(e,n,t){return lt(["install",e,n?"-g":null],t)},ct=ge("path"),ft=ct().sep,pt=function(e,n,t){var r=ct().resolve,i=n?r(n,e):r(e);return t?i+ft:i},vt=function(e){return require(pt(e))},ht=class{constructor(){this.store={}}get(e,n){return A(this.store,e,n)}remove(e){return delete this.store[e]}delete(e){return this.remove(e)}},dt=new ht,mt=function(e){return e[e.length-1]},gt=te,yt=function(e,n,t){return e=on(e,{global:!0}),null!=t&&(n=gt(t,n)),e.lastIndex=n,e},bt=function(e,n,t){return e=null!=t?yt(e,t,n):sn(e),Array.from(n.matchAll(e))},wt=function(e,n,t){return null!=t&&(n=n.slice(0,t)),mt(bt(e,n))||null},Et=function(e,n){var t=wt(e,n);return t&&n.length===t.index+t[0].length?t:null},xt=function(e,n){if(u(n))return e.endsWith(n);if(Se(n))return!!Et(n,e);throw Yn(n,1,"matchThis")},Tt=function(e){return xt(e,ft)?e:e+ft},Ot=function(e,n,t){if(D()){var r=ct().join(e,n);return t?Tt(r):r}throw I()},St=function(e,n){return e.endsWith(n)?e:Ot(e,n)},_t=ge("module"),At=function(e){return e=St(e,"node_modules"),_t().createRequire(e)},Nt=function(e,n){return dt.get(e,()=>At(e))(n)},jt=function(e,n,t){return Object.keys(n).forEach(r=>A(e,r,n[r],t)),e},It=function(e,n,t){return n?jt(e,n,t):e},Ft=function(e,n){return e.endsWith(n)?e.substring(0,e.length-n.length):e},kt=function(e,n){var t=Et(n,e);return t?e.slice(0,t.index):e},Ct=function(e,n){if(u(n))return Ft(e,n);if(Se(n))return kt(e,n);throw Yn(n,1)},Lt=Ct,Dt=function(e,n){return[e.slice(0,n),e.slice(n)]},Mt=function(e){e=Lt(e.trim(),";");var n=Math.max(e.lastIndexOf(";"),e.lastIndexOf("\n"));return Dt(e,n+1)},Pt=function(e,n){return e.startsWith(n)?e:n+e},Rt=function(e){var[n,t]=Mt(e);return n+Pt(t.trim(),"return ")},qt=function(e){return ai("node-repl-await").processTopLevelAwait(e)},Bt=function(e){return qt(e)??e},Gt=hn,Kt=function(e,n){return""===e?e:(!1!==n&&(e=Tt(e)),Gt(e,"\\","/"))},Wt=L(function(){return process.argv.slice(2)}),Ht=Wt,zt=function(e,n){const t=[];let r="",i="outside",u=!1;for(let o=0;o<e.length;o++){const a=e[o];switch(i){case"outside":'"'===a?u?(r+=a,u=!1):(n&&(r+=a),i="insideQuote"):"\\"===a?u=!0:" "===a?(r.length>0&&(t.push(r),r=""),u=!1):(r+=a,u=!1);break;case"insideQuote":'"'!==a||u?"\\"!==a||u?(r+=a,u=!1):u=!0:(n&&(r+=a),i="outside")}}return r.length>0&&t.push(r),t},Yt=function(e,n){var t=e;return null==t?Ht():u(t)?zt(t,n):t},Ut=function(e,n){return Yt(e,n).slice()},Vt=Ut,Qt=function(){var e=require.main?.filename;return e||(null!=process._eval?null:Vt(process.argv)[1])},$t=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},Jt=function(e){return e.split(".")[0]},Xt=function(e){return ct().win32.basename(e)},Zt=function(e){return Jt(Xt(e))},er=function(e,n,t,r){e||(e=Qt()??"_console.js");var i=$t(Zt(e));return n&&(i+="_repl"),i+(t&&r?.dynamic?".dypkg.json":".pkg.js")},nr=function(e,n){return e=ct().dirname(e),!1===n?e:Tt(e)},tr=function(e,n,t,r){var i,u=er(e,n,t,r);return i=e?nr(e):"./",pt(i+u)},rr=function(e){return'require("'+Kt(tr(),!1)+'");\n'+e},ir=function(e,n){return hn(e,n,"")},ur=function(e,n){return n.forEach(n=>e=ir(e,n)),e},or=function(e){return ur(e,["\r","\n"])},ar=function(e,n){return ai("astring").generate(e,n)},lr=function(e,n){return e.stack=n+"\n"+e.stack,e},sr=function(e,n,t){t||(t={}),t.ecmaVersion||(t.ecmaVersion=2024),!1!==n&&(t.sourceType="module"),null==t.allowAwaitOutsideFunction&&(t.allowAwaitOutsideFunction=!0),null==t.allowReturnOutsideFunction&&(t.allowReturnOutsideFunction=!0);var r=ai("acorn");try{return r.parse(e,t)}catch(n){throw lr(n,"Acorn parsing error: "+e)}},cr=function(e,n,t){return ar(sr(e,n,t))},fr=function(e){return or(cr(e))},pr=function(e,n,t){return(n||t)&&(n||(n={}),t&&It(n,t),n.ensureReturn&&(e=Rt(e)),n.topLevelAwait&&(e=Bt(e)),n.useTitan&&(e=rr(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=fr(e))),e},vr=function(e){return u(e)?e:yn(e)},hr=function(e){var n=e.indexOf("{");return-1===n||e.slice(0,n).includes("=>")},dr=function(e,n,t,r,i){return xe(e,n,t,r,(n,t)=>null===n?null:(n.input=e,void 0!==t&&(n.index+=t),n),i)},mr=function(e,n){return e.splice(e.length,0,...n),n},gr=function(e,n){return mr(e,n),e},yr=gr,br=class extends Array{constructor(e,n,t,r,i){if(-1===n)throw Nn("RegexResult index cannot be -1. For empty result, use bare null.");if(null==e)throw Nn("RegexResult matchString cannot be null. For empty result, use bare null.");super(),this[0]=e,r&&yr(this,r),this.index=n,this.input=t,i&&(this.groups=i)}fromParts(e){var n=e;return new br(n.match,n.index,n.input,n.captures,n.groups)}},wr=function(e,n,t,r,i){return new br(e,n,t,r,i)},Er=function(e,n,t,r,i){return-1===n||null==e?null:wr(e,n,t,r,i)},xr=ir,Tr=function(e,n){return on(e,xr(e.flags,n))},Or=function(e){return Tr(e,"g")},Sr=en(function(e){return e.global?Or(e):e},0),_r=function(e,n,t){return(e=null!=t?yt(e,t,n):Sr(e)).exec(n)},Ar=function(e,n,t,r,i){return dr(e,e=>{if(u(n)){var t=e.indexOf(n);return Er(n,t,e)}return _r(n,e)},t,r,i)},Nr=function(e){return e.index+e[0].length},jr=function(e,n){var t=Ar(e,n);return null===t[0]?null:e.slice(Nr(t))},Ir=function(e,n){return e.startsWith(n)?e.substring(n.length):e},Fr=function(e,n){var t=_r(e,n);return t&&0===t.index?t:null},kr=function(e,n){var t=Fr(n,e);return t?e.slice(t[0].length):e},Cr=function(e,n){if(u(n))return Ir(e,n);if(Se(n))return kr(e,n);throw Yn(n,1)},Lr=Cr,Dr=function(e){var n=jr(e,"=>").trim();return Lr(Lt(n,"}"),"{")},Mr=function(e){return jr(e,"{").slice(0,-1)},Pr=function(e){var n=vr(e);return hr(n)?Dr(n):Mr(n)},Rr=function(e){return null==e?"":u(e)?e:c(e)?Pr(e):String(e)},qr=function(e,n){var t=n?.basic?null:{topLevelAwait:!0,useTitan:!0},r=pr(Rr(e),n,t);return at("node",[n?.mode??"-p",r],n)},Br=function(e,n,t,r){var i="Required argument";return t&&(i+=' "'+t+'"'),null!=n&&(i+=" (index "+n+")"),i+=" missing",arguments.length>0&&(i+=" (received "+_n(e)+")"),Nn(i,null,j(r,Br))},Gr=function(e,n,t){if(null==e)throw Br(e,n,t,{fromFn:Gr});return e},Kr=function(e,n){return process.kill(e,Gr(n,0,"signalName"))},Wr=function(e){return Kr(e,"SIGINT")},Hr=function(){return Wr(process.pid)},zr=Hr,Yr=function(e){if("Y"===(e=e.toUpperCase()))return!0;if("N"===e)return!1;throw An(e,0,"char")},Ur=function(e){null==e&&(e="Are you sure? [y/n]: "),process.stdout.write(e);var n=qr(function(){const e=process.stdin,n=process.stdout;e.setRawMode(!0),e.setEncoding("utf8"),e.on("data",e=>{var t=e.toUpperCase();"Y"===t||"N"===t?(n.write(e),process.exit(0)):""===e&&(n.write("^C"),process.exit(0))})},{mode:"-e",basic:!0,stdio:["inherit","pipe"]});if("^C"===n)throw process.stdout.write(n),zr(),Nn("Prompt was cancelled via interrupt.");return console.log(n),Yr(n)},Vr=function(e){return o(e)?e:u(e)?e.split("."):[e]},Qr=function(e,n,t,r,i,u){var o=t;return He(e,n,r,i,u,(e,n,t)=>t(e,n,Fe(o)))},$r=function(e,n){var t=n,r=globalThis.config;r||(r=globalThis.config={});var i,u=Vr(e);return u.length>1?i=Qr(r,u,t):(i=Fe(t),r[u[0]]=i),i},Jr=function(e,n){return $r("node.require.customDirs",t=>(t||(t=[]),!1!==n&&(e=St(e,"node_modules")),t.includes(e)||t.push(e),t)),e},Xr=Jr,Zr=He,ei=function(e){var n=globalThis.config;if(n){var t=Vr(e);return t.length>1?Zr(n,t):n[t[0]]}},ni=function(e,n,t){if(null!=e)return e;var r=ei(n);return null!=r?r:t},ti=ge("fs"),ri=function(e){return!!ti().lstatSync(e,{throwIfNoEntry:!1})},ii=function(e){var n=nr(e,!1);return ri(n)||(n!==e&&ii(n),ti().mkdirSync(n)),e},ui=function(e){return ii(e),ti().mkdirSync(e),e},oi=function(e){return ri(e)?e:ui(e)},ai=function(e,n){if(Jn(e))return require(e);if(Xn(e))return vt(e);try{return require(e)}catch(e){}var t=__dirname,r=process.mainModule?.path;if(r!==t)try{return Nt(r,e)}catch(e){}var i=process.cwd();if(i!==r&&i!==t)try{return Nt(i,e)}catch(e){}var u=ei("node.require.customDirs");if(u)for(var o of u)try{return Nt(o,e)}catch(e){}var a=ni(n?.autoInstall,"node.require.autoInstall"),l=ni(n?.promptInstall,"node.require.promptInstall",!0);if(a||l){var s=a||l;!0===s&&(s="./node_modules"),s=pt(s);var c=!1;if(a?(c=!0,console.log('Auto-installing "'+e+'" from npm to "'+s+'"...')):(c=Ur('Npm package "'+e+'" is required. Install now? (Y/N) '))&&console.log('Installing "'+e+'" from npm to "'+s+'"...'),c){s=oi(s),st(e,!1,{cwd:s});try{return Xr(s),Nt(s,e)}catch(e){console.error("Failed to load from auto-install dir: ",s)}}}throw Nn('Module not found: "'+e+'"',{checked:{moduleDir:t,scriptDir:r,cwd:i}})},li=L(function(){if(!globalThis.CustomEvent||!globalThis.EventTarget||!globalThis.Event){var e=ai("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}}),si=li().EventTarget,ci=function(e){var n=Qn,t=e[n];return void 0===t&&(t=new si,T(e,n,t)),t},fi=Vn("EventInterface",{addEventListener(e,n,t){ci(this).addEventListener(e,n,t)},on(e,n){this.addEventListener(e,n)},removeEventListener(e,n){ci(this).removeEventListener(e,n)},off(e,n){this.removeEventListener(e,n)},dispatchEvent(e){return ci(this).dispatchEvent(e)}}),pi=fi,vi=function(e){return Un(e,pi)},hi=function(e){return!(!e.addEventListener&&!e.on)},di=function(e){return hi(e)||vi(e),e},mi=function(e,n,t){return e[n]=t,e},gi=function(e,n,t){return mi(e||{},n,t)},yi=function(e,n,t,r){return ji(e,n,t,gi(r,"once",!0))},bi=function(e,n){return function(){var t=n.apply(this,arguments);return e.apply(this,arguments),t}},wi=bi,Ei=function(e,n,t){return e[n]=wi(e[n],t)},xi=e(class{constructor(e){this._remover=e}remove(){this._remover()}removeOn(e,n,t){t&&di(e);var r=yi(target,n,()=>this.remove());return Ei(this,"remove",()=>r.remove()),this}},Dn),Ti=class extends xi{constructor(e,n){super(e),this.handleEvent=n}},Oi=function(e,n){return new Ti(e,n)},Si=function(e,n,t){(e.removeEventListener||e.off).call(e,n,t)},_i=function(e,n,t){for(var r=e.length-1;r>=n;r--)e[r+1]=e[r];return e[n]=t,e.length++,e},Ai=function(e,n){return _i(e,0,n)},Ni=Ai,ji=function(e,n,t,r){if(r?.valueFirst){var i=t;t=function(e){var[n,t]=Gn(e);return Ni(arguments,n),arguments[1]=t,i.apply(this,arguments)}}var u=e.addEventListener;return u||(e.on?u=r?.once?e.once:e.on:(vi(e),u=e.addEventListener)),u.call(e,n,t,r),Oi(()=>Si(e,n,t),t)},Ii=class extends xi{constructor(e){super(()=>clearInterval(e))}stop(){this.remove()}},Fi=function(e,n){return new Ii(setInterval(n,e))},ki=function(){},Ci=function(){return Fi(1e9,ki)},Li=function(){return Bn([Ci(),ji(process,"uncaughtException",console.error),ji(process,"unhandledRejection",console.error)])},Di=function(e){var n=pt(e);return delete require.cache[n],vt(n)},Mi=L(function(){var e=process.env.TITAN_PATH;if(!e)throw Nn("Environment variable TITAN_PATH is not set.");return Tt(e)}),Pi=L(function(){return Mi()+"Compiled/"}),Ri=function(e){return ti().readFileSync(e,"utf8")},qi=function(){return new Date},Bi=function(e){return new Date(e.getTime())},Gi=function(e){return new Date(e,null)},Ki=function(e){var n=new Date(e);return isNaN(n.getTime())?null:n},Wi=function(e){return isNaN(e)?null:e},Hi=function(e){return null==e?null:Wi(Number(e))},zi=Hi,Yi=function(e){var n=typeof e;return"number"===n||"bigint"===n},Ui=function(e,n){if(null==e)throw Br(e,0);if(e.constructor===Date)return n?Bi(e):e;if(u(e)){var t=zi(e);return null!=t?Gi(t):Ki(e)||null}return Yi(e)?Gi(e):void 0},Vi=function(e,n){return null==e?qi():Ui(e,n)},Qi=function(e){return Vi(e,!0)},$i=Qi,Ji=function(){var e=Pi()+"LastCompileTime.txt";return ri(e)?$i(Ri(e)):null},Xi=function(e,n){return ti().statSync(e,n)},Zi=function(e,n){return ti().lstatSync(e,n)},eu=function(e,n,t){return(n?Xi:Zi)(e,t)},nu=function(e){return eu(e).mtime},tu=function(e,n,t){return e=Ui(e),n=Ui(n),!1===t?e<n:e<=n},ru=function(e){var n=Ji();if(n){var t=nu(e);if(tu(t,n))return!0}return!1},iu=/(['"])(.*?)\1/,uu=ln(iu),ou=function(e){return e.replace(uu,"")},au=ou,lu=function(e){return globalThis.structuredClone(e)},su=lu,cu=en,fu=/\r?\n/,pu=function(e){return null==e||void 0!==e.length&&0===e.length},vu=function(e,n){return tt(e,pu)},hu=function(e,n){return e.splice(n,1),e},du=function(e,n,t){for(var r={},i=e.length,u=0;u<i;u++){var o=n(e[u],u,e);if(o){var[a,l]=o;t?(r[a]||(r[a]=[]),r[a].push(l)):r[a]=l}}return r},mu=function(e,n,t,r){return[n,t]=re(e,n,t,r),e.slice(n,t)},gu=function(e,n){return Ae(n,e).join("")},yu=function(e){return e?e[0]:null},bu=function(e,n){var t=null==n?-1:n.index;if(-1===t)return[e];var r=Dt(e,t);return r[1]=r[1].slice(n[0].length),r},wu=function(e,n,t,r,i){return bu(e,Ar(e,n,t,r,i))},Eu=Hi,xu=function(e){return Eu(e)??e},Tu=function(e,n){null==n&&(n="=");var t={};return e.forEach(function(e){var[r,i]=wu(e,n);null!=i&&(i=xu(i.trim())),t[r.trim()]=i}),t},Ou=N,Su=class extends Array{constructor(e){var n,t=e;null!=t&&(o(t)?n=t:u(t)&&(n=t.split(fu))),n?(super(n.length),Object.assign(this,n)):super(...arguments)}condense(e){return this.trim().removeEmpty(),e&&this.removeComments(e),this}trim(){return this.apply(e=>e.trim())}removeEmpty(){return vu(this)}removeComments(e){for(var n=0;n<this.length;n++){var t=this[n],r=t.indexOf(e);-1!==r&&(""===(t=t.slice(0,r)).trim()?(hu(this,n),n--):this[n]=t)}return this}removeFirst(){return this.shift(),this}removeLast(){return this.pop(),this}apply(e){return ie(this,e)}join(){return super.join("\n")}toObj(e){return Tu(this,e)}mapToObj(e,n){return du(this,e,n)}between(e,n,t){return t=Ou(t,"inclusiveEnd",!0),mu(this,e,n,t)}normalize(){if(this.length>0&&(""===this[0].trim()&&this.shift(),this.length>0&&(""===mt(this).trim()&&this.pop(),this.length>0))){var e=this.find(e=>""!==e.trim()),n=yu(_r(/^\s*/,e));if(n){var t=n.length;this.apply(e=>{if(e.startsWith(n))return e.slice(t)})}}return this}deindent(e,n,t){throw I()}indent(e,n){var t=gu(n??"\t",e??1);return this.apply(e=>t+e)}static is(e){return se(e,this)}static fromChunks(e){return e.map(e=>Lt(e,fu)).flatMap(e=>Au(e,!1))}},_u=function(e,n){var t=new Su(e);return n&&t.condense(),t},Au=function(e,n,t){var r=e.split(fu);return n?_u(r,t):r},Nu=Ri,ju=function(e,n){return Au(Nu(e),!0,n)},Iu=function(e,n){return Sr(e).test(n)},Fu=function(e,n){return Se(n)?Iu(n,e):e.includes(n)},ku=function(e,n,t,r){null==e&&(e=""),null==n&&(n="");var i={},u=(t,r)=>i[e+t+n]=r;return r&&En(r,u),t&&En(t,u),i},Cu=function(e,n){return En(n,(n,t)=>e=hn(e,n,t)),e},Lu=function(e,n,t,r){var i,a,l=r?.paramIdentifier??"$";if(l)if(u(l)){if(!Fu(e,l))return e;i=l}else{if(!o(l))throw Yn(l,1,"paramIdentifier");if([i,a]=l,!Fu(e,i)&&!Fu(e,a))return e}var s=ku(i,a,n,t);return Cu(e,s)},Du=function(e){return u(e)?e:String(e)},Mu=globalThis.process?.env.windir,Pu=ge("os"),Ru=function(){return Pu().tmpdir()+ft},qu=function(e){if(e)throw I();return Pu().homedir()+ft},Bu=function(e){return qu(e)+"Desktop/"},Gu={PROGRAMFILES:globalThis.process?.env.ProgramFiles,WINDIR:Mu,SYSTEM32:Mu&&Mu+"System32",TEMP:Ru(),DESKTOP:Bu()},Ku=function(e,n){return Lu(Du(e),n,Gu)},Wu=function(){return Mi()+"Source/SourceMap.txt"},Hu=function(e){return e?Ku(e,{TITAN:Mi()}):Wu()},zu=function(e,n,t,r,i){return xe(e,n,t,r,(e,n)=>-1===e?-1:void 0===n?e:n+e,i)},Yu=function(e,n){return Array.prototype.findIndex.call(e,n)},Uu=function(e,n,t,r,i){var o=u(n);return o&&null==r&&!i?e.indexOf(n,t):zu(e,e=>o?e.indexOf(n):Se(n)?e.search(n):Yu(e,n),t,r,i)},Vu=function(e,n,t,r,i){var u=Uu(e,n,t,r,i);return-1===u?null:e.slice(t,u)},Qu=function(e){var n=e[0];return n===n.toUpperCase()},$u=cu(function(e){var n=ju(Hu(e),!0),t={};return n.forEach(e=>{var n=Vu(e,"=").split(",").map(e=>e.trim()),[r,i]=Q(n,e=>!Qu(e)),u=r[0];if(!u)throw Nn('No shortName in SourceMap line: "'+e+'"');i.forEach(e=>{t[e]=u})}),t},0),Ju=L(function(e){var n=Object.keys(e);return fn("\\b("+n.join("|")+")\\.(\\w+)","g")}),Xu=/\bt\.(\w+)\.(\w+)/g,Zu=function(e,n){n||(n={});var t={},r=t.t={};if(n.enableGlobals){var i;i=n.additionalGlobals?su(n.additionalGlobals):{},t.globals=i;var u=$u(),o=Ju(u),a=bt(o,e).filter(n=>{var t=n[1],r=n[2],i=e[n.index-1];if("."===i||"_"===i)return!1;var u=globalThis[t];return!u||void 0===u[r]});for(var[l,s,c]of a)i[s]||(i[s]={}),i[s][c]=!0;var f=a.map(([e,n,t])=>{var r=u[n];if(!r)throw Nn("No short name found for global: "+n);return"t."+r+"."+t+";"}).join(" ");e+="\n"+f}for(var[l,p,c]of a=e.matchAll(Xu))r[p]||(r[p]={}),r[p][c]=!0;return t},eo=function(e,n){return e=cr(e),e=au(e),Zu(e,n)},no=function(e,n){return n in e},to=no,ro=function(e,n){for(var t of(Gr(n,1),Object.keys(e))){if(!to(n,t))return!1;var r=e[t];if(r&&r.constructor===Object&&!ro(r,n[t]))return!1}return!0},io=function(e,n){return!ro(n.t,e)||!(!n.globals||e._globals&&ro(n.globals,e._globals))},uo=function(e){return xt(e,ft)},oo=function(e){var n=e.lastIndexOf(ft);return-1===n?null:e.slice(0,n+1)},ao=function(e,n,t){if(uo(e))return t?[e,null]:e;var r,i,u=oo(e),o=n(Xt(e),u,e);return t?[r,i]=o:r=o,null!=r&&(e=u?u+r:r),t?[e,i]:e},lo=function(e,n,t,r,i){return dr(e,e=>{if(Se(n))return wt(n,e);if(u(n)){var t=e.lastIndexOf(n);return-1!==t?new br(n,t):null}throw Yn(n,1)},t,r,i)},so=function(e,n,t,r,i){return bu(e,lo(e,n,t,r,i))},co=function(e){return ao(e,e=>so(e,"."),!0)},fo=function(e,n){var t=co(e)[1];return t?!1!==n?t.toLowerCase():t:null},po=function(e,n){return Zu(e,n)},vo=function(e,n){var t=n?.fileType;if(t){if("js"===(t=t.toLowerCase()))return eo(e,n);if("html"===t)return po(e,n)}return Zu(e,n)},ho={},mo=cu(function(e){e=Hu(e);var n=nr(e)+"../Compiled/",t=ju(e,"//"),r=ho;for(var i of t){var u=i.indexOf("="),o=i.slice(0,u).trim();o=o.split(",").map(e=>e.trim()).filter(e=>!Qu(e));var a=i.slice(u+1).trim(),l=Ot(n,a).replaceAll("\\","/");for(var s of o)r[s]=l}return r},0),go=function*(e,n){var t=0;for(var r of e)n(r,t++,e)&&(yield r)},yo=function(e){return e.slice()},bo=function(e,n){return _i(e,e.length,n)},wo=bo,Eo=function(e,n){return e.call(this,...n,function n(){return mt(arguments)!==n&&wo(arguments,n),e.apply(this,arguments)})},xo=function(e){e||(e={});var n=e.getKeys;n||(n=function(e){return Object.keys(e)});var t=e.recurseIf;if(!t){var r=this.constructor;t=e=>se(e,r)||fe(e)||o(e)}var i=e.leavesOnly??e.leafsOnly??!1,u=this;return Eo(function*(e,r,o,a){var l=n(e,r,o);if(l)for(var s=l.length,c=0;c<s;c++){var f=l[c],p=e[f],v=yo(r);v.push(f);var h=null,d={value:p,key:f,object:e,path:v,level:o,isLeaf:h,root:u},m=t(p,d);d.isLeaf=h=!m,i&&!h||(yield d),m&&(yield*a(p,v,o+1,a))}},[this,[],0])},To=function(e,n){return xo.call(e,n)},Oo=function(e,n){1===arguments.length&&(n=!0);var t={};for(var r of e)t[r]=n;return t},So=function(e,n,t,r){var i=sr(e,n,r);ai("acorn-walk").full(i,t)},_o=function(e,n,t,r){var i;if(u(t))i=e=>e.type===t;else if(o(t)){var a=Oo(t);i=e=>a[e.type]}else i=t;var l=[];return So(e,n,function(e){i.apply(this,arguments)&&l.push(e)},r),l},Ao=ar,No=function(e){var n,t,r,i=e,o=u(i)?sr(i).body[0]:i,a=o.type;if("VariableDeclaration"===a){n="variable";var l=o.declarations[0];t=l.id.name,r=l.init?l.init.raw??ar(l.init):"undefined"}else"FunctionDeclaration"===a?n="function":"ClassDeclaration"===a&&(n="class"),t=o.id.name;var s={type:n,name:t};return r&&(s.value=r),s.text=Ao(o),s.node=o,s},jo=function(e){return _o(e,!0,["ExportNamedDeclaration","ExportDefaultDeclaration"]).map(function(e){var n=e.declaration;if(n){var t=No(n);return t.node=e,t}return{node:e}})},Io=function(e,n){n||(n={});var t=n.enableGlobals,r=mo(n.sourceMap),i={},u=[];return function e(n,o){var a=go(To(n),e=>e.isLeaf);for(var l of a){var[s,c]=l.path,f=i[s];if(f||(f=i[s]={}),null==f[c]){var p=r[s];if(p){var v=Kt(p)+c+".js";if(!ri(v)){var h='Titan compiled value "t.'+s+"."+c+'" does not exist';throw o&&(h+=' (called by "'+o+'")'),Nn(h+=".")}var d=Ri(v),m=jo(d)[0];f[c]=m;var g="t."+s+"."+c;e(vo(d,{fileType:"js",enableGlobals:t}).t,g),u.push([s,c])}else console.log('Skipping unmapped module "'+s+'"'),f[c]=!1}}}(e.t),{t:i,globals:e.globals,order:u}},Fo=function(e){return _u(e).normalize().join()},ko=Fo,Co=function(e,n){var t=e,r=c(t)?Pr(t):t;return!1!==n&&(r=Fo(r)),r},Lo=function(e,n,t){H(e,t).forEach(n)},Do=function(e,n,t){return jt(e||{},n,t)},Mo=function(e,n,t){return n?Do(e,n,t):e??{}},Po=function(e,n,t){if(Object.hasOwn(e,n)){var r=e[n];return delete e[n],t?t(r,e,n):r}},Ro=function(e,n){En(n,(n,t)=>Po(e,n,t))},qo=Ro,Bo=function(e,n,t){return null==(n=Mo(n,t)).compress&&(n.compress={}),null==n.mangle&&(n.mangle={}),null==n.format&&(n.format={}),qo(n,{isModule:e=>n.compress.module=e,originalQuotes:e=>n.format.quote_style=e?3:null,mangleEval:e=>n.mangle.eval=e,mangleExcept:e=>n.mangle.reserved=a(e)}),null==n.toplevel&&(n.toplevel=!0),null==n.compress.passes&&(n.compress.passes=1/0),e=cr(e),ai("terser").minify_sync(e,n).code},Go=function(e,n){n||(n={});var t=n.minify??!1,r=n.debug??!1,i=n.deps??vo(e,n),{t:u,globals:o,order:a}=Io(i,n),l="//Flat references:\n";for(var[s,c]of a){var f=u[s][c],p="t_"+s+"_"+c,v="variable"===f.type?f.value:"("+f.text+")";v=v.replaceAll(Xu,(e,n,t)=>"t_"+n+"_"+t),l+="var "+p+" = "+v+"\n"}for(var[s,h]of(r&&(l+="//Debug functions:\n",l+=ko('\n function _isFn(value) {\n return typeof value === "function";\n }\n function _withName(value, name) {\n if(_isFn(value)) { Object.defineProperty(value, "name", {value:name}); }\n return value;\n }\n\n ')),l+="//New tree items:\n",l+="var newItems = {",ae(u))){for(var c of(l+="\n\t"+s+": {",Object.keys(h))){var d="t_"+s+"_"+c;r&&(d="_withName("+d+", 't."+s+"."+c+"')"),l+="\n\t\t"+c+": "+d+","}l+="\n\t},"}if(l+="\n}\n",l+="//Add items to t:\n",l+=Fo("\n if(globalThis.t) {\n //If t already exists, integrate new items.\n Object.keys(newItems).forEach(function(modName) {\n if(t[modName]) {\n var newModule = newItems[modName];\n Object.keys(newModule).forEach(function(item) {\n t[modName][item] = newModule[item];\n });\n } else {\n t[modName] = newItems[modName];\n }\n });\n } else {\n globalThis.t = Object.assign({}, newItems);\n }\n "),n.enableGlobals&&o){l+="\n//Add weak global aliases:\n",l+=Co("\n if(!t._globals) { t._globals = {}; }\n function _ensureGlobal(name) {\n if(!globalThis[name]) { globalThis[name] = {}; }\n if(!t._globals[name]) { t._globals[name] = {}; }\n }\n function _weakGlobalize(globalName, shortName, itemName) {\n var globalObj = globalThis[globalName];\n if(!globalObj[itemName]) { globalObj[itemName] = t[shortName][itemName]; }\n t._globals[globalName][itemName] = true;\n }\n ");var m=$u();En(o,(e,n)=>{l+='\n_ensureGlobal("'+e+'");',Lo(n,n=>{var t=m[e];l+='\n_weakGlobalize("'+e+'", "'+t+'", "'+n+'");'})})}if(l+="\n//Export t:",l+="\nif(globalThis.exports) { exports.default = globalThis.t; }",t){var g=ce(t)?t:null;l=Bo(l,g,{mangleExcept:["t","_t"],mangleEval:!0})}return l},Ko=function(e){return e instanceof Buffer},Wo=function(e){return ArrayBuffer.isView(e)},Ho=Wo,zo=function(e){return Ko(e)||Ho(e)||u(e)},Yo=function(e){return e.constructor===ArrayBuffer},Uo=function(e){return zo(e)?e:Yo(e)?Buffer.from(e):yn(e)},Vo=function(e){return Yi(e)?String(e):Uo(e)},Qo=function(e,n){return ii(e),ti().writeFileSync(e,Vo(n)),e},$o=function(e,n,t){t||(t={}),t.fileType||!n||t.deps||(t.fileType=fo(n));var r=Go(e,t),i=t.packagePath||tr(n,t.repl);return Qo(i,r),i},Jo={titan:{harness:function(e,n){n||(n=e,e=null);var r=e??{};null==r.minify&&(r.minify=!1),r.keepAlive&&Li();var i,u,o=r.packagePath||tr();if(o=pt(o),ri(o)){if(ru(o)&&(i="New compile"),!i){u=r.text??Pr(n);var a=eo(u,r);require(o),io(t,a)&&(i="New deps")}}else i="No package";return i&&(r.onPack&&r.onPack(i),null==u&&(u=r.text??Pr(n)),r.packagePath=o,$o(u,Qt(),r),Di(o)),n()},getPackagePath:tr,getPackageName:er,hasNewCompile:ru,getLastCompileTime:Ji,getCompiledDir:Pi,locate:Mi,getDepsFromJS:eo,_getDepsBasic:Zu,loadGlobalsMap:$u,_resolveSourceMapPath:Hu,locateSourceMap:Wu,_getGlobalsRegex:Ju,depsRegex:Xu,hasNewDeps:io,packTextToFile:$o,packText:Go,getDeps:vo,getDepsFromHTML:po,_getAllDeps:Io,loadSourceMap:mo,sourceMap:ho},node:{keepAlive:Li,is:D,display:be,util:ye,_builtInModule:ge,requireBuiltIn:me,require:ai,_basicRequire:$n,child_process:it,requireLocal:vt,path:ct,_requireFromDir:Nt,_requireDirCache:dt,_createRequire:At,module:_t,promptYNSync:Ur,run:qr,getScriptPath:Qt,positionalArgs:Vt,args:Wt,sigint:zr,interrupt:Hr,ensureRequireDir:Xr,addRequireDir:Jr,fs:ti,reloadRequireLocal:Di,os:Pu},ev:{multiHandle:Bn,on:ji,resolveValue:Gn,enable:vi,EventInterface:pi,Interface:fi,_ensureHasTarget:ci,targetSym:Qn,EventTarget:si,polyfill:li,handle:Oi,ListenerHandle:Ti,ensureEnabled:di,can:hi,once:yi,off:Si},o:{multiHandle:qn,isAny:y,setHidden:T,addNonEnumerable:x,defineProperty:E,weakAssign:w,merge:b,safeEnsure:N,ensure:A,hideKey:B,makeNonEnumerable:q,filterSplit:J,keys:H,allKeys:W,split:$,pick:z,iterateAll:le,iterate:ae,iterator:oe,entries:ue,isPure:fe,is:ce,setProtoLazy:he,setGetter:pe,forceSet:ve,display:On,toLiteral:Tn,constructorMatches:Oe,ensureCustom:ke,get:je,set:Ie,createEmpty:Ge,remove:Ve,reduce:xn,each:En,addInterface:Un,Cache:ht,setDefaults:It,ensureMulti:jt,resolveKeys:Vr,diveGet:Zr,safeSet:gi,touch:mi,deepCopy:su,fromLines:Tu,safeDefault:Ou,hasKey:to,has:no,fromKeys:Oo,eachKey:Lo,safeSetDefaults:Mo,safeEnsureMulti:Do,consumeOptions:qo,consumeMulti:Ro,consume:Po},handle:{createMulti:Rn,MultiHandle:Mn,HandleInterface:Dn,Handle:xi},class:{addInterface:e,create:R,setName:k,addStatics:C,setDisplay:P,isInterface:Wn,interface:Vn},ifc:{create:Cn,Interface:kn,is:Kn},f:{createClass:G,ensureConstructor:d,createConstructor:h,isArrowFn:p,isArrow:f,is:c,wrap:v,retThis:m,setName:F,one:L,eq:K,memoize:en,MemoizedFunction:Ze,not:nt,body:Pr,isArrowString:hr,_getArrowFnBody:Dr,_getNormalFnBody:Mr,hookAfterMethod:Ei,hookAfter:wi,injectAfter:bi,interval:Fi,TimerHandle:Ii,noop:ki,cache:cu,recurse:Eo},s:{is:u,isAny:i,isPrimitive:n,isObject:r,toLiteral:gn,quote:mn,escape:dn,replaceAll:hn,apply:Te,withIndices:xe,chars:nn,from:yn,spaceBefore:In,fromKey:Fn,endsWith:xt,resolveIndex:gt,removeTrailing:Lt,removeFromEnd:Ct,_removeStringFromEnd:Ft,_removeRegexFromEnd:kt,splitAtIndex:Dt,ensureStartsWith:Pt,replace:Gt,decapitalize:$t,removeLineBreaks:or,removeMulti:ur,removeAll:ir,resolve:Rr,ensure:vr,after:jr,match:Ar,_matchWithIndices:dr,remove:xr,removeLeading:Lr,removeFromStart:Cr,_removeStringFromStart:Ir,_removeRegexFromStart:kr,removeQuotes:ou,splitLines:Au,lines:_u,LinesArray:Su,repeat:gu,splitFirst:wu,_splitByMatch:bu,replaceParams:Lu,contains:Fu,_createParamsObj:ku,_replaceByObj:Cu,before:Vu,index:Uu,_indexWithIndices:zu,indexOfFn:Yu,isCapitalized:Qu,splitLast:so,matchLast:lo,normalize:ko,normalizeMLS:Fo,mls:Co},a:{is:o,ensure:a,filterSplit:Q,iterate:ne,iterator:ee,apply:ie,resolveIndices:re,resolveIndex:te,wrapIndices:Ee,wrapIndex:we,pick:Ne,create:Ae,fill:_e,push:Re,add:Pe,splitLast:We,splitTail:Ke,toLiteral:bn,display:Sn,unboxArgs:Pn,removeNullish:rt,removeByFilter:tt,replaceContents:et,last:mt,pushMulti:yr,addMulti:gr,pushThroughMulti:mr,removeEmpty:vu,removeIndex:hu,mapToObj:du,slice:mu,copy:yo},p:{asyncJoint:s,is:l},v:{isPrimitive:g,constructorMatches:se,display:_n,toLiteral:wn,resolve:Fe,type:zn,req:Gr,nullIfNaN:Wi,isEmpty:pu},err:{nyi:I,NYIError:_,Error:S,Enhanced:O,defaultFromFn:j,value:An,ValueError:de,create:Nn,type:Yn,TypeError:Hn,prepend:lr,req:Br},sym:{display:M,value:Be,cleanup:Ln},macro:{config:function(e){}},set:{resolve:V,ensure:U,is:Y},n:{cap:Z,least:X,fromString:zi,ensure:Hi,is:Yi,tryCoerce:xu,tryParse:Eu},re:{is:Se,ensureGlobal:sn,global:ln,addFlag:an,copy:on,updateFlagString:un,parseFlagString:tn,createFlagString:rn,createEscaped:vn,create:fn,resolveFlags:cn,escape:pn,matchEnd:Et,matchLast:wt,matchAll:bt,setStartIndex:yt,safeCreateResult:Er,createResult:wr,RegexResult:br,match:_r,ensureLocal:Sr,local:Or,removeFlag:Tr,resultEndIndex:Nr,matchStart:Fr,quotes:uu,quote:iu,newline:fu,text:yu,test:Iu},map:{Cache:Me,ensure:De,get:Ce,set:Le,MultiCache:Xe,diveEnsure:Ue,createEmpty:Ye,diveDelete:Je,remove:$e},args:{ensureArray:qe,unshift:Ni,prepend:Ai,insert:_i,push:wo,append:bo},tree:{ensure:ze,dive:He,remove:Qe,setCustom:Qr,copy:lu,isSubsetOf:ro,iterate:To,iterator:xo},gen:{join:jn,filter:go},npm:{isBuiltIn:Jn,isFile:Xn,install:st,_runCommand:lt},os:{run:at,_resolveStdio:Zn},win:{is:ut},shell:{_handleError:ot},path:{abs:pt,sep:ft,ensureEndsWith:St,join:Ot,ensureTrailingSlash:Tt,fws:Kt,baseName:Zt,_removeExtsFromFile:Jt,file:Xt,dir:nr,resolveVars:Ku,string:Du,_defaultParams:Gu,windir:Mu,_getDefaultTempDir:Ru,getDesktop:Bu,getUserDir:qu,ext:fo,splitExt:co,ignoreDir:ao,isDir:uo,dirPart:oo},js:{enhance:pr,ensureReturn:Rt,splitLastExpression:Mt,enableAwait:Bt,_nodeEnableAwait:qt,useTitan:rr,inline:fr,removeComments:cr,fromAST:ar,parse:sr,removeQuotes:au,getExports:jo,getNodes:_o,eachNode:So,parseDeclaration:No,fromASTNode:Ao,minify:Bo},cli:{positionalArgs:Ut,resolveArgs:Yt,splitArgs:zt},env:{args:Ht,setConfig:$r,getConfig:ei,resolveConfig:ni,keepAlive:Ci},proc:{interrupt:Wr,signal:Kr},bool:{fromYN:Yr},fs:{ensureDir:oi,exists:ri,mkdir:ui,ensureParent:ii,load:Ri,getModifiedDate:nu,stat:eu,deepStat:Xi,shallowStat:Zi,loadLines:ju,loadText:Nu,write:Qo,formatRaw:Vo},d:{from:$i,create:Qi,resolve:Vi,now:qi,ensure:Ui,copy:Bi,fromYear:Gi,_resolveNative:Ki,isBefore:tu},bin:{ensureByteSafe:Uo,isByteSafe:zo,isNodeBuffer:Ko,isTA:Ho},ab:{isTA:Wo,is:Yo}};globalThis.t?Object.keys(Jo).forEach(function(e){if(t[e]){var n=Jo[e];Object.keys(n).forEach(function(r){t[e][r]=n[r]})}else t[e]=Jo[e]}):globalThis.t=Object.assign({},Jo),globalThis.exports&&(exports.default=globalThis.t);
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "titanfiber",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.142",
|
|
4
4
|
"description": "",
|
|
5
5
|
"exports": {
|
|
6
|
-
".": "./router.
|
|
7
|
-
"./script": "./script.
|
|
8
|
-
"./custom": "./custom.
|
|
9
|
-
"./eval": "./eval.
|
|
10
|
-
"./harness": "./harness.
|
|
11
|
-
"./repl": "./repl.
|
|
12
|
-
"./cli": "./cli.
|
|
13
|
-
"./build": "./build.
|
|
14
|
-
"./build/stable": "./build_stable.
|
|
6
|
+
".": "./router.js",
|
|
7
|
+
"./script": "./script.js",
|
|
8
|
+
"./custom": "./custom.js",
|
|
9
|
+
"./eval": "./eval.js",
|
|
10
|
+
"./harness": "./harness.js",
|
|
11
|
+
"./repl": "./repl.js",
|
|
12
|
+
"./cli": "./cli.js",
|
|
13
|
+
"./build": "./build.js",
|
|
14
|
+
"./build/stable": "./build_stable.js"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {},
|
|
17
17
|
"author": "",
|
package/router.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
for(var e={},r=process.argv,o=r.length,i=0;i<o;i++)e[r[i]]=!0;if(e["--nf"]);else if(e["--dev"]&&!globalThis.__routedToLocal){globalThis.__routedToLocal=!0;var s="/links/"+("win32"===process.platform?"win/":"")+"titanfiber/",l=require("node:path").join(process.env.TITAN_PATH,s,"Dist");console.log("Local titanfiber"),module.exports=require(l+"/router.js")}else process._eval?module.exports=require("./eval.js"):require.main?.filename?module.exports=require("./script.js"):e["--cli"]&&(module.exports=require("./cli.js"));
|
package/router.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
for(var e={},
|
|
1
|
+
for(var e={},o=process.argv,r=o.length,i=0;i<r;i++)e[o[i]]=!0;if(console.log("LOCAL"),e["--nf"]);else if(e["--dev"]&&!globalThis.__routedToLocal){globalThis.__routedToLocal=!0;var l="/links/"+("win32"===process.platform?"win/":"")+"titanfiber/",s=require("node:path").join(process.env.TITAN_PATH,l,"Dist");console.log("Local titanfiber"),module.exports=require(s+"/router.min.js")}else process._eval?module.exports=require("./eval.min.js"):require.main?.filename?module.exports=require("./script.min.js"):e["--cli"]&&(module.exports=require("./cli.min.js"));
|
package/script.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require("./script.pkg.js");var a=globalThis.__titanfiberOptions??{},e=t.node.getScriptPath(),i=e?t.fs.loadText(e):process._eval;if(!e&&null==i)throw new Error("titanfiber/script requires either scriptPath or scriptText.");var n={};dynPackagePath=e?t.titan.getTempDir()+"TitanFiber/"+t.path.baseName(e)+"_"+t.fs.getID(e)+"/main.pkg.json":t.titan.getPackagePath(null,!1,!0,a),a.packagePath=dynPackagePath,a.enableGlobals=!0,t.fs.exists(dynPackagePath)&&!t.titan.hasNewCompile(dynPackagePath)&&t.titan._loadDynamicDeps(dynPackagePath,n,a),t.titan.autoPackAndLoadJSON(e,i,n,a),globalThis.t=n;
|
package/script.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,i=function(e){return"string"==typeof e},u=function(e){return e instanceof String},o=function(e){return i(e)||u(e)},a=o,s=function(e,n){const r=[];let i="",u="outside",o=!1;for(let a=0;a<e.length;a++){const s=e[a];switch(u){case"outside":'"'===s?o?(i+=s,o=!1):(n&&(i+=s),u="insideQuote"):"\\"===s?o=!0:" "===s?(i.length>0&&(r.push(i),i=""),o=!1):(i+=s,o=!1);break;case"insideQuote":'"'!==s||o?"\\"!==s||o?(i+=s,o=!1):o=!0:(n&&(i+=s),u="outside")}}return i.length>0&&r.push(i),r},l=function(e,n){var i=e;return null==i?r():a(i)?s(i,n):i},c=function(e,n){return l(e,n).slice()},f=c,p=function(){var e=require.main?.filename;return e||(null!=process._eval?null:f(process.argv)[1])},d=function(e){return require("node:"+e)},h=function(n){return e(()=>d(n))},v=h("fs"),m=function(e){return v().readFileSync(e,"utf8")},g=m,y=function(e,n){return v().statSync(e,n)},w=function(e,n){return v().lstatSync(e,n)},b=function(e,n,r){return(n?y:w)(e,r)},x=function(e,n){return b(e,n).ino},O=function(e){return!!v().lstatSync(e,{throwIfNoEntry:!1})},T=function(e){return class extends e{constructor(e,n){super(e,n);var r=this.constructor.name;r&&(this.name=r)}}},E=T(globalThis.Error),S=class extends E{constructor(e,n){super(e??"Not yet implemented",n)}},A=function(e){return"function"==typeof e},j=function(e,n,r,i){var u=e[n];if(void 0===u){var o=r;!1!==i&&A(o)&&(o=o(e,n)),e[n]=u=o}return u},N=function(e,n,r,i){return e||(e={}),j(e,n,r,i),e},k=function(e,n){return N(e,"fromFn",n,!1)},F=function(e,n){return new S(e,k(n,F))},I=h("os"),_=h("path"),D=_().sep,C=function(){return I().tmpdir()+D},P=function(e){if(e)throw F();return C()},L=function(){return P()+"Titan/"},M=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},R=function(e){return e.split(".")[0]},q=function(e){return _().win32.basename(e)},G=function(e){return R(q(e))},B=function(e,n,r,i){e||(e=p()??"_console.js");var u=M(G(e));return n&&(u+="_repl"),u+(r&&i?.dynamic?".dypkg.json":".pkg.js")},W=function(e,n){return null!=e&&e.constructor===n},K=W,J=function(e){return K(e,RegExp)},U=function(e){return e[e.length-1]},Y=function(e){return W(e,Object)},z=function(e){return new Set(e)},V=function(e){var n={};if(e){var r=z(e);r.has("g")&&(n.global=!0),r.has("i")&&(n.caseInsensitive=!0),r.has("y")&&(n.sticky=!0)}return n},H=function(e){var n="";return e.global&&(n+="g"),(e.caseInsensitive||0==e.caseSensitive)&&(n+="i"),e.sticky&&(n+="y"),n},Q=function(e,n){var r=V(e);return H(Object.assign(r,n))},$=function(e,n){var r=n,i=void 0;return a(r)?i=r:Y(r)&&(i=Q(e.flags,r)),new RegExp(e,i)},X=function(e,n){return n<0?e.length+n:n},Z=X,ee=function(e,n,r){return e=$(e,{global:!0}),null!=r&&(n=Z(r,n)),e.lastIndex=n,e},ne=function(e){return Array.isArray(e)},re=function(e){return ne(e)?e:[e]},te=function(e){return e instanceof Promise},ie=function(e,n){var r=e;return te(r)?r.then(n):n(r)},ue=function(e){return A(e)&&null==e.prototype},oe=ue,ae=function(e){return function(){return e.apply(this,arguments)}},se=function(e,n){var r;return r=n?function(){this.super=n;var r=e.apply(this,arguments);return ie(r,()=>(delete this.super,r))}:oe(e)?ae(e):e,r._isConstructor=!0,r},le=function(e,n){return e._isConstructor?e:se(e,n)},ce=function(){return this},fe=function(e){var n=typeof e;return"object"!==n&&"function"!==n||null===e},pe=function(e){return!fe(e)},de=function(e,n,r){return!1===r?Object.keys(n).forEach(r=>{void 0===e[r]&&(e[r]=n[r])}):Object.assign(e,n),e},he=function(e,n){return de(e,n,!1)},ve=function(e,n,r,i){return r||(r={}),i&&he(r,i),null==r.enumerable&&(r.enumerable=!0),null==r.configurable&&(r.configurable=!0),Object.defineProperty(e,n,r)},me=function(e,n,r,i){return ve(e,n,{value:r,writable:!0,enumerable:!1},i),r},ge=me,ye=function(e,n){Object.defineProperty(e,"name",{value:n,configurable:!0}),ge(e,"displayName",n)},we=ye,be=function(e,n){return Object.assign(e,n)},xe=function(e){},Oe=e(function(){return xe("node.is")??"undefined"==typeof window}),Te=Oe()?require("util").inspect.custom:Symbol("Display"),Ee=function(e,n){e.prototype[Te]=n},Se=function(e,n,r,i,u,o){o||(o={}),a(n)&&(n=null);var s,l,c,f=r;f&&(ne(f)?([l,c]=f,l&&(l=le(l))):s=le(f,n));var p=o.bareFn;o.singleton&&(p=function(){return null==v.default&&(v.default=new v(...arguments)),v.default});var d,h=l||s||n||ce;function v(){if(!new.target&&p&&!(this instanceof v))return p.apply(this,arguments);var e=this;return ie(h.apply(e,arguments),r=>{if(r&&pe(r)&&(e=r,l)){if(!new.target)throw F('Prototype repair is NYI for class instantiation without "new".');if(!n)throw F("instanceFn is not yet supported when extendsClass is null.");var i=Object.getPrototypeOf(this);Object.getPrototypeOf(e)!==i&&Object.setPrototypeOf(e,i)}return c?ie(c.apply(e,arguments),()=>e):e})}return e&&we(v,e),i?(d=i,n&&Object.setPrototypeOf(i,n.prototype)):d=n?Object.create(n.prototype):{},ge(d,"constructor",v),v.prototype=d,u&&be(v,u),o.display&&Ee(v,o.display),o.implements&&re(o.implements).forEach(e=>e(v)),v},Ae=function(e,n){Object.defineProperty(e,n,{enumerable:!1})},je=Ae,Ne=function(e,n,r,i,u){var o=Symbol();return Se(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,je(this,o)}],r,i,u)},ke=function(e,n,r,i){return n=null==n?0:X(e,n),r=null==r?e.length:X(e,r),i&&(0==i.inclusiveStart&&n++,i.inclusiveEnd&&r++),[n,r]},Fe=function(e,n,r,i){var u=n;if([r,i]=ke(e,r,i),A(u))for(var o=r;o<i;o++)e[o]=u(o,e);else e.fill(u,r,i);return e},Ie=function(e,n){var r=new Array(e||0);return arguments.length>1&&Fe(r,n),r},_e=function(e,n){return Ie(n.length,r=>e[n[r]])},De=function(e,n){return e[n]},Ce=function(e,n,r){return e[n]=r},Pe=function(e,n,r){var i=e;return A(i)?i.apply(r,n):i},Le=function(e,n,r,i,u){i||(i=De);var o=i(e,n);return void 0===o&&(o=Pe(r,[e,n]),u||(u=Ce),u(e,n,o)),o},Me=function(e,n){return e.get(n)},Re=function(e,n,r){return e.set(n,r)},qe=function(e,n,r){return Le(e,n,r,Me,Re)},Ge=class{constructor(){this.store=new Map}get(e,n){return qe(this.store,e,n)}remove(e){return this.store.delete(e)}delete(e){return this.remove(e)}},Be=function(e,n){return e.push(n),e},We=Be,Ke=function(e){var n=e;return Array.isArray(n)?n:Array.from(n)},Je=Symbol("Value"),Ue=function(){return{}},Ye=function(e){return[e.slice(0,-1),e[e.length-1]]},ze=Ye,Ve=function(e,n,r,i,u,o){r||(r=De),null==i&&(i=Ue),null==u&&(u=Ce),null==o&&(o=r);for(var[a,s]=ze(n),l=e,c=a.length,f=0;f<c;f++){var p=a[f],d=r(l,p);if(void 0===d){if(!i)return;d=Le(l,p,i,r,u)}l=d}if(o)return o(l,s,u)},He=function(e,n,r,i,u,o){return Ve(e,n,i,u,o,(e,n)=>Le(e,n,r,i,o))},Qe=function(){return new Map},$e=function(e,n,r){return He(e,n,r,Me,Qe,Re)},Xe=function(e,n){return delete e[n],e},Ze=function(e,n,r,i){return Ve(e,n,r,!1,!1,i||Xe)},en=function(e,n){return e.delete(n)},nn=function(e,n){return Ze(e,n,Me,en)},rn=class{constructor(){this.store=new Map}get(e,n){return e=We(Ke(e),Je),$e(this.store,e,n)}remove(e){return e=We(Ke(e),Je),nn(this.store,e)}delete(e){return this.remove(e)}},tn=Ne("MemoizedFunction",function(e,n){if(this.base=e,null!=n)if(1===(n=re(n)).length){this.cache=new Ge;var r=n[0];this._cacheKeyFormatter=e=>e[r]}else this.cache=new rn,this._cacheKeyFormatter=e=>_e(e,n);else this.cache=new rn,this._cacheKeyFormatter=e=>e;var i=this;return function(){var n=i._cacheKeyFormatter(arguments);return i.cache.get(n,()=>e.apply(this,arguments))}},{remove(e){return this.cache.remove(this._cacheKeyFormatter(e))}}),un=function(e,n){return new tn(e,n)},on=function(e,n){return $(e,e.flags+n)},an=function(e){return on(e,"g")},sn=un(function(e){return e.global?e:an(e)},0),ln=function(e,n,r){return e=null!=r?ee(e,r,n):sn(e),Array.from(n.matchAll(e))},cn=function(e,n,r){return null!=r&&(n=n.slice(0,r)),U(ln(e,n))||null},fn=function(e,n){var r=cn(e,n);return r&&n.length===r.index+r[0].length?r:null},pn=T(globalThis.TypeError),dn=function(e){return null==e?e:e.constructor},hn=h("util"),vn=function(e,n){return n||(n={}),null==n.colors&&(n.colors=!0),hn().inspect(e,n)},mn=X,gn=function(e,n,r,i){return void 0!==n&&(null===n||0===n?n=void 0:(n=mn(e,n),i&&0==i.inclusiveStart&&n++)),void 0!==r&&(null===r||r===e.length?r=void 0:(r=mn(e,r),i&&i.inclusiveEnd&&r++)),[n,r]},yn=function(e,n,r,i,u,o){if(r||null!=i){[r,i]=gn(e,r,i,o);var a=e.slice(r,i),s=n(a);return u?u(s,r,i,a,e):s}return n(e)},wn=function(e,n,r,i,u){return yn(e,n,r,i,(n,r,i)=>(void 0!==r?e.slice(0,r):"")+(n||"")+(void 0!==i?e.slice(i):""),u)},bn=function(e){var n=e;return null==n?void 0:a(n)?n:H(n)},xn=function(e,n){return new RegExp(e,bn(n))},On=function(e){return e.replace(/[-[\]{}()*+!<=:?.\/\\^$|#\s,]/g,"\\$&")},Tn=function(e,n){return xn(On(e),n)},En=function(e,n,r,i,u,o){return wn(e,function(e){return e.replaceAll?(J(n)&&(n=sn(n)),e.replaceAll(n,r)):(n=a(n)?Tn(n,"g"):sn(n),this.replace(n,r))},i,u,o)},Sn=function(e,n,r){return En(e,n,(r??"\\")+n)},An=function(e,n,r){return null==n&&(n='"'),!1!==r&&(e=Sn(e,n,r)),n+e+n},jn=function(e){return An(e,'"')},Nn=Y,kn=function(e){return Nn(e)?Ln(e):String(e)},Fn=function(e,n){return n||(n=In),"["+e.reduce(function(e,r){return e+n(r)+", "},"").slice(0,-2)+"]"},In=function(e){return a(e)?jn(e):ne(e)?Fn(e):kn(e)},_n=function(e){return Reflect.ownKeys(e)},Dn=function(e,n){return(n?_n:Object.keys)(e)},Cn=function(e,n,r){Dn(e,r).forEach((r,i,u)=>n(r,e[r],i,u))},Pn=function(e,n,r,i){var u=null!=r?r:"";return Cn(e,function(){u=n.call(this,u,...arguments)},i),u},Ln=function(e,n){return n||(n=In),"{"+Pn(e,function(e,r,i){return e+r+":"+n(i)+", "},"",!0).slice(0,-2)+"}"},Mn=function(e,n){return null==n&&(n=1),n<=0?"[object Object]":Ln(e,e=>qn(e,n-1))},Rn=function(e,n){return null==n&&(n=1),n<=0?"[object Array]":Fn(e,e=>qn(e,n-1))},qn=function(e,n){return void 0===e?"undefined":null===e?"null":Oe()?vn(e,n):Y(e)?Mn(e,maxNumLevels):ne(e)?Rn(e,maxNumLevels):kn(e)},Gn=function(e,n,r,i){if(0===arguments.length)return new pn("Unexpected type received");i||(i={});var u,{type:o,expected:a}=i;return null==o&&(o=dn(e)),o&&o.name&&(o=o.name),a?(a.name&&(a=a.name),u="Expected "+a+", received "):u="Unexpected type received (",u+=o,null!=e&&(u+=" ("+qn(e)+")"),a||(u+=")"),r&&(u+=' for "'+r+'"'),null!=n&&(u+=" (index "+n+")"),i.fromFn||(i.fromFn=Gn),new pn(u,i)},Bn=function(e,n){if(a(n))return e.endsWith(n);if(J(n))return!!fn(n,e);throw Gn(n,1,"matchThis")},Wn=function(e){return Bn(e,D)?e:e+D},Kn=function(e,n){return e=_().dirname(e),!1===n?e:Wn(e)},Jn=function(e,n,r){var i=_().resolve,u=n?i(n,e):i(e);return r?u+D:u},Un=function(e,n,r,i){var u,o=B(e,n,r,i);return u=e?Kn(e):"./",Jn(u+o)},Yn=function(e,n,r){var i=new E(e,r);return n&&Object.assign(i,n),i},zn=e(function(){var e=process.env.TITAN_PATH;if(!e)throw Yn("Environment variable TITAN_PATH is not set.");return Wn(e)}),Vn=e(function(){return zn()+"Compiled/"}),Hn=function(){return new Date},Qn=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 "+qn(e)+")"),Yn(u,null,k(i,Qn))},$n=function(e){return new Date(e.getTime())},Xn=function(e){return new Date(e,null)},Zn=function(e){var n=new Date(e);return isNaN(n.getTime())?null:n},er=function(e){return isNaN(e)?null:e},nr=function(e){return null==e?null:er(Number(e))},rr=nr,tr=function(e){var n=typeof e;return"number"===n||"bigint"===n},ir=function(e,n){if(null==e)throw Qn(e,0);if(e.constructor===Date)return n?$n(e):e;if(a(e)){var r=rr(e);return null!=r?Xn(r):Zn(e)||null}return tr(e)?Xn(e):void 0},ur=function(e,n){return null==e?Hn():ir(e,n)},or=function(e){return ur(e,!0)},ar=or,sr=function(){var e=Vn()+"LastCompileTime.txt";return O(e)?ar(m(e)):null},lr=function(e){return b(e).mtime},cr=function(e,n,r){return e=ir(e),n=ir(n),!1===r?e<n:e<=n},fr=function(e){var n=sr();if(n){var r=lr(e);if(cr(r,n))return!0}return!1},pr=function(e){var n=p();return n?Kn(n,e):null},dr=function(e){return JSON.parse(g(e))},hr=function(e,n,r,i,u){return ve(e,n,{get:r,set:i},u)},vr=hr,mr=function(e,n,r,i){return ve(e,n,{value:r,writable:!0},i)},gr=function(e,n,r,i){vr(e,n,function(){var i=r(n,e);return this[n]=i,i},function(e){mr(this,n,e,i)},i)},yr=function(e,n){var r=e.globals,i=e.shortNamesToGlobals;Object.keys(i).forEach(e=>{for(var u=i[e],o=u.length,a=0;a<o;a++){var s=u[a],l=globalThis[s];l||(l=globalThis[s]={});var c=r[s];Object.keys(c).forEach(r=>{var i=n[e][r];l[r]=i})}}),n._meta||(n._meta={}),n._meta.globals=e.globals},wr=function e(n,r,i){const u=_();if(n)n=u.resolve(pr(),n);else{var o=p();if(!o)throw new Error("Cannot find package name because scriptPath does not exist.");var a=u.dirname(o),s=u.basename(o).split(".")[0];s=s[0].toLowerCase()+s.slice(1),n=u.join(a,s+".pkg.json")}for(var l=dr(n),c=gr,f=l.itemsInOrder,d=f.length,h=0;h<d;h++){let e=f[h],[n,i,u]=e,o=r[n];o||(o=r[n]={}),Object.hasOwn(o,i)||c(o,i,function(){let t=r;return eval("("+u+")")})}l.globals&&yr(l,r)},br=function(e){return require(e)},xr=function(e){return!!e.startsWith("node:")||br("node:module").isBuiltin(e)},Or=function(e){return e.startsWith(".")},Tr=class extends E{constructor(e,n){super(e??"Unexpected value",n)}},Er=function(e,n,r,i){if(0===arguments.length)return new Tr("Unexpected value received");i||(i={});var u,{expected:o}=i;return u=o?"Received "+qn(e)+", expected one of "+qn(o):"Unexpected value received: "+qn(e),r&&(u+=' for "'+r+'"'),null!=n&&(u+=" (index "+n+")"),i.fromFn||(i.fromFn=Er),new Tr(u,i)},Sr=function(e){var n=e.stdio;if(n){if(!ne(n)){if(!a(n))throw Gn(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 Er(n,"stdio");n=["overlapped","overlapped","overlapped"]}e.stdio=n}}else n=e.stdio=[null,null,null];return n},Ar=function(e,n){var r=n.length;e.length=r;for(var i=0;i<r;i++)e[i]=n[i];return e},jr=function(e){return function(){return!e.apply(this,arguments)}},Nr=function(e,n){return Ar(e,e.filter(jr(n)))},kr=function(e){return Nr(e,e=>null==e)},Fr=h("child_process"),Ir=e(function(){return"win32"===process.platform}),_r=function(e,n,r){if(r||(r={}),n(e))throw e;if(r.nullOnErr)return null;var i=r.onErr;if(void 0!==i)return Pe(i);throw e},Dr=function(e,n,r){r||(r={}),r.dir&&(r.cwd=r.dir);var i=Sr(r);if(null==i[0]){var u=r.allowInput,o=r.input;if(u&&o)throw Yn("allowInput (user) and input (programmatic) cannot be used simultaneously for synchronous child processes.");u&&(i[0]="inherit")}if(null==i[1]){var a=r.captureOutput??!1,s=r.showOutput;if(a&&s)throw Yn("captureOutput and showOutput cannot be used simultaneously for synchronous child processes.");a?i[1]="pipe":(null==s&&(s=!0),i[1]=s?"inherit":"ignore")}if(null==i[2]){var l=r.captureErr??!1,c=r.showErr;if(l&&c)throw Yn("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&&kr(n);try{var f=Fr().execFileSync(e,n,r);null!=f&&!1!==r.trim&&(f=f.trim());var p=r.map??r.mapFn;return p&&(f=p(f)),f}catch(e){if(Ir())return _r(e,e=>"ENOENT"===e.code,r);throw e}},Cr=function(e,n){return n||(n={}),null==n.captureOutput&&(n.captureOutput=!1),n.shell=!0,n.filterExtensions=!1,Dr("npm",e,n)},Pr=function(e,n,r){return Cr(["install",e,n?"-g":null],r)},Lr=function(e){return require(Jn(e))},Mr=class{constructor(){this.store={}}get(e,n){return j(this.store,e,n)}remove(e){return delete this.store[e]}delete(e){return this.remove(e)}},Rr=new Mr,qr=function(e,n,r){if(Oe()){var i=_().join(e,n);return r?Wn(i):i}throw F()},Gr=function(e,n){return e.endsWith(n)?e:qr(e,n)},Br=h("module"),Wr=function(e){return e=Gr(e,"node_modules"),Br().createRequire(e)},Kr=function(e,n){return Rr.get(e,()=>Wr(e))(n)},Jr=function(e,n,r){return Object.keys(n).forEach(i=>j(e,i,n[i],r)),e},Ur=function(e,n,r){return n?Jr(e,n,r):e},Yr=function(e,n){return e.endsWith(n)?e.substring(0,e.length-n.length):e},zr=function(e,n){var r=fn(n,e);return r?e.slice(0,r.index):e},Vr=function(e,n){if(a(n))return Yr(e,n);if(J(n))return zr(e,n);throw Gn(n,1)},Hr=Vr,Qr=function(e,n){return[e.slice(0,n),e.slice(n)]},$r=function(e){e=Hr(e.trim(),";");var n=Math.max(e.lastIndexOf(";"),e.lastIndexOf("\n"));return Qr(e,n+1)},Xr=function(e,n){return e.startsWith(n)?e:n+e},Zr=function(e){var[n,r]=$r(e);return n+Xr(r.trim(),"return ")},et=function(e){return ri("node-repl-await").processTopLevelAwait(e)},nt=function(e){return et(e)??e},rt=En,tt=function(e,n){return""===e?e:(!1!==n&&(e=Wn(e)),rt(e,"\\","/"))},it=function(e){return'require("'+tt(Un(),!1)+'");\n'+e},ut=function(e,n){return En(e,n,"")},ot=function(e,n){return n.forEach(n=>e=ut(e,n)),e},at=function(e){return ot(e,["\r","\n"])},st=function(e){return at(oi(e))},lt=function(e,n,r){return(n||r)&&(n||(n={}),r&&Ur(n,r),n.ensureReturn&&(e=Zr(e)),n.topLevelAwait&&(e=nt(e)),n.useTitan&&(e=it(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=st(e))),e},ct=function(e){return a(e)?e:kn(e)},ft=function(e){var n=e.indexOf("{");return-1===n||e.slice(0,n).includes("=>")},pt=function(e,n,r,i,u){return yn(e,n,r,i,(n,r)=>null===n?null:(n.input=e,void 0!==r&&(n.index+=r),n),u)},dt=function(e,n){return e.splice(e.length,0,...n),n},ht=function(e,n){return dt(e,n),e},vt=ht,mt=class extends Array{constructor(e,n,r,i,u){if(-1===n)throw Yn("RegexResult index cannot be -1. For empty result, use bare null.");if(null==e)throw Yn("RegexResult matchString cannot be null. For empty result, use bare null.");super(),this[0]=e,i&&vt(this,i),this.index=n,this.input=r,u&&(this.groups=u)}fromParts(e){var n=e;return new mt(n.match,n.index,n.input,n.captures,n.groups)}},gt=function(e,n,r,i,u){return new mt(e,n,r,i,u)},yt=function(e,n,r,i,u){return-1===n||null==e?null:gt(e,n,r,i,u)},wt=ut,bt=function(e,n){return $(e,wt(e.flags,n))},xt=function(e){return bt(e,"g")},Ot=un(function(e){return e.global?xt(e):e},0),Tt=function(e,n,r){return(e=null!=r?ee(e,r,n):Ot(e)).exec(n)},Et=function(e,n,r,i,u){return pt(e,e=>{if(a(n)){var r=e.indexOf(n);return yt(n,r,e)}return Tt(n,e)},r,i,u)},St=function(e){return e.index+e[0].length},At=function(e,n){var r=Et(e,n);return null===r[0]?null:e.slice(St(r))},jt=function(e,n){return e.startsWith(n)?e.substring(n.length):e},Nt=function(e,n){var r=Tt(e,n);return r&&0===r.index?r:null},kt=function(e,n){var r=Nt(n,e);return r?e.slice(r[0].length):e},Ft=function(e,n){if(a(n))return jt(e,n);if(J(n))return kt(e,n);throw Gn(n,1)},It=Ft,Dt=function(e){var n=At(e,"=>").trim();return It(Hr(n,"}"),"{")},Ct=function(e){return At(e,"{").slice(0,-1)},Pt=function(e){var n=ct(e);return ft(n)?Dt(n):Ct(n)},Lt=function(e){return null==e?"":a(e)?e:A(e)?Pt(e):String(e)},Mt=function(e,n){var r=n?.basic?null:{topLevelAwait:!0,useTitan:!0},i=lt(Lt(e),n,r);return Dr("node",[n?.mode??"-p",i],n)},Rt=function(e,n,r){if(null==e)throw Qn(e,n,r,{fromFn:Rt});return e},qt=function(e,n){return process.kill(e,Rt(n,0,"signalName"))},Gt=function(e){return qt(e,"SIGINT")},Bt=function(){return Gt(process.pid)},Wt=Bt,Kt=function(e){if("Y"===(e=e.toUpperCase()))return!0;if("N"===e)return!1;throw Er(e,0,"char")},Jt=function(e){null==e&&(e="Are you sure? [y/n]: "),process.stdout.write(e);var n=Mt(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))})},{mode:"-e",basic:!0,stdio:["inherit","pipe"]});if("^C"===n)throw process.stdout.write(n),Wt(),Yn("Prompt was cancelled via interrupt.");return console.log(n),Kt(n)},Ut=function(e){return ne(e)?e:a(e)?e.split("."):[e]},Yt=function(e,n,r,i,u,o){var a=r;return Ve(e,n,i,u,o,(e,n,r)=>r(e,n,Pe(a)))},zt=function(e,n){var r=n,i=globalThis.config;i||(i=globalThis.config={});var u,o=Ut(e);return o.length>1?u=Yt(i,o,r):(u=Pe(r),i[o[0]]=u),u},Vt=function(e,n){return zt("node.require.customDirs",r=>(r||(r=[]),!1!==n&&(e=Gr(e,"node_modules")),r.includes(e)||r.push(e),r)),e},Ht=Vt,Qt=Ve,$t=function(e){var n=globalThis.config;if(n){var r=Ut(e);return r.length>1?Qt(n,r):n[r[0]]}},Xt=function(e,n,r){if(null!=e)return e;var i=$t(n);return null!=i?i:r},Zt=function(e){var n=Kn(e,!1);return O(n)||(n!==e&&Zt(n),v().mkdirSync(n)),e},ei=function(e){return Zt(e),v().mkdirSync(e),e},ni=function(e){return O(e)?e:ei(e)},ri=function(e,n){if(xr(e))return require(e);if(Or(e))return Lr(e);try{return require(e)}catch(e){}var r=__dirname,i=process.mainModule?.path;if(i!==r)try{return Kr(i,e)}catch(e){}var u=process.cwd();if(u!==i&&u!==r)try{return Kr(u,e)}catch(e){}var o=$t("node.require.customDirs");if(o)for(var a of o)try{return Kr(a,e)}catch(e){}var s=Xt(n?.autoInstall,"node.require.autoInstall"),l=Xt(n?.promptInstall,"node.require.promptInstall",!0);if(s||l){var c=s||l;!0===c&&(c="./node_modules"),c=Jn(c);var f=!1;if(s?(f=!0,console.log('Auto-installing "'+e+'" from npm to "'+c+'"...')):(f=Jt('Npm package "'+e+'" is required. Install now? (Y/N) '))&&console.log('Installing "'+e+'" from npm to "'+c+'"...'),f){c=ni(c),Pr(e,!1,{cwd:c});try{return Ht(c),Kr(c,e)}catch(e){console.error("Failed to load from auto-install dir: ",c)}}}throw Yn('Module not found: "'+e+'"',{checked:{moduleDir:r,scriptDir:i,cwd:u}})},ti=function(e,n){return ri("astring").generate(e,n)},ii=function(e,n){return e.stack=n+"\n"+e.stack,e},ui=function(e,n,r){r||(r={}),r.ecmaVersion||(r.ecmaVersion=2024),!1!==n&&(r.sourceType="module"),null==r.allowAwaitOutsideFunction&&(r.allowAwaitOutsideFunction=!0),null==r.allowReturnOutsideFunction&&(r.allowReturnOutsideFunction=!0);var i=ri("acorn");try{return i.parse(e,r)}catch(n){throw ii(n,"Acorn parsing error: "+e)}},oi=function(e,n,r){return ti(ui(e,n,r))},ai=/(['"])(.*?)\1/,si=an(ai),li=function(e){return e.replace(si,"")},ci=li,fi=function(e){return globalThis.structuredClone(e)},pi=fi,di=un,hi=/\r?\n/,vi=function(e){return null==e||void 0!==e.length&&0===e.length},mi=function(e,n){return Nr(e,vi)},gi=function(e,n){return e.splice(n,1),e},yi=function(e,n,r,i){[r,i]=ke(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},wi=function(e,n,r){for(var i={},u=e.length,o=0;o<u;o++){var a=n(e[o],o,e);if(a){var[s,l]=a;r?(i[s]||(i[s]=[]),i[s].push(l)):i[s]=l}}return i},bi=function(e,n,r,i){return[n,r]=ke(e,n,r,i),e.slice(n,r)},xi=function(e,n){return Ie(n,e).join("")},Oi=function(e){return e?e[0]:null},Ti=function(e,n){var r=null==n?-1:n.index;if(-1===r)return[e];var i=Qr(e,r);return i[1]=i[1].slice(n[0].length),i},Ei=function(e,n,r,i,u){return Ti(e,Et(e,n,r,i,u))},Si=nr,Ai=function(e){return Si(e)??e},ji=function(e,n){null==n&&(n="=");var r={};return e.forEach(function(e){var[i,u]=Ei(e,n);null!=u&&(u=Ai(u.trim())),r[i.trim()]=u}),r},Ni=N,ki=class extends Array{constructor(e){var n,r=e;null!=r&&(ne(r)?n=r:a(r)&&(n=r.split(hi))),n?(super(n.length),Object.assign(this,n)):super(...arguments)}condense(e){return this.trim().removeEmpty(),e&&this.removeComments(e),this}trim(){return this.apply(e=>e.trim())}removeEmpty(){return mi(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()?(gi(this,n),n--):this[n]=r)}return this}removeFirst(){return this.shift(),this}removeLast(){return this.pop(),this}apply(e){return yi(this,e)}join(){return super.join("\n")}toObj(e){return ji(this,e)}mapToObj(e,n){return wi(this,e,n)}between(e,n,r){return r=Ni(r,"inclusiveEnd",!0),bi(this,e,n,r)}normalize(){if(this.length>0&&(""===this[0].trim()&&this.shift(),this.length>0&&(""===U(this).trim()&&this.pop(),this.length>0))){var e=this.find(e=>""!==e.trim()),n=Oi(Tt(/^\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 F()}indent(e,n){var r=xi(n??"\t",e??1);return this.apply(e=>r+e)}static is(e){return W(e,this)}static fromChunks(e){return e.map(e=>Hr(e,hi)).flatMap(e=>Ii(e,!1))}},Fi=function(e,n){var r=new ki(e);return n&&r.condense(),r},Ii=function(e,n,r){var i=e.split(hi);return n?Fi(i,r):i},_i=function(e,n){return Ii(g(e),!0,n)},Di=function(e,n){return Ot(e).test(n)},Ci=function(e,n){return J(n)?Di(n,e):e.includes(n)},Pi=function(e,n,r,i){null==e&&(e=""),null==n&&(n="");var u={},o=(r,i)=>u[e+r+n]=i;return i&&Cn(i,o),r&&Cn(r,o),u},Li=function(e,n){return Cn(n,(n,r)=>e=En(e,n,r)),e},Mi=function(e,n,r,i){var u,o,s=i?.paramIdentifier??"$";if(s)if(a(s)){if(!Ci(e,s))return e;u=s}else{if(!ne(s))throw Gn(s,1,"paramIdentifier");if([u,o]=s,!Ci(e,u)&&!Ci(e,o))return e}var l=Pi(u,o,n,r);return Li(e,l)},Ri=function(e){return a(e)?e:String(e)},qi=globalThis.process?.env.windir,Gi=function(e){if(e)throw F();return I().homedir()+D},Bi=function(e){return Gi(e)+"Desktop/"},Wi={PROGRAMFILES:globalThis.process?.env.ProgramFiles,WINDIR:qi,SYSTEM32:qi&&qi+"System32",TEMP:C(),DESKTOP:Bi()},Ki=function(e,n){return Mi(Ri(e),n,Wi)},Ji=function(){return zn()+"Source/SourceMap.txt"},Ui=function(e){return e?Ki(e,{TITAN:zn()}):Ji()},Yi=function(e,n,r,i,u){return yn(e,n,r,i,(e,n)=>-1===e?-1:void 0===n?e:n+e,u)},zi=function(e,n){return Array.prototype.findIndex.call(e,n)},Vi=function(e,n,r,i,u){var o=a(n);return o&&null==i&&!u?e.indexOf(n,r):Yi(e,e=>o?e.indexOf(n):J(n)?e.search(n):zi(e,n),r,i,u)},Hi=function(e,n,r,i,u){var o=Vi(e,n,r,i,u);return-1===o?null:e.slice(r,o)},Qi=function(e){var n=e[0];return n===n.toUpperCase()},$i=function(e,n){var r=[],i=[];return e.forEach((u,o)=>(n(u,o,e)?r:i).push(u)),[r,i]},Xi=di(function(e){var n=_i(Ui(e),!0),r={};return n.forEach(e=>{var n=Hi(e,"=").split(",").map(e=>e.trim()),[i,u]=$i(n,e=>!Qi(e)),o=i[0];if(!o)throw Yn('No shortName in SourceMap line: "'+e+'"');u.forEach(e=>{r[e]=o})}),r},0),Zi=e(function(e){var n=Object.keys(e);return xn("\\b("+n.join("|")+")\\.(\\w+)","g")}),eu=/\bt\.(\w+)\.(\w+)/g,nu=function(e,n){n||(n={});var r={},i=r.t={};if(n.enableGlobals){var u;u=n.additionalGlobals?pi(n.additionalGlobals):{},r.globals=u;var o=Xi(),a=Zi(o),s=ln(a,e).filter(n=>{var r=n[1],i=n[2],u=e[n.index-1];if("."===u||"_"===u)return!1;var o=globalThis[r];return!o||void 0===o[i]});for(var[l,c,f]of s)u[c]||(u[c]={}),u[c][f]=!0;var p=s.map(([e,n,r])=>{var i=o[n];if(!i)throw Yn("No short name found for global: "+n);return"t."+i+"."+r+";"}).join(" ");e+="\n"+p}for(var[l,d,f]of s=e.matchAll(eu))i[d]||(i[d]={}),i[d][f]=!0;return r},ru=function(e,n){return e=oi(e),e=ci(e),nu(e,n)},tu=function(e,n){return nu(e,n)},iu=function(e,n,r){if(n){if("js"===(n=n.toLowerCase()))return ru(e,r);if("html"===n)return tu(e,r)}return nu(e,r)},uu=function(e,n){return n in e},ou=uu,au=function(e,n){for(var r of(Rt(n,1),Object.keys(e))){if(!ou(n,r))return!1;var i=e[r];if(i&&i.constructor===Object&&!au(i,n[r]))return!1}return!0},su=function(e,n){if(!au(n.t,e))return!0;if(n.globals){var r=e._meta?.globals;if(!r)return!0;if(!au(n.globals,r))return!0}return!1},lu=function(e,n,r,i){var u,o,a,s;i||(i={}),e&&(e=Jn(e)),u=i.packagePath?Jn(i.packagePath):Un(e,!1,!0,i);var l,c=O(u);c?(o=fr(u))?a="New compile":(null==n&&(n=g(e)),s=iu(n,"js",i),(l=su(r,s))&&(a="New deps")):a="No package";var f={needsPack:!!a,scriptPath:e,packagePath:u};return a&&(f.reasonText=a),null!=c&&(f.exists=c),null!=o&&(f.newCompile=o),null!=l&&(f.newDeps=l),n&&(f.sourceText=n),s&&(f.shallowDeps=s),f},cu=function(e){return Bn(e,D)},fu=function(e){var n=e.lastIndexOf(D);return-1===n?null:e.slice(0,n+1)},pu=function(e,n,r){if(cu(e))return r?[e,null]:e;var i,u,o=fu(e),a=n(q(e),o,e);return r?[i,u]=a:i=a,null!=i&&(e=o?o+i:i),r?[e,u]:e},du=function(e,n,r,i,u){return pt(e,e=>{if(J(n))return cn(n,e);if(a(n)){var r=e.lastIndexOf(n);return-1!==r?new mt(n,r):null}throw Gn(n,1)},r,i,u)},hu=function(e,n,r,i,u){return Ti(e,du(e,n,r,i,u))},vu=function(e){return pu(e,e=>hu(e,"."),!0)},mu=function(e,n){var r=vu(e)[1];return r?!1!==n?r.toLowerCase():r:null},gu={},yu=di(function(e){e=Ui(e);var n=Kn(e)+"../Compiled/",r=_i(e,"//"),i=gu;for(var u of r){var o=u.indexOf("="),a=u.slice(0,o).trim();a=a.split(",").map(e=>e.trim()).filter(e=>!Qi(e));var s=u.slice(o+1).trim(),l=qr(n,s).replaceAll("\\","/");for(var c of a)i[c]=l}return i},0),wu=function(e,n){var r=n?.fileType;if(r){if("js"===(r=r.toLowerCase()))return ru(e,n);if("html"===r)return tu(e,n)}return nu(e,n)},bu=function*(e,n){var r=0;for(var i of e)n(i,r++,e)&&(yield i)},xu=function(e){return e.slice()},Ou=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},Tu=function(e,n){return Ou(e,e.length,n)},Eu=Tu,Su=function(e,n){return e.call(this,...n,function n(){return U(arguments)!==n&&Eu(arguments,n),e.apply(this,arguments)})},Au=function(e){e||(e={});var n=e.getKeys;n||(n=function(e){return Object.keys(e)});var r=e.recurseIf;if(!r){var i=this.constructor;r=e=>W(e,i)||Nn(e)||ne(e)}var u=e.leavesOnly??e.leafsOnly??!1,o=this;return Su(function*(e,i,a,s){var l=n(e,i,a);if(l)for(var c=l.length,f=0;f<c;f++){var p=l[f],d=e[p],h=xu(i);h.push(p);var v=null,m={value:d,key:p,object:e,path:h,level:a,isLeaf:v,root:o},g=r(d,m);m.isLeaf=v=!g,u&&!v||(yield m),g&&(yield*s(d,h,a+1,s))}},[this,[],0])},ju=function(e,n){return Au.call(e,n)},Nu=function(e,n){1===arguments.length&&(n=!0);var r={};for(var i of e)r[i]=n;return r},ku=function(e,n,r,i){var u=ui(e,n,i);ri("acorn-walk").full(u,r)},Fu=function(e,n,r,i){var u;if(a(r))u=e=>e.type===r;else if(ne(r)){var o=Nu(r);u=e=>o[e.type]}else u=r;var s=[];return ku(e,n,function(e){u.apply(this,arguments)&&s.push(e)},i),s},Iu=ti,_u=function(e){var n,r,i,u=e,o=a(u)?ui(u).body[0]:u,s=o.type;if("VariableDeclaration"===s){n="variable";var l=o.declarations[0];r=l.id.name,i=l.init?l.init.raw??ti(l.init):"undefined"}else"FunctionDeclaration"===s?n="function":"ClassDeclaration"===s&&(n="class"),r=o.id.name;var c={type:n,name:r};return i&&(c.value=i),c.text=Iu(o),c.node=o,c},Du=function(e){return Fu(e,!0,["ExportNamedDeclaration","ExportDefaultDeclaration"]).map(function(e){var n=e.declaration;if(n){var r=_u(n);return r.node=e,r}return{node:e}})},Cu=function(e,n){n||(n={});var r=n.enableGlobals,i=yu(n.sourceMap),u={},o=[];return function e(n,a){var s=bu(ju(n),e=>e.isLeaf);for(var l of s){var[c,f]=l.path,p=u[c];if(p||(p=u[c]={}),null==p[f]){var d=i[c];if(d){var h=tt(d)+f+".js";if(!O(h)){var v='Titan compiled value "t.'+c+"."+f+'" does not exist';throw a&&(v+=' (called by "'+a+'")'),Yn(v+=".")}var g=m(h),y=Du(g)[0];p[f]=y;var w="t."+c+"."+f;e(wu(g,{fileType:"js",enableGlobals:r}).t,w),o.push([c,f])}else console.log('Skipping unmapped module "'+c+'"'),p[f]=!1}}}(e.t),{t:u,globals:e.globals,order:o}},Pu=function(e,n){n||(n={});var r=n.deps??iu(e,n.fileType,n),{t:i,globals:u,order:o}=Cu(r,n),a={};if(a.t=r.t,u&&n.enableGlobals){a.globals=u;var s=Xi(),l=Object.keys(u),c=wi(l,e=>[s[e],e],!0);a.shortNamesToGlobals=c}return a.itemsInOrder=o.map(([e,n])=>{var r=i[e][n];return[e,n,"variable"===r.type?r.value:"("+r.text+")"]}),a},Lu=function(e,n,r){return null==r&&(r=!0),Su(function(e,n,i){Cn(e,function(e,u){if(ou(n,e)){var o=n[e];r?Y(o)&&Y(u)?i(u,o):n[e]=u:Y(o)&&i(u,o)}else n[e]=u})},[e,n]),n},Mu=Lu,Ru=function(e){return Object.assign({},e)},qu=function(e,n){if(n){var r={};return e.forEach((e,i,u)=>r[n(e,i,u)]=!0),r}return Ru(e)},Gu=function(e,n){Mu(n.t,e.t,!1);var r=n.globals;if(r){var i=e.globals;i?Mu(r,i,!1):e.globals=r,e.shortNamesToGlobals=n.shortNamesToGlobals}var u=qu(e.itemsInOrder,e=>e[0]+"."+e[1]);return n.itemsInOrder.forEach(n=>{u[n[0]+"."+n[1]]||e.itemsInOrder.push(n)}),e},Bu=function(e){return e instanceof Buffer},Wu=function(e){return ArrayBuffer.isView(e)},Ku=Wu,Ju=function(e){return Bu(e)||Ku(e)||a(e)},Uu=function(e){return e.constructor===ArrayBuffer},Yu=function(e){return Ju(e)?e:Uu(e)?Buffer.from(e):kn(e)},zu=function(e){return tr(e)?String(e):Yu(e)},Vu=function(e,n){return Zt(e),v().writeFileSync(e,zu(n)),e},Hu=function(e,n){var r;return n||(n={}),r=n.condensed?0:null!=n.whitespace?n.whitespace:"\t",JSON.stringify(e,n.replacer,r)},Qu=function(e,n,r){return Vu(e,Hu(n,r))},$u=function(e,n,r){r||(r={}),r.deps||r.fileType||!n||(r.fileType=mu(n));var i=Pu(e,r),u=r.packagePath||Un(n,r.repl,!0,r);if(r.dynamic&&(r.packageExists??O(u))&&!(r.newCompile??fr(u))){var o=dr(u);i=Gu(o,i)}return Qu(u,i),u},Xu=function(e,n,r,i){var u=lu(e,n,r,i);return u.needsPack&&(i.onPack&&i.onPack(u.reasonText),n=u.sourceText??g(e),i.packagePath=u.packagePath,i.packageExists=u.exists,i.newCompile=u.newCompile,i.deps=u.shallowDeps,$u(n,e,i),wr(u.packagePath,r,i)),r},Zu={node:{getScriptPath:p,positionalArgs:f,args:n,fs:v,_builtInModule:h,requireBuiltIn:d,os:I,path:_,is:Oe,display:vn,util:hn,getScriptDir:pr,require:ri,_basicRequire:br,child_process:Fr,requireLocal:Lr,_requireFromDir:Kr,_requireDirCache:Rr,_createRequire:Wr,module:Br,promptYNSync:Jt,run:Mt,sigint:Wt,interrupt:Bt,ensureRequireDir:Ht,addRequireDir:Vt},cli:{positionalArgs:c,resolveArgs:l,splitArgs:s},env:{args:r,setConfig:zt,getConfig:$t,resolveConfig:Xt},f:{one:e,is:A,memoize:un,MemoizedFunction:tn,createClass:Ne,ensureConstructor:le,createConstructor:se,isArrowFn:oe,isArrow:ue,wrap:ae,retThis:ce,setName:ye,not:jr,body:Pt,isArrowString:ft,_getArrowFnBody:Dt,_getNormalFnBody:Ct,cache:di,recurse:Su},s:{is:a,isAny:o,isPrimitive:i,isObject:u,decapitalize:M,endsWith:Bn,chars:z,resolveIndex:Z,toLiteral:jn,quote:An,escape:Sn,replaceAll:En,apply:wn,withIndices:yn,from:kn,removeTrailing:Hr,removeFromEnd:Vr,_removeStringFromEnd:Yr,_removeRegexFromEnd:zr,splitAtIndex:Qr,ensureStartsWith:Xr,replace:rt,removeLineBreaks:at,removeMulti:ot,removeAll:ut,resolve:Lt,ensure:ct,after:At,match:Et,_matchWithIndices:pt,remove:wt,removeLeading:It,removeFromStart:Ft,_removeStringFromStart:jt,_removeRegexFromStart:kt,removeQuotes:li,splitLines:Ii,lines:Fi,LinesArray:ki,repeat:xi,splitFirst:Ei,_splitByMatch:Ti,replaceParams:Mi,contains:Ci,_createParamsObj:Pi,_replaceByObj:Li,before:Hi,index:Vi,_indexWithIndices:Yi,indexOfFn:zi,isCapitalized:Qi,splitLast:hu,matchLast:du},fs:{loadText:g,load:m,getID:x,stat:b,deepStat:y,shallowStat:w,exists:O,getModifiedDate:lr,loadJSON:dr,ensureDir:ni,mkdir:ei,ensureParent:Zt,loadLines:_i,writeJSON:Qu,write:Vu,formatRaw:zu},titan:{getTempDir:L,getPackagePath:Un,getPackageName:B,hasNewCompile:fr,getLastCompileTime:sr,getCompiledDir:Vn,locate:zn,_loadDynamicDeps:wr,_trackGlobals:yr,autoPackAndLoadJSON:Xu,needsToPack:lu,getShallowDeps:iu,getDepsFromJS:ru,_getDepsBasic:nu,loadGlobalsMap:Xi,_resolveSourceMapPath:Ui,locateSourceMap:Ji,_getGlobalsRegex:Zi,depsRegex:eu,getDepsFromHTML:tu,jsonHasNewDeps:su,packTextToJSONFile:$u,packTextToJSON:Pu,_getAllDeps:Cu,loadSourceMap:yu,sourceMap:gu,getDeps:wu,addNewItemsToJSON:Gu},path:{getTempDir:P,_getDefaultTempDir:C,sep:D,baseName:G,_removeExtsFromFile:R,file:q,dir:Kn,ensureTrailingSlash:Wn,abs:Jn,ensureEndsWith:Gr,join:qr,fws:tt,resolveVars:Ki,string:Ri,_defaultParams:Wi,windir:qi,getDesktop:Bi,getUserDir:Gi,ext:mu,splitExt:vu,ignoreDir:pu,isDir:cu,dirPart:fu},err:{nyi:F,NYIError:S,Error:E,Enhanced:T,defaultFromFn:k,type:Gn,TypeError:pn,create:Yn,req:Qn,value:Er,ValueError:Tr,prepend:ii},o:{safeEnsure:N,ensure:j,constructorMatches:K,is:Y,isAny:pe,setHidden:ge,addNonEnumerable:me,defineProperty:ve,weakAssign:he,merge:de,hideKey:je,makeNonEnumerable:Ae,ensureCustom:Le,get:De,set:Ce,createEmpty:Ue,remove:Xe,display:Mn,toLiteral:Ln,isPure:Nn,reduce:Pn,each:Cn,keys:Dn,allKeys:_n,setLazy:gr,setGetterAndSetter:vr,addGetterAndSetter:hr,replaceGetterAndSetter:mr,Cache:Mr,setDefaults:Ur,ensureMulti:Jr,resolveKeys:Ut,diveGet:Qt,deepCopy:pi,fromLines:ji,safeDefault:Ni,hasKey:ou,has:uu,fromKeys:Nu,fromArray:Ru},re:{is:J,matchEnd:fn,matchLast:cn,matchAll:ln,setStartIndex:ee,copy:$,updateFlagString:Q,parseFlagString:V,createFlagString:H,ensureGlobal:sn,global:an,addFlag:on,createEscaped:Tn,create:xn,resolveFlags:bn,escape:On,safeCreateResult:yt,createResult:gt,RegexResult:mt,match:Tt,ensureLocal:Ot,local:xt,removeFlag:bt,resultEndIndex:St,matchStart:Nt,quotes:si,quote:ai,newline:hi,text:Oi,test:Di},v:{constructorMatches:W,isPrimitive:fe,resolve:Pe,type:dn,display:qn,toLiteral:In,nullIfNaN:er,req:Rt,isEmpty:vi},a:{last:U,resolveIndex:X,is:ne,ensure:re,pick:_e,create:Ie,fill:Fe,resolveIndices:ke,push:We,add:Be,splitLast:ze,splitTail:Ye,wrapIndices:gn,wrapIndex:mn,toLiteral:Fn,display:Rn,removeNullish:kr,removeByFilter:Nr,replaceContents:Ar,pushMulti:vt,addMulti:ht,pushThroughMulti:dt,removeEmpty:mi,removeIndex:gi,apply:yi,mapToObj:wi,slice:bi,filterSplit:$i,copy:xu,toObj:qu},class:{create:Se,setName:we,addStatics:be,setDisplay:Ee},p:{asyncJoint:ie,is:te},sym:{display:Te,value:Je},macro:{config:xe},map:{Cache:Ge,ensure:qe,get:Me,set:Re,MultiCache:rn,diveEnsure:$e,createEmpty:Qe,diveDelete:nn,remove:en},args:{ensureArray:Ke,push:Eu,append:Tu,insert:Ou},tree:{ensure:He,dive:Ve,remove:Ze,setCustom:Yt,copy:fi,isSubsetOf:au,iterate:ju,iterator:Au,merge:Mu,join:Lu},d:{from:ar,create:or,resolve:ur,now:Hn,ensure:ir,copy:$n,fromYear:Xn,_resolveNative:Zn,isBefore:cr},n:{fromString:rr,ensure:nr,is:tr,tryCoerce:Ai,tryParse:Si},js:{removeComments:oi,fromAST:ti,enhance:lt,ensureReturn:Zr,splitLastExpression:$r,enableAwait:nt,_nodeEnableAwait:et,useTitan:it,inline:st,parse:ui,removeQuotes:ci,getExports:Du,getNodes:Fu,eachNode:ku,parseDeclaration:_u,fromASTNode:Iu},npm:{isBuiltIn:xr,isFile:Or,install:Pr,_runCommand:Cr},os:{run:Dr,_resolveStdio:Sr},win:{is:Ir},shell:{_handleError:_r},proc:{interrupt:Gt,signal:qt},bool:{fromYN:Kt},gen:{filter:bu},bin:{ensureByteSafe:Yu,isByteSafe:Ju,isNodeBuffer:Bu,isTA:Ku},ab:{isTA:Wu,is:Uu},json:{stringify:Hu}};globalThis.t?Object.keys(Zu).forEach(function(e){if(t[e]){var n=Zu[e];Object.keys(n).forEach(function(r){t[e][r]=n[r]})}else t[e]=Zu[e]}):globalThis.t=Object.assign({},Zu),globalThis.exports&&(exports.default=globalThis.t);
|
|
1
|
+
var t_f_one=function(t){var e,r=!1;return function(){return r||(r=!0,e=t.apply(this,arguments)),e}},t_node_args=t_f_one(function(){return process.argv.slice(2)}),t_env_args=t_node_args,t_s_isPrimitive=function(t){return"string"==typeof t},t_s_isObject=function(t){return t instanceof String},t_s_isAny=function(t){return t_s_isPrimitive(t)||t_s_isObject(t)},t_s_is=t_s_isAny,t_cli_splitArgs=function(t,e){const r=[];let _="",n="outside",s=!1;for(let i=0;i<t.length;i++){const a=t[i];switch(n){case"outside":'"'===a?s?(_+=a,s=!1):(e&&(_+=a),n="insideQuote"):"\\"===a?s=!0:" "===a?(_.length>0&&(r.push(_),_=""),s=!1):(_+=a,s=!1);break;case"insideQuote":'"'!==a||s?"\\"!==a||s?(_+=a,s=!1):s=!0:(e&&(_+=a),n="outside")}}return _.length>0&&r.push(_),r},t_cli_resolveArgs=function(t,e){var r=t;return null==r?t_env_args():t_s_is(r)?t_cli_splitArgs(r,e):r},t_cli_positionalArgs=function(t,e){return t_cli_resolveArgs(t,e).slice()},t_node_positionalArgs=t_cli_positionalArgs,t_node_getScriptPath=function(){var t=require.main?.filename;return t||(null!=process._eval?null:t_node_positionalArgs(process.argv)[1])},t_node_requireBuiltIn=function(t){return require("node:"+t)},t_node__builtInModule=function(t){return t_f_one(()=>t_node_requireBuiltIn(t))},t_node_fs=t_node__builtInModule("fs"),t_fs_load=function(t){return t_node_fs().readFileSync(t,"utf8")},t_fs_loadText=t_fs_load,t_fs_deepStat=function(t,e){return t_node_fs().statSync(t,e)},t_fs_shallowStat=function(t,e){return t_node_fs().lstatSync(t,e)},t_fs_stat=function(t,e,r){return(e?t_fs_deepStat:t_fs_shallowStat)(t,r)},t_fs_getID=function(t,e){return t_fs_stat(t,e).ino},t_fs_exists=function(t){return!!t_node_fs().lstatSync(t,{throwIfNoEntry:!1})},t_err_Enhanced=function(t){return class extends t{constructor(t,e){super(t,e);var r=this.constructor.name;r&&(this.name=r)}}},t_err_Error=t_err_Enhanced(globalThis.Error),t_err_NYIError=class extends t_err_Error{constructor(t,e){super(t??"Not yet implemented",e)}},t_f_is=function(t){return"function"==typeof t},t_o_ensure=function(t,e,r,_){var n=t[e];if(void 0===n){var s=r;!1!==_&&t_f_is(s)&&(s=s(t,e)),t[e]=n=s}return n},t_o_safeEnsure=function(t,e,r,_){return t||(t={}),t_o_ensure(t,e,r,_),t},t_err_defaultFromFn=function(t,e){return t_o_safeEnsure(t,"fromFn",e,!1)},t_err_nyi=function(t,e){return new t_err_NYIError(t,t_err_defaultFromFn(e,t_err_nyi))},t_node_os=t_node__builtInModule("os"),t_node_path=t_node__builtInModule("path"),t_path_sep=t_node_path().sep,t_path__getDefaultTempDir=function(){return t_node_os().tmpdir()+t_path_sep},t_path_getTempDir=function(t){if(t)throw t_err_nyi();return t_path__getDefaultTempDir()},t_titan_getTempDir=function(){return t_path_getTempDir()+"Titan/"},t_s_decapitalize=function(t){return t.charAt(0).toLowerCase()+t.slice(1)},t_path__removeExtsFromFile=function(t){return t.split(".")[0]},t_path_file=function(t){return t_node_path().win32.basename(t)},t_path_baseName=function(t){return t_path__removeExtsFromFile(t_path_file(t))},t_titan_getPackageName=function(t,e,r,_){t||(t=t_node_getScriptPath()??"_console.js");var n=t_s_decapitalize(t_path_baseName(t));return e&&(n+="_repl"),n+(r&&_?.dynamic?".dypkg.json":".pkg.js")},t_v_constructorMatches=function(t,e){return null!=t&&t.constructor===e},t_o_constructorMatches=t_v_constructorMatches,t_re_is=function(t){return t_o_constructorMatches(t,RegExp)},t_a_last=function(t){return t[t.length-1]},t_o_is=function(t){return t_v_constructorMatches(t,Object)},t_s_chars=function(t){return new Set(t)},t_re_parseFlagString=function(t){var e={};if(t){var r=t_s_chars(t);r.has("g")&&(e.global=!0),r.has("i")&&(e.caseInsensitive=!0),r.has("y")&&(e.sticky=!0)}return e},t_re_createFlagString=function(t){var e="";return t.global&&(e+="g"),(t.caseInsensitive||0==t.caseSensitive)&&(e+="i"),t.sticky&&(e+="y"),e},t_re_updateFlagString=function(t,e){var r=t_re_parseFlagString(t);return t_re_createFlagString(Object.assign(r,e))},t_re_copy=function(t,e){var r=e,_=void 0;return t_s_is(r)?_=r:t_o_is(r)&&(_=t_re_updateFlagString(t.flags,r)),new RegExp(t,_)},t_a_resolveIndex=function(t,e){return e<0?t.length+e:e},t_s_resolveIndex=t_a_resolveIndex,t_re_setStartIndex=function(t,e,r){return t=t_re_copy(t,{global:!0}),null!=r&&(e=t_s_resolveIndex(r,e)),t.lastIndex=e,t},t_a_is=function(t){return Array.isArray(t)},t_a_ensure=function(t){return t_a_is(t)?t:[t]},t_p_is=function(t){return t instanceof Promise},t_p_asyncJoint=function(t,e){var r=t;return t_p_is(r)?r.then(e):e(r)},t_f_isArrow=function(t){return t_f_is(t)&&null==t.prototype},t_f_isArrowFn=t_f_isArrow,t_f_wrap=function(t){return function(){return t.apply(this,arguments)}},t_f_createConstructor=function(t,e){var r;return r=e?function(){this.super=e;var r=t.apply(this,arguments);return t_p_asyncJoint(r,()=>(delete this.super,r))}:t_f_isArrowFn(t)?t_f_wrap(t):t,r._isConstructor=!0,r},t_f_ensureConstructor=function(t,e){return t._isConstructor?t:t_f_createConstructor(t,e)},t_f_retThis=function(){return this},t_v_isPrimitive=function(t){var e=typeof t;return"object"!==e&&"function"!==e||null===t},t_o_isAny=function(t){return!t_v_isPrimitive(t)},t_o_merge=function(t,e,r){return!1===r?Object.keys(e).forEach(r=>{void 0===t[r]&&(t[r]=e[r])}):Object.assign(t,e),t},t_o_weakAssign=function(t,e){return t_o_merge(t,e,!1)},t_o_defineProperty=function(t,e,r,_){return r||(r={}),_&&t_o_weakAssign(r,_),null==r.enumerable&&(r.enumerable=!0),null==r.configurable&&(r.configurable=!0),Object.defineProperty(t,e,r)},t_o_addNonEnumerable=function(t,e,r,_){return t_o_defineProperty(t,e,{value:r,writable:!0,enumerable:!1},_),r},t_o_setHidden=t_o_addNonEnumerable,t_f_setName=function(t,e){Object.defineProperty(t,"name",{value:e,configurable:!0}),t_o_setHidden(t,"displayName",e)},t_class_setName=t_f_setName,t_class_addStatics=function(t,e){return Object.assign(t,e)},t_macro_config=function(t){},t_node_is=t_f_one(function(){return t_macro_config("node.is")??"undefined"==typeof window}),t_sym_display=t_node_is()?require("util").inspect.custom:Symbol("Display"),t_class_setDisplay=function(t,e){t.prototype[t_sym_display]=e},t_class_create=function(t,e,r,_,n,s){s||(s={}),t_s_is(e)&&(e=null);var i,a,o,u=r;u&&(t_a_is(u)?([a,o]=u,a&&(a=t_f_ensureConstructor(a))):i=t_f_ensureConstructor(u,e));var l=s.bareFn;s.singleton&&(l=function(){return null==p.default&&(p.default=new p(...arguments)),p.default});var c,f=a||i||e||t_f_retThis;function p(){if(!new.target&&l&&!(this instanceof p))return l.apply(this,arguments);var t=this;return t_p_asyncJoint(f.apply(t,arguments),r=>{if(r&&t_o_isAny(r)&&(t=r,a)){if(!new.target)throw t_err_nyi('Prototype repair is NYI for class instantiation without "new".');if(!e)throw t_err_nyi("instanceFn is not yet supported when extendsClass is null.");var _=Object.getPrototypeOf(this);Object.getPrototypeOf(t)!==_&&Object.setPrototypeOf(t,_)}return o?t_p_asyncJoint(o.apply(t,arguments),()=>t):t})}return t&&t_class_setName(p,t),_?(c=_,e&&Object.setPrototypeOf(_,e.prototype)):c=e?Object.create(e.prototype):{},t_o_setHidden(c,"constructor",p),p.prototype=c,n&&t_class_addStatics(p,n),s.display&&t_class_setDisplay(p,s.display),s.implements&&t_a_ensure(s.implements).forEach(t=>t(p)),p},t_o_makeNonEnumerable=function(t,e){Object.defineProperty(t,e,{enumerable:!1})},t_o_hideKey=t_o_makeNonEnumerable,t_f_createClass=function(t,e,r,_,n){var s=Symbol();return t_class_create(t,Function,[function(){var t=function(){return t[s].apply(this,arguments)};return t},function(){var t=e.apply(this,arguments);if(!t)throw new Error("Constructor must return a function.");this[s]=t,t_o_hideKey(this,s)}],r,_,n)},t_a_resolveIndices=function(t,e,r,_){return e=null==e?0:t_a_resolveIndex(t,e),r=null==r?t.length:t_a_resolveIndex(t,r),_&&(0==_.inclusiveStart&&e++,_.inclusiveEnd&&r++),[e,r]},t_a_fill=function(t,e,r,_){var n=e;if([r,_]=t_a_resolveIndices(t,r,_),t_f_is(n))for(var s=r;s<_;s++)t[s]=n(s,t);else t.fill(n,r,_);return t},t_a_create=function(t,e){var r=new Array(t||0);return arguments.length>1&&t_a_fill(r,e),r},t_a_pick=function(t,e){return t_a_create(e.length,r=>t[e[r]])},t_o_get=function(t,e){return t[e]},t_o_set=function(t,e,r){return t[e]=r},t_v_resolve=function(t,e,r){var _=t;return t_f_is(_)?_.apply(r,e):_},t_o_ensureCustom=function(t,e,r,_,n){_||(_=t_o_get);var s=_(t,e);return void 0===s&&(s=t_v_resolve(r,[t,e]),n||(n=t_o_set),n(t,e,s)),s},t_map_get=function(t,e){return t.get(e)},t_map_set=function(t,e,r){return t.set(e,r)},t_map_ensure=function(t,e,r){return t_o_ensureCustom(t,e,r,t_map_get,t_map_set)},t_map_Cache=class{constructor(){this.store=new Map}get(t,e){return t_map_ensure(this.store,t,e)}remove(t){return this.store.delete(t)}delete(t){return this.remove(t)}},t_a_add=function(t,e){return t.push(e),t},t_a_push=t_a_add,t_args_ensureArray=function(t){var e=t;return Array.isArray(e)?e:Array.from(e)},t_sym_value=Symbol("Value"),t_o_createEmpty=function(){return{}},t_a_splitTail=function(t){return[t.slice(0,-1),t[t.length-1]]},t_a_splitLast=t_a_splitTail,t_tree_dive=function(t,e,r,_,n,s){r||(r=t_o_get),null==_&&(_=t_o_createEmpty),null==n&&(n=t_o_set),null==s&&(s=r);for(var[i,a]=t_a_splitLast(e),o=t,u=i.length,l=0;l<u;l++){var c=i[l],f=r(o,c);if(void 0===f){if(!_)return;f=t_o_ensureCustom(o,c,_,r,n)}o=f}if(s)return s(o,a,n)},t_tree_ensure=function(t,e,r,_,n,s){return t_tree_dive(t,e,_,n,s,(t,e)=>t_o_ensureCustom(t,e,r,_,s))},t_map_createEmpty=function(){return new Map},t_map_diveEnsure=function(t,e,r){return t_tree_ensure(t,e,r,t_map_get,t_map_createEmpty,t_map_set)},t_o_remove=function(t,e){return delete t[e],t},t_tree_remove=function(t,e,r,_){return t_tree_dive(t,e,r,!1,!1,_||t_o_remove)},t_map_remove=function(t,e){return t.delete(e)},t_map_diveDelete=function(t,e){return t_tree_remove(t,e,t_map_get,t_map_remove)},t_map_MultiCache=class{constructor(){this.store=new Map}get(t,e){return t=t_a_push(t_args_ensureArray(t),t_sym_value),t_map_diveEnsure(this.store,t,e)}remove(t){return t=t_a_push(t_args_ensureArray(t),t_sym_value),t_map_diveDelete(this.store,t)}delete(t){return this.remove(t)}},t_f_MemoizedFunction=t_f_createClass("MemoizedFunction",function(t,e){if(this.base=t,null!=e)if(1===(e=t_a_ensure(e)).length){this.cache=new t_map_Cache;var r=e[0];this._cacheKeyFormatter=t=>t[r]}else this.cache=new t_map_MultiCache,this._cacheKeyFormatter=t=>t_a_pick(t,e);else this.cache=new t_map_MultiCache,this._cacheKeyFormatter=t=>t;var _=this;return function(){var e=_._cacheKeyFormatter(arguments);return _.cache.get(e,()=>t.apply(this,arguments))}},{remove(t){return this.cache.remove(this._cacheKeyFormatter(t))}}),t_f_memoize=function(t,e){return new t_f_MemoizedFunction(t,e)},t_re_addFlag=function(t,e){return t_re_copy(t,t.flags+e)},t_re_global=function(t){return t_re_addFlag(t,"g")},t_re_ensureGlobal=t_f_memoize(function(t){return t.global?t:t_re_global(t)},0),t_re_matchAll=function(t,e,r){return t=null!=r?t_re_setStartIndex(t,r,e):t_re_ensureGlobal(t),Array.from(e.matchAll(t))},t_re_matchLast=function(t,e,r){return null!=r&&(e=e.slice(0,r)),t_a_last(t_re_matchAll(t,e))||null},t_re_matchEnd=function(t,e){var r=t_re_matchLast(t,e);return r&&e.length===r.index+r[0].length?r:null},t_err_TypeError=t_err_Enhanced(globalThis.TypeError),t_v_type=function(t){return null==t?t:t.constructor},t_node_util=t_node__builtInModule("util"),t_node_display=function(t,e){return e||(e={}),null==e.colors&&(e.colors=!0),t_node_util().inspect(t,e)},t_a_wrapIndex=t_a_resolveIndex,t_a_wrapIndices=function(t,e,r,_){return void 0!==e&&(null===e||0===e?e=void 0:(e=t_a_wrapIndex(t,e),_&&0==_.inclusiveStart&&e++)),void 0!==r&&(null===r||r===t.length?r=void 0:(r=t_a_wrapIndex(t,r),_&&_.inclusiveEnd&&r++)),[e,r]},t_s_withIndices=function(t,e,r,_,n,s){if(r||null!=_){[r,_]=t_a_wrapIndices(t,r,_,s);var i=t.slice(r,_),a=e(i);return n?n(a,r,_,i,t):a}return e(t)},t_s_apply=function(t,e,r,_,n){return t_s_withIndices(t,e,r,_,(e,r,_)=>(void 0!==r?t.slice(0,r):"")+(e||"")+(void 0!==_?t.slice(_):""),n)},t_re_resolveFlags=function(t){var e=t;return null==e?void 0:t_s_is(e)?e:t_re_createFlagString(e)},t_re_create=function(t,e){return new RegExp(t,t_re_resolveFlags(e))},t_re_escape=function(t){return t.replace(/[-[\]{}()*+!<=:?.\/\\^$|#\s,]/g,"\\$&")},t_re_createEscaped=function(t,e){return t_re_create(t_re_escape(t),e)},t_s_replaceAll=function(t,e,r,_,n,s){return t_s_apply(t,function(t){return t.replaceAll?(t_re_is(e)&&(e=t_re_ensureGlobal(e)),t.replaceAll(e,r)):(e=t_s_is(e)?t_re_createEscaped(e,"g"):t_re_ensureGlobal(e),this.replace(e,r))},_,n,s)},t_s_escape=function(t,e,r){return t_s_replaceAll(t,e,(r??"\\")+e)},t_s_quote=function(t,e,r){return null==e&&(e='"'),!1!==r&&(t=t_s_escape(t,e,r)),e+t+e},t_s_toLiteral=function(t){return t_s_quote(t,'"')},t_o_isPure=t_o_is,t_s_from=function(t){return t_o_isPure(t)?t_o_toLiteral(t):String(t)},t_a_toLiteral=function(t,e){return e||(e=t_v_toLiteral),"["+t.reduce(function(t,r){return t+e(r)+", "},"").slice(0,-2)+"]"},t_v_toLiteral=function(t){return t_s_is(t)?t_s_toLiteral(t):t_a_is(t)?t_a_toLiteral(t):t_s_from(t)},t_o_allKeys=function(t){return Reflect.ownKeys(t)},t_o_keys=function(t,e){return(e?t_o_allKeys:Object.keys)(t)},t_o_each=function(t,e,r){t_o_keys(t,r).forEach((r,_,n)=>e(r,t[r],_,n))},t_o_reduce=function(t,e,r,_){var n=null!=r?r:"";return t_o_each(t,function(){n=e.call(this,n,...arguments)},_),n},t_o_toLiteral=function(t,e){return e||(e=t_v_toLiteral),"{"+t_o_reduce(t,function(t,r,_){return t+r+":"+e(_)+", "},"",!0).slice(0,-2)+"}"},t_o_display=function(t,e){return null==e&&(e=1),e<=0?"[object Object]":t_o_toLiteral(t,t=>t_v_display(t,e-1))},t_a_display=function(t,e){return null==e&&(e=1),e<=0?"[object Array]":t_a_toLiteral(t,t=>t_v_display(t,e-1))},t_v_display=function(t,e){return void 0===t?"undefined":null===t?"null":t_node_is()?t_node_display(t,e):t_o_is(t)?t_o_display(t,maxNumLevels):t_a_is(t)?t_a_display(t,maxNumLevels):t_s_from(t)},t_err_type=function(t,e,r,_){if(0===arguments.length)return new t_err_TypeError("Unexpected type received");_||(_={});var n,{type:s,expected:i}=_;return null==s&&(s=t_v_type(t)),s&&s.name&&(s=s.name),i?(i.name&&(i=i.name),n="Expected "+i+", received "):n="Unexpected type received (",n+=s,null!=t&&(n+=" ("+t_v_display(t)+")"),i||(n+=")"),r&&(n+=' for "'+r+'"'),null!=e&&(n+=" (index "+e+")"),_.fromFn||(_.fromFn=t_err_type),new t_err_TypeError(n,_)},t_s_endsWith=function(t,e){if(t_s_is(e))return t.endsWith(e);if(t_re_is(e))return!!t_re_matchEnd(e,t);throw t_err_type(e,1,"matchThis")},t_path_ensureTrailingSlash=function(t){return t_s_endsWith(t,t_path_sep)?t:t+t_path_sep},t_path_dir=function(t,e){return t=t_node_path().dirname(t),!1===e?t:t_path_ensureTrailingSlash(t)},t_path_abs=function(t,e,r){var _=t_node_path().resolve,n=e?_(e,t):_(t);return r?n+t_path_sep:n},t_titan_getPackagePath=function(t,e,r,_){var n,s=t_titan_getPackageName(t,e,r,_);return n=t?t_path_dir(t):"./",t_path_abs(n+s)},t_err_create=function(t,e,r){var _=new t_err_Error(t,r);return e&&Object.assign(_,e),_},t_titan_locate=t_f_one(function(){var t=process.env.TITAN_PATH;if(!t)throw t_err_create("Environment variable TITAN_PATH is not set.");return t_path_ensureTrailingSlash(t)}),t_titan_getCompiledDir=t_f_one(function(){return t_titan_locate()+"Compiled/"}),t_d_now=function(){return new Date},t_err_req=function(t,e,r,_){var n="Required argument";return r&&(n+=' "'+r+'"'),null!=e&&(n+=" (index "+e+")"),n+=" missing",arguments.length>0&&(n+=" (received "+t_v_display(t)+")"),t_err_create(n,null,t_err_defaultFromFn(_,t_err_req))},t_d_copy=function(t){return new Date(t.getTime())},t_d_fromYear=function(t){return new Date(t,null)},t_d__resolveNative=function(t){var e=new Date(t);return isNaN(e.getTime())?null:e},t_v_nullIfNaN=function(t){return isNaN(t)?null:t},t_n_ensure=function(t){return null==t?null:t_v_nullIfNaN(Number(t))},t_n_fromString=t_n_ensure,t_n_is=function(t){var e=typeof t;return"number"===e||"bigint"===e},t_d_ensure=function(t,e){if(null==t)throw t_err_req(t,0);if(t.constructor===Date)return e?t_d_copy(t):t;if(t_s_is(t)){var r=t_n_fromString(t);return null!=r?t_d_fromYear(r):t_d__resolveNative(t)||null}return t_n_is(t)?t_d_fromYear(t):void 0},t_d_resolve=function(t,e){return null==t?t_d_now():t_d_ensure(t,e)},t_d_create=function(t){return t_d_resolve(t,!0)},t_d_from=t_d_create,t_titan_getLastCompileTime=function(){var t=t_titan_getCompiledDir()+"LastCompileTime.txt";return t_fs_exists(t)?t_d_from(t_fs_load(t)):null},t_fs_getModifiedDate=function(t){return t_fs_stat(t).mtime},t_d_isBefore=function(t,e,r){return t=t_d_ensure(t),e=t_d_ensure(e),!1===r?t<e:t<=e},t_titan_hasNewCompile=function(t){var e=t_titan_getLastCompileTime();if(e){var r=t_fs_getModifiedDate(t);if(t_d_isBefore(r,e))return!0}return!1},t_node_getScriptDir=function(t){var e=t_node_getScriptPath();return e?t_path_dir(e,t):null},t_fs_loadJSON=function(t){return JSON.parse(t_fs_loadText(t))},t_o_addGetterAndSetter=function(t,e,r,_,n){return t_o_defineProperty(t,e,{get:r,set:_},n)},t_o_setGetterAndSetter=t_o_addGetterAndSetter,t_o_replaceGetterAndSetter=function(t,e,r,_){return t_o_defineProperty(t,e,{value:r,writable:!0},_)},t_o_setLazy=function(t,e,r,_){t_o_setGetterAndSetter(t,e,function(){var _=r(e,t);return this[e]=_,_},function(t){t_o_replaceGetterAndSetter(this,e,t,_)},_)},t_titan__trackGlobals=function(t,e){var r=t.globals,_=t.shortNamesToGlobals;Object.keys(_).forEach(t=>{for(var n=_[t],s=n.length,i=0;i<s;i++){var a=n[i],o=globalThis[a];o||(o=globalThis[a]={});var u=r[a];Object.keys(u).forEach(r=>{var _=e[t][r];o[r]=_})}}),e._meta||(e._meta={}),e._meta.globals=t.globals},t_titan__loadDynamicDeps=function _loadDynamicDeps(dynPackagePath,localT,options){const path=t_node_path();if(dynPackagePath)dynPackagePath=path.resolve(t_node_getScriptDir(),dynPackagePath);else{var scriptPath=t_node_getScriptPath();if(!scriptPath)throw new Error("Cannot find package name because scriptPath does not exist.");var dir=path.dirname(scriptPath),baseName=path.basename(scriptPath).split(".")[0];baseName=baseName[0].toLowerCase()+baseName.slice(1),dynPackagePath=path.join(dir,baseName+".pkg.json")}for(var packageObj=t_fs_loadJSON(dynPackagePath),setLazy=t_o_setLazy,items=packageObj.itemsInOrder,numItems=items.length,i=0;i<numItems;i++){let item=items[i],[shortName,itemName,evalText]=item,tModObj=localT[shortName];tModObj||(tModObj=localT[shortName]={}),Object.hasOwn(tModObj,itemName)||setLazy(tModObj,itemName,function(){let t=localT;return eval("("+evalText+")")})}packageObj.globals&&t_titan__trackGlobals(packageObj,localT)},t_node__basicRequire=function(t){return require(t)},t_npm_isBuiltIn=function(t){return!!t.startsWith("node:")||t_node__basicRequire("node:module").isBuiltin(t)},t_npm_isFile=function(t){return t.startsWith(".")},t_err_ValueError=class extends t_err_Error{constructor(t,e){super(t??"Unexpected value",e)}},t_err_value=function(t,e,r,_){if(0===arguments.length)return new t_err_ValueError("Unexpected value received");_||(_={});var n,{expected:s}=_;return n=s?"Received "+t_v_display(t)+", expected one of "+t_v_display(s):"Unexpected value received: "+t_v_display(t),r&&(n+=' for "'+r+'"'),null!=e&&(n+=" (index "+e+")"),_.fromFn||(_.fromFn=t_err_value),new t_err_ValueError(n,_)},t_os__resolveStdio=function(t){var e=t.stdio;if(e){if(!t_a_is(e)){if(!t_s_is(e))throw t_err_type(e,"stdio");if("pipe"===e)e=["pipe","pipe","pipe"];else if("inherit"===e)e=["inherit","inherit","inherit"];else if("ignore"===e)e=["ignore","ignore","ignore"];else{if("overlapped"!==e)throw t_err_value(e,"stdio");e=["overlapped","overlapped","overlapped"]}t.stdio=e}}else e=t.stdio=[null,null,null];return e},t_a_replaceContents=function(t,e){var r=e.length;t.length=r;for(var _=0;_<r;_++)t[_]=e[_];return t},t_f_not=function(t){return function(){return!t.apply(this,arguments)}},t_a_removeByFilter=function(t,e){return t_a_replaceContents(t,t.filter(t_f_not(e)))},t_a_removeNullish=function(t){return t_a_removeByFilter(t,t=>null==t)},t_node_child_process=t_node__builtInModule("child_process"),t_win_is=t_f_one(function(){return"win32"===process.platform}),t_shell__handleError=function(t,e,r){if(r||(r={}),e(t))throw t;if(r.nullOnErr)return null;var _=r.onErr;if(void 0!==_)return t_v_resolve(_);throw t},t_os_run=function(t,e,r){r||(r={}),r.dir&&(r.cwd=r.dir);var _=t_os__resolveStdio(r);if(null==_[0]){var n=r.allowInput,s=r.input;if(n&&s)throw t_err_create("allowInput (user) and input (programmatic) cannot be used simultaneously for synchronous child processes.");n&&(_[0]="inherit")}if(null==_[1]){var i=r.captureOutput??!1,a=r.showOutput;if(i&&a)throw t_err_create("captureOutput and showOutput cannot be used simultaneously for synchronous child processes.");i?_[1]="pipe":(null==a&&(a=!0),_[1]=a?"inherit":"ignore")}if(null==_[2]){var o=r.captureErr??!1,u=r.showErr;if(o&&u)throw t_err_create("captureErr and showErr cannot be used simultaneously for synchronous child processes.");o?_[2]="pipe":(null==u&&(u=!0),_[2]=u?"inherit":"ignore")}r.encoding||(r.encoding="utf8"),e&&t_a_removeNullish(e);try{var l=t_node_child_process().execFileSync(t,e,r);null!=l&&!1!==r.trim&&(l=l.trim());var c=r.map??r.mapFn;return c&&(l=c(l)),l}catch(t){if(t_win_is())return t_shell__handleError(t,t=>"ENOENT"===t.code,r);throw t}},t_npm__runCommand=function(t,e){return e||(e={}),null==e.captureOutput&&(e.captureOutput=!1),e.shell=!0,e.filterExtensions=!1,t_os_run("npm",t,e)},t_npm_install=function(t,e,r){return t_npm__runCommand(["install",t,e?"-g":null],r)},t_node_requireLocal=function(t){return require(t_path_abs(t))},t_o_Cache=class{constructor(){this.store={}}get(t,e){return t_o_ensure(this.store,t,e)}remove(t){return delete this.store[t]}delete(t){return this.remove(t)}},t_node__requireDirCache=new t_o_Cache,t_path_join=function(t,e,r){if(t_node_is()){var _=t_node_path().join(t,e);return r?t_path_ensureTrailingSlash(_):_}throw t_err_nyi()},t_path_ensureEndsWith=function(t,e){return t.endsWith(e)?t:t_path_join(t,e)},t_node_module=t_node__builtInModule("module"),t_node__createRequire=function(t){return t=t_path_ensureEndsWith(t,"node_modules"),t_node_module().createRequire(t)},t_node__requireFromDir=function(t,e){return t_node__requireDirCache.get(t,()=>t_node__createRequire(t))(e)},t_o_ensureMulti=function(t,e,r){return Object.keys(e).forEach(_=>t_o_ensure(t,_,e[_],r)),t},t_o_setDefaults=function(t,e,r){return e?t_o_ensureMulti(t,e,r):t},t_s__removeStringFromEnd=function(t,e){return t.endsWith(e)?t.substring(0,t.length-e.length):t},t_s__removeRegexFromEnd=function(t,e){var r=t_re_matchEnd(e,t);return r?t.slice(0,r.index):t},t_s_removeFromEnd=function(t,e){if(t_s_is(e))return t_s__removeStringFromEnd(t,e);if(t_re_is(e))return t_s__removeRegexFromEnd(t,e);throw t_err_type(e,1)},t_s_removeTrailing=t_s_removeFromEnd,t_s_splitAtIndex=function(t,e){return[t.slice(0,e),t.slice(e)]},t_js_splitLastExpression=function(t){t=t_s_removeTrailing(t.trim(),";");var e=Math.max(t.lastIndexOf(";"),t.lastIndexOf("\n"));return t_s_splitAtIndex(t,e+1)},t_s_ensureStartsWith=function(t,e){return t.startsWith(e)?t:e+t},t_js_ensureReturn=function(t){var[e,r]=t_js_splitLastExpression(t);return e+t_s_ensureStartsWith(r.trim(),"return ")},t_js__nodeEnableAwait=function(t){return t_node_require("node-repl-await").processTopLevelAwait(t)},t_js_enableAwait=function(t){return t_js__nodeEnableAwait(t)??t},t_s_replace=t_s_replaceAll,t_path_fws=function(t,e){return""===t?t:(!1!==e&&(t=t_path_ensureTrailingSlash(t)),t_s_replace(t,"\\","/"))},t_js_useTitan=function(t){return'require("'+t_path_fws(t_titan_getPackagePath(),!1)+'");\n'+t},t_s_removeAll=function(t,e){return t_s_replaceAll(t,e,"")},t_s_removeMulti=function(t,e){return e.forEach(e=>t=t_s_removeAll(t,e)),t},t_s_removeLineBreaks=function(t){return t_s_removeMulti(t,["\r","\n"])},t_js_inline=function(t){return t_s_removeLineBreaks(t_js_removeComments(t))},t_js_enhance=function(t,e,r){return(e||r)&&(e||(e={}),r&&t_o_setDefaults(e,r),e.ensureReturn&&(t=t_js_ensureReturn(t)),e.topLevelAwait&&(t=t_js_enableAwait(t)),e.useTitan&&(t=t_js_useTitan(t)),e.keepAlive&&(t="\nsetInterval(()=>{}, 100000);\n"+t),(e.logErrors||e.keepAlive)&&(t="process.on('uncaughtException', console.error);\nprocess.on('unhandledRejection', console.error);\n"+t),e.inline&&(t=t_js_inline(t))),t},t_s_ensure=function(t){return t_s_is(t)?t:t_s_from(t)},t_f_isArrowString=function(t){var e=t.indexOf("{");return-1===e||t.slice(0,e).includes("=>")},t_s__matchWithIndices=function(t,e,r,_,n){return t_s_withIndices(t,e,r,_,(e,r)=>null===e?null:(e.input=t,void 0!==r&&(e.index+=r),e),n)},t_a_pushThroughMulti=function(t,e){return t.splice(t.length,0,...e),e},t_a_addMulti=function(t,e){return t_a_pushThroughMulti(t,e),t},t_a_pushMulti=t_a_addMulti,t_re_RegexResult=class extends Array{constructor(t,e,r,_,n){if(-1===e)throw t_err_create("RegexResult index cannot be -1. For empty result, use bare null.");if(null==t)throw t_err_create("RegexResult matchString cannot be null. For empty result, use bare null.");super(),this[0]=t,_&&t_a_pushMulti(this,_),this.index=e,this.input=r,n&&(this.groups=n)}fromParts(t){var e=t;return new t_re_RegexResult(e.match,e.index,e.input,e.captures,e.groups)}},t_re_createResult=function(t,e,r,_,n){return new t_re_RegexResult(t,e,r,_,n)},t_re_safeCreateResult=function(t,e,r,_,n){return-1===e||null==t?null:t_re_createResult(t,e,r,_,n)},t_s_remove=t_s_removeAll,t_re_removeFlag=function(t,e){return t_re_copy(t,t_s_remove(t.flags,e))},t_re_local=function(t){return t_re_removeFlag(t,"g")},t_re_ensureLocal=t_f_memoize(function(t){return t.global?t_re_local(t):t},0),t_re_match=function(t,e,r){return(t=null!=r?t_re_setStartIndex(t,r,e):t_re_ensureLocal(t)).exec(e)},t_s_match=function(t,e,r,_,n){return t_s__matchWithIndices(t,t=>{if(t_s_is(e)){var r=t.indexOf(e);return t_re_safeCreateResult(e,r,t)}return t_re_match(e,t)},r,_,n)},t_re_resultEndIndex=function(t){return t.index+t[0].length},t_s_after=function(t,e){var r=t_s_match(t,e);return null===r[0]?null:t.slice(t_re_resultEndIndex(r))},t_s__removeStringFromStart=function(t,e){return t.startsWith(e)?t.substring(e.length):t},t_re_matchStart=function(t,e){var r=t_re_match(t,e);return r&&0===r.index?r:null},t_s__removeRegexFromStart=function(t,e){var r=t_re_matchStart(e,t);return r?t.slice(r[0].length):t},t_s_removeFromStart=function(t,e){if(t_s_is(e))return t_s__removeStringFromStart(t,e);if(t_re_is(e))return t_s__removeRegexFromStart(t,e);throw t_err_type(e,1)},t_s_removeLeading=t_s_removeFromStart,t_f__getArrowFnBody=function(t){var e=t_s_after(t,"=>").trim();return t_s_removeLeading(t_s_removeTrailing(e,"}"),"{")},t_f__getNormalFnBody=function(t){return t_s_after(t,"{").slice(0,-1)},t_f_body=function(t){var e=t_s_ensure(t);return t_f_isArrowString(e)?t_f__getArrowFnBody(e):t_f__getNormalFnBody(e)},t_s_resolve=function(t){return null==t?"":t_s_is(t)?t:t_f_is(t)?t_f_body(t):String(t)},t_node_run=function(t,e){var r=e?.basic?null:{topLevelAwait:!0,useTitan:!0},_=t_js_enhance(t_s_resolve(t),e,r);return t_os_run("node",[e?.mode??"-p",_],e)},t_v_req=function(t,e,r){if(null==t)throw t_err_req(t,e,r,{fromFn:t_v_req});return t},t_proc_signal=function(t,e){return process.kill(t,t_v_req(e,0,"signalName"))},t_proc_interrupt=function(t){return t_proc_signal(t,"SIGINT")},t_node_interrupt=function(){return t_proc_interrupt(process.pid)},t_node_sigint=t_node_interrupt,t_bool_fromYN=function(t){if("Y"===(t=t.toUpperCase()))return!0;if("N"===t)return!1;throw t_err_value(t,0,"char")},t_node_promptYNSync=function(t){null==t&&(t="Are you sure? [y/n]: "),process.stdout.write(t);var e=t_node_run(function(){const t=process.stdin,e=process.stdout;t.setRawMode(!0),t.setEncoding("utf8"),t.on("data",t=>{var r=t.toUpperCase();"Y"===r||"N"===r?(e.write(t),process.exit(0)):""===t&&(e.write("^C"),process.exit(0))})},{mode:"-e",basic:!0,stdio:["inherit","pipe"]});if("^C"===e)throw process.stdout.write(e),t_node_sigint(),t_err_create("Prompt was cancelled via interrupt.");return console.log(e),t_bool_fromYN(e)},t_o_resolveKeys=function(t){return t_a_is(t)?t:t_s_is(t)?t.split("."):[t]},t_tree_setCustom=function(t,e,r,_,n,s){var i=r;return t_tree_dive(t,e,_,n,s,(t,e,r)=>r(t,e,t_v_resolve(i)))},t_env_setConfig=function(t,e){var r=e,_=globalThis.config;_||(_=globalThis.config={});var n,s=t_o_resolveKeys(t);return s.length>1?n=t_tree_setCustom(_,s,r):(n=t_v_resolve(r),_[s[0]]=n),n},t_node_addRequireDir=function(t,e){return t_env_setConfig("node.require.customDirs",r=>(r||(r=[]),!1!==e&&(t=t_path_ensureEndsWith(t,"node_modules")),r.includes(t)||r.push(t),r)),t},t_node_ensureRequireDir=t_node_addRequireDir,t_o_diveGet=t_tree_dive,t_env_getConfig=function(t){var e=globalThis.config;if(e){var r=t_o_resolveKeys(t);return r.length>1?t_o_diveGet(e,r):e[r[0]]}},t_env_resolveConfig=function(t,e,r){if(null!=t)return t;var _=t_env_getConfig(e);return null!=_?_:r},t_fs_ensureParent=function(t){var e=t_path_dir(t,!1);return t_fs_exists(e)||(e!==t&&t_fs_ensureParent(e),t_node_fs().mkdirSync(e)),t},t_fs_mkdir=function(t){return t_fs_ensureParent(t),t_node_fs().mkdirSync(t),t},t_fs_ensureDir=function(t){return t_fs_exists(t)?t:t_fs_mkdir(t)},t_node_require=function(t,e){if(t_npm_isBuiltIn(t))return require(t);if(t_npm_isFile(t))return t_node_requireLocal(t);try{return require(t)}catch(t){}var r=__dirname,_=process.mainModule?.path;if(_!==r)try{return t_node__requireFromDir(_,t)}catch(t){}var n=process.cwd();if(n!==_&&n!==r)try{return t_node__requireFromDir(n,t)}catch(t){}var s=t_env_getConfig("node.require.customDirs");if(s)for(var i of s)try{return t_node__requireFromDir(i,t)}catch(t){}var a=t_env_resolveConfig(e?.autoInstall,"node.require.autoInstall"),o=t_env_resolveConfig(e?.promptInstall,"node.require.promptInstall",!0);if(a||o){var u=a||o;!0===u&&(u="./node_modules"),u=t_path_abs(u);var l=!1;if(a?(l=!0,console.log('Auto-installing "'+t+'" from npm to "'+u+'"...')):(l=t_node_promptYNSync('Npm package "'+t+'" is required. Install now? (Y/N) '))&&console.log('Installing "'+t+'" from npm to "'+u+'"...'),l){u=t_fs_ensureDir(u),t_npm_install(t,!1,{cwd:u});try{return t_node_ensureRequireDir(u),t_node__requireFromDir(u,t)}catch(t){console.error("Failed to load from auto-install dir: ",u)}}}throw t_err_create('Module not found: "'+t+'"',{checked:{moduleDir:r,scriptDir:_,cwd:n}})},t_js_fromAST=function(t,e){return t_node_require("astring").generate(t,e)},t_err_prepend=function(t,e){return t.stack=e+"\n"+t.stack,t},t_js_parse=function(t,e,r){r||(r={}),r.ecmaVersion||(r.ecmaVersion=2024),!1!==e&&(r.sourceType="module"),null==r.allowAwaitOutsideFunction&&(r.allowAwaitOutsideFunction=!0),null==r.allowReturnOutsideFunction&&(r.allowReturnOutsideFunction=!0);var _=t_node_require("acorn");try{return _.parse(t,r)}catch(e){throw t_err_prepend(e,"Acorn parsing error: "+t)}},t_js_removeComments=function(t,e,r){return t_js_fromAST(t_js_parse(t,e,r))},t_re_quote=/(['"])(.*?)\1/,t_re_quotes=t_re_global(t_re_quote),t_s_removeQuotes=function(t){return t.replace(t_re_quotes,"")},t_js_removeQuotes=t_s_removeQuotes,t_tree_copy=function(t){return globalThis.structuredClone(t)},t_o_deepCopy=t_tree_copy,t_f_cache=t_f_memoize,t_re_newline=/\r?\n/,t_v_isEmpty=function(t){return null==t||void 0!==t.length&&0===t.length},t_a_removeEmpty=function(t,e){return t_a_removeByFilter(t,t_v_isEmpty)},t_a_removeIndex=function(t,e){return t.splice(e,1),t},t_a_apply=function(t,e,r,_){[r,_]=t_a_resolveIndices(t,r,_);for(var n=r;n<_;n++){var s=e(t[n],n,t);void 0!==s&&(t[n]=s)}return t},t_a_mapToObj=function(t,e,r){for(var _={},n=t.length,s=0;s<n;s++){var i=e(t[s],s,t);if(i){var[a,o]=i;r?(_[a]||(_[a]=[]),_[a].push(o)):_[a]=o}}return _},t_a_slice=function(t,e,r,_){return[e,r]=t_a_resolveIndices(t,e,r,_),t.slice(e,r)},t_s_repeat=function(t,e){return t_a_create(e,t).join("")},t_re_text=function(t){return t?t[0]:null},t_s__splitByMatch=function(t,e){var r=null==e?-1:e.index;if(-1===r)return[t];var _=t_s_splitAtIndex(t,r);return _[1]=_[1].slice(e[0].length),_},t_s_splitFirst=function(t,e,r,_,n){return t_s__splitByMatch(t,t_s_match(t,e,r,_,n))},t_n_tryParse=t_n_ensure,t_n_tryCoerce=function(t){return t_n_tryParse(t)??t},t_o_fromLines=function(t,e){null==e&&(e="=");var r={};return t.forEach(function(t){var[_,n]=t_s_splitFirst(t,e);null!=n&&(n=t_n_tryCoerce(n.trim())),r[_.trim()]=n}),r},t_o_safeDefault=t_o_safeEnsure,t_s_LinesArray=class extends Array{constructor(t){var e,r=t;null!=r&&(t_a_is(r)?e=r:t_s_is(r)&&(e=r.split(t_re_newline))),e?(super(e.length),Object.assign(this,e)):super(...arguments)}condense(t){return this.trim().removeEmpty(),t&&this.removeComments(t),this}trim(){return this.apply(t=>t.trim())}removeEmpty(){return t_a_removeEmpty(this)}removeComments(t){for(var e=0;e<this.length;e++){var r=this[e],_=r.indexOf(t);-1!==_&&(""===(r=r.slice(0,_)).trim()?(t_a_removeIndex(this,e),e--):this[e]=r)}return this}removeFirst(){return this.shift(),this}removeLast(){return this.pop(),this}apply(t){return t_a_apply(this,t)}join(){return super.join("\n")}toObj(t){return t_o_fromLines(this,t)}mapToObj(t,e){return t_a_mapToObj(this,t,e)}between(t,e,r){return r=t_o_safeDefault(r,"inclusiveEnd",!0),t_a_slice(this,t,e,r)}normalize(){if(this.length>0&&(""===this[0].trim()&&this.shift(),this.length>0&&(""===t_a_last(this).trim()&&this.pop(),this.length>0))){var t=this.find(t=>""!==t.trim()),e=t_re_text(t_re_match(/^\s*/,t));if(e){var r=e.length;this.apply(t=>{if(t.startsWith(e))return t.slice(r)})}}return this}deindent(t,e,r){throw t_err_nyi()}indent(t,e){var r=t_s_repeat(e??"\t",t??1);return this.apply(t=>r+t)}static is(t){return t_v_constructorMatches(t,this)}static fromChunks(t){return t.map(t=>t_s_removeTrailing(t,t_re_newline)).flatMap(t=>t_s_splitLines(t,!1))}},t_s_lines=function(t,e){var r=new t_s_LinesArray(t);return e&&r.condense(),r},t_s_splitLines=function(t,e,r){var _=t.split(t_re_newline);return e?t_s_lines(_,r):_},t_fs_loadLines=function(t,e){return t_s_splitLines(t_fs_loadText(t),!0,e)},t_re_test=function(t,e){return t_re_ensureLocal(t).test(e)},t_s_contains=function(t,e){return t_re_is(e)?t_re_test(e,t):t.includes(e)},t_s__createParamsObj=function(t,e,r,_){null==t&&(t=""),null==e&&(e="");var n={},s=(r,_)=>n[t+r+e]=_;return _&&t_o_each(_,s),r&&t_o_each(r,s),n},t_s__replaceByObj=function(t,e){return t_o_each(e,(e,r)=>t=t_s_replaceAll(t,e,r)),t},t_s_replaceParams=function(t,e,r,_){var n,s,i=_?.paramIdentifier??"$";if(i)if(t_s_is(i)){if(!t_s_contains(t,i))return t;n=i}else{if(!t_a_is(i))throw t_err_type(i,1,"paramIdentifier");if([n,s]=i,!t_s_contains(t,n)&&!t_s_contains(t,s))return t}var a=t_s__createParamsObj(n,s,e,r);return t_s__replaceByObj(t,a)},t_path_string=function(t){return t_s_is(t)?t:String(t)},t_path_windir=globalThis.process?.env.windir,t_path_getUserDir=function(t){if(t)throw t_err_nyi();return t_node_os().homedir()+t_path_sep},t_path_getDesktop=function(t){return t_path_getUserDir(t)+"Desktop/"},t_path__defaultParams={PROGRAMFILES:globalThis.process?.env.ProgramFiles,WINDIR:t_path_windir,SYSTEM32:t_path_windir&&t_path_windir+"System32",TEMP:t_path__getDefaultTempDir(),DESKTOP:t_path_getDesktop()},t_path_resolveVars=function(t,e){return t_s_replaceParams(t_path_string(t),e,t_path__defaultParams)},t_titan_locateSourceMap=function(){return t_titan_locate()+"Source/SourceMap.txt"},t_titan__resolveSourceMapPath=function(t){return t?t_path_resolveVars(t,{TITAN:t_titan_locate()}):t_titan_locateSourceMap()},t_s__indexWithIndices=function(t,e,r,_,n){return t_s_withIndices(t,e,r,_,(t,e)=>-1===t?-1:void 0===e?t:e+t,n)},t_s_indexOfFn=function(t,e){return Array.prototype.findIndex.call(t,e)},t_s_index=function(t,e,r,_,n){var s=t_s_is(e);return s&&null==_&&!n?t.indexOf(e,r):t_s__indexWithIndices(t,t=>s?t.indexOf(e):t_re_is(e)?t.search(e):t_s_indexOfFn(t,e),r,_,n)},t_s_before=function(t,e,r,_,n){var s=t_s_index(t,e,r,_,n);return-1===s?null:t.slice(r,s)},t_s_isCapitalized=function(t){var e=t[0];return e===e.toUpperCase()},t_a_filterSplit=function(t,e){var r=[],_=[];return t.forEach((n,s)=>(e(n,s,t)?r:_).push(n)),[r,_]},t_titan_loadGlobalsMap=t_f_cache(function(t){var e=t_fs_loadLines(t_titan__resolveSourceMapPath(t),!0),r={};return e.forEach(t=>{var e=t_s_before(t,"=").split(",").map(t=>t.trim()),[_,n]=t_a_filterSplit(e,t=>!t_s_isCapitalized(t)),s=_[0];if(!s)throw t_err_create('No shortName in SourceMap line: "'+t+'"');n.forEach(t=>{r[t]=s})}),r},0),t_titan__getGlobalsRegex=t_f_one(function(t){var e=Object.keys(t);return t_re_create("\\b("+e.join("|")+")\\.(\\w+)","g")}),t_titan_depsRegex=/\bt\.(\w+)\.(\w+)/g,t_titan__getDepsBasic=function(t,e){e||(e={});var r={},_=r.t={};if(e.enableGlobals){var n;n=e.additionalGlobals?t_o_deepCopy(e.additionalGlobals):{},r.globals=n;var s=t_titan_loadGlobalsMap(),i=t_titan__getGlobalsRegex(s),a=t_re_matchAll(i,t).filter(e=>{var r=e[1],_=e[2],n=t[e.index-1];if("."===n||"_"===n)return!1;var s=globalThis[r];return!s||void 0===s[_]});for(var[o,u,l]of a)n[u]||(n[u]={}),n[u][l]=!0;var c=a.map(([t,e,r])=>{var _=s[e];if(!_)throw t_err_create("No short name found for global: "+e);return"t."+_+"."+r+";"}).join(" ");t+="\n"+c}for(var[o,f,l]of a=t.matchAll(t_titan_depsRegex))_[f]||(_[f]={}),_[f][l]=!0;return r},t_titan_getDepsFromJS=function(t,e){return t=t_js_removeComments(t),t=t_js_removeQuotes(t),t_titan__getDepsBasic(t,e)},t_titan_getDepsFromHTML=function(t,e){return t_titan__getDepsBasic(t,e)},t_titan_getShallowDeps=function(t,e,r){if(e){if("js"===(e=e.toLowerCase()))return t_titan_getDepsFromJS(t,r);if("html"===e)return t_titan_getDepsFromHTML(t,r)}return t_titan__getDepsBasic(t,r)},t_o_has=function(t,e){return e in t},t_o_hasKey=t_o_has,t_tree_isSubsetOf=function(t,e){for(var r of(t_v_req(e,1),Object.keys(t))){if(!t_o_hasKey(e,r))return!1;var _=t[r];if(_&&_.constructor===Object&&!t_tree_isSubsetOf(_,e[r]))return!1}return!0},t_titan_jsonHasNewDeps=function(t,e){if(!t_tree_isSubsetOf(e.t,t))return!0;if(e.globals){var r=t._meta?.globals;if(!r)return!0;if(!t_tree_isSubsetOf(e.globals,r))return!0}return!1},t_titan_needsToPack=function(t,e,r,_){var n,s,i,a;_||(_={}),t&&(t=t_path_abs(t)),n=_.packagePath?t_path_abs(_.packagePath):t_titan_getPackagePath(t,!1,!0,_);var o,u=t_fs_exists(n);u?(s=t_titan_hasNewCompile(n))?i="New compile":(null==e&&(e=t_fs_loadText(t)),a=t_titan_getShallowDeps(e,"js",_),(o=t_titan_jsonHasNewDeps(r,a))&&(i="New deps")):i="No package";var l={needsPack:!!i,scriptPath:t,packagePath:n};return i&&(l.reasonText=i),null!=u&&(l.exists=u),null!=s&&(l.newCompile=s),null!=o&&(l.newDeps=o),e&&(l.sourceText=e),a&&(l.shallowDeps=a),l},t_path_isDir=function(t){return t_s_endsWith(t,t_path_sep)},t_path_dirPart=function(t){var e=t.lastIndexOf(t_path_sep);return-1===e?null:t.slice(0,e+1)},t_path_ignoreDir=function(t,e,r){if(t_path_isDir(t))return r?[t,null]:t;var _,n,s=t_path_dirPart(t),i=e(t_path_file(t),s,t);return r?[_,n]=i:_=i,null!=_&&(t=s?s+_:_),r?[t,n]:t},t_s_matchLast=function(t,e,r,_,n){return t_s__matchWithIndices(t,t=>{if(t_re_is(e))return t_re_matchLast(e,t);if(t_s_is(e)){var r=t.lastIndexOf(e);return-1!==r?new t_re_RegexResult(e,r):null}throw t_err_type(e,1)},r,_,n)},t_s_splitLast=function(t,e,r,_,n){return t_s__splitByMatch(t,t_s_matchLast(t,e,r,_,n))},t_path_splitExt=function(t){return t_path_ignoreDir(t,t=>t_s_splitLast(t,"."),!0)},t_path_ext=function(t,e){var r=t_path_splitExt(t)[1];return r?!1!==e?r.toLowerCase():r:null},t_titan_sourceMap={},t_titan_loadSourceMap=t_f_cache(function(t){t=t_titan__resolveSourceMapPath(t);var e=t_path_dir(t)+"../Compiled/",r=t_fs_loadLines(t,"//"),_=t_titan_sourceMap;for(var n of r){var s=n.indexOf("="),i=n.slice(0,s).trim();i=i.split(",").map(t=>t.trim()).filter(t=>!t_s_isCapitalized(t));var a=n.slice(s+1).trim(),o=t_path_join(e,a).replaceAll("\\","/");for(var u of i)_[u]=o}return _},0),t_titan_getDeps=function(t,e){var r=e?.fileType;if(r){if("js"===(r=r.toLowerCase()))return t_titan_getDepsFromJS(t,e);if("html"===r)return t_titan_getDepsFromHTML(t,e)}return t_titan__getDepsBasic(t,e)},t_gen_filter=function*(t,e){var r=0;for(var _ of t)e(_,r++,t)&&(yield _)},t_a_copy=function(t){return t.slice()},t_args_insert=function(t,e,r){for(var _=t.length-1;_>=e;_--)t[_+1]=t[_];return t[e]=r,t.length++,t},t_args_append=function(t,e){return t_args_insert(t,t.length,e)},t_args_push=t_args_append,t_f_recurse=function(t,e){return t.call(this,...e,function e(){return t_a_last(arguments)!==e&&t_args_push(arguments,e),t.apply(this,arguments)})},t_tree_iterator=function(t){t||(t={});var e=t.getKeys;e||(e=function(t){return Object.keys(t)});var r=t.recurseIf;if(!r){var _=this.constructor;r=t=>t_v_constructorMatches(t,_)||t_o_isPure(t)||t_a_is(t)}var n=t.leavesOnly??t.leafsOnly??!1,s=this;return t_f_recurse(function*(t,_,i,a){var o=e(t,_,i);if(o)for(var u=o.length,l=0;l<u;l++){var c=o[l],f=t[c],p=t_a_copy(_);p.push(c);var d=null,m={value:f,key:c,object:t,path:p,level:i,isLeaf:d,root:s},h=r(f,m);m.isLeaf=d=!h,n&&!d||(yield m),h&&(yield*a(f,p,i+1,a))}},[this,[],0])},t_tree_iterate=function(t,e){return t_tree_iterator.call(t,e)},t_o_fromKeys=function(t,e){1===arguments.length&&(e=!0);var r={};for(var _ of t)r[_]=e;return r},t_js_eachNode=function(t,e,r,_){var n=t_js_parse(t,e,_);t_node_require("acorn-walk").full(n,r)},t_js_getNodes=function(t,e,r,_){var n;if(t_s_is(r))n=t=>t.type===r;else if(t_a_is(r)){var s=t_o_fromKeys(r);n=t=>s[t.type]}else n=r;var i=[];return t_js_eachNode(t,e,function(t){n.apply(this,arguments)&&i.push(t)},_),i},t_js_fromASTNode=t_js_fromAST,t_js_parseDeclaration=function(t){var e,r,_,n=t,s=t_s_is(n)?t_js_parse(n).body[0]:n,i=s.type;if("VariableDeclaration"===i){e="variable";var a=s.declarations[0];r=a.id.name,_=a.init?a.init.raw??t_js_fromAST(a.init):"undefined"}else"FunctionDeclaration"===i?e="function":"ClassDeclaration"===i&&(e="class"),r=s.id.name;var o={type:e,name:r};return _&&(o.value=_),o.text=t_js_fromASTNode(s),o.node=s,o},t_js_getExports=function(t){return t_js_getNodes(t,!0,["ExportNamedDeclaration","ExportDefaultDeclaration"]).map(function(t){var e=t.declaration;if(e){var r=t_js_parseDeclaration(e);return r.node=t,r}return{node:t}})},t_titan__getAllDeps=function(t,e){e||(e={});var r=e.enableGlobals,_=t_titan_loadSourceMap(e.sourceMap),n={},s=[];return function t(e,i){var a=t_gen_filter(t_tree_iterate(e),t=>t.isLeaf);for(var o of a){var[u,l]=o.path,c=n[u];if(c||(c=n[u]={}),null==c[l]){var f=_[u];if(f){var p=t_path_fws(f)+l+".js";if(!t_fs_exists(p)){var d='Titan compiled value "t.'+u+"."+l+'" does not exist';throw i&&(d+=' (called by "'+i+'")'),t_err_create(d+=".")}var m=t_fs_load(p),h=t_js_getExports(m)[0];c[l]=h;var v="t."+u+"."+l;t(t_titan_getDeps(m,{fileType:"js",enableGlobals:r}).t,v),s.push([u,l])}else console.log('Skipping unmapped module "'+u+'"'),c[l]=!1}}}(t.t),{t:n,globals:t.globals,order:s}},t_titan_packTextToJSON=function(t,e){e||(e={});var r=e.deps??t_titan_getShallowDeps(t,e.fileType,e),{t:_,globals:n,order:s}=t_titan__getAllDeps(r,e),i={};if(i.t=r.t,n&&e.enableGlobals){i.globals=n;var a=t_titan_loadGlobalsMap(),o=Object.keys(n),u=t_a_mapToObj(o,t=>[a[t],t],!0);i.shortNamesToGlobals=u}return i.itemsInOrder=s.map(([t,e])=>{var r=_[t][e];return[t,e,"variable"===r.type?r.value:"("+r.text+")"]}),i},t_tree_join=function(t,e,r){return null==r&&(r=!0),t_f_recurse(function(t,e,_){t_o_each(t,function(t,n){if(t_o_hasKey(e,t)){var s=e[t];r?t_o_is(s)&&t_o_is(n)?_(n,s):e[t]=n:t_o_is(s)&&_(n,s)}else e[t]=n})},[t,e]),e},t_tree_merge=t_tree_join,t_o_fromArray=function(t){return Object.assign({},t)},t_a_toObj=function(t,e){if(e){var r={};return t.forEach((t,_,n)=>r[e(t,_,n)]=!0),r}return t_o_fromArray(t)},t_titan_addNewItemsToJSON=function(t,e){t_tree_merge(e.t,t.t,!1);var r=e.globals;if(r){var _=t.globals;_?t_tree_merge(r,_,!1):t.globals=r,t.shortNamesToGlobals=e.shortNamesToGlobals}var n=t_a_toObj(t.itemsInOrder,t=>t[0]+"."+t[1]);return e.itemsInOrder.forEach(e=>{n[e[0]+"."+e[1]]||t.itemsInOrder.push(e)}),t},t_bin_isNodeBuffer=function(t){return t instanceof Buffer},t_ab_isTA=function(t){return ArrayBuffer.isView(t)},t_bin_isTA=t_ab_isTA,t_bin_isByteSafe=function(t){return t_bin_isNodeBuffer(t)||t_bin_isTA(t)||t_s_is(t)},t_ab_is=function(t){return t.constructor===ArrayBuffer},t_bin_ensureByteSafe=function(t){return t_bin_isByteSafe(t)?t:t_ab_is(t)?Buffer.from(t):t_s_from(t)},t_fs_formatRaw=function(t){return t_n_is(t)?String(t):t_bin_ensureByteSafe(t)},t_fs_write=function(t,e){return t_fs_ensureParent(t),t_node_fs().writeFileSync(t,t_fs_formatRaw(e)),t},t_json_stringify=function(t,e){var r;return e||(e={}),r=e.condensed?0:null!=e.whitespace?e.whitespace:"\t",JSON.stringify(t,e.replacer,r)},t_fs_writeJSON=function(t,e,r){return t_fs_write(t,t_json_stringify(e,r))},t_titan_packTextToJSONFile=function(t,e,r){r||(r={}),r.deps||r.fileType||!e||(r.fileType=t_path_ext(e));var _=t_titan_packTextToJSON(t,r),n=r.packagePath||t_titan_getPackagePath(e,r.repl,!0,r);if(r.dynamic&&(r.packageExists??t_fs_exists(n))&&!(r.newCompile??t_titan_hasNewCompile(n))){var s=t_fs_loadJSON(n);_=t_titan_addNewItemsToJSON(s,_)}return t_fs_writeJSON(n,_),n},t_titan_autoPackAndLoadJSON=function(t,e,r,_){var n=t_titan_needsToPack(t,e,r,_);return n.needsPack&&(_.onPack&&_.onPack(n.reasonText),e=n.sourceText??t_fs_loadText(t),_.packagePath=n.packagePath,_.packageExists=n.exists,_.newCompile=n.newCompile,_.deps=n.shallowDeps,t_titan_packTextToJSONFile(e,t,_),t_titan__loadDynamicDeps(n.packagePath,r,_)),r},newItems={node:{getScriptPath:t_node_getScriptPath,positionalArgs:t_node_positionalArgs,args:t_node_args,fs:t_node_fs,_builtInModule:t_node__builtInModule,requireBuiltIn:t_node_requireBuiltIn,os:t_node_os,path:t_node_path,is:t_node_is,display:t_node_display,util:t_node_util,getScriptDir:t_node_getScriptDir,require:t_node_require,_basicRequire:t_node__basicRequire,child_process:t_node_child_process,requireLocal:t_node_requireLocal,_requireFromDir:t_node__requireFromDir,_requireDirCache:t_node__requireDirCache,_createRequire:t_node__createRequire,module:t_node_module,promptYNSync:t_node_promptYNSync,run:t_node_run,sigint:t_node_sigint,interrupt:t_node_interrupt,ensureRequireDir:t_node_ensureRequireDir,addRequireDir:t_node_addRequireDir},cli:{positionalArgs:t_cli_positionalArgs,resolveArgs:t_cli_resolveArgs,splitArgs:t_cli_splitArgs},env:{args:t_env_args,setConfig:t_env_setConfig,getConfig:t_env_getConfig,resolveConfig:t_env_resolveConfig},f:{one:t_f_one,is:t_f_is,memoize:t_f_memoize,MemoizedFunction:t_f_MemoizedFunction,createClass:t_f_createClass,ensureConstructor:t_f_ensureConstructor,createConstructor:t_f_createConstructor,isArrowFn:t_f_isArrowFn,isArrow:t_f_isArrow,wrap:t_f_wrap,retThis:t_f_retThis,setName:t_f_setName,not:t_f_not,body:t_f_body,isArrowString:t_f_isArrowString,_getArrowFnBody:t_f__getArrowFnBody,_getNormalFnBody:t_f__getNormalFnBody,cache:t_f_cache,recurse:t_f_recurse},s:{is:t_s_is,isAny:t_s_isAny,isPrimitive:t_s_isPrimitive,isObject:t_s_isObject,decapitalize:t_s_decapitalize,endsWith:t_s_endsWith,chars:t_s_chars,resolveIndex:t_s_resolveIndex,toLiteral:t_s_toLiteral,quote:t_s_quote,escape:t_s_escape,replaceAll:t_s_replaceAll,apply:t_s_apply,withIndices:t_s_withIndices,from:t_s_from,removeTrailing:t_s_removeTrailing,removeFromEnd:t_s_removeFromEnd,_removeStringFromEnd:t_s__removeStringFromEnd,_removeRegexFromEnd:t_s__removeRegexFromEnd,splitAtIndex:t_s_splitAtIndex,ensureStartsWith:t_s_ensureStartsWith,replace:t_s_replace,removeLineBreaks:t_s_removeLineBreaks,removeMulti:t_s_removeMulti,removeAll:t_s_removeAll,resolve:t_s_resolve,ensure:t_s_ensure,after:t_s_after,match:t_s_match,_matchWithIndices:t_s__matchWithIndices,remove:t_s_remove,removeLeading:t_s_removeLeading,removeFromStart:t_s_removeFromStart,_removeStringFromStart:t_s__removeStringFromStart,_removeRegexFromStart:t_s__removeRegexFromStart,removeQuotes:t_s_removeQuotes,splitLines:t_s_splitLines,lines:t_s_lines,LinesArray:t_s_LinesArray,repeat:t_s_repeat,splitFirst:t_s_splitFirst,_splitByMatch:t_s__splitByMatch,replaceParams:t_s_replaceParams,contains:t_s_contains,_createParamsObj:t_s__createParamsObj,_replaceByObj:t_s__replaceByObj,before:t_s_before,index:t_s_index,_indexWithIndices:t_s__indexWithIndices,indexOfFn:t_s_indexOfFn,isCapitalized:t_s_isCapitalized,splitLast:t_s_splitLast,matchLast:t_s_matchLast},fs:{loadText:t_fs_loadText,load:t_fs_load,getID:t_fs_getID,stat:t_fs_stat,deepStat:t_fs_deepStat,shallowStat:t_fs_shallowStat,exists:t_fs_exists,getModifiedDate:t_fs_getModifiedDate,loadJSON:t_fs_loadJSON,ensureDir:t_fs_ensureDir,mkdir:t_fs_mkdir,ensureParent:t_fs_ensureParent,loadLines:t_fs_loadLines,writeJSON:t_fs_writeJSON,write:t_fs_write,formatRaw:t_fs_formatRaw},titan:{getTempDir:t_titan_getTempDir,getPackagePath:t_titan_getPackagePath,getPackageName:t_titan_getPackageName,hasNewCompile:t_titan_hasNewCompile,getLastCompileTime:t_titan_getLastCompileTime,getCompiledDir:t_titan_getCompiledDir,locate:t_titan_locate,_loadDynamicDeps:t_titan__loadDynamicDeps,_trackGlobals:t_titan__trackGlobals,autoPackAndLoadJSON:t_titan_autoPackAndLoadJSON,needsToPack:t_titan_needsToPack,getShallowDeps:t_titan_getShallowDeps,getDepsFromJS:t_titan_getDepsFromJS,_getDepsBasic:t_titan__getDepsBasic,loadGlobalsMap:t_titan_loadGlobalsMap,_resolveSourceMapPath:t_titan__resolveSourceMapPath,locateSourceMap:t_titan_locateSourceMap,_getGlobalsRegex:t_titan__getGlobalsRegex,depsRegex:t_titan_depsRegex,getDepsFromHTML:t_titan_getDepsFromHTML,jsonHasNewDeps:t_titan_jsonHasNewDeps,packTextToJSONFile:t_titan_packTextToJSONFile,packTextToJSON:t_titan_packTextToJSON,_getAllDeps:t_titan__getAllDeps,loadSourceMap:t_titan_loadSourceMap,sourceMap:t_titan_sourceMap,getDeps:t_titan_getDeps,addNewItemsToJSON:t_titan_addNewItemsToJSON},path:{getTempDir:t_path_getTempDir,_getDefaultTempDir:t_path__getDefaultTempDir,sep:t_path_sep,baseName:t_path_baseName,_removeExtsFromFile:t_path__removeExtsFromFile,file:t_path_file,dir:t_path_dir,ensureTrailingSlash:t_path_ensureTrailingSlash,abs:t_path_abs,ensureEndsWith:t_path_ensureEndsWith,join:t_path_join,fws:t_path_fws,resolveVars:t_path_resolveVars,string:t_path_string,_defaultParams:t_path__defaultParams,windir:t_path_windir,getDesktop:t_path_getDesktop,getUserDir:t_path_getUserDir,ext:t_path_ext,splitExt:t_path_splitExt,ignoreDir:t_path_ignoreDir,isDir:t_path_isDir,dirPart:t_path_dirPart},err:{nyi:t_err_nyi,NYIError:t_err_NYIError,Error:t_err_Error,Enhanced:t_err_Enhanced,defaultFromFn:t_err_defaultFromFn,type:t_err_type,TypeError:t_err_TypeError,create:t_err_create,req:t_err_req,value:t_err_value,ValueError:t_err_ValueError,prepend:t_err_prepend},o:{safeEnsure:t_o_safeEnsure,ensure:t_o_ensure,constructorMatches:t_o_constructorMatches,is:t_o_is,isAny:t_o_isAny,setHidden:t_o_setHidden,addNonEnumerable:t_o_addNonEnumerable,defineProperty:t_o_defineProperty,weakAssign:t_o_weakAssign,merge:t_o_merge,hideKey:t_o_hideKey,makeNonEnumerable:t_o_makeNonEnumerable,ensureCustom:t_o_ensureCustom,get:t_o_get,set:t_o_set,createEmpty:t_o_createEmpty,remove:t_o_remove,display:t_o_display,toLiteral:t_o_toLiteral,isPure:t_o_isPure,reduce:t_o_reduce,each:t_o_each,keys:t_o_keys,allKeys:t_o_allKeys,setLazy:t_o_setLazy,setGetterAndSetter:t_o_setGetterAndSetter,addGetterAndSetter:t_o_addGetterAndSetter,replaceGetterAndSetter:t_o_replaceGetterAndSetter,Cache:t_o_Cache,setDefaults:t_o_setDefaults,ensureMulti:t_o_ensureMulti,resolveKeys:t_o_resolveKeys,diveGet:t_o_diveGet,deepCopy:t_o_deepCopy,fromLines:t_o_fromLines,safeDefault:t_o_safeDefault,hasKey:t_o_hasKey,has:t_o_has,fromKeys:t_o_fromKeys,fromArray:t_o_fromArray},re:{is:t_re_is,matchEnd:t_re_matchEnd,matchLast:t_re_matchLast,matchAll:t_re_matchAll,setStartIndex:t_re_setStartIndex,copy:t_re_copy,updateFlagString:t_re_updateFlagString,parseFlagString:t_re_parseFlagString,createFlagString:t_re_createFlagString,ensureGlobal:t_re_ensureGlobal,global:t_re_global,addFlag:t_re_addFlag,createEscaped:t_re_createEscaped,create:t_re_create,resolveFlags:t_re_resolveFlags,escape:t_re_escape,safeCreateResult:t_re_safeCreateResult,createResult:t_re_createResult,RegexResult:t_re_RegexResult,match:t_re_match,ensureLocal:t_re_ensureLocal,local:t_re_local,removeFlag:t_re_removeFlag,resultEndIndex:t_re_resultEndIndex,matchStart:t_re_matchStart,quotes:t_re_quotes,quote:t_re_quote,newline:t_re_newline,text:t_re_text,test:t_re_test},v:{constructorMatches:t_v_constructorMatches,isPrimitive:t_v_isPrimitive,resolve:t_v_resolve,type:t_v_type,display:t_v_display,toLiteral:t_v_toLiteral,nullIfNaN:t_v_nullIfNaN,req:t_v_req,isEmpty:t_v_isEmpty},a:{last:t_a_last,resolveIndex:t_a_resolveIndex,is:t_a_is,ensure:t_a_ensure,pick:t_a_pick,create:t_a_create,fill:t_a_fill,resolveIndices:t_a_resolveIndices,push:t_a_push,add:t_a_add,splitLast:t_a_splitLast,splitTail:t_a_splitTail,wrapIndices:t_a_wrapIndices,wrapIndex:t_a_wrapIndex,toLiteral:t_a_toLiteral,display:t_a_display,removeNullish:t_a_removeNullish,removeByFilter:t_a_removeByFilter,replaceContents:t_a_replaceContents,pushMulti:t_a_pushMulti,addMulti:t_a_addMulti,pushThroughMulti:t_a_pushThroughMulti,removeEmpty:t_a_removeEmpty,removeIndex:t_a_removeIndex,apply:t_a_apply,mapToObj:t_a_mapToObj,slice:t_a_slice,filterSplit:t_a_filterSplit,copy:t_a_copy,toObj:t_a_toObj},class:{create:t_class_create,setName:t_class_setName,addStatics:t_class_addStatics,setDisplay:t_class_setDisplay},p:{asyncJoint:t_p_asyncJoint,is:t_p_is},sym:{display:t_sym_display,value:t_sym_value},macro:{config:t_macro_config},map:{Cache:t_map_Cache,ensure:t_map_ensure,get:t_map_get,set:t_map_set,MultiCache:t_map_MultiCache,diveEnsure:t_map_diveEnsure,createEmpty:t_map_createEmpty,diveDelete:t_map_diveDelete,remove:t_map_remove},args:{ensureArray:t_args_ensureArray,push:t_args_push,append:t_args_append,insert:t_args_insert},tree:{ensure:t_tree_ensure,dive:t_tree_dive,remove:t_tree_remove,setCustom:t_tree_setCustom,copy:t_tree_copy,isSubsetOf:t_tree_isSubsetOf,iterate:t_tree_iterate,iterator:t_tree_iterator,merge:t_tree_merge,join:t_tree_join},d:{from:t_d_from,create:t_d_create,resolve:t_d_resolve,now:t_d_now,ensure:t_d_ensure,copy:t_d_copy,fromYear:t_d_fromYear,_resolveNative:t_d__resolveNative,isBefore:t_d_isBefore},n:{fromString:t_n_fromString,ensure:t_n_ensure,is:t_n_is,tryCoerce:t_n_tryCoerce,tryParse:t_n_tryParse},js:{removeComments:t_js_removeComments,fromAST:t_js_fromAST,enhance:t_js_enhance,ensureReturn:t_js_ensureReturn,splitLastExpression:t_js_splitLastExpression,enableAwait:t_js_enableAwait,_nodeEnableAwait:t_js__nodeEnableAwait,useTitan:t_js_useTitan,inline:t_js_inline,parse:t_js_parse,removeQuotes:t_js_removeQuotes,getExports:t_js_getExports,getNodes:t_js_getNodes,eachNode:t_js_eachNode,parseDeclaration:t_js_parseDeclaration,fromASTNode:t_js_fromASTNode},npm:{isBuiltIn:t_npm_isBuiltIn,isFile:t_npm_isFile,install:t_npm_install,_runCommand:t_npm__runCommand},os:{run:t_os_run,_resolveStdio:t_os__resolveStdio},win:{is:t_win_is},shell:{_handleError:t_shell__handleError},proc:{interrupt:t_proc_interrupt,signal:t_proc_signal},bool:{fromYN:t_bool_fromYN},gen:{filter:t_gen_filter},bin:{ensureByteSafe:t_bin_ensureByteSafe,isByteSafe:t_bin_isByteSafe,isNodeBuffer:t_bin_isNodeBuffer,isTA:t_bin_isTA},ab:{isTA:t_ab_isTA,is:t_ab_is},json:{stringify:t_json_stringify}};globalThis.t?Object.keys(newItems).forEach(function(e){if(t[e]){var r=newItems[e];Object.keys(r).forEach(function(_){t[e][_]=r[_]})}else t[e]=newItems[e]}):globalThis.t=Object.assign({},newItems),globalThis.exports&&(exports.default=globalThis.t);
|