@gjsify/cli 0.57.0 → 0.59.0

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/dist/cli.gjs.mjs CHANGED
@@ -145,7 +145,7 @@ fi
145
145
  `)}`:``;n.fail(N(`Missing required argument: %s`,`Missing required arguments: %s`,Object.keys(C).length,Object.keys(C).join(`, `)+S))}},F.unknownArguments=function unknownArguments(S,C,I,H,W=!0){let q=t.getInternalMethods().getCommandInstance().getCommands(),Y=[],X=t.getInternalMethods().getContext();if(Object.keys(S).forEach(n=>{!pp.includes(n)&&!Object.prototype.hasOwnProperty.call(I,n)&&!Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),n)&&!F.isValidAndSomeAliasIsNotNew(n,C)&&Y.push(n)}),W&&(X.commands.length>0||q.length>0||H)&&S._.slice(X.commands.length).forEach(t=>{q.includes(``+t)||Y.push(``+t)}),W){let n=t.getDemandedCommands()._?.max||0,C=X.commands.length+n;C<S._.length&&S._.slice(C).forEach(t=>{t=String(t),!X.commands.includes(t)&&!Y.includes(t)&&Y.push(t)})}Y.length&&n.fail(N(`Unknown argument: %s`,`Unknown arguments: %s`,Y.length,Y.map(t=>t.trim()?t:`"${t}"`).join(`, `)))},F.unknownCommands=function unknownCommands(S){let C=t.getInternalMethods().getCommandInstance().getCommands(),F=[],I=t.getInternalMethods().getContext();return(I.commands.length>0||C.length>0)&&S._.slice(I.commands.length).forEach(t=>{C.includes(``+t)||F.push(``+t)}),F.length>0?(n.fail(N(`Unknown command: %s`,`Unknown commands: %s`,F.length,F.join(`, `))),!0):!1},F.isValidAndSomeAliasIsNotNew=function isValidAndSomeAliasIsNotNew(n,S){if(!Object.prototype.hasOwnProperty.call(S,n))return!1;let C=t.parsed.newAliases;return[n,...S[n]].some(t=>!Object.prototype.hasOwnProperty.call(C,t)||!C[n])},F.limitedChoices=function limitedChoices(S){let N=t.getOptions(),F={};if(!Object.keys(N.choices).length)return;Object.keys(S).forEach(t=>{pp.indexOf(t)===-1&&Object.prototype.hasOwnProperty.call(N.choices,t)&&[].concat(S[t]).forEach(n=>{N.choices[t].indexOf(n)===-1&&n!==void 0&&(F[t]=(F[t]||[]).concat(n))})});let I=Object.keys(F);if(!I.length)return;let H=C(`Invalid values:`);I.forEach(t=>{H+=`\n ${C(`Argument: %s, Given: %s, Choices: %s`,t,n.stringifiedValues(F[t]),n.stringifiedValues(N.choices[t]))}`}),n.fail(H)};let I={};F.implies=function implies(n,C){argsert(`<string|object> [array|number|string]`,[n,C],arguments.length),typeof n==`object`?Object.keys(n).forEach(t=>{F.implies(t,n[t])}):(t.global(n),I[n]||(I[n]=[]),Array.isArray(C)?C.forEach(t=>F.implies(n,t)):(assertNotStrictEqual(C,void 0,S),I[n].push(C)))},F.getImplied=function getImplied(){return I};function keyExists(t,n){let S=Number(n);return n=isNaN(S)?n:S,typeof n==`number`?n=t._.length>=n:n.match(/^--no-.+/)?(n=n.match(/^--no-(.+)/)[1],n=!Object.prototype.hasOwnProperty.call(t,n)):n=Object.prototype.hasOwnProperty.call(t,n),n}F.implications=function implications(t){let S=[];if(Object.keys(I).forEach(n=>{let C=n;(I[n]||[]).forEach(n=>{let N=C,F=n;N=keyExists(t,N),n=keyExists(t,n),N&&!n&&S.push(` ${C} -> ${F}`)})}),S.length){let t=`${C(`Implications failed:`)}\n`;S.forEach(n=>{t+=n}),n.fail(t)}};let H={};F.conflicts=function conflicts(n,S){argsert(`<string|object> [array|string]`,[n,S],arguments.length),typeof n==`object`?Object.keys(n).forEach(t=>{F.conflicts(t,n[t])}):(t.global(n),H[n]||(H[n]=[]),Array.isArray(S)?S.forEach(t=>F.conflicts(n,t)):H[n].push(S))},F.getConflicting=()=>H,F.conflicting=function conflictingFn(N){Object.keys(N).forEach(t=>{H[t]&&H[t].forEach(S=>{S&&N[t]!==void 0&&N[S]!==void 0&&n.fail(C(`Arguments %s and %s are mutually exclusive`,t,S))})}),t.getInternalMethods().getParserConfiguration()[`strip-dashed`]&&Object.keys(H).forEach(t=>{H[t].forEach(F=>{F&&N[S.Parser.camelCase(t)]!==void 0&&N[S.Parser.camelCase(F)]!==void 0&&n.fail(C(`Arguments %s and %s are mutually exclusive`,t,F))})})},F.recommendCommands=function recommendCommands(t,S){S=S.sort((t,n)=>n.length-t.length);let N=null,F=1/0;for(let n=0,C;(C=S[n])!==void 0;n++){let n=levenshtein(t,C);n<=3&&n<F&&(F=n,N=C)}N&&n.fail(C(`Did you mean %s?`,N))},F.reset=function reset(t){return I=objFilter(I,n=>!t[n]),H=objFilter(H,n=>!t[n]),F};let W=[];return F.freeze=function freeze(){W.push({implied:I,conflicting:H})},F.unfreeze=function unfreeze(){let t=W.pop();assertNotStrictEqual(t,void 0,S),{implied:I,conflicting:H}=t},F}var pp,mp=__esmMin(()=>{$f(),Yf(),fp(),ip(),pp=[`$0`,`--`,`_`]});function YargsFactory(t){return(n=[],S=t.process.cwd(),C)=>{let N=new YargsInstance(n,S,C,t);return Object.defineProperty(N,"argv",{get:()=>N.parse(),enumerable:!0}),N.help(),N.version(),N}}function isYargsInstance(t){return!!t&&typeof t.getInternalMethods==`function`}var __classPrivateFieldSet,__classPrivateFieldGet,hp,gp,vp,yp,bp,xp,Sp,Cp,wp,Tp,Ep,Dp,Op,kp,Ap,jp,Mp,Np,Pp,Fp,Ip,Lp,Rp,zp,Bp,Vp,Hp,Up,Wp,Gp,Kp,qp,Jp,Yp,Xp,Zp,Qp,$p,em,tm,nm,im,am,om,sm,cm,lm,um,dm,fm,pm,mm,hm,gm,_m,vm,ym,bm,xm,Sm,Cm,wm,Tm,Em,Dm,Om,km,Am,jm,Mm,Nm,Pm,YargsInstance,Fm=__esmMin(()=>{_e(),rp(),Yf(),_l(),op(),$f(),dp(),mp(),ip(),bl(),ep(),Xf(),tp(),ap(),__classPrivateFieldSet=function(t,n,S,C,N){if(C===`m`)throw TypeError(`Private method is not writable`);if(C===`a`&&!N)throw TypeError(`Private accessor was defined without a setter`);if(typeof n==`function`?t!==n||!N:!n.has(t))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return C===`a`?N.call(t,S):N?N.value=S:n.set(t,S),S},__classPrivateFieldGet=function(t,n,S,C){if(S===`a`&&!C)throw TypeError(`Private accessor was defined without a getter`);if(typeof n==`function`?t!==n||!C:!n.has(t))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return S===`m`?C:S===`a`?C.call(t):C?C.value:n.get(t)},Zp=Symbol(`copyDoubleDash`),Qp=Symbol(`copyDoubleDash`),$p=Symbol(`deleteFromParserHintObject`),em=Symbol(`emitWarning`),tm=Symbol(`freeze`),nm=Symbol(`getDollarZero`),im=Symbol(`getParserConfiguration`),am=Symbol(`getUsageConfiguration`),om=Symbol(`guessLocale`),sm=Symbol(`guessVersion`),cm=Symbol(`parsePositionalNumbers`),lm=Symbol(`pkgUp`),um=Symbol(`populateParserHintArray`),dm=Symbol(`populateParserHintSingleValueDictionary`),fm=Symbol(`populateParserHintArrayDictionary`),pm=Symbol(`populateParserHintDictionary`),mm=Symbol(`sanitizeKey`),hm=Symbol(`setKey`),gm=Symbol(`unfreeze`),_m=Symbol(`validateAsync`),vm=Symbol(`getCommandInstance`),ym=Symbol(`getContext`),bm=Symbol(`getHasOutput`),xm=Symbol(`getLoggerInstance`),Sm=Symbol(`getParseContext`),Cm=Symbol(`getUsageInstance`),wm=Symbol(`getValidationInstance`),Tm=Symbol(`hasParseCallback`),Em=Symbol(`isGlobalContext`),Dm=Symbol(`postProcess`),Om=Symbol(`rebase`),km=Symbol(`reset`),Am=Symbol(`runYargsParserAndExecuteCommands`),jm=Symbol(`runValidation`),Mm=Symbol(`setHasOutput`),Nm=Symbol(`kTrackManuallySetKeys`),Pm=`en_US`,YargsInstance=class{constructor(t=[],n,S,C){this.customScriptName=!1,this.parsed=!1,hp.set(this,void 0),gp.set(this,void 0),vp.set(this,{commands:[],fullCommands:[]}),yp.set(this,null),bp.set(this,null),xp.set(this,`show-hidden`),Sp.set(this,null),Cp.set(this,!0),wp.set(this,{}),Tp.set(this,!0),Ep.set(this,[]),Dp.set(this,void 0),Op.set(this,{}),kp.set(this,!1),Ap.set(this,null),jp.set(this,!0),Mp.set(this,void 0),Np.set(this,``),Pp.set(this,void 0),Fp.set(this,void 0),Ip.set(this,{}),Lp.set(this,null),Rp.set(this,null),zp.set(this,{}),Bp.set(this,{}),Vp.set(this,void 0),Hp.set(this,!1),Up.set(this,void 0),Wp.set(this,!1),Gp.set(this,!1),Kp.set(this,!1),qp.set(this,void 0),Jp.set(this,{}),Yp.set(this,null),Xp.set(this,void 0),__classPrivateFieldSet(this,Up,C,`f`),__classPrivateFieldSet(this,Vp,t,`f`),__classPrivateFieldSet(this,gp,n,`f`),__classPrivateFieldSet(this,Fp,S,`f`),__classPrivateFieldSet(this,Dp,new GlobalMiddleware(this),`f`),this.$0=this[nm](),this[km](),__classPrivateFieldSet(this,hp,__classPrivateFieldGet(this,hp,`f`),`f`),__classPrivateFieldSet(this,qp,__classPrivateFieldGet(this,qp,`f`),`f`),__classPrivateFieldSet(this,Xp,__classPrivateFieldGet(this,Xp,`f`),`f`),__classPrivateFieldSet(this,Pp,__classPrivateFieldGet(this,Pp,`f`),`f`),__classPrivateFieldGet(this,Pp,`f`).showHiddenOpt=__classPrivateFieldGet(this,xp,`f`),__classPrivateFieldSet(this,Mp,this[Qp](),`f`),__classPrivateFieldGet(this,Up,`f`).y18n.setLocale(Pm)}addHelpOpt(t,n){return argsert(`[string|boolean] [string]`,[t,n],arguments.length),__classPrivateFieldGet(this,Ap,`f`)&&(this[$p](__classPrivateFieldGet(this,Ap,`f`)),__classPrivateFieldSet(this,Ap,null,`f`)),t===!1&&n===void 0?this:(__classPrivateFieldSet(this,Ap,typeof t==`string`?t:`help`,`f`),this.boolean(__classPrivateFieldGet(this,Ap,`f`)),this.describe(__classPrivateFieldGet(this,Ap,`f`),n||__classPrivateFieldGet(this,qp,`f`).deferY18nLookup(`Show help`)),this)}help(t,n){return this.addHelpOpt(t,n)}addShowHiddenOpt(t,n){if(argsert(`[string|boolean] [string]`,[t,n],arguments.length),t===!1&&n===void 0)return this;let S=typeof t==`string`?t:__classPrivateFieldGet(this,xp,`f`);return this.boolean(S),this.describe(S,n||__classPrivateFieldGet(this,qp,`f`).deferY18nLookup(`Show hidden options`)),__classPrivateFieldGet(this,Pp,`f`).showHiddenOpt=S,this}showHidden(t,n){return this.addShowHiddenOpt(t,n)}alias(t,n){return argsert(`<object|string|array> [string|array]`,[t,n],arguments.length),this[fm](this.alias.bind(this),`alias`,t,n),this}array(t){return argsert(`<array|string>`,[t],arguments.length),this[um](`array`,t),this[Nm](t),this}boolean(t){return argsert(`<array|string>`,[t],arguments.length),this[um](`boolean`,t),this[Nm](t),this}check(t,n){return argsert(`<function> [boolean]`,[t,n],arguments.length),this.middleware((n,S)=>maybeAsyncResult(()=>t(n,S.getOptions()),S=>(S?(typeof S==`string`||S instanceof Error)&&__classPrivateFieldGet(this,qp,`f`).fail(S.toString(),S):__classPrivateFieldGet(this,qp,`f`).fail(__classPrivateFieldGet(this,Up,`f`).y18n.__(`Argument check failed: %s`,t.toString())),n),t=>(__classPrivateFieldGet(this,qp,`f`).fail(t.message?t.message:t.toString(),t),n)),!1,n),this}choices(t,n){return argsert(`<object|string|array> [string|array]`,[t,n],arguments.length),this[fm](this.choices.bind(this),`choices`,t,n),this}coerce(t,n){if(argsert(`<object|string|array> [function]`,[t,n],arguments.length),Array.isArray(t)){if(!n)throw new gl(`coerce callback must be provided`);for(let S of t)this.coerce(S,n);return this}else if(typeof t==`object`){for(let n of Object.keys(t))this.coerce(n,t[n]);return this}if(!n)throw new gl(`coerce callback must be provided`);let S=t;return __classPrivateFieldGet(this,Pp,`f`).key[S]=!0,__classPrivateFieldGet(this,Dp,`f`).addCoerceMiddleware((t,C)=>{let N=C.getAliases()[S]??[],F=[S,...N].filter(n=>Object.prototype.hasOwnProperty.call(t,n));return F.length===0?t:maybeAsyncResult(()=>n(t[F[0]]),n=>(F.forEach(S=>{t[S]=n}),t),t=>{throw new gl(t.message)})},S),this}conflicts(t,n){return argsert(`<string|object> [string|array]`,[t,n],arguments.length),__classPrivateFieldGet(this,Xp,`f`).conflicts(t,n),this}config(t=`config`,n,S){return argsert(`[object|string] [string|function] [function]`,[t,n,S],arguments.length),typeof t==`object`&&!Array.isArray(t)?(t=applyExtends(t,__classPrivateFieldGet(this,gp,`f`),this[im]()[`deep-merge-config`]||!1,__classPrivateFieldGet(this,Up,`f`)),__classPrivateFieldGet(this,Pp,`f`).configObjects=(__classPrivateFieldGet(this,Pp,`f`).configObjects||[]).concat(t),this):(typeof n==`function`&&(S=n,n=void 0),this.describe(t,n||__classPrivateFieldGet(this,qp,`f`).deferY18nLookup(`Path to JSON config file`)),(Array.isArray(t)?t:[t]).forEach(t=>{__classPrivateFieldGet(this,Pp,`f`).config[t]=S||!0}),this)}completion(t,n,S){return argsert(`[string] [string|boolean|function] [function]`,[t,n,S],arguments.length),typeof n==`function`&&(S=n,n=void 0),__classPrivateFieldSet(this,bp,t||__classPrivateFieldGet(this,bp,`f`)||`completion`,`f`),!n&&n!==!1&&(n=`generate completion script`),this.command(__classPrivateFieldGet(this,bp,`f`),n),S&&__classPrivateFieldGet(this,yp,`f`).registerFunction(S),this}command(t,n,S,C,N,F){return argsert(`<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]`,[t,n,S,C,N,F],arguments.length),__classPrivateFieldGet(this,hp,`f`).addHandler(t,n,S,C,N,F),this}commands(t,n,S,C,N,F){return this.command(t,n,S,C,N,F)}commandDir(t,n){argsert(`<string> [object]`,[t,n],arguments.length);let S=__classPrivateFieldGet(this,Fp,`f`)||__classPrivateFieldGet(this,Up,`f`).require;return __classPrivateFieldGet(this,hp,`f`).addDirectory(t,S,__classPrivateFieldGet(this,Up,`f`).getCallerFile(),n),this}count(t){return argsert(`<array|string>`,[t],arguments.length),this[um](`count`,t),this[Nm](t),this}default(t,n,S){return argsert(`<object|string|array> [*] [string]`,[t,n,S],arguments.length),S&&(assertSingleKey(t,__classPrivateFieldGet(this,Up,`f`)),__classPrivateFieldGet(this,Pp,`f`).defaultDescription[t]=S),typeof n==`function`&&(assertSingleKey(t,__classPrivateFieldGet(this,Up,`f`)),__classPrivateFieldGet(this,Pp,`f`).defaultDescription[t]||(__classPrivateFieldGet(this,Pp,`f`).defaultDescription[t]=__classPrivateFieldGet(this,qp,`f`).functionDescription(n)),n=n.call()),this[dm](this.default.bind(this),`default`,t,n),this}defaults(t,n,S){return this.default(t,n,S)}demandCommand(t=1,n,S,C){return argsert(`[number] [number|string] [string|null|undefined] [string|null|undefined]`,[t,n,S,C],arguments.length),typeof n!=`number`&&(S=n,n=1/0),this.global(`_`,!1),__classPrivateFieldGet(this,Pp,`f`).demandedCommands._={min:t,max:n,minMsg:S,maxMsg:C},this}demand(t,n,S){return Array.isArray(n)?(n.forEach(t=>{assertNotStrictEqual(S,!0,__classPrivateFieldGet(this,Up,`f`)),this.demandOption(t,S)}),n=1/0):typeof n!=`number`&&(S=n,n=1/0),typeof t==`number`?(assertNotStrictEqual(S,!0,__classPrivateFieldGet(this,Up,`f`)),this.demandCommand(t,n,S,S)):Array.isArray(t)?t.forEach(t=>{assertNotStrictEqual(S,!0,__classPrivateFieldGet(this,Up,`f`)),this.demandOption(t,S)}):typeof S==`string`?this.demandOption(t,S):(S===!0||S===void 0)&&this.demandOption(t),this}demandOption(t,n){return argsert(`<object|string|array> [string]`,[t,n],arguments.length),this[dm](this.demandOption.bind(this),`demandedOptions`,t,n),this}deprecateOption(t,n){return argsert(`<string> [string|boolean]`,[t,n],arguments.length),__classPrivateFieldGet(this,Pp,`f`).deprecatedOptions[t]=n,this}describe(t,n){return argsert(`<object|string|array> [string]`,[t,n],arguments.length),this[hm](t,!0),__classPrivateFieldGet(this,qp,`f`).describe(t,n),this}detectLocale(t){return argsert(`<boolean>`,[t],arguments.length),__classPrivateFieldSet(this,Cp,t,`f`),this}env(t){return argsert(`[string|boolean]`,[t],arguments.length),t===!1?delete __classPrivateFieldGet(this,Pp,`f`).envPrefix:__classPrivateFieldGet(this,Pp,`f`).envPrefix=t||``,this}epilogue(t){return argsert(`<string>`,[t],arguments.length),__classPrivateFieldGet(this,qp,`f`).epilog(t),this}epilog(t){return this.epilogue(t)}example(t,n){return argsert(`<string|array> [string]`,[t,n],arguments.length),Array.isArray(t)?t.forEach(t=>this.example(...t)):__classPrivateFieldGet(this,qp,`f`).example(t,n),this}exit(t,n){__classPrivateFieldSet(this,kp,!0,`f`),__classPrivateFieldSet(this,Sp,n,`f`),__classPrivateFieldGet(this,Tp,`f`)&&__classPrivateFieldGet(this,Up,`f`).process.exit(t)}exitProcess(t=!0){return argsert(`[boolean]`,[t],arguments.length),__classPrivateFieldSet(this,Tp,t,`f`),this}fail(t){if(argsert(`<function|boolean>`,[t],arguments.length),typeof t==`boolean`&&t!==!1)throw new gl(`Invalid first argument. Expected function or boolean 'false'`);return __classPrivateFieldGet(this,qp,`f`).failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,n){return argsert(`<array> [function]`,[t,n],arguments.length),n?__classPrivateFieldGet(this,yp,`f`).getCompletion(t,n):new Promise((n,S)=>{__classPrivateFieldGet(this,yp,`f`).getCompletion(t,(t,C)=>{t?S(t):n(C)})})}getDemandedOptions(){return argsert([],0),__classPrivateFieldGet(this,Pp,`f`).demandedOptions}getDemandedCommands(){return argsert([],0),__classPrivateFieldGet(this,Pp,`f`).demandedCommands}getDeprecatedOptions(){return argsert([],0),__classPrivateFieldGet(this,Pp,`f`).deprecatedOptions}getDetectLocale(){return __classPrivateFieldGet(this,Cp,`f`)}getExitProcess(){return __classPrivateFieldGet(this,Tp,`f`)}getGroups(){return Object.assign({},__classPrivateFieldGet(this,Op,`f`),__classPrivateFieldGet(this,Bp,`f`))}getHelp(){if(__classPrivateFieldSet(this,kp,!0,`f`),!__classPrivateFieldGet(this,qp,`f`).hasCachedHelpMessage()){if(!this.parsed){let t=this[Am](__classPrivateFieldGet(this,Vp,`f`),void 0,void 0,0,!0);if(isPromise(t))return t.then(()=>__classPrivateFieldGet(this,qp,`f`).help())}let t=__classPrivateFieldGet(this,hp,`f`).runDefaultBuilderOn(this);if(isPromise(t))return t.then(()=>__classPrivateFieldGet(this,qp,`f`).help())}return Promise.resolve(__classPrivateFieldGet(this,qp,`f`).help())}getOptions(){return __classPrivateFieldGet(this,Pp,`f`)}getStrict(){return __classPrivateFieldGet(this,Wp,`f`)}getStrictCommands(){return __classPrivateFieldGet(this,Gp,`f`)}getStrictOptions(){return __classPrivateFieldGet(this,Kp,`f`)}global(t,n){return argsert(`<string|array> [boolean]`,[t,n],arguments.length),t=[].concat(t),n===!1?t.forEach(t=>{__classPrivateFieldGet(this,Pp,`f`).local.includes(t)||__classPrivateFieldGet(this,Pp,`f`).local.push(t)}):__classPrivateFieldGet(this,Pp,`f`).local=__classPrivateFieldGet(this,Pp,`f`).local.filter(n=>t.indexOf(n)===-1),this}group(t,n){argsert(`<string|array> <string>`,[t,n],arguments.length);let S=__classPrivateFieldGet(this,Bp,`f`)[n]||__classPrivateFieldGet(this,Op,`f`)[n];__classPrivateFieldGet(this,Bp,`f`)[n]&&delete __classPrivateFieldGet(this,Bp,`f`)[n];let C={};return __classPrivateFieldGet(this,Op,`f`)[n]=(S||[]).concat(t).filter(t=>C[t]?!1:C[t]=!0),this}hide(t){return argsert(`<string>`,[t],arguments.length),__classPrivateFieldGet(this,Pp,`f`).hiddenOptions.push(t),this}implies(t,n){return argsert(`<string|object> [number|string|array]`,[t,n],arguments.length),__classPrivateFieldGet(this,Xp,`f`).implies(t,n),this}locale(t){return argsert(`[string]`,[t],arguments.length),t===void 0?(this[om](),__classPrivateFieldGet(this,Up,`f`).y18n.getLocale()):(__classPrivateFieldSet(this,Cp,!1,`f`),__classPrivateFieldGet(this,Up,`f`).y18n.setLocale(t),this)}middleware(t,n,S){return __classPrivateFieldGet(this,Dp,`f`).addMiddleware(t,!!n,S)}nargs(t,n){return argsert(`<string|object|array> [number]`,[t,n],arguments.length),this[dm](this.nargs.bind(this),`narg`,t,n),this}normalize(t){return argsert(`<array|string>`,[t],arguments.length),this[um](`normalize`,t),this}number(t){return argsert(`<array|string>`,[t],arguments.length),this[um](`number`,t),this[Nm](t),this}option(t,n){if(argsert(`<string|object> [object]`,[t,n],arguments.length),typeof t==`object`)Object.keys(t).forEach(n=>{this.options(n,t[n])});else{typeof n!=`object`&&(n={}),this[Nm](t),__classPrivateFieldGet(this,Yp,`f`)&&(t===`version`||n?.alias===`version`)&&this[em]([`"version" is a reserved word.`,`Please do one of the following:`,'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)",`- Use a different option key`,`https://yargs.js.org/docs/#api-reference-version`].join(`
146
146
  `),void 0,`versionWarning`),__classPrivateFieldGet(this,Pp,`f`).key[t]=!0,n.alias&&this.alias(t,n.alias);let S=n.deprecate||n.deprecated;S&&this.deprecateOption(t,S);let C=n.demand||n.required||n.require;C&&this.demand(t,C),n.demandOption&&this.demandOption(t,typeof n.demandOption==`string`?n.demandOption:void 0),n.conflicts&&this.conflicts(t,n.conflicts),`default`in n&&this.default(t,n.default),n.implies!==void 0&&this.implies(t,n.implies),n.nargs!==void 0&&this.nargs(t,n.nargs),n.config&&this.config(t,n.configParser),n.normalize&&this.normalize(t),n.choices&&this.choices(t,n.choices),n.coerce&&this.coerce(t,n.coerce),n.group&&this.group(t,n.group),(n.boolean||n.type===`boolean`)&&(this.boolean(t),n.alias&&this.boolean(n.alias)),(n.array||n.type===`array`)&&(this.array(t),n.alias&&this.array(n.alias)),(n.number||n.type===`number`)&&(this.number(t),n.alias&&this.number(n.alias)),(n.string||n.type===`string`)&&(this.string(t),n.alias&&this.string(n.alias)),(n.count||n.type===`count`)&&this.count(t),typeof n.global==`boolean`&&this.global(t,n.global),n.defaultDescription&&(__classPrivateFieldGet(this,Pp,`f`).defaultDescription[t]=n.defaultDescription),n.skipValidation&&this.skipValidation(t);let N=n.describe||n.description||n.desc,F=__classPrivateFieldGet(this,qp,`f`).getDescriptions();(!Object.prototype.hasOwnProperty.call(F,t)||typeof N==`string`)&&this.describe(t,N),n.hidden&&this.hide(t),n.requiresArg&&this.requiresArg(t)}return this}options(t,n){return this.option(t,n)}parse(t,n,S){argsert(`[string|array] [function|boolean|object] [function]`,[t,n,S],arguments.length),this[tm](),t===void 0&&(t=__classPrivateFieldGet(this,Vp,`f`)),typeof n==`object`&&(__classPrivateFieldSet(this,Rp,n,`f`),n=S),typeof n==`function`&&(__classPrivateFieldSet(this,Lp,n,`f`),n=!1),n||__classPrivateFieldSet(this,Vp,t,`f`),__classPrivateFieldGet(this,Lp,`f`)&&__classPrivateFieldSet(this,Tp,!1,`f`);let C=this[Am](t,!!n),N=this.parsed;return __classPrivateFieldGet(this,yp,`f`).setParsed(this.parsed),isPromise(C)?C.then(t=>(__classPrivateFieldGet(this,Lp,`f`)&&__classPrivateFieldGet(this,Lp,`f`).call(this,__classPrivateFieldGet(this,Sp,`f`),t,__classPrivateFieldGet(this,Np,`f`)),t)).catch(t=>{throw __classPrivateFieldGet(this,Lp,`f`)&&__classPrivateFieldGet(this,Lp,`f`)(t,this.parsed.argv,__classPrivateFieldGet(this,Np,`f`)),t}).finally(()=>{this[gm](),this.parsed=N}):(__classPrivateFieldGet(this,Lp,`f`)&&__classPrivateFieldGet(this,Lp,`f`).call(this,__classPrivateFieldGet(this,Sp,`f`),C,__classPrivateFieldGet(this,Np,`f`)),this[gm](),this.parsed=N,C)}parseAsync(t,n,S){let C=this.parse(t,n,S);return isPromise(C)?C:Promise.resolve(C)}parseSync(t,n,S){let C=this.parse(t,n,S);if(isPromise(C))throw new gl(`.parseSync() must not be used with asynchronous builders, handlers, or middleware`);return C}parserConfiguration(t){return argsert(`<object>`,[t],arguments.length),__classPrivateFieldSet(this,Ip,t,`f`),this}pkgConf(t,n){argsert(`<string> [string]`,[t,n],arguments.length);let S=null,C=this[lm](n||__classPrivateFieldGet(this,gp,`f`));return C[t]&&typeof C[t]==`object`&&(S=applyExtends(C[t],n||__classPrivateFieldGet(this,gp,`f`),this[im]()[`deep-merge-config`]||!1,__classPrivateFieldGet(this,Up,`f`)),__classPrivateFieldGet(this,Pp,`f`).configObjects=(__classPrivateFieldGet(this,Pp,`f`).configObjects||[]).concat(S)),this}positional(t,n){argsert(`<string> <object>`,[t,n],arguments.length);let S=[`default`,`defaultDescription`,`implies`,`normalize`,`choices`,`conflicts`,`coerce`,`type`,`describe`,`desc`,`description`,`alias`];n=objFilter(n,(t,n)=>t===`type`&&![`string`,`number`,`boolean`].includes(n)?!1:S.includes(t));let C=__classPrivateFieldGet(this,vp,`f`).fullCommands[__classPrivateFieldGet(this,vp,`f`).fullCommands.length-1],N=C?__classPrivateFieldGet(this,hp,`f`).cmdToParseOptions(C):{array:[],alias:{},default:{},demand:{}};return objectKeys(N).forEach(S=>{let C=N[S];Array.isArray(C)?C.indexOf(t)!==-1&&(n[S]=!0):C[t]&&!(S in n)&&(n[S]=C[t])}),this.group(t,__classPrivateFieldGet(this,qp,`f`).getPositionalGroupName()),this.option(t,n)}recommendCommands(t=!0){return argsert(`[boolean]`,[t],arguments.length),__classPrivateFieldSet(this,Hp,t,`f`),this}required(t,n,S){return this.demand(t,n,S)}require(t,n,S){return this.demand(t,n,S)}requiresArg(t){return argsert(`<array|string|object> [number]`,[t],arguments.length),typeof t==`string`&&__classPrivateFieldGet(this,Pp,`f`).narg[t]||this[dm](this.requiresArg.bind(this),`narg`,t,NaN),this}showCompletionScript(t,n){return argsert(`[string] [string]`,[t,n],arguments.length),t||=this.$0,__classPrivateFieldGet(this,Mp,`f`).log(__classPrivateFieldGet(this,yp,`f`).generateCompletionScript(t,n||__classPrivateFieldGet(this,bp,`f`)||`completion`)),this}showHelp(t){if(argsert(`[string|function]`,[t],arguments.length),__classPrivateFieldSet(this,kp,!0,`f`),!__classPrivateFieldGet(this,qp,`f`).hasCachedHelpMessage()){if(!this.parsed){let n=this[Am](__classPrivateFieldGet(this,Vp,`f`),void 0,void 0,0,!0);if(isPromise(n))return n.then(()=>{__classPrivateFieldGet(this,qp,`f`).showHelp(t)}),this}let n=__classPrivateFieldGet(this,hp,`f`).runDefaultBuilderOn(this);if(isPromise(n))return n.then(()=>{__classPrivateFieldGet(this,qp,`f`).showHelp(t)}),this}return __classPrivateFieldGet(this,qp,`f`).showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,n){return argsert(`[boolean|string] [string]`,[t,n],arguments.length),__classPrivateFieldGet(this,qp,`f`).showHelpOnFail(t,n),this}showVersion(t){return argsert(`[string|function]`,[t],arguments.length),__classPrivateFieldGet(this,qp,`f`).showVersion(t),this}skipValidation(t){return argsert(`<array|string>`,[t],arguments.length),this[um](`skipValidation`,t),this}strict(t){return argsert(`[boolean]`,[t],arguments.length),__classPrivateFieldSet(this,Wp,t!==!1,`f`),this}strictCommands(t){return argsert(`[boolean]`,[t],arguments.length),__classPrivateFieldSet(this,Gp,t!==!1,`f`),this}strictOptions(t){return argsert(`[boolean]`,[t],arguments.length),__classPrivateFieldSet(this,Kp,t!==!1,`f`),this}string(t){return argsert(`<array|string>`,[t],arguments.length),this[um](`string`,t),this[Nm](t),this}terminalWidth(){return argsert([],0),__classPrivateFieldGet(this,Up,`f`).process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return argsert(`<object>`,[t],arguments.length),__classPrivateFieldSet(this,Cp,!1,`f`),__classPrivateFieldGet(this,Up,`f`).y18n.updateLocale(t),this}usage(t,n,S,C){if(argsert(`<string|null|undefined> [string|boolean] [function|object] [function]`,[t,n,S,C],arguments.length),n!==void 0){if(assertNotStrictEqual(t,null,__classPrivateFieldGet(this,Up,`f`)),(t||``).match(/^\$0( |$)/))return this.command(t,n,S,C);throw new gl(`.usage() description must start with $0 if being used as alias for .command()`)}else return __classPrivateFieldGet(this,qp,`f`).usage(t),this}usageConfiguration(t){return argsert(`<object>`,[t],arguments.length),__classPrivateFieldSet(this,Jp,t,`f`),this}version(t,n,S){let C=`version`;if(argsert(`[boolean|string] [string] [string]`,[t,n,S],arguments.length),__classPrivateFieldGet(this,Yp,`f`)&&(this[$p](__classPrivateFieldGet(this,Yp,`f`)),__classPrivateFieldGet(this,qp,`f`).version(void 0),__classPrivateFieldSet(this,Yp,null,`f`)),arguments.length===0)S=this[sm](),t=C;else if(arguments.length===1){if(t===!1)return this;S=t,t=C}else arguments.length===2&&(S=n,n=void 0);return __classPrivateFieldSet(this,Yp,typeof t==`string`?t:C,`f`),n||=__classPrivateFieldGet(this,qp,`f`).deferY18nLookup(`Show version number`),__classPrivateFieldGet(this,qp,`f`).version(S||void 0),this.boolean(__classPrivateFieldGet(this,Yp,`f`)),this.describe(__classPrivateFieldGet(this,Yp,`f`),n),this}wrap(t){return argsert(`<number|null|undefined>`,[t],arguments.length),__classPrivateFieldGet(this,qp,`f`).wrap(t),this}[(hp=new WeakMap,gp=new WeakMap,vp=new WeakMap,yp=new WeakMap,bp=new WeakMap,xp=new WeakMap,Sp=new WeakMap,Cp=new WeakMap,wp=new WeakMap,Tp=new WeakMap,Ep=new WeakMap,Dp=new WeakMap,Op=new WeakMap,kp=new WeakMap,Ap=new WeakMap,jp=new WeakMap,Mp=new WeakMap,Np=new WeakMap,Pp=new WeakMap,Fp=new WeakMap,Ip=new WeakMap,Lp=new WeakMap,Rp=new WeakMap,zp=new WeakMap,Bp=new WeakMap,Vp=new WeakMap,Hp=new WeakMap,Up=new WeakMap,Wp=new WeakMap,Gp=new WeakMap,Kp=new WeakMap,qp=new WeakMap,Jp=new WeakMap,Yp=new WeakMap,Xp=new WeakMap,Zp)](t){if(!t._||!t[`--`])return t;t._.push.apply(t._,t[`--`]);try{delete t[`--`]}catch{}return t}[Qp](){return{log:(...t)=>{this[Tm]()||ge.log(...t),__classPrivateFieldSet(this,kp,!0,`f`),__classPrivateFieldGet(this,Np,`f`).length&&__classPrivateFieldSet(this,Np,__classPrivateFieldGet(this,Np,`f`)+`
147
147
  `,`f`),__classPrivateFieldSet(this,Np,__classPrivateFieldGet(this,Np,`f`)+t.join(` `),`f`)},error:(...t)=>{this[Tm]()||ge.error(...t),__classPrivateFieldSet(this,kp,!0,`f`),__classPrivateFieldGet(this,Np,`f`).length&&__classPrivateFieldSet(this,Np,__classPrivateFieldGet(this,Np,`f`)+`
148
- `,`f`),__classPrivateFieldSet(this,Np,__classPrivateFieldGet(this,Np,`f`)+t.join(` `),`f`)}}}[$p](t){objectKeys(__classPrivateFieldGet(this,Pp,`f`)).forEach(n=>{if((t=>t===`configObjects`)(n))return;let S=__classPrivateFieldGet(this,Pp,`f`)[n];Array.isArray(S)?S.includes(t)&&S.splice(S.indexOf(t),1):typeof S==`object`&&delete S[t]}),delete __classPrivateFieldGet(this,qp,`f`).getDescriptions()[t]}[em](t,n,S){__classPrivateFieldGet(this,wp,`f`)[S]||(__classPrivateFieldGet(this,Up,`f`).process.emitWarning(t,n),__classPrivateFieldGet(this,wp,`f`)[S]=!0)}[tm](){__classPrivateFieldGet(this,Ep,`f`).push({options:__classPrivateFieldGet(this,Pp,`f`),configObjects:__classPrivateFieldGet(this,Pp,`f`).configObjects.slice(0),exitProcess:__classPrivateFieldGet(this,Tp,`f`),groups:__classPrivateFieldGet(this,Op,`f`),strict:__classPrivateFieldGet(this,Wp,`f`),strictCommands:__classPrivateFieldGet(this,Gp,`f`),strictOptions:__classPrivateFieldGet(this,Kp,`f`),completionCommand:__classPrivateFieldGet(this,bp,`f`),output:__classPrivateFieldGet(this,Np,`f`),exitError:__classPrivateFieldGet(this,Sp,`f`),hasOutput:__classPrivateFieldGet(this,kp,`f`),parsed:this.parsed,parseFn:__classPrivateFieldGet(this,Lp,`f`),parseContext:__classPrivateFieldGet(this,Rp,`f`)}),__classPrivateFieldGet(this,qp,`f`).freeze(),__classPrivateFieldGet(this,Xp,`f`).freeze(),__classPrivateFieldGet(this,hp,`f`).freeze(),__classPrivateFieldGet(this,Dp,`f`).freeze()}[nm](){let t=``,n;return n=/\b(node|iojs|electron)(\.exe)?$/.test(__classPrivateFieldGet(this,Up,`f`).process.argv()[0])?__classPrivateFieldGet(this,Up,`f`).process.argv().slice(1,2):__classPrivateFieldGet(this,Up,`f`).process.argv().slice(0,1),t=n.map(t=>{let n=this[Om](__classPrivateFieldGet(this,gp,`f`),t);return t.match(/^(\/|([a-zA-Z]:)?\\)/)&&n.length<t.length?n:t}).join(` `).trim(),__classPrivateFieldGet(this,Up,`f`).getEnv(`_`)&&__classPrivateFieldGet(this,Up,`f`).getProcessArgvBin()===__classPrivateFieldGet(this,Up,`f`).getEnv(`_`)&&(t=__classPrivateFieldGet(this,Up,`f`).getEnv(`_`).replace(`${__classPrivateFieldGet(this,Up,`f`).path.dirname(__classPrivateFieldGet(this,Up,`f`).process.execPath())}/`,``)),t}[im](){return __classPrivateFieldGet(this,Ip,`f`)}[am](){return __classPrivateFieldGet(this,Jp,`f`)}[om](){if(!__classPrivateFieldGet(this,Cp,`f`))return;let t=__classPrivateFieldGet(this,Up,`f`).getEnv(`LC_ALL`)||__classPrivateFieldGet(this,Up,`f`).getEnv(`LC_MESSAGES`)||__classPrivateFieldGet(this,Up,`f`).getEnv(`LANG`)||__classPrivateFieldGet(this,Up,`f`).getEnv(`LANGUAGE`)||`en_US`;this.locale(t.replace(/[.:].*/,``))}[sm](){return this[lm]().version||`unknown`}[cm](t){let n=t[`--`]?t[`--`]:t._;for(let t=0,S;(S=n[t])!==void 0;t++)__classPrivateFieldGet(this,Up,`f`).Parser.looksLikeNumber(S)&&Number.isSafeInteger(Math.floor(parseFloat(`${S}`)))&&(n[t]=Number(S));return t}[lm](t){let n=t||`*`;if(__classPrivateFieldGet(this,zp,`f`)[n])return __classPrivateFieldGet(this,zp,`f`)[n];let S={};try{let n=t||__classPrivateFieldGet(this,Up,`f`).mainFilename;__classPrivateFieldGet(this,Up,`f`).path.extname(n)&&(n=__classPrivateFieldGet(this,Up,`f`).path.dirname(n));let C=__classPrivateFieldGet(this,Up,`f`).findUp(n,(t,n)=>{if(n.includes(`package.json`))return`package.json`});assertNotStrictEqual(C,void 0,__classPrivateFieldGet(this,Up,`f`)),S=JSON.parse(__classPrivateFieldGet(this,Up,`f`).readFileSync(C,`utf8`))}catch{}return __classPrivateFieldGet(this,zp,`f`)[n]=S||{},__classPrivateFieldGet(this,zp,`f`)[n]}[um](t,n){n=[].concat(n),n.forEach(n=>{n=this[mm](n),__classPrivateFieldGet(this,Pp,`f`)[t].push(n)})}[dm](t,n,S,C){this[pm](t,n,S,C,(t,n,S)=>{__classPrivateFieldGet(this,Pp,`f`)[t][n]=S})}[fm](t,n,S,C){this[pm](t,n,S,C,(t,n,S)=>{__classPrivateFieldGet(this,Pp,`f`)[t][n]=(__classPrivateFieldGet(this,Pp,`f`)[t][n]||[]).concat(S)})}[pm](t,n,S,C,N){if(Array.isArray(S))S.forEach(n=>{t(n,C)});else if((t=>typeof t==`object`)(S))for(let n of objectKeys(S))t(n,S[n]);else N(n,this[mm](S),C)}[mm](t){return t===`__proto__`?`___proto___`:t}[hm](t,n){return this[dm](this[hm].bind(this),`key`,t,n),this}[gm](){var t,n,S,C,N,F,I,H,W,q,Y,X;let Z=__classPrivateFieldGet(this,Ep,`f`).pop();assertNotStrictEqual(Z,void 0,__classPrivateFieldGet(this,Up,`f`));let te;t=this,n=this,S=this,C=this,N=this,F=this,I=this,H=this,W=this,q=this,Y=this,X=this,{options:{set value(n){__classPrivateFieldSet(t,Pp,n,`f`)}}.value,configObjects:te,exitProcess:{set value(t){__classPrivateFieldSet(n,Tp,t,`f`)}}.value,groups:{set value(t){__classPrivateFieldSet(S,Op,t,`f`)}}.value,output:{set value(t){__classPrivateFieldSet(C,Np,t,`f`)}}.value,exitError:{set value(t){__classPrivateFieldSet(N,Sp,t,`f`)}}.value,hasOutput:{set value(t){__classPrivateFieldSet(F,kp,t,`f`)}}.value,parsed:this.parsed,strict:{set value(t){__classPrivateFieldSet(I,Wp,t,`f`)}}.value,strictCommands:{set value(t){__classPrivateFieldSet(H,Gp,t,`f`)}}.value,strictOptions:{set value(t){__classPrivateFieldSet(W,Kp,t,`f`)}}.value,completionCommand:{set value(t){__classPrivateFieldSet(q,bp,t,`f`)}}.value,parseFn:{set value(t){__classPrivateFieldSet(Y,Lp,t,`f`)}}.value,parseContext:{set value(t){__classPrivateFieldSet(X,Rp,t,`f`)}}.value}=Z,__classPrivateFieldGet(this,Pp,`f`).configObjects=te,__classPrivateFieldGet(this,qp,`f`).unfreeze(),__classPrivateFieldGet(this,Xp,`f`).unfreeze(),__classPrivateFieldGet(this,hp,`f`).unfreeze(),__classPrivateFieldGet(this,Dp,`f`).unfreeze()}[_m](t,n){return maybeAsyncResult(n,n=>(t(n),n))}getInternalMethods(){return{getCommandInstance:this[vm].bind(this),getContext:this[ym].bind(this),getHasOutput:this[bm].bind(this),getLoggerInstance:this[xm].bind(this),getParseContext:this[Sm].bind(this),getParserConfiguration:this[im].bind(this),getUsageConfiguration:this[am].bind(this),getUsageInstance:this[Cm].bind(this),getValidationInstance:this[wm].bind(this),hasParseCallback:this[Tm].bind(this),isGlobalContext:this[Em].bind(this),postProcess:this[Dm].bind(this),reset:this[km].bind(this),runValidation:this[jm].bind(this),runYargsParserAndExecuteCommands:this[Am].bind(this),setHasOutput:this[Mm].bind(this)}}[vm](){return __classPrivateFieldGet(this,hp,`f`)}[ym](){return __classPrivateFieldGet(this,vp,`f`)}[bm](){return __classPrivateFieldGet(this,kp,`f`)}[xm](){return __classPrivateFieldGet(this,Mp,`f`)}[Sm](){return __classPrivateFieldGet(this,Rp,`f`)||{}}[Cm](){return __classPrivateFieldGet(this,qp,`f`)}[wm](){return __classPrivateFieldGet(this,Xp,`f`)}[Tm](){return!!__classPrivateFieldGet(this,Lp,`f`)}[Em](){return __classPrivateFieldGet(this,jp,`f`)}[Dm](t,n,S,C){return S||isPromise(t)?t:(n||(t=this[Zp](t)),(this[im]()[`parse-positional-numbers`]||this[im]()[`parse-positional-numbers`]===void 0)&&(t=this[cm](t)),C&&(t=applyMiddleware(t,this,__classPrivateFieldGet(this,Dp,`f`).getMiddleware(),!1)),t)}[km](t={}){__classPrivateFieldSet(this,Pp,__classPrivateFieldGet(this,Pp,`f`)||{},`f`);let n={};n.local=__classPrivateFieldGet(this,Pp,`f`).local||[],n.configObjects=__classPrivateFieldGet(this,Pp,`f`).configObjects||[];let S={};return n.local.forEach(n=>{S[n]=!0,(t[n]||[]).forEach(t=>{S[t]=!0})}),Object.assign(__classPrivateFieldGet(this,Bp,`f`),Object.keys(__classPrivateFieldGet(this,Op,`f`)).reduce((t,n)=>{let C=__classPrivateFieldGet(this,Op,`f`)[n].filter(t=>!(t in S));return C.length>0&&(t[n]=C),t},{})),__classPrivateFieldSet(this,Op,{},`f`),[`array`,`boolean`,`string`,`skipValidation`,`count`,`normalize`,`number`,`hiddenOptions`].forEach(t=>{n[t]=(__classPrivateFieldGet(this,Pp,`f`)[t]||[]).filter(t=>!S[t])}),[`narg`,`key`,`alias`,`default`,`defaultDescription`,`config`,`choices`,`demandedOptions`,`demandedCommands`,`deprecatedOptions`].forEach(t=>{n[t]=objFilter(__classPrivateFieldGet(this,Pp,`f`)[t],t=>!S[t])}),n.envPrefix=__classPrivateFieldGet(this,Pp,`f`).envPrefix,__classPrivateFieldSet(this,Pp,n,`f`),__classPrivateFieldSet(this,qp,__classPrivateFieldGet(this,qp,`f`)?__classPrivateFieldGet(this,qp,`f`).reset(S):usage(this,__classPrivateFieldGet(this,Up,`f`)),`f`),__classPrivateFieldSet(this,Xp,__classPrivateFieldGet(this,Xp,`f`)?__classPrivateFieldGet(this,Xp,`f`).reset(S):validation(this,__classPrivateFieldGet(this,qp,`f`),__classPrivateFieldGet(this,Up,`f`)),`f`),__classPrivateFieldSet(this,hp,__classPrivateFieldGet(this,hp,`f`)?__classPrivateFieldGet(this,hp,`f`).reset():command(__classPrivateFieldGet(this,qp,`f`),__classPrivateFieldGet(this,Xp,`f`),__classPrivateFieldGet(this,Dp,`f`),__classPrivateFieldGet(this,Up,`f`)),`f`),__classPrivateFieldGet(this,yp,`f`)||__classPrivateFieldSet(this,yp,completion(this,__classPrivateFieldGet(this,qp,`f`),__classPrivateFieldGet(this,hp,`f`),__classPrivateFieldGet(this,Up,`f`)),`f`),__classPrivateFieldGet(this,Dp,`f`).reset(),__classPrivateFieldSet(this,bp,null,`f`),__classPrivateFieldSet(this,Np,``,`f`),__classPrivateFieldSet(this,Sp,null,`f`),__classPrivateFieldSet(this,kp,!1,`f`),this.parsed=!1,this}[Om](t,n){return __classPrivateFieldGet(this,Up,`f`).path.relative(t,n)}[Am](t,n,S,C=0,N=!1){let F=!!S||N;t||=__classPrivateFieldGet(this,Vp,`f`),__classPrivateFieldGet(this,Pp,`f`).__=__classPrivateFieldGet(this,Up,`f`).y18n.__,__classPrivateFieldGet(this,Pp,`f`).configuration=this[im]();let I=!!__classPrivateFieldGet(this,Pp,`f`).configuration[`populate--`],H=Object.assign({},__classPrivateFieldGet(this,Pp,`f`).configuration,{"populate--":!0}),W=__classPrivateFieldGet(this,Up,`f`).Parser.detailed(t,Object.assign({},__classPrivateFieldGet(this,Pp,`f`),{configuration:{"parse-positional-numbers":!1,...H}})),q=Object.assign(W.argv,__classPrivateFieldGet(this,Rp,`f`)),Y,X=W.aliases,Z=!1,te=!1;Object.keys(q).forEach(t=>{t===__classPrivateFieldGet(this,Ap,`f`)&&q[t]?Z=!0:t===__classPrivateFieldGet(this,Yp,`f`)&&q[t]&&(te=!0)}),q.$0=this.$0,this.parsed=W,C===0&&__classPrivateFieldGet(this,qp,`f`).clearCachedHelpMessage();try{if(this[om](),n)return this[Dm](q,I,!!S,!1);__classPrivateFieldGet(this,Ap,`f`)&&[__classPrivateFieldGet(this,Ap,`f`)].concat(X[__classPrivateFieldGet(this,Ap,`f`)]||[]).filter(t=>t.length>1).includes(``+q._[q._.length-1])&&(q._.pop(),Z=!0),__classPrivateFieldSet(this,jp,!1,`f`);let H=__classPrivateFieldGet(this,hp,`f`).getCommands(),ne=__classPrivateFieldGet(this,yp,`f`)?.completionKey?[__classPrivateFieldGet(this,yp,`f`)?.completionKey,...this.getAliases()[__classPrivateFieldGet(this,yp,`f`)?.completionKey]??[]].some(t=>Object.prototype.hasOwnProperty.call(q,t)):!1,re=Z||ne||N;if(q._.length){if(H.length){let t;for(let n=C||0,F;q._[n]!==void 0;n++)if(F=String(q._[n]),H.includes(F)&&F!==__classPrivateFieldGet(this,bp,`f`)){let t=__classPrivateFieldGet(this,hp,`f`).runCommand(F,this,W,n+1,N,Z||te||N);return this[Dm](t,I,!!S,!1)}else if(!t&&F!==__classPrivateFieldGet(this,bp,`f`)){t=F;break}!__classPrivateFieldGet(this,hp,`f`).hasDefaultCommand()&&__classPrivateFieldGet(this,Hp,`f`)&&t&&!re&&__classPrivateFieldGet(this,Xp,`f`).recommendCommands(t,H)}__classPrivateFieldGet(this,bp,`f`)&&q._.includes(__classPrivateFieldGet(this,bp,`f`))&&!ne&&(__classPrivateFieldGet(this,Tp,`f`)&&setBlocking(!0),this.showCompletionScript(),this.exit(0))}if(__classPrivateFieldGet(this,hp,`f`).hasDefaultCommand()&&!re){let t=__classPrivateFieldGet(this,hp,`f`).runCommand(null,this,W,0,N,Z||te||N);return this[Dm](t,I,!!S,!1)}if(ne){__classPrivateFieldGet(this,Tp,`f`)&&setBlocking(!0),t=[].concat(t);let n=t.slice(t.indexOf(`--${__classPrivateFieldGet(this,yp,`f`).completionKey}`)+1);return __classPrivateFieldGet(this,yp,`f`).getCompletion(n,(t,n)=>{if(t)throw new gl(t.message);(n||[]).forEach(t=>{__classPrivateFieldGet(this,Mp,`f`).log(t)}),this.exit(0)}),this[Dm](q,!I,!!S,!1)}if(__classPrivateFieldGet(this,kp,`f`)||(Z?(__classPrivateFieldGet(this,Tp,`f`)&&setBlocking(!0),F=!0,this.showHelp(t=>{__classPrivateFieldGet(this,Mp,`f`).log(t),this.exit(0)})):te&&(__classPrivateFieldGet(this,Tp,`f`)&&setBlocking(!0),F=!0,__classPrivateFieldGet(this,qp,`f`).showVersion(`log`),this.exit(0))),!F&&__classPrivateFieldGet(this,Pp,`f`).skipValidation.length>0&&(F=Object.keys(q).some(t=>__classPrivateFieldGet(this,Pp,`f`).skipValidation.indexOf(t)>=0&&q[t]===!0)),!F){if(W.error)throw new gl(W.error.message);if(!ne){let t=this[jm](X,{},W.error);S||(Y=applyMiddleware(q,this,__classPrivateFieldGet(this,Dp,`f`).getMiddleware(),!0)),Y=this[_m](t,Y??q),isPromise(Y)&&!S&&(Y=Y.then(()=>applyMiddleware(q,this,__classPrivateFieldGet(this,Dp,`f`).getMiddleware(),!1)))}}}catch(t){if(t instanceof gl)__classPrivateFieldGet(this,qp,`f`).fail(t.message,t);else throw t}return this[Dm](Y??q,I,!!S,!0)}[jm](t,n,S,C){let N={...this.getDemandedOptions()};return F=>{if(S)throw new gl(S.message);__classPrivateFieldGet(this,Xp,`f`).nonOptionCount(F),__classPrivateFieldGet(this,Xp,`f`).requiredArguments(F,N);let I=!1;__classPrivateFieldGet(this,Gp,`f`)&&(I=__classPrivateFieldGet(this,Xp,`f`).unknownCommands(F)),__classPrivateFieldGet(this,Wp,`f`)&&!I?__classPrivateFieldGet(this,Xp,`f`).unknownArguments(F,t,n,!!C):__classPrivateFieldGet(this,Kp,`f`)&&__classPrivateFieldGet(this,Xp,`f`).unknownArguments(F,t,{},!1,!1),__classPrivateFieldGet(this,Xp,`f`).limitedChoices(F),__classPrivateFieldGet(this,Xp,`f`).implications(F),__classPrivateFieldGet(this,Xp,`f`).conflicting(F)}}[Mm](){__classPrivateFieldSet(this,kp,!0,`f`)}[Nm](t){if(typeof t==`string`)__classPrivateFieldGet(this,Pp,`f`).key[t]=!0;else for(let n of t)__classPrivateFieldGet(this,Pp,`f`).key[n]=!0}}}),Im,Lm=__esmMin(()=>{Jf(),Fm(),Im=YargsFactory(qf)});function classifyCliFailure(t,n){return typeof t==`string`&&t.length>0?{kind:`usage`,message:t}:{kind:`runtime`}}var Rm=__esmMin(()=>{});function buildHeaders(t,n){let S={"user-agent":`gjsify-install/0.57.0`,"accept-encoding":n.acceptEncoding??`identity`};if(n.npmrc){let C=resolveAuthForUrl(t,n.npmrc);C&&(S.authorization=C)}if(n.headers)for(let[t,C]of Object.entries(n.headers))S[t.toLowerCase()]=C;return S}function resolveAuthForUrl(t,n){let S=pathPrefixes(new URL(t));for(let t of S){let S=n.authTokens[t];if(S)return`Bearer ${S}`;let C=n.basicAuth[t];if(C)return`Basic ${btoa(`${C.username}:${C.password}`)}`}return null}function pathPrefixes(t){let n=t.pathname.split(`/`).filter(Boolean),S=[];for(let C=n.length;C>=0;C--){let N=n.slice(0,C).join(`/`);S.push(N?`//${t.host}/${N}`:`//${t.host}`)}return S}var zm=__esmMin(()=>{}),PackageNotFoundError,IntegrityError,RegistryTimeoutError,RegistryUnreachableError,Bm=__esmMin(()=>{PackageNotFoundError=class extends Error{name;url;constructor(t,n){super(`Package not found in registry: ${t} (${n})`),this.name=t,this.url=n,this.name=`PackageNotFoundError`}},IntegrityError=class extends Error{url;integrity;constructor(t,n){super(`Tarball integrity mismatch for ${t} (expected ${n})`),this.url=t,this.integrity=n,this.name=`IntegrityError`}},RegistryTimeoutError=class extends Error{url;timeoutMs;attempts;constructor(t,n,S){let C=Math.round(n/100)/10,N=Math.round(n*S/100)/10;super(`@gjsify/npm-registry: GET ${t} timed out after ${C}s × ${S} attempt(s) (total ~${N}s). This usually means the registry CDN is slow or unreachable.`),this.url=t,this.timeoutMs=n,this.attempts=S,this.name=`RegistryTimeoutError`}},RegistryUnreachableError=class extends Error{url;attempts;elapsedMs;constructor(t,n,S,C){let N=Math.round(S/100)/10,F=C instanceof Error?C.message:String(C);super(`@gjsify/npm-registry: GET ${t} failed after ${n} attempt(s) over ~${N}s: ${F}. This usually means the registry or the network dropped out.`),this.url=t,this.attempts=n,this.elapsedMs=S,this.name=`RegistryUnreachableError`,this.cause=C}}});function registryFor(t,n){if(n&&t.startsWith(`@`)){let S=t.slice(0,t.indexOf(`/`)),C=n.scopes[S];if(C)return ensureTrailingSlash$1(C)}return n?.registry?ensureTrailingSlash$1(n.registry):Vm}function parseNpmrc(t){let n={registry:Vm,scopes:{},authTokens:{},basicAuth:{}},S=t.split(/\r?\n/),C={};for(let t of S){let S=t.replace(/^\s+|\s+$/g,``);if(!S||S.startsWith(`#`)||S.startsWith(`;`))continue;let N=S.indexOf(`=`);if(N<0)continue;let F=S.slice(0,N).trim(),I=expandEnv(stripQuotes(S.slice(N+1).trim()));if(F===`registry`){n.registry=ensureTrailingSlash$1(I);continue}let H=F.match(/^(@[^:]+):registry$/);if(H){n.scopes[H[1]]=ensureTrailingSlash$1(I);continue}let W=F.match(/^\/\/(.+):_authToken$/);if(W){n.authTokens[normalizeAuthHost(W[1])]=I;continue}let q=F.match(/^\/\/(.+):username$/);if(q){(C[normalizeAuthHost(q[1])]??={}).user=I;continue}let Y=F.match(/^\/\/(.+):_password$/);if(Y){let t=base64Decode$1(I);(C[normalizeAuthHost(Y[1])]??={}).pass=t;continue}}for(let[t,S]of Object.entries(C))S.user&&S.pass!==void 0&&(n.basicAuth[t]={username:S.user,password:S.pass});return n}function normalizeAuthHost(t){return`//${t.replace(/\/+$/,``)}`}function ensureTrailingSlash$1(t){return t.endsWith(`/`)?t:t+`/`}function stripQuotes(t){return t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`)?t.slice(1,-1):t}function expandEnv(t){return t.replace(/\$\{([A-Z0-9_]+)\}/gi,(t,n)=>globalThis.process?.env?.[n]??``)}function base64Decode$1(t){return atob(t)}var Vm,Hm=__esmMin(()=>{Vm=`https://registry.npmjs.org/`,__name$1(ensureTrailingSlash$1,`ensureTrailingSlash`),__name$1(base64Decode$1,`base64Decode`)});async function fetchWithRetry(t,n,S){let C=S.fetch??globalThis.fetch;if(!C)throw Error(`@gjsify/npm-registry: globalThis.fetch is missing`);let N=Math.max(0,S.retries??5),F=Math.max(0,S.retryDelayMs??1e3),I=Math.max(0,S.timeoutMs??3e4),H=S.retryNotFound??!1,W=Date.now(),q=0,Y,X=0;for(;;){if(n.signal?.aborted)throw signalAbortError(n.signal);let Z=I>0?new AbortController:null,te=Z===null?null:setTimeout(()=>Z.abort(Error(`@gjsify/npm-registry: per-request timeout ${I}ms`)),I),ne=composeSignals(n.signal,Z?.signal);try{let F=await C(t,{...n,signal:ne}),I=isRetryableStatus(F.status)||H&&F.status===404;if(F.ok||!I||q>=N)return S.read?await S.read(F):F;try{await F.arrayBuffer()}catch{}Y=Error(`HTTP ${F.status} ${F.statusText}`)}catch(S){let C=Z!==null&&Z.signal.aborted,F=n.signal?.aborted===!0;if(C&&!F){if(X++,q>=N)throw new RegistryTimeoutError(t,I,X);Y=S}else if(F)throw signalAbortError(n.signal);else{if(!isRetryableError(S))throw S;if(q>=N)throw new RegistryUnreachableError(t,q+1,Date.now()-W,S);Y=S}}finally{te!==null&&clearTimeout(te)}let re=Math.min(F*2**q,8e3);S.onRetry?.({attempt:q+1,error:Y,delayMs:re}),await delay$1(re,n.signal),q++}}function composeSignals(t,n){return t?n?AbortSignal.any([t,n]):t:n}function isRetryableStatus(t){return t===408||t===425||t===429||t===500||t===502||t===503||t===504||t===521||t===522||t===524||t===525}function isRetryableError(t){if(t&&typeof t==`object`&&`name`in t&&t.name===`AbortError`)return!1;if(t instanceof TypeError)return!0;if(t&&typeof t==`object`&&`name`in t){let n=t.name;if(n===`FetchError`)return!0;if(n===`AbortError`)return!1}let n=t?.cause;if(n&&typeof n==`object`&&`code`in n){let t=n.code;if(typeof t==`string`)return t===`ECONNRESET`||t===`ECONNREFUSED`||t===`ENETUNREACH`||t===`ENOTFOUND`||t===`ETIMEDOUT`||t===`EAI_AGAIN`||t===`UND_ERR_SOCKET`||t===`UND_ERR_CONNECT_TIMEOUT`}return!1}function delay$1(t,n){return t<=0?Promise.resolve():new Promise((S,C)=>{let N=setTimeout(()=>{n?.removeEventListener?.(`abort`,onAbort),S()},t),onAbort=()=>{clearTimeout(N),C(signalAbortError(n))};if(n?.aborted){clearTimeout(N),C(signalAbortError(n));return}n?.addEventListener?.(`abort`,onAbort,{once:!0})})}function signalAbortError(t){let n=t&&`reason`in t?t.reason:void 0;if(n instanceof Error)return n;let S=Error(`Aborted`);return S.name=`AbortError`,S}var Um=__esmMin(()=>{Bm(),__name$1(delay$1,`delay`)});async function verifyIntegrity(t,n){let S=n.trim().split(/\s+/);for(let n of S){let S=n.indexOf(`-`);if(S<0)continue;let C=n.slice(0,S).toLowerCase(),N=n.slice(S+1),F=globalThis.crypto?.subtle;if(!F)throw Error(`@gjsify/npm-registry: globalThis.crypto.subtle is missing`);let I=subriToWebCryptoAlgo(C);if(!I)continue;let H=await F.digest(I,dataAsArrayBuffer(t));if(bytesToBase64(new Uint8Array(H))===N)return!0}return!1}function subriToWebCryptoAlgo(t){switch(t){case`sha1`:return`SHA-1`;case`sha256`:return`SHA-256`;case`sha384`:return`SHA-384`;case`sha512`:return`SHA-512`;default:return null}}function dataAsArrayBuffer(t){if(t.byteOffset===0&&t.byteLength===t.buffer.byteLength)return t.buffer;let n=new Uint8Array(t.byteLength);return n.set(t),n.buffer}function bytesToBase64(t){let n=``;for(let S=0;S<t.length;S++)n+=String.fromCharCode(t[S]);return btoa(n)}var Wm=__esmMin(()=>{});function assertPackument(t,n){if(!n||typeof n!=`object`)throw TypeError(`registry: ${t} packument is not an object`);let S=n;if(typeof S.name!=`string`)throw TypeError(`registry: ${t} packument missing string name`);if(!S.versions||typeof S.versions!=`object`)throw TypeError(`registry: ${t} packument missing versions map`)}function packumentUrl(t,n){let S=ensureTrailingSlash$1(n);if(t.startsWith(`@`)){let n=t.indexOf(`/`);if(n<0)throw TypeError(`Invalid scoped package name: ${t}`);let C=t.slice(0,n),N=t.slice(n+1);return`${S}${encodeURIComponent(C)}/${encodeURIComponent(N)}`}return`${S}${encodeURIComponent(t)}`}async function fetchPackumentConditional(t,n={}){let S=packumentUrl(t,n.registry??registryFor(t,n.npmrc)),C=buildHeaders(S,{...n,acceptEncoding:`gzip`});C.accept??=n.fullMetadata?`application/json`:`application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*`,n.ifNoneMatch&&(C[`if-none-match`]=n.ifNoneMatch);let N=await fetchWithRetry(S,{headers:C,signal:n.signal},{fetch:n.fetch,retries:n.retries,retryDelayMs:n.retryDelayMs,timeoutMs:n.timeoutMs,onRetry:n.onRetry,read:async n=>{if(n.status===304){try{await n.arrayBuffer()}catch{}return{status:`not-modified`}}if(!n.ok)throw n.status===404||n.status===406?new PackageNotFoundError(t,S):Error(`registry GET ${S} -> ${n.status} ${n.statusText}`);return{status:`fresh`,body:await decodeJsonBody(n),etag:n.headers.get(`etag`)??void 0}}});if(N.status===`not-modified`)return{status:`not-modified`,etag:n.ifNoneMatch};let F=N.body;return assertPackument(t,F),{status:`fresh`,packument:F,etag:N.etag}}async function decodeJsonBody(t){return t.json()}async function fetchPackument(t,n={}){let S=await fetchPackumentConditional(t,n);if(!S.packument)throw Error(`registry: ${t} returned 304 Not Modified to an unconditional request`);return S.packument}var Gm=__esmMin(()=>{zm(),Bm(),Hm(),Um()});async function fetchTarball(t,n={}){let S=buildHeaders(t,{...n,acceptEncoding:`identity`});S.accept??=`application/octet-stream`;let C=await fetchWithRetry(t,{headers:S,signal:n.signal},{fetch:n.fetch,retries:n.retries,retryDelayMs:n.retryDelayMs,timeoutMs:n.timeoutMs,onRetry:n.onRetry,retryNotFound:n.retryNotFound??!0,read:async n=>{if(!n.ok)throw Error(`tarball GET ${t} -> ${n.status} ${n.statusText}`);return new Uint8Array(await n.arrayBuffer())}});if(n.integrity&&!await verifyIntegrity(C,n.integrity))throw new IntegrityError(t,n.integrity);return C}var Km=__esmMin(()=>{zm(),Bm(),Um(),Wm()});async function whoami(t,n){let S=`${ensureTrailingSlash$1(t)}-/whoami`,C=buildHeaders(S,{npmrc:n});C.accept=`application/json`;let N=globalThis.fetch;if(!N)throw Error(`@gjsify/npm-registry: globalThis.fetch is missing`);let F=await N(S,{method:`GET`,headers:C});if(!F.ok)throw Error(`whoami GET ${S} -> ${F.status} ${F.statusText}`);let I=await F.json();if(I&&typeof I==`object`&&`username`in I){let t=I.username;if(typeof t==`string`&&t.length>0)return{username:t}}return{}}var qm=__esmMin(()=>{zm(),Hm()}),Jm=__esmMin(()=>{zm(),Hm(),Wm(),Gm(),Km(),qm()});function escapePackageName(t){return t.replace(`/`,`%2f`)}function buildPublishHeaders(t,n){let S=buildHeaders(t,{npmrc:n.npmrc});return S[`content-type`]=`application/json`,S[`npm-command`]=`publish`,S[`npm-auth-type`]=n.otp?`legacy`:`web`,S[`user-agent`]=n.userAgent??defaultUserAgent(),n.otp&&(S[`npm-otp`]=n.otp),n.authorization&&(S.authorization=n.authorization),S}function cliVersion(){return Ym===void 0&&(Ym=`0.57.0`),Ym}function cliPackageDir(){let t=globalThis.process?.env?.GJSIFY_CLI_PACKAGE_JSON,n;try{n=wn(t||fileURLToPath(import.meta.url))}catch{return null}for(let t=0;t<12;t++){try{if(JSON.parse(readFileSync(`${n}/package.json`,`utf8`)).name===`@gjsify/cli`)return n}catch{}let t=wn(n);if(t===n)break;n=t}return null}function defaultUserAgent(){let t=globalThis.process,n=t?.arch??`x64`,S=t?.platform??`linux`;return`gjsify-publish/${cliVersion()} (${S} ${n})`}var Ym,Xm=__esmMin(()=>{Md(),jn(),Hn(),Jm()}),Zm,Qm=__esmMin(()=>{Zm=`gjsify`}),$m=__commonJSMin(((t,n)=>{let S=(jn(),__toCommonJS(gn)),C=(Al(),__toCommonJS(El)),N=(Md(),__toCommonJS(Ad)),resolveFrom=(t,n,F)=>{if(typeof t!=`string`)throw TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof t}\``);if(typeof n!=`string`)throw TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof n}\``);try{t=N.realpathSync(t)}catch(n){if(n.code===`ENOENT`)t=S.resolve(t);else if(F)return null;else throw n}let I=S.join(t,`noop.js`),resolveFileName=()=>C._resolveFilename(n,{id:I,filename:I,paths:C._nodeModulePaths(t)});if(F)try{return resolveFileName()}catch{return null}return resolveFileName()};n.exports=(t,n)=>resolveFrom(t,n),n.exports.silent=(t,n)=>resolveFrom(t,n,!0)})),eh=__commonJSMin(((t,n)=>{let callsites=()=>{let t=Error.prepareStackTrace;Error.prepareStackTrace=(t,n)=>n;let n=Error().stack.slice(1);return Error.prepareStackTrace=t,n};n.exports=callsites,n.exports.default=callsites})),th=__commonJSMin(((t,n)=>{let S=eh();n.exports=t=>{let n=S();if(!t)return n[2].getFileName();let C=!1;n.shift();for(let S of n){let n=S.getFileName();if(typeof n==`string`){if(n===t){C=!0;continue}if(n!==`module.js`&&C&&n!==t)return n}}}})),nh=__commonJSMin(((t,n)=>{var{__gjsifyModuleDir:S,__gjsifyModuleFile:C}=(Pl(),__toCommonJS(jl)),N=S(`import-fresh/index.js`),F=C(`import-fresh/index.js`);let I=(jn(),__toCommonJS(gn)),H=$m(),W=th();n.exports=t=>{if(typeof t!=`string`)throw TypeError(`Expected a string`);let n=W(F),S=n?I.dirname(n):N,C=H(S,t),q=Y.cache[C];if(q&&q.parent){let t=q.parent.children.length;for(;t--;)q.parent.children[t].id===C&&q.parent.children.splice(t,1)}delete Y.cache[C];let X=Y.cache[n];return X===void 0||X.require===void 0?Y(C):X.require(C)}})),rh=__commonJSMin(((t,n)=>{n.exports=function isArrayish(t){return t?t instanceof Array||Array.isArray(t)||t.length>=0&&t.splice instanceof Function:!1}})),ih=__commonJSMin(((t,n)=>{var S=(yu(),__toCommonJS(hu)),C=rh(),N=function errorEx(t,n){(!t||t.constructor!==String)&&(n=t||{},t=Error.name);var N=function ErrorEXError(S){if(!this)return new ErrorEXError(S);S=S instanceof Error?S.message:S||this.message,Error.call(this,S),Error.captureStackTrace(this,N),this.name=t,Object.defineProperty(this,"message",{configurable:!0,enumerable:!1,get:function(){var t=S.split(/\r?\n/g);for(var N in n)if(n.hasOwnProperty(N)){var F=n[N];`message`in F&&(t=F.message(this[N],t)||t,C(t)||(t=[t]))}return t.join(`
148
+ `,`f`),__classPrivateFieldSet(this,Np,__classPrivateFieldGet(this,Np,`f`)+t.join(` `),`f`)}}}[$p](t){objectKeys(__classPrivateFieldGet(this,Pp,`f`)).forEach(n=>{if((t=>t===`configObjects`)(n))return;let S=__classPrivateFieldGet(this,Pp,`f`)[n];Array.isArray(S)?S.includes(t)&&S.splice(S.indexOf(t),1):typeof S==`object`&&delete S[t]}),delete __classPrivateFieldGet(this,qp,`f`).getDescriptions()[t]}[em](t,n,S){__classPrivateFieldGet(this,wp,`f`)[S]||(__classPrivateFieldGet(this,Up,`f`).process.emitWarning(t,n),__classPrivateFieldGet(this,wp,`f`)[S]=!0)}[tm](){__classPrivateFieldGet(this,Ep,`f`).push({options:__classPrivateFieldGet(this,Pp,`f`),configObjects:__classPrivateFieldGet(this,Pp,`f`).configObjects.slice(0),exitProcess:__classPrivateFieldGet(this,Tp,`f`),groups:__classPrivateFieldGet(this,Op,`f`),strict:__classPrivateFieldGet(this,Wp,`f`),strictCommands:__classPrivateFieldGet(this,Gp,`f`),strictOptions:__classPrivateFieldGet(this,Kp,`f`),completionCommand:__classPrivateFieldGet(this,bp,`f`),output:__classPrivateFieldGet(this,Np,`f`),exitError:__classPrivateFieldGet(this,Sp,`f`),hasOutput:__classPrivateFieldGet(this,kp,`f`),parsed:this.parsed,parseFn:__classPrivateFieldGet(this,Lp,`f`),parseContext:__classPrivateFieldGet(this,Rp,`f`)}),__classPrivateFieldGet(this,qp,`f`).freeze(),__classPrivateFieldGet(this,Xp,`f`).freeze(),__classPrivateFieldGet(this,hp,`f`).freeze(),__classPrivateFieldGet(this,Dp,`f`).freeze()}[nm](){let t=``,n;return n=/\b(node|iojs|electron)(\.exe)?$/.test(__classPrivateFieldGet(this,Up,`f`).process.argv()[0])?__classPrivateFieldGet(this,Up,`f`).process.argv().slice(1,2):__classPrivateFieldGet(this,Up,`f`).process.argv().slice(0,1),t=n.map(t=>{let n=this[Om](__classPrivateFieldGet(this,gp,`f`),t);return t.match(/^(\/|([a-zA-Z]:)?\\)/)&&n.length<t.length?n:t}).join(` `).trim(),__classPrivateFieldGet(this,Up,`f`).getEnv(`_`)&&__classPrivateFieldGet(this,Up,`f`).getProcessArgvBin()===__classPrivateFieldGet(this,Up,`f`).getEnv(`_`)&&(t=__classPrivateFieldGet(this,Up,`f`).getEnv(`_`).replace(`${__classPrivateFieldGet(this,Up,`f`).path.dirname(__classPrivateFieldGet(this,Up,`f`).process.execPath())}/`,``)),t}[im](){return __classPrivateFieldGet(this,Ip,`f`)}[am](){return __classPrivateFieldGet(this,Jp,`f`)}[om](){if(!__classPrivateFieldGet(this,Cp,`f`))return;let t=__classPrivateFieldGet(this,Up,`f`).getEnv(`LC_ALL`)||__classPrivateFieldGet(this,Up,`f`).getEnv(`LC_MESSAGES`)||__classPrivateFieldGet(this,Up,`f`).getEnv(`LANG`)||__classPrivateFieldGet(this,Up,`f`).getEnv(`LANGUAGE`)||`en_US`;this.locale(t.replace(/[.:].*/,``))}[sm](){return this[lm]().version||`unknown`}[cm](t){let n=t[`--`]?t[`--`]:t._;for(let t=0,S;(S=n[t])!==void 0;t++)__classPrivateFieldGet(this,Up,`f`).Parser.looksLikeNumber(S)&&Number.isSafeInteger(Math.floor(parseFloat(`${S}`)))&&(n[t]=Number(S));return t}[lm](t){let n=t||`*`;if(__classPrivateFieldGet(this,zp,`f`)[n])return __classPrivateFieldGet(this,zp,`f`)[n];let S={};try{let n=t||__classPrivateFieldGet(this,Up,`f`).mainFilename;__classPrivateFieldGet(this,Up,`f`).path.extname(n)&&(n=__classPrivateFieldGet(this,Up,`f`).path.dirname(n));let C=__classPrivateFieldGet(this,Up,`f`).findUp(n,(t,n)=>{if(n.includes(`package.json`))return`package.json`});assertNotStrictEqual(C,void 0,__classPrivateFieldGet(this,Up,`f`)),S=JSON.parse(__classPrivateFieldGet(this,Up,`f`).readFileSync(C,`utf8`))}catch{}return __classPrivateFieldGet(this,zp,`f`)[n]=S||{},__classPrivateFieldGet(this,zp,`f`)[n]}[um](t,n){n=[].concat(n),n.forEach(n=>{n=this[mm](n),__classPrivateFieldGet(this,Pp,`f`)[t].push(n)})}[dm](t,n,S,C){this[pm](t,n,S,C,(t,n,S)=>{__classPrivateFieldGet(this,Pp,`f`)[t][n]=S})}[fm](t,n,S,C){this[pm](t,n,S,C,(t,n,S)=>{__classPrivateFieldGet(this,Pp,`f`)[t][n]=(__classPrivateFieldGet(this,Pp,`f`)[t][n]||[]).concat(S)})}[pm](t,n,S,C,N){if(Array.isArray(S))S.forEach(n=>{t(n,C)});else if((t=>typeof t==`object`)(S))for(let n of objectKeys(S))t(n,S[n]);else N(n,this[mm](S),C)}[mm](t){return t===`__proto__`?`___proto___`:t}[hm](t,n){return this[dm](this[hm].bind(this),`key`,t,n),this}[gm](){var t,n,S,C,N,F,I,H,W,q,Y,X;let Z=__classPrivateFieldGet(this,Ep,`f`).pop();assertNotStrictEqual(Z,void 0,__classPrivateFieldGet(this,Up,`f`));let te;t=this,n=this,S=this,C=this,N=this,F=this,I=this,H=this,W=this,q=this,Y=this,X=this,{options:{set value(n){__classPrivateFieldSet(t,Pp,n,`f`)}}.value,configObjects:te,exitProcess:{set value(t){__classPrivateFieldSet(n,Tp,t,`f`)}}.value,groups:{set value(t){__classPrivateFieldSet(S,Op,t,`f`)}}.value,output:{set value(t){__classPrivateFieldSet(C,Np,t,`f`)}}.value,exitError:{set value(t){__classPrivateFieldSet(N,Sp,t,`f`)}}.value,hasOutput:{set value(t){__classPrivateFieldSet(F,kp,t,`f`)}}.value,parsed:this.parsed,strict:{set value(t){__classPrivateFieldSet(I,Wp,t,`f`)}}.value,strictCommands:{set value(t){__classPrivateFieldSet(H,Gp,t,`f`)}}.value,strictOptions:{set value(t){__classPrivateFieldSet(W,Kp,t,`f`)}}.value,completionCommand:{set value(t){__classPrivateFieldSet(q,bp,t,`f`)}}.value,parseFn:{set value(t){__classPrivateFieldSet(Y,Lp,t,`f`)}}.value,parseContext:{set value(t){__classPrivateFieldSet(X,Rp,t,`f`)}}.value}=Z,__classPrivateFieldGet(this,Pp,`f`).configObjects=te,__classPrivateFieldGet(this,qp,`f`).unfreeze(),__classPrivateFieldGet(this,Xp,`f`).unfreeze(),__classPrivateFieldGet(this,hp,`f`).unfreeze(),__classPrivateFieldGet(this,Dp,`f`).unfreeze()}[_m](t,n){return maybeAsyncResult(n,n=>(t(n),n))}getInternalMethods(){return{getCommandInstance:this[vm].bind(this),getContext:this[ym].bind(this),getHasOutput:this[bm].bind(this),getLoggerInstance:this[xm].bind(this),getParseContext:this[Sm].bind(this),getParserConfiguration:this[im].bind(this),getUsageConfiguration:this[am].bind(this),getUsageInstance:this[Cm].bind(this),getValidationInstance:this[wm].bind(this),hasParseCallback:this[Tm].bind(this),isGlobalContext:this[Em].bind(this),postProcess:this[Dm].bind(this),reset:this[km].bind(this),runValidation:this[jm].bind(this),runYargsParserAndExecuteCommands:this[Am].bind(this),setHasOutput:this[Mm].bind(this)}}[vm](){return __classPrivateFieldGet(this,hp,`f`)}[ym](){return __classPrivateFieldGet(this,vp,`f`)}[bm](){return __classPrivateFieldGet(this,kp,`f`)}[xm](){return __classPrivateFieldGet(this,Mp,`f`)}[Sm](){return __classPrivateFieldGet(this,Rp,`f`)||{}}[Cm](){return __classPrivateFieldGet(this,qp,`f`)}[wm](){return __classPrivateFieldGet(this,Xp,`f`)}[Tm](){return!!__classPrivateFieldGet(this,Lp,`f`)}[Em](){return __classPrivateFieldGet(this,jp,`f`)}[Dm](t,n,S,C){return S||isPromise(t)?t:(n||(t=this[Zp](t)),(this[im]()[`parse-positional-numbers`]||this[im]()[`parse-positional-numbers`]===void 0)&&(t=this[cm](t)),C&&(t=applyMiddleware(t,this,__classPrivateFieldGet(this,Dp,`f`).getMiddleware(),!1)),t)}[km](t={}){__classPrivateFieldSet(this,Pp,__classPrivateFieldGet(this,Pp,`f`)||{},`f`);let n={};n.local=__classPrivateFieldGet(this,Pp,`f`).local||[],n.configObjects=__classPrivateFieldGet(this,Pp,`f`).configObjects||[];let S={};return n.local.forEach(n=>{S[n]=!0,(t[n]||[]).forEach(t=>{S[t]=!0})}),Object.assign(__classPrivateFieldGet(this,Bp,`f`),Object.keys(__classPrivateFieldGet(this,Op,`f`)).reduce((t,n)=>{let C=__classPrivateFieldGet(this,Op,`f`)[n].filter(t=>!(t in S));return C.length>0&&(t[n]=C),t},{})),__classPrivateFieldSet(this,Op,{},`f`),[`array`,`boolean`,`string`,`skipValidation`,`count`,`normalize`,`number`,`hiddenOptions`].forEach(t=>{n[t]=(__classPrivateFieldGet(this,Pp,`f`)[t]||[]).filter(t=>!S[t])}),[`narg`,`key`,`alias`,`default`,`defaultDescription`,`config`,`choices`,`demandedOptions`,`demandedCommands`,`deprecatedOptions`].forEach(t=>{n[t]=objFilter(__classPrivateFieldGet(this,Pp,`f`)[t],t=>!S[t])}),n.envPrefix=__classPrivateFieldGet(this,Pp,`f`).envPrefix,__classPrivateFieldSet(this,Pp,n,`f`),__classPrivateFieldSet(this,qp,__classPrivateFieldGet(this,qp,`f`)?__classPrivateFieldGet(this,qp,`f`).reset(S):usage(this,__classPrivateFieldGet(this,Up,`f`)),`f`),__classPrivateFieldSet(this,Xp,__classPrivateFieldGet(this,Xp,`f`)?__classPrivateFieldGet(this,Xp,`f`).reset(S):validation(this,__classPrivateFieldGet(this,qp,`f`),__classPrivateFieldGet(this,Up,`f`)),`f`),__classPrivateFieldSet(this,hp,__classPrivateFieldGet(this,hp,`f`)?__classPrivateFieldGet(this,hp,`f`).reset():command(__classPrivateFieldGet(this,qp,`f`),__classPrivateFieldGet(this,Xp,`f`),__classPrivateFieldGet(this,Dp,`f`),__classPrivateFieldGet(this,Up,`f`)),`f`),__classPrivateFieldGet(this,yp,`f`)||__classPrivateFieldSet(this,yp,completion(this,__classPrivateFieldGet(this,qp,`f`),__classPrivateFieldGet(this,hp,`f`),__classPrivateFieldGet(this,Up,`f`)),`f`),__classPrivateFieldGet(this,Dp,`f`).reset(),__classPrivateFieldSet(this,bp,null,`f`),__classPrivateFieldSet(this,Np,``,`f`),__classPrivateFieldSet(this,Sp,null,`f`),__classPrivateFieldSet(this,kp,!1,`f`),this.parsed=!1,this}[Om](t,n){return __classPrivateFieldGet(this,Up,`f`).path.relative(t,n)}[Am](t,n,S,C=0,N=!1){let F=!!S||N;t||=__classPrivateFieldGet(this,Vp,`f`),__classPrivateFieldGet(this,Pp,`f`).__=__classPrivateFieldGet(this,Up,`f`).y18n.__,__classPrivateFieldGet(this,Pp,`f`).configuration=this[im]();let I=!!__classPrivateFieldGet(this,Pp,`f`).configuration[`populate--`],H=Object.assign({},__classPrivateFieldGet(this,Pp,`f`).configuration,{"populate--":!0}),W=__classPrivateFieldGet(this,Up,`f`).Parser.detailed(t,Object.assign({},__classPrivateFieldGet(this,Pp,`f`),{configuration:{"parse-positional-numbers":!1,...H}})),q=Object.assign(W.argv,__classPrivateFieldGet(this,Rp,`f`)),Y,X=W.aliases,Z=!1,te=!1;Object.keys(q).forEach(t=>{t===__classPrivateFieldGet(this,Ap,`f`)&&q[t]?Z=!0:t===__classPrivateFieldGet(this,Yp,`f`)&&q[t]&&(te=!0)}),q.$0=this.$0,this.parsed=W,C===0&&__classPrivateFieldGet(this,qp,`f`).clearCachedHelpMessage();try{if(this[om](),n)return this[Dm](q,I,!!S,!1);__classPrivateFieldGet(this,Ap,`f`)&&[__classPrivateFieldGet(this,Ap,`f`)].concat(X[__classPrivateFieldGet(this,Ap,`f`)]||[]).filter(t=>t.length>1).includes(``+q._[q._.length-1])&&(q._.pop(),Z=!0),__classPrivateFieldSet(this,jp,!1,`f`);let H=__classPrivateFieldGet(this,hp,`f`).getCommands(),ne=__classPrivateFieldGet(this,yp,`f`)?.completionKey?[__classPrivateFieldGet(this,yp,`f`)?.completionKey,...this.getAliases()[__classPrivateFieldGet(this,yp,`f`)?.completionKey]??[]].some(t=>Object.prototype.hasOwnProperty.call(q,t)):!1,re=Z||ne||N;if(q._.length){if(H.length){let t;for(let n=C||0,F;q._[n]!==void 0;n++)if(F=String(q._[n]),H.includes(F)&&F!==__classPrivateFieldGet(this,bp,`f`)){let t=__classPrivateFieldGet(this,hp,`f`).runCommand(F,this,W,n+1,N,Z||te||N);return this[Dm](t,I,!!S,!1)}else if(!t&&F!==__classPrivateFieldGet(this,bp,`f`)){t=F;break}!__classPrivateFieldGet(this,hp,`f`).hasDefaultCommand()&&__classPrivateFieldGet(this,Hp,`f`)&&t&&!re&&__classPrivateFieldGet(this,Xp,`f`).recommendCommands(t,H)}__classPrivateFieldGet(this,bp,`f`)&&q._.includes(__classPrivateFieldGet(this,bp,`f`))&&!ne&&(__classPrivateFieldGet(this,Tp,`f`)&&setBlocking(!0),this.showCompletionScript(),this.exit(0))}if(__classPrivateFieldGet(this,hp,`f`).hasDefaultCommand()&&!re){let t=__classPrivateFieldGet(this,hp,`f`).runCommand(null,this,W,0,N,Z||te||N);return this[Dm](t,I,!!S,!1)}if(ne){__classPrivateFieldGet(this,Tp,`f`)&&setBlocking(!0),t=[].concat(t);let n=t.slice(t.indexOf(`--${__classPrivateFieldGet(this,yp,`f`).completionKey}`)+1);return __classPrivateFieldGet(this,yp,`f`).getCompletion(n,(t,n)=>{if(t)throw new gl(t.message);(n||[]).forEach(t=>{__classPrivateFieldGet(this,Mp,`f`).log(t)}),this.exit(0)}),this[Dm](q,!I,!!S,!1)}if(__classPrivateFieldGet(this,kp,`f`)||(Z?(__classPrivateFieldGet(this,Tp,`f`)&&setBlocking(!0),F=!0,this.showHelp(t=>{__classPrivateFieldGet(this,Mp,`f`).log(t),this.exit(0)})):te&&(__classPrivateFieldGet(this,Tp,`f`)&&setBlocking(!0),F=!0,__classPrivateFieldGet(this,qp,`f`).showVersion(`log`),this.exit(0))),!F&&__classPrivateFieldGet(this,Pp,`f`).skipValidation.length>0&&(F=Object.keys(q).some(t=>__classPrivateFieldGet(this,Pp,`f`).skipValidation.indexOf(t)>=0&&q[t]===!0)),!F){if(W.error)throw new gl(W.error.message);if(!ne){let t=this[jm](X,{},W.error);S||(Y=applyMiddleware(q,this,__classPrivateFieldGet(this,Dp,`f`).getMiddleware(),!0)),Y=this[_m](t,Y??q),isPromise(Y)&&!S&&(Y=Y.then(()=>applyMiddleware(q,this,__classPrivateFieldGet(this,Dp,`f`).getMiddleware(),!1)))}}}catch(t){if(t instanceof gl)__classPrivateFieldGet(this,qp,`f`).fail(t.message,t);else throw t}return this[Dm](Y??q,I,!!S,!0)}[jm](t,n,S,C){let N={...this.getDemandedOptions()};return F=>{if(S)throw new gl(S.message);__classPrivateFieldGet(this,Xp,`f`).nonOptionCount(F),__classPrivateFieldGet(this,Xp,`f`).requiredArguments(F,N);let I=!1;__classPrivateFieldGet(this,Gp,`f`)&&(I=__classPrivateFieldGet(this,Xp,`f`).unknownCommands(F)),__classPrivateFieldGet(this,Wp,`f`)&&!I?__classPrivateFieldGet(this,Xp,`f`).unknownArguments(F,t,n,!!C):__classPrivateFieldGet(this,Kp,`f`)&&__classPrivateFieldGet(this,Xp,`f`).unknownArguments(F,t,{},!1,!1),__classPrivateFieldGet(this,Xp,`f`).limitedChoices(F),__classPrivateFieldGet(this,Xp,`f`).implications(F),__classPrivateFieldGet(this,Xp,`f`).conflicting(F)}}[Mm](){__classPrivateFieldSet(this,kp,!0,`f`)}[Nm](t){if(typeof t==`string`)__classPrivateFieldGet(this,Pp,`f`).key[t]=!0;else for(let n of t)__classPrivateFieldGet(this,Pp,`f`).key[n]=!0}}}),Im,Lm=__esmMin(()=>{Jf(),Fm(),Im=YargsFactory(qf)});function classifyCliFailure(t,n){return typeof t==`string`&&t.length>0?{kind:`usage`,message:t}:{kind:`runtime`}}var Rm=__esmMin(()=>{});function buildHeaders(t,n){let S={"user-agent":`gjsify-install/0.59.0`,"accept-encoding":n.acceptEncoding??`identity`};if(n.npmrc){let C=resolveAuthForUrl(t,n.npmrc);C&&(S.authorization=C)}if(n.headers)for(let[t,C]of Object.entries(n.headers))S[t.toLowerCase()]=C;return S}function resolveAuthForUrl(t,n){let S=pathPrefixes(new URL(t));for(let t of S){let S=n.authTokens[t];if(S)return`Bearer ${S}`;let C=n.basicAuth[t];if(C)return`Basic ${btoa(`${C.username}:${C.password}`)}`}return null}function pathPrefixes(t){let n=t.pathname.split(`/`).filter(Boolean),S=[];for(let C=n.length;C>=0;C--){let N=n.slice(0,C).join(`/`);S.push(N?`//${t.host}/${N}`:`//${t.host}`)}return S}var zm=__esmMin(()=>{}),PackageNotFoundError,IntegrityError,RegistryTimeoutError,RegistryUnreachableError,Bm=__esmMin(()=>{PackageNotFoundError=class extends Error{name;url;constructor(t,n){super(`Package not found in registry: ${t} (${n})`),this.name=t,this.url=n,this.name=`PackageNotFoundError`}},IntegrityError=class extends Error{url;integrity;constructor(t,n){super(`Tarball integrity mismatch for ${t} (expected ${n})`),this.url=t,this.integrity=n,this.name=`IntegrityError`}},RegistryTimeoutError=class extends Error{url;timeoutMs;attempts;constructor(t,n,S){let C=Math.round(n/100)/10,N=Math.round(n*S/100)/10;super(`@gjsify/npm-registry: GET ${t} timed out after ${C}s × ${S} attempt(s) (total ~${N}s). This usually means the registry CDN is slow or unreachable.`),this.url=t,this.timeoutMs=n,this.attempts=S,this.name=`RegistryTimeoutError`}},RegistryUnreachableError=class extends Error{url;attempts;elapsedMs;constructor(t,n,S,C){let N=Math.round(S/100)/10,F=C instanceof Error?C.message:String(C);super(`@gjsify/npm-registry: GET ${t} failed after ${n} attempt(s) over ~${N}s: ${F}. This usually means the registry or the network dropped out.`),this.url=t,this.attempts=n,this.elapsedMs=S,this.name=`RegistryUnreachableError`,this.cause=C}}});function registryFor(t,n){if(n&&t.startsWith(`@`)){let S=t.slice(0,t.indexOf(`/`)),C=n.scopes[S];if(C)return ensureTrailingSlash$1(C)}return n?.registry?ensureTrailingSlash$1(n.registry):Vm}function parseNpmrc(t){let n={registry:Vm,scopes:{},authTokens:{},basicAuth:{}},S=t.split(/\r?\n/),C={};for(let t of S){let S=t.replace(/^\s+|\s+$/g,``);if(!S||S.startsWith(`#`)||S.startsWith(`;`))continue;let N=S.indexOf(`=`);if(N<0)continue;let F=S.slice(0,N).trim(),I=expandEnv(stripQuotes(S.slice(N+1).trim()));if(F===`registry`){n.registry=ensureTrailingSlash$1(I);continue}let H=F.match(/^(@[^:]+):registry$/);if(H){n.scopes[H[1]]=ensureTrailingSlash$1(I);continue}let W=F.match(/^\/\/(.+):_authToken$/);if(W){n.authTokens[normalizeAuthHost(W[1])]=I;continue}let q=F.match(/^\/\/(.+):username$/);if(q){(C[normalizeAuthHost(q[1])]??={}).user=I;continue}let Y=F.match(/^\/\/(.+):_password$/);if(Y){let t=base64Decode$1(I);(C[normalizeAuthHost(Y[1])]??={}).pass=t;continue}}for(let[t,S]of Object.entries(C))S.user&&S.pass!==void 0&&(n.basicAuth[t]={username:S.user,password:S.pass});return n}function normalizeAuthHost(t){return`//${t.replace(/\/+$/,``)}`}function ensureTrailingSlash$1(t){return t.endsWith(`/`)?t:t+`/`}function stripQuotes(t){return t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`)?t.slice(1,-1):t}function expandEnv(t){return t.replace(/\$\{([A-Z0-9_]+)\}/gi,(t,n)=>globalThis.process?.env?.[n]??``)}function base64Decode$1(t){return atob(t)}var Vm,Hm=__esmMin(()=>{Vm=`https://registry.npmjs.org/`,__name$1(ensureTrailingSlash$1,`ensureTrailingSlash`),__name$1(base64Decode$1,`base64Decode`)});async function fetchWithRetry(t,n,S){let C=S.fetch??globalThis.fetch;if(!C)throw Error(`@gjsify/npm-registry: globalThis.fetch is missing`);let N=Math.max(0,S.retries??5),F=Math.max(0,S.retryDelayMs??1e3),I=Math.max(0,S.timeoutMs??3e4),H=S.retryNotFound??!1,W=Date.now(),q=0,Y,X=0;for(;;){if(n.signal?.aborted)throw signalAbortError(n.signal);let Z=I>0?new AbortController:null,te=Z===null?null:setTimeout(()=>Z.abort(Error(`@gjsify/npm-registry: per-request timeout ${I}ms`)),I),ne=composeSignals(n.signal,Z?.signal);try{let F=await C(t,{...n,signal:ne}),I=isRetryableStatus(F.status)||H&&F.status===404;if(F.ok||!I||q>=N)return S.read?await S.read(F):F;try{await F.arrayBuffer()}catch{}Y=Error(`HTTP ${F.status} ${F.statusText}`)}catch(S){let C=Z!==null&&Z.signal.aborted,F=n.signal?.aborted===!0;if(C&&!F){if(X++,q>=N)throw new RegistryTimeoutError(t,I,X);Y=S}else if(F)throw signalAbortError(n.signal);else{if(!isRetryableError(S))throw S;if(q>=N)throw new RegistryUnreachableError(t,q+1,Date.now()-W,S);Y=S}}finally{te!==null&&clearTimeout(te)}let re=Math.min(F*2**q,8e3);S.onRetry?.({attempt:q+1,error:Y,delayMs:re}),await delay$1(re,n.signal),q++}}function composeSignals(t,n){return t?n?AbortSignal.any([t,n]):t:n}function isRetryableStatus(t){return t===408||t===425||t===429||t===500||t===502||t===503||t===504||t===521||t===522||t===524||t===525}function isRetryableError(t){if(t&&typeof t==`object`&&`name`in t&&t.name===`AbortError`)return!1;if(t instanceof TypeError)return!0;if(t&&typeof t==`object`&&`name`in t){let n=t.name;if(n===`FetchError`)return!0;if(n===`AbortError`)return!1}let n=t?.cause;if(n&&typeof n==`object`&&`code`in n){let t=n.code;if(typeof t==`string`)return t===`ECONNRESET`||t===`ECONNREFUSED`||t===`ENETUNREACH`||t===`ENOTFOUND`||t===`ETIMEDOUT`||t===`EAI_AGAIN`||t===`UND_ERR_SOCKET`||t===`UND_ERR_CONNECT_TIMEOUT`}return!1}function delay$1(t,n){return t<=0?Promise.resolve():new Promise((S,C)=>{let N=setTimeout(()=>{n?.removeEventListener?.(`abort`,onAbort),S()},t),onAbort=()=>{clearTimeout(N),C(signalAbortError(n))};if(n?.aborted){clearTimeout(N),C(signalAbortError(n));return}n?.addEventListener?.(`abort`,onAbort,{once:!0})})}function signalAbortError(t){let n=t&&`reason`in t?t.reason:void 0;if(n instanceof Error)return n;let S=Error(`Aborted`);return S.name=`AbortError`,S}var Um=__esmMin(()=>{Bm(),__name$1(delay$1,`delay`)});async function verifyIntegrity(t,n){let S=n.trim().split(/\s+/);for(let n of S){let S=n.indexOf(`-`);if(S<0)continue;let C=n.slice(0,S).toLowerCase(),N=n.slice(S+1),F=globalThis.crypto?.subtle;if(!F)throw Error(`@gjsify/npm-registry: globalThis.crypto.subtle is missing`);let I=subriToWebCryptoAlgo(C);if(!I)continue;let H=await F.digest(I,dataAsArrayBuffer(t));if(bytesToBase64(new Uint8Array(H))===N)return!0}return!1}function subriToWebCryptoAlgo(t){switch(t){case`sha1`:return`SHA-1`;case`sha256`:return`SHA-256`;case`sha384`:return`SHA-384`;case`sha512`:return`SHA-512`;default:return null}}function dataAsArrayBuffer(t){if(t.byteOffset===0&&t.byteLength===t.buffer.byteLength)return t.buffer;let n=new Uint8Array(t.byteLength);return n.set(t),n.buffer}function bytesToBase64(t){let n=``;for(let S=0;S<t.length;S++)n+=String.fromCharCode(t[S]);return btoa(n)}var Wm=__esmMin(()=>{});function assertPackument(t,n){if(!n||typeof n!=`object`)throw TypeError(`registry: ${t} packument is not an object`);let S=n;if(typeof S.name!=`string`)throw TypeError(`registry: ${t} packument missing string name`);if(!S.versions||typeof S.versions!=`object`)throw TypeError(`registry: ${t} packument missing versions map`)}function packumentUrl(t,n){let S=ensureTrailingSlash$1(n);if(t.startsWith(`@`)){let n=t.indexOf(`/`);if(n<0)throw TypeError(`Invalid scoped package name: ${t}`);let C=t.slice(0,n),N=t.slice(n+1);return`${S}${encodeURIComponent(C)}/${encodeURIComponent(N)}`}return`${S}${encodeURIComponent(t)}`}async function fetchPackumentConditional(t,n={}){let S=packumentUrl(t,n.registry??registryFor(t,n.npmrc)),C=buildHeaders(S,{...n,acceptEncoding:`gzip`});C.accept??=n.fullMetadata?`application/json`:`application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*`,n.ifNoneMatch&&(C[`if-none-match`]=n.ifNoneMatch);let N=await fetchWithRetry(S,{headers:C,signal:n.signal},{fetch:n.fetch,retries:n.retries,retryDelayMs:n.retryDelayMs,timeoutMs:n.timeoutMs,onRetry:n.onRetry,read:async n=>{if(n.status===304){try{await n.arrayBuffer()}catch{}return{status:`not-modified`}}if(!n.ok)throw n.status===404||n.status===406?new PackageNotFoundError(t,S):Error(`registry GET ${S} -> ${n.status} ${n.statusText}`);return{status:`fresh`,body:await decodeJsonBody(n),etag:n.headers.get(`etag`)??void 0}}});if(N.status===`not-modified`)return{status:`not-modified`,etag:n.ifNoneMatch};let F=N.body;return assertPackument(t,F),{status:`fresh`,packument:F,etag:N.etag}}async function decodeJsonBody(t){return t.json()}async function fetchPackument(t,n={}){let S=await fetchPackumentConditional(t,n);if(!S.packument)throw Error(`registry: ${t} returned 304 Not Modified to an unconditional request`);return S.packument}var Gm=__esmMin(()=>{zm(),Bm(),Hm(),Um()});async function fetchTarball(t,n={}){let S=buildHeaders(t,{...n,acceptEncoding:`identity`});S.accept??=`application/octet-stream`;let C=await fetchWithRetry(t,{headers:S,signal:n.signal},{fetch:n.fetch,retries:n.retries,retryDelayMs:n.retryDelayMs,timeoutMs:n.timeoutMs,onRetry:n.onRetry,retryNotFound:n.retryNotFound??!0,read:async n=>{if(!n.ok)throw Error(`tarball GET ${t} -> ${n.status} ${n.statusText}`);return new Uint8Array(await n.arrayBuffer())}});if(n.integrity&&!await verifyIntegrity(C,n.integrity))throw new IntegrityError(t,n.integrity);return C}var Km=__esmMin(()=>{zm(),Bm(),Um(),Wm()});async function whoami(t,n){let S=`${ensureTrailingSlash$1(t)}-/whoami`,C=buildHeaders(S,{npmrc:n});C.accept=`application/json`;let N=globalThis.fetch;if(!N)throw Error(`@gjsify/npm-registry: globalThis.fetch is missing`);let F=await N(S,{method:`GET`,headers:C});if(!F.ok)throw Error(`whoami GET ${S} -> ${F.status} ${F.statusText}`);let I=await F.json();if(I&&typeof I==`object`&&`username`in I){let t=I.username;if(typeof t==`string`&&t.length>0)return{username:t}}return{}}var qm=__esmMin(()=>{zm(),Hm()}),Jm=__esmMin(()=>{zm(),Hm(),Wm(),Gm(),Km(),qm()});function escapePackageName(t){return t.replace(`/`,`%2f`)}function buildPublishHeaders(t,n){let S=buildHeaders(t,{npmrc:n.npmrc});return S[`content-type`]=`application/json`,S[`npm-command`]=`publish`,S[`npm-auth-type`]=n.otp?`legacy`:`web`,S[`user-agent`]=n.userAgent??defaultUserAgent(),n.otp&&(S[`npm-otp`]=n.otp),n.authorization&&(S.authorization=n.authorization),S}function cliVersion(){return Ym===void 0&&(Ym=`0.59.0`),Ym}function cliPackageDir(){let t=globalThis.process?.env?.GJSIFY_CLI_PACKAGE_JSON,n;try{n=wn(t||fileURLToPath(import.meta.url))}catch{return null}for(let t=0;t<12;t++){try{if(JSON.parse(readFileSync(`${n}/package.json`,`utf8`)).name===`@gjsify/cli`)return n}catch{}let t=wn(n);if(t===n)break;n=t}return null}function defaultUserAgent(){let t=globalThis.process,n=t?.arch??`x64`,S=t?.platform??`linux`;return`gjsify-publish/${cliVersion()} (${S} ${n})`}var Ym,Xm=__esmMin(()=>{Md(),jn(),Hn(),Jm()}),Zm,Qm=__esmMin(()=>{Zm=`gjsify`}),$m=__commonJSMin(((t,n)=>{let S=(jn(),__toCommonJS(gn)),C=(Al(),__toCommonJS(El)),N=(Md(),__toCommonJS(Ad)),resolveFrom=(t,n,F)=>{if(typeof t!=`string`)throw TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof t}\``);if(typeof n!=`string`)throw TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof n}\``);try{t=N.realpathSync(t)}catch(n){if(n.code===`ENOENT`)t=S.resolve(t);else if(F)return null;else throw n}let I=S.join(t,`noop.js`),resolveFileName=()=>C._resolveFilename(n,{id:I,filename:I,paths:C._nodeModulePaths(t)});if(F)try{return resolveFileName()}catch{return null}return resolveFileName()};n.exports=(t,n)=>resolveFrom(t,n),n.exports.silent=(t,n)=>resolveFrom(t,n,!0)})),eh=__commonJSMin(((t,n)=>{let callsites=()=>{let t=Error.prepareStackTrace;Error.prepareStackTrace=(t,n)=>n;let n=Error().stack.slice(1);return Error.prepareStackTrace=t,n};n.exports=callsites,n.exports.default=callsites})),th=__commonJSMin(((t,n)=>{let S=eh();n.exports=t=>{let n=S();if(!t)return n[2].getFileName();let C=!1;n.shift();for(let S of n){let n=S.getFileName();if(typeof n==`string`){if(n===t){C=!0;continue}if(n!==`module.js`&&C&&n!==t)return n}}}})),nh=__commonJSMin(((t,n)=>{var{__gjsifyModuleDir:S,__gjsifyModuleFile:C}=(Pl(),__toCommonJS(jl)),N=S(`import-fresh/index.js`),F=C(`import-fresh/index.js`);let I=(jn(),__toCommonJS(gn)),H=$m(),W=th();n.exports=t=>{if(typeof t!=`string`)throw TypeError(`Expected a string`);let n=W(F),S=n?I.dirname(n):N,C=H(S,t),q=Y.cache[C];if(q&&q.parent){let t=q.parent.children.length;for(;t--;)q.parent.children[t].id===C&&q.parent.children.splice(t,1)}delete Y.cache[C];let X=Y.cache[n];return X===void 0||X.require===void 0?Y(C):X.require(C)}})),rh=__commonJSMin(((t,n)=>{n.exports=function isArrayish(t){return t?t instanceof Array||Array.isArray(t)||t.length>=0&&t.splice instanceof Function:!1}})),ih=__commonJSMin(((t,n)=>{var S=(yu(),__toCommonJS(hu)),C=rh(),N=function errorEx(t,n){(!t||t.constructor!==String)&&(n=t||{},t=Error.name);var N=function ErrorEXError(S){if(!this)return new ErrorEXError(S);S=S instanceof Error?S.message:S||this.message,Error.call(this,S),Error.captureStackTrace(this,N),this.name=t,Object.defineProperty(this,"message",{configurable:!0,enumerable:!1,get:function(){var t=S.split(/\r?\n/g);for(var N in n)if(n.hasOwnProperty(N)){var F=n[N];`message`in F&&(t=F.message(this[N],t)||t,C(t)||(t=[t]))}return t.join(`
149
149
  `)},set:function(t){S=t}});var F=null,I=Object.getOwnPropertyDescriptor(this,`stack`),H=I.get,W=I.value;delete I.value,delete I.writable,I.set=function(t){F=t},I.get=function(){var t=(F||(H?H.call(this):W)).split(/\r?\n+/g);F||(t[0]=this.name+`: `+this.message);var S=1;for(var C in n)if(n.hasOwnProperty(C)){var N=n[C];if(`line`in N){var I=N.line(this[C]);I&&t.splice(S++,0,` `+I)}`stack`in N&&N.stack(this[C],t)}return t.join(`
150
150
  `)},Object.defineProperty(this,"stack",I)};return Object.setPrototypeOf?(Object.setPrototypeOf(N.prototype,Error.prototype),Object.setPrototypeOf(N,Error)):S.inherits(N,Error),N};N.append=function(t,n){return{message:function(S,C){return S||=n,S&&(C[0]+=` `+t.replace(`%s`,S.toString())),C}}},N.line=function(t,n){return{line:function(S){return S||=n,S?t.replace(`%s`,S.toString()):null}}},n.exports=N})),ah=__commonJSMin(((t,n)=>{let hexify=t=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return`0x`+(n.length%2?`0`:``)+n},parseError=(t,n,S)=>{if(!n)return{message:t.message+` while parsing empty string`,position:0};let C=t.message.match(/^Unexpected token (.) .*position\s+(\d+)/i),N=C?+C[2]:t.message.match(/^Unexpected end of JSON.*/i)?n.length-1:null,F=C?t.message.replace(/^Unexpected token ./,`Unexpected token ${JSON.stringify(C[1])} (${hexify(C[1])})`):t.message;if(N!=null){let t=N<=S?0:N-S,C=N+S>=n.length?n.length:N+S,I=(t===0?``:`...`)+n.slice(t,C)+(C===n.length?``:`...`);return{message:F+` while parsing ${n===I?``:`near `}${JSON.stringify(I)}`,position:N}}else return{message:F+` while parsing '${n.slice(0,S*2)}'`,position:0}};var JSONParseError=class extends SyntaxError{constructor(t,n,S,C){S||=20;let N=parseError(t,n,S);super(N.message),Object.assign(this,N),this.code=`EJSONPARSE`,this.systemError=t,Error.captureStackTrace(this,C||this.constructor)}get name(){return this.constructor.name}set name(t){}get[Symbol.toStringTag](){return this.constructor.name}};let S=Symbol.for(`indent`),C=Symbol.for(`newline`),N=/^\s*[{\[]((?:\r?\n)+)([\s\t]*)/,F=/^(?:\{\}|\[\])((?:\r?\n)+)?$/,parseJson=(t,n,I)=>{let H=stripBOM(t);I||=20;try{let[,t=`
151
151
  `,I=` `]=H.match(F)||H.match(N)||[,``,``],W=JSON.parse(H,n);return W&&typeof W==`object`&&(W[C]=t,W[S]=I),W}catch(n){if(typeof t!=`string`&&!Buffer.isBuffer(t)){let S=Array.isArray(t)&&t.length===0;throw Object.assign(TypeError(`Cannot parse ${S?`an empty array`:String(t)}`),{code:`EJSONPARSE`,systemError:n})}throw new JSONParseError(n,H,I,parseJson)}},stripBOM=t=>String(t).replace(/^\uFEFF/,``);n.exports=parseJson,parseJson.JSONParseError=JSONParseError,parseJson.noExceptions=(t,n)=>{try{return JSON.parse(stripBOM(t),n)}catch{}}})),oh=__commonJSMin((t=>{t.__esModule=!0,t.LinesAndColumns=void 0;var n=`
@@ -648,7 +648,7 @@ Project '${t.projectName}' (${Rh[t.projectKind]}) ${n}
648
648
  Additional information: BADCLIENT: Bad error code, ${q} not found in range ${F}..${I} (found: ${W.join(`, `)})`),N}return n?H.map(t=>this.mapCodeFixAction(t)):H}getCombinedCodeFix({scope:t,fixId:n},S){Q.assert(t.type===`file`);let{file:C,project:N}=this.getFileAndProject(t.args),F=N.getLanguageService().getCombinedCodeFix({type:`file`,fileName:C},n,this.getFormatOptions(C),this.getPreferences(C));return S?{changes:this.mapTextChangesToCodeEdits(F.changes),commands:F.commands}:F}applyCodeActionCommand(t){let n=t.command;for(let t of toArray(n)){let{file:n,project:S}=this.getFileAndProject(t);S.getLanguageService().applyCodeActionCommand(t,this.getFormatOptions(n)).then(t=>{},t=>{})}return{}}getStartAndEndPosition(t,n){let S,C;return t.startPosition===void 0?(S=n.lineOffsetToPosition(t.startLine,t.startOffset),t.startPosition=S):S=t.startPosition,t.endPosition===void 0?(C=n.lineOffsetToPosition(t.endLine,t.endOffset),t.endPosition=C):C=t.endPosition,{startPosition:S,endPosition:C}}mapCodeAction({description:t,changes:n,commands:S}){return{description:t,changes:this.mapTextChangesToCodeEdits(n),commands:S}}mapCodeFixAction({fixName:t,description:n,changes:S,commands:C,fixId:N,fixAllDescription:F}){return{fixName:t,description:n,changes:this.mapTextChangesToCodeEdits(S),commands:C,fixId:N,fixAllDescription:F}}mapPasteEditsAction({edits:t,fixId:n}){return{edits:this.mapTextChangesToCodeEdits(t),fixId:n}}mapTextChangesToCodeEdits(t){return t.map(t=>this.mapTextChangeToCodeEdit(t))}mapTextChangeToCodeEdit(t){let n=this.projectService.getScriptInfoOrConfig(t.fileName);return!!t.isNewFile==!!n&&(n||this.projectService.logErrorForScriptInfoNotFound(t.fileName),Q.fail(`Expected isNewFile for (only) new files. `+JSON.stringify({isNewFile:!!t.isNewFile,hasScriptInfo:!!n}))),n?{fileName:t.fileName,textChanges:t.textChanges.map(t=>convertTextChangeToCodeEdit(t,n))}:convertNewFileTextChangeToCodeEdit(t)}convertTextChangeToCodeEdit(t,n){return{start:n.positionToLineOffset(t.span.start),end:n.positionToLineOffset(t.span.start+t.span.length),newText:t.newText?t.newText:``}}getBraceMatching(t,n){let{file:S,languageService:C}=this.getFileAndLanguageServiceForSyntacticOperation(t),N=this.projectService.getScriptInfoForNormalizedPath(S),F=this.getPosition(t,N),I=C.getBraceMatchingAtPosition(S,F);return I?n?I.map(t=>toProtocolTextSpan(t,N)):I:void 0}getDiagnosticsForProject(t,n,S){if(this.suppressDiagnosticEvents)return;let{fileNames:C,languageServiceDisabled:N}=this.getProjectInfoWorker(S,void 0,!0,void 0,!0);if(N)return;let F=C.filter(t=>!t.includes(`lib.d.ts`));if(F.length===0)return;let I=[],H=[],W=[],q=[],Y=toNormalizedPath(S),X=this.projectService.ensureDefaultProjectForFile(Y);for(let t of F)this.getCanonicalFileName(t)===this.getCanonicalFileName(S)?I.push(t):this.projectService.getScriptInfo(t).isScriptOpen()?H.push(t):isDeclarationFileName(t)?q.push(t):W.push(t);let Z=[...I,...H,...W,...q].map(t=>({fileName:t,project:X}));this.updateErrorCheck(t,Z,n,!1)}configurePlugin(t){this.projectService.configurePlugin(t)}getSmartSelectionRange(t,n){let{locations:S}=t,{file:C,languageService:N}=this.getFileAndLanguageServiceForSyntacticOperation(t),F=Q.checkDefined(this.projectService.getScriptInfo(C));return map(S,t=>{let S=this.getPosition(t,F),I=N.getSmartSelectionRange(C,S);return n?this.mapSelectionRange(I,F):I})}toggleLineComment(t,n){let{file:S,languageService:C}=this.getFileAndLanguageServiceForSyntacticOperation(t),N=this.projectService.getScriptInfo(S),F=this.getRange(t,N),I=C.toggleLineComment(S,F);if(n){let t=this.projectService.getScriptInfoForNormalizedPath(S);return I.map(n=>this.convertTextChangeToCodeEdit(n,t))}return I}toggleMultilineComment(t,n){let{file:S,languageService:C}=this.getFileAndLanguageServiceForSyntacticOperation(t),N=this.projectService.getScriptInfoForNormalizedPath(S),F=this.getRange(t,N),I=C.toggleMultilineComment(S,F);if(n){let t=this.projectService.getScriptInfoForNormalizedPath(S);return I.map(n=>this.convertTextChangeToCodeEdit(n,t))}return I}commentSelection(t,n){let{file:S,languageService:C}=this.getFileAndLanguageServiceForSyntacticOperation(t),N=this.projectService.getScriptInfoForNormalizedPath(S),F=this.getRange(t,N),I=C.commentSelection(S,F);if(n){let t=this.projectService.getScriptInfoForNormalizedPath(S);return I.map(n=>this.convertTextChangeToCodeEdit(n,t))}return I}uncommentSelection(t,n){let{file:S,languageService:C}=this.getFileAndLanguageServiceForSyntacticOperation(t),N=this.projectService.getScriptInfoForNormalizedPath(S),F=this.getRange(t,N),I=C.uncommentSelection(S,F);if(n){let t=this.projectService.getScriptInfoForNormalizedPath(S);return I.map(n=>this.convertTextChangeToCodeEdit(n,t))}return I}mapSelectionRange(t,n){let S={textSpan:toProtocolTextSpan(t.textSpan,n)};return t.parent&&(S.parent=this.mapSelectionRange(t.parent,n)),S}getScriptInfoFromProjectService(t){let n=toNormalizedPath(t);return this.projectService.getScriptInfoForNormalizedPath(n)||(this.projectService.logErrorForScriptInfoNotFound(n),wh.ThrowNoProject())}toProtocolCallHierarchyItem(t){let n=this.getScriptInfoFromProjectService(t.file);return{name:t.name,kind:t.kind,kindModifiers:t.kindModifiers,file:t.file,containerName:t.containerName,span:toProtocolTextSpan(t.span,n),selectionSpan:toProtocolTextSpan(t.selectionSpan,n)}}toProtocolCallHierarchyIncomingCall(t){let n=this.getScriptInfoFromProjectService(t.from.file);return{from:this.toProtocolCallHierarchyItem(t.from),fromSpans:t.fromSpans.map(t=>toProtocolTextSpan(t,n))}}toProtocolCallHierarchyOutgoingCall(t,n){return{to:this.toProtocolCallHierarchyItem(t.to),fromSpans:t.fromSpans.map(t=>toProtocolTextSpan(t,n))}}prepareCallHierarchy(t){let{file:n,project:S}=this.getFileAndProject(t),C=this.projectService.getScriptInfoForNormalizedPath(n);if(C){let N=this.getPosition(t,C),F=S.getLanguageService().prepareCallHierarchy(n,N);return F&&mapOneOrMany(F,t=>this.toProtocolCallHierarchyItem(t))}}provideCallHierarchyIncomingCalls(t){let{file:n,project:S}=this.getFileAndProject(t),C=this.getScriptInfoFromProjectService(n);return S.getLanguageService().provideCallHierarchyIncomingCalls(n,this.getPosition(t,C)).map(t=>this.toProtocolCallHierarchyIncomingCall(t))}provideCallHierarchyOutgoingCalls(t){let{file:n,project:S}=this.getFileAndProject(t),C=this.getScriptInfoFromProjectService(n);return S.getLanguageService().provideCallHierarchyOutgoingCalls(n,this.getPosition(t,C)).map(t=>this.toProtocolCallHierarchyOutgoingCall(t,C))}getCanonicalFileName(t){return normalizePath(this.host.useCaseSensitiveFileNames?t:toFileNameLowerCase(t))}exit(){}notRequired(t){return t&&this.doOutput(void 0,t.command,t.seq,!0,this.performanceData),{responseRequired:!1,performanceData:this.performanceData}}requiredResponse(t){return{response:t,responseRequired:!0,performanceData:this.performanceData}}addProtocolHandler(t,n){if(this.handlers.has(t))throw Error(`Protocol handler already exists for command "${t}"`);this.handlers.set(t,n)}setCurrentRequest(t){Q.assert(this.currentRequestId===void 0),this.currentRequestId=t,this.cancellationToken.setRequest(t)}resetCurrentRequest(t){Q.assert(this.currentRequestId===t),this.currentRequestId=void 0,this.cancellationToken.resetRequest(t)}executeWithRequestId(t,n,S){let C=this.performanceData;try{return this.performanceData=S,this.setCurrentRequest(t),n()}finally{this.resetCurrentRequest(t),this.performanceData=C}}executeCommand(t){let n=this.handlers.get(t.command);if(n){let S=this.executeWithRequestId(t.seq,()=>n(t),void 0);return this.projectService.enableRequestedPlugins(),S}else return this.logger.msg(`Unrecognized JSON command:${stringifyIndented(t)}`,`Err`),this.doOutput(void 0,`unknown`,t.seq,!1,void 0,`Unrecognized JSON command: ${t.command}`),{responseRequired:!1}}onMessage(t){var n,S,C,N,F,I,H;this.gcTimer.scheduleCollect();let W,q=this.performanceData;this.logger.hasLevel(2)&&(W=this.hrtime(),this.logger.hasLevel(3)&&this.logger.info(`request:${indent2(this.toStringMessage(t))}`));let Y,X;try{Y=this.parseMessage(t),X=Y.arguments&&Y.arguments.file?Y.arguments:void 0,(n=Ie)==null||n.instant(Ie.Phase.Session,`request`,{seq:Y.seq,command:Y.command}),(S=Ie)==null||S.push(Ie.Phase.Session,`executeCommand`,{seq:Y.seq,command:Y.command},!0);let{response:F,responseRequired:I,performanceData:H}=this.executeCommand(Y);if((C=Ie)==null||C.pop(),this.logger.hasLevel(2)){let t=hrTimeToMilliseconds(this.hrtime(W)).toFixed(4);I?this.logger.perftrc(`${Y.seq}::${Y.command}: elapsed time (in milliseconds) ${t}`):this.logger.perftrc(`${Y.seq}::${Y.command}: async elapsed time (in milliseconds) ${t}`)}(N=Ie)==null||N.instant(Ie.Phase.Session,`response`,{seq:Y.seq,command:Y.command,success:!!F}),F?this.doOutput(F,Y.command,Y.seq,!0,H):I&&this.doOutput(void 0,Y.command,Y.seq,!1,H,`No content available.`)}catch(n){if((F=Ie)==null||F.popAll(),n instanceof OperationCanceledException){(I=Ie)==null||I.instant(Ie.Phase.Session,`commandCanceled`,{seq:Y?.seq,command:Y?.command}),this.doOutput({canceled:!0},Y.command,Y.seq,!0,this.performanceData);return}this.logErrorWorker(n,this.toStringMessage(t),X),(H=Ie)==null||H.instant(Ie.Phase.Session,`commandError`,{seq:Y?.seq,command:Y?.command,message:n.message}),this.doOutput(void 0,Y?Y.command:`unknown`,Y?Y.seq:0,!1,this.performanceData,`Error processing request. `+n.message+`
649
649
  `+n.stack)}finally{this.performanceData=q}}parseMessage(t){return JSON.parse(t)}toStringMessage(t){return t}getFormatOptions(t){return this.projectService.getFormatCodeOptions(t)}getPreferences(t){return this.projectService.getPreferences(t)}getHostFormatOptions(){return this.projectService.getHostFormatCodeOptions()}getHostPreferences(){return this.projectService.getHostPreferences()}};function toProtocolPerformanceData(t){let n=t.diagnosticsDuration&&arrayFrom(t.diagnosticsDuration,([t,n])=>({...n,file:t}));return{...t,diagnosticsDuration:n}}function toProtocolTextSpan(t,n){return{start:n.positionToLineOffset(t.start),end:n.positionToLineOffset(textSpanEnd(t))}}function toProtocolTextSpanWithContext(t,n,S){let C=toProtocolTextSpan(t,S),N=n&&toProtocolTextSpan(n,S);return N?{...C,contextStart:N.start,contextEnd:N.end}:C}function convertTextChangeToCodeEdit(t,n){return{start:positionToLineOffset(n,t.span.start),end:positionToLineOffset(n,textSpanEnd(t.span)),newText:t.newText}}function positionToLineOffset(t,n){return isConfigFile(t)?locationFromLineAndCharacter(t.getLineAndCharacterOfPosition(n)):t.positionToLineOffset(n)}function convertLinkedEditInfoToRanges(t,n){let S=t.ranges.map(t=>({start:n.positionToLineOffset(t.start),end:n.positionToLineOffset(t.start+t.length)}));return t.wordPattern?{ranges:S,wordPattern:t.wordPattern}:{ranges:S}}function locationFromLineAndCharacter(t){return{line:t.line+1,offset:t.character+1}}function convertNewFileTextChangeToCodeEdit(t){Q.assert(t.textChanges.length===1);let n=first(t.textChanges);return Q.assert(n.span.start===0&&n.span.length===0),{fileName:t.fileName,textChanges:[{start:{line:0,offset:0},end:{line:0,offset:0},newText:n.newText}]}}function getLocationInNewDocument(t,n,S,C){let{line:N,character:F}=computeLineAndCharacterOfPosition(computeLineStarts(applyEdits(t,n,C)),S);return{line:N+1,offset:F+1}}function applyEdits(t,n,S){for(let{fileName:C,textChanges:N}of S)if(C===n)for(let n=N.length-1;n>=0;n--){let{newText:S,span:{start:C,length:F}}=N[n];t=t.slice(0,C)+S+t.slice(C+F)}return t}function referenceEntryToReferencesResponseItem(t,{fileName:n,textSpan:S,contextSpan:C,isWriteAccess:N,isDefinition:F},{disableLineTextInReferences:I}){let H=Q.checkDefined(t.getScriptInfo(n)),W=toProtocolTextSpanWithContext(S,C,H),q=I?void 0:getLineText(H,W);return{file:n,...W,lineText:q,isWriteAccess:N,isDefinition:F}}function getLineText(t,n){let S=t.lineToTextSpan(n.start.line-1);return t.getSnapshot().getText(S.start,textSpanEnd(S)).replace(/\r|\n/g,``)}function isCompletionEntryData(t){return t===void 0||t&&typeof t==`object`&&typeof t.exportName==`string`&&(t.fileName===void 0||typeof t.fileName==`string`)&&(t.ambientModuleName===void 0||typeof t.ambientModuleName==`string`&&(t.isPackageJsonImport===void 0||typeof t.isPackageJsonImport==`boolean`))}var vg=4,bg=(t=>(t[t.PreStart=0]=`PreStart`,t[t.Start=1]=`Start`,t[t.Entire=2]=`Entire`,t[t.Mid=3]=`Mid`,t[t.End=4]=`End`,t[t.PostEnd=5]=`PostEnd`,t))(bg||{}),EditWalker=class{constructor(){this.goSubtree=!0,this.lineIndex=new wg,this.endBranch=[],this.state=2,this.initialText=``,this.trailingText=``,this.lineIndex.root=new Tg,this.startPath=[this.lineIndex.root],this.stack=[this.lineIndex.root]}get done(){return!1}insertLines(t,n){n&&(this.trailingText=``),t=t?this.initialText+t+this.trailingText:this.initialText+this.trailingText;let S=wg.linesFromText(t).lines;S.length>1&&S[S.length-1]===``&&S.pop();let C,N;for(let t=this.endBranch.length-1;t>=0;t--)this.endBranch[t].updateCounts(),this.endBranch[t].charCount()===0&&(N=this.endBranch[t],C=t>0?this.endBranch[t-1]:this.branchNode);N&&C.remove(N);let F=this.startPath[this.startPath.length-1];if(S.length>0)if(F.text=S[0],S.length>1){let t=Array(S.length-1),n=F;for(let n=1;n<S.length;n++)t[n-1]=new LineLeaf(S[n]);let C=this.startPath.length-2;for(;C>=0;){let S=this.startPath[C];t=S.insertAt(n,t),C--,n=S}let N=t.length;for(;N>0;){let n=new Tg;n.add(this.lineIndex.root),t=n.insertAt(this.lineIndex.root,t),N=t.length,this.lineIndex.root=n}this.lineIndex.root.updateCounts()}else for(let t=this.startPath.length-2;t>=0;t--)this.startPath[t].updateCounts();else{this.startPath[this.startPath.length-2].remove(F);for(let t=this.startPath.length-2;t>=0;t--)this.startPath[t].updateCounts()}return this.lineIndex}post(t,n,S){S===this.lineCollectionAtBranch&&(this.state=4),this.stack.pop()}pre(t,n,S,C,N){let F=this.stack[this.stack.length-1];this.state===2&&N===1&&(this.state=1,this.branchNode=F,this.lineCollectionAtBranch=S);let I;function fresh(t){return t.isLeaf()?new LineLeaf(``):new Tg}switch(N){case 0:this.goSubtree=!1,this.state!==4&&F.add(S);break;case 1:this.state===4?this.goSubtree=!1:(I=fresh(S),F.add(I),this.startPath.push(I));break;case 2:this.state===4?S.isLeaf()||(I=fresh(S),F.add(I),this.endBranch.push(I)):(I=fresh(S),F.add(I),this.startPath.push(I));break;case 3:this.goSubtree=!1;break;case 4:this.state===4?S.isLeaf()||(I=fresh(S),F.add(I),this.endBranch.push(I)):this.goSubtree=!1;break;case 5:this.goSubtree=!1,this.state!==1&&F.add(S);break}this.goSubtree&&this.stack.push(I)}leaf(t,n,S){this.state===1?this.initialText=S.text.substring(0,t):(this.state===2&&(this.initialText=S.text.substring(0,t)),this.trailingText=S.text.substring(t+n))}},TextChange9=class{constructor(t,n,S){this.pos=t,this.deleteLen=n,this.insertedText=S}getTextChangeRange(){return createTextChangeRange(createTextSpan(this.pos,this.deleteLen),this.insertedText?this.insertedText.length:0)}},xg=class _ScriptVersionCache{constructor(){this.changes=[],this.versions=Array(_ScriptVersionCache.maxVersions),this.minVersion=0,this.currentVersion=0}versionToIndex(t){if(!(t<this.minVersion||t>this.currentVersion))return t%_ScriptVersionCache.maxVersions}currentVersionToIndex(){return this.currentVersion%_ScriptVersionCache.maxVersions}edit(t,n,S){this.changes.push(new TextChange9(t,n,S)),(this.changes.length>_ScriptVersionCache.changeNumberThreshold||n>_ScriptVersionCache.changeLengthThreshold||S&&S.length>_ScriptVersionCache.changeLengthThreshold)&&this.getSnapshot()}getSnapshot(){return this._getSnapshot()}_getSnapshot(){let t=this.versions[this.currentVersionToIndex()];if(this.changes.length>0){let n=t.index;for(let t of this.changes)n=n.edit(t.pos,t.deleteLen,t.insertedText);t=new Cg(this.currentVersion+1,this,n,this.changes),this.currentVersion=t.version,this.versions[this.currentVersionToIndex()]=t,this.changes=[],this.currentVersion-this.minVersion>=_ScriptVersionCache.maxVersions&&(this.minVersion=this.currentVersion-_ScriptVersionCache.maxVersions+1)}return t}getSnapshotVersion(){return this._getSnapshot().version}getAbsolutePositionAndLineText(t){return this._getSnapshot().index.lineNumberToInfo(t)}lineOffsetToPosition(t,n){return this._getSnapshot().index.absolutePositionOfStartOfLine(t)+(n-1)}positionToLineOffset(t){return this._getSnapshot().index.positionToLineOffset(t)}lineToTextSpan(t){let n=this._getSnapshot().index,{lineText:S,absolutePosition:C}=n.lineNumberToInfo(t+1);return createTextSpan(C,S===void 0?n.absolutePositionOfStartOfLine(t+2)-C:S.length)}getTextChangesBetweenVersions(t,n){if(t<n)if(t>=this.minVersion){let S=[];for(let C=t+1;C<=n;C++){let t=this.versions[this.versionToIndex(C)];for(let n of t.changesSincePreviousVersion)S.push(n.getTextChangeRange())}return collapseTextChangeRangesAcrossMultipleVersions(S)}else return;else return Xn}getLineCount(){return this._getSnapshot().index.getLineCount()}static fromString(t){let n=new _ScriptVersionCache,S=new Cg(0,n,new wg);n.versions[n.currentVersion]=S;let C=wg.linesFromText(t);return S.index.load(C.lines),n}};xg.changeNumberThreshold=8,xg.changeLengthThreshold=256,xg.maxVersions=8;var Sg=xg,Cg=class _LineIndexSnapshot{constructor(t,n,S,C=Sh){this.version=t,this.cache=n,this.index=S,this.changesSincePreviousVersion=C}getText(t,n){return this.index.getText(t,n-t)}getLength(){return this.index.getLength()}getChangeRange(t){if(t instanceof _LineIndexSnapshot&&this.cache===t.cache)return this.version<=t.version?Xn:this.cache.getTextChangesBetweenVersions(t.version,this.version)}},wg=class _LineIndex{constructor(){this.checkEdits=!1}absolutePositionOfStartOfLine(t){return this.lineNumberToInfo(t).absolutePosition}positionToLineOffset(t){let{oneBasedLine:n,zeroBasedColumn:S}=this.root.charOffsetToLineInfo(1,t);return{line:n,offset:S+1}}positionToColumnAndLineText(t){return this.root.charOffsetToLineInfo(1,t)}getLineCount(){return this.root.lineCount()}lineNumberToInfo(t){if(t<=this.getLineCount()){let{position:n,leaf:S}=this.root.lineNumberToInfo(t,0);return{absolutePosition:n,lineText:S&&S.text}}else return{absolutePosition:this.root.charCount(),lineText:void 0}}load(t){if(t.length>0){let n=[];for(let S=0;S<t.length;S++)n[S]=new LineLeaf(t[S]);this.root=_LineIndex.buildTreeFromBottom(n)}else this.root=new Tg}walk(t,n,S){this.root.walk(t,n,S)}getText(t,n){let S=``;return n>0&&t<this.root.charCount()&&this.walk(t,n,{goSubtree:!0,done:!1,leaf:(t,n,C)=>{S=S.concat(C.text.substring(t,t+n))}}),S}getLength(){return this.root.charCount()}every(t,n,S){S||=this.root.charCount();let C={goSubtree:!0,done:!1,leaf(n,S,C){t(C,n,S)||(this.done=!0)}};return this.walk(n,S-n,C),!C.done}edit(t,n,S){if(this.root.charCount()===0)return Q.assert(n===0),S===void 0?void 0:(this.load(_LineIndex.linesFromText(S).lines),this);{let C;if(this.checkEdits){let N=this.getText(0,this.root.charCount());C=N.slice(0,t)+S+N.slice(t+n)}let N=new EditWalker,F=!1;if(t>=this.root.charCount()){t=this.root.charCount()-1;let C=this.getText(t,1);S=S?C+S:C,n=0,F=!0}else if(n>0){let C=t+n,{zeroBasedColumn:N,lineText:F}=this.positionToColumnAndLineText(C);N===0&&(n+=F.length,S=S?S+F:F)}if(this.root.walk(t,n,N),N.insertLines(S,F),this.checkEdits){let t=N.lineIndex.getText(0,N.lineIndex.getLength());Q.assert(C===t,`buffer edit mismatch`)}return N.lineIndex}}static buildTreeFromBottom(t){if(t.length<vg)return new Tg(t);let n=Array(Math.ceil(t.length/vg)),S=0;for(let C=0;C<n.length;C++){let N=Math.min(S+vg,t.length);n[C]=new Tg(t.slice(S,N)),S=N}return this.buildTreeFromBottom(n)}static linesFromText(t){let n=computeLineStarts(t);if(n.length===0)return{lines:[],lineMap:n};let S=Array(n.length),C=n.length-1;for(let N=0;N<C;N++)S[N]=t.substring(n[N],n[N+1]);let N=t.substring(n[C]);return N.length>0?S[C]=N:S.pop(),{lines:S,lineMap:n}}},Tg=class _LineNode{constructor(t=[]){this.children=t,this.totalChars=0,this.totalLines=0,t.length&&this.updateCounts()}isLeaf(){return!1}updateCounts(){this.totalChars=0,this.totalLines=0;for(let t of this.children)this.totalChars+=t.charCount(),this.totalLines+=t.lineCount()}execWalk(t,n,S,C,N){return S.pre&&S.pre(t,n,this.children[C],this,N),S.goSubtree?(this.children[C].walk(t,n,S),S.post&&S.post(t,n,this.children[C],this,N)):S.goSubtree=!0,S.done}skipChild(t,n,S,C,N){C.pre&&!C.done&&(C.pre(t,n,this.children[S],this,N),C.goSubtree=!0)}walk(t,n,S){if(this.children.length===0)return;let C=0,N=this.children[C].charCount(),F=t;for(;F>=N;)this.skipChild(F,n,C,S,0),F-=N,C++,N=this.children[C].charCount();if(F+n<=N){if(this.execWalk(F,n,S,C,2))return}else{if(this.execWalk(F,N-F,S,C,1))return;let t=n-(N-F);for(C++,N=this.children[C].charCount();t>N;){if(this.execWalk(0,N,S,C,3))return;t-=N,C++,N=this.children[C].charCount()}if(t>0&&this.execWalk(0,t,S,C,4))return}if(S.pre){let t=this.children.length;if(C<t-1)for(let n=C+1;n<t;n++)this.skipChild(0,0,n,S,5)}}charOffsetToLineInfo(t,n){if(this.children.length===0)return{oneBasedLine:t,zeroBasedColumn:n,lineText:void 0};for(let S of this.children)if(S.charCount()>n)return S.isLeaf()?{oneBasedLine:t,zeroBasedColumn:n,lineText:S.text}:S.charOffsetToLineInfo(t,n);else n-=S.charCount(),t+=S.lineCount();let S=this.lineCount();return S===0?{oneBasedLine:1,zeroBasedColumn:0,lineText:void 0}:{oneBasedLine:S,zeroBasedColumn:Q.checkDefined(this.lineNumberToInfo(S,0).leaf).charCount(),lineText:void 0}}lineNumberToInfo(t,n){for(let S of this.children){let C=S.lineCount();if(C>=t)return S.isLeaf()?{position:n,leaf:S}:S.lineNumberToInfo(t,n);t-=C,n+=S.charCount()}return{position:n,leaf:void 0}}splitAfter(t){let n,S=this.children.length;t++;let C=t;if(t<S){for(n=new _LineNode;t<S;)n.add(this.children[t]),t++;n.updateCounts()}return this.children.length=C,n}remove(t){let n=this.findChildIndex(t),S=this.children.length;if(n<S-1)for(let t=n;t<S-1;t++)this.children[t]=this.children[t+1];this.children.pop()}findChildIndex(t){let n=this.children.indexOf(t);return Q.assert(n!==-1),n}insertAt(t,n){let S=this.findChildIndex(t),C=this.children.length,N=n.length;if(C<vg&&S===C-1&&N===1)return this.add(n[0]),this.updateCounts(),[];{let t=this.splitAfter(S),C=0;for(S++;S<vg&&C<N;)this.children[S]=n[C],S++,C++;let F=[],I=0;if(C<N){I=Math.ceil((N-C)/vg),F=Array(I);let t=0;for(let t=0;t<I;t++)F[t]=new _LineNode;let S=F[0];for(;C<N;)S.add(n[C]),C++,S.children.length===vg&&(t++,S=F[t]);for(let t=F.length-1;t>=0;t--)F[t].children.length===0&&F.pop()}t&&F.push(t),this.updateCounts();for(let t=0;t<I;t++)F[t].updateCounts();return F}}add(t){this.children.push(t),Q.assert(this.children.length<=vg)}charCount(){return this.totalChars}lineCount(){return this.totalLines}},LineLeaf=class{constructor(t){this.text=t}isLeaf(){return!0}walk(t,n,S){S.leaf(t,n,this)}charCount(){return this.text.length}lineCount(){return 1}},Eg=class _TypingsInstallerAdapter{constructor(t,n,S,C,N,F){this.telemetryEnabled=t,this.logger=n,this.host=S,this.globalTypingsCacheLocation=C,this.event=N,this.maxActiveRequestCount=F,this.activeRequestCount=0,this.requestQueue=createQueue(),this.requestMap=new Map,this.requestedRegistry=!1,this.packageInstallId=0}isKnownTypesPackageName(t){return $s.validatePackageName(t)===$s.NameValidationResult.Ok?(this.requestedRegistry||(this.requestedRegistry=!0,this.installer.send({kind:`typesRegistry`})),!!this.typesRegistryCache?.has(t)):!1}installPackage(t){this.packageInstallId++;let n={kind:`installPackage`,...t,id:this.packageInstallId},S=new Promise((t,n)=>{(this.packageInstalledPromise??=new Map).set(this.packageInstallId,{resolve:t,reject:n})});return this.installer.send(n),S}attach(t){this.projectService=t,this.installer=this.createInstallerProcess()}onProjectClosed(t){this.installer.send({projectName:t.getProjectName(),kind:`closeProject`})}enqueueInstallTypingsRequest(t,n,S){let C=createInstallTypingsRequest(t,n,S);this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling throttled operation:${stringifyIndented(C)}`),this.activeRequestCount<this.maxActiveRequestCount?this.scheduleRequest(C):(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Deferring request for: ${C.projectName}`),this.requestQueue.enqueue(C),this.requestMap.set(C.projectName,C))}handleMessage(t){var n;switch(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Received response:${stringifyIndented(t)}`),t.kind){case rc:this.typesRegistryCache=new Map(Object.entries(t.typesRegistry));break;case nc:{let S=this.packageInstalledPromise?.get(t.id);Q.assertIsDefined(S,`Should find the promise for package install`),(n=this.packageInstalledPromise)==null||n.delete(t.id),t.success?S.resolve({successMessage:t.message}):S.reject(t.message),this.projectService.updateTypingsForProject(t),this.event(t,`setTypings`);break}case oc:{let n={message:t.message};this.event(n,`typesInstallerInitializationFailed`);break}case ic:{let n={eventId:t.eventId,packages:t.packagesToInstall};this.event(n,`beginInstallTypes`);break}case ac:{if(this.telemetryEnabled){let n={telemetryEventName:`typingsInstalled`,payload:{installedPackages:t.packagesToInstall.join(`,`),installSuccess:t.installSuccess,typingsInstallerVersion:t.typingsInstallerVersion}};this.event(n,`telemetry`)}let n={eventId:t.eventId,packages:t.packagesToInstall,success:t.installSuccess};this.event(n,`endInstallTypes`);break}case tc:this.projectService.updateTypingsForProject(t);break;case ec:for(this.activeRequestCount>0?this.activeRequestCount--:Q.fail(`TIAdapter:: Received too many responses`);!this.requestQueue.isEmpty();){let t=this.requestQueue.dequeue();if(this.requestMap.get(t.projectName)===t){this.requestMap.delete(t.projectName),this.scheduleRequest(t);break}this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Skipping defunct request for: ${t.projectName}`)}this.projectService.updateTypingsForProject(t),this.event(t,`setTypings`);break;case sc:this.projectService.watchTypingLocations(t);break;default:}}scheduleRequest(t){this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling request for: ${t.projectName}`),this.activeRequestCount++,this.host.setTimeout(()=>{this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Sending request:${stringifyIndented(t)}`),this.installer.send(t)},_TypingsInstallerAdapter.requestDelayMillis,`${t.projectName}::${t.kind}`)}};Eg.requestDelayMillis=100;var Og=Eg,kg={};__export(kg,{ActionInvalidate:()=>tc,ActionPackageInstalled:()=>nc,ActionSet:()=>ec,ActionWatchTypingLocations:()=>sc,Arguments:()=>cc,AutoImportProviderProject:()=>Vh,AuxiliaryProject:()=>AuxiliaryProject,CharRangeSection:()=>bg,CloseFileWatcherEvent:()=>eg,CommandNames:()=>mg,ConfigFileDiagEvent:()=>Jh,ConfiguredProject:()=>ConfiguredProject2,ConfiguredProjectLoadKind:()=>ug,CreateDirectoryWatcherEvent:()=>$h,CreateFileWatcherEvent:()=>Qh,Errors:()=>wh,EventBeginInstallTypes:()=>ic,EventEndInstallTypes:()=>ac,EventInitializationFailed:()=>oc,EventTypesRegistry:()=>rc,ExternalProject:()=>ExternalProject,GcTimer:()=>Eh,InferredProject:()=>InferredProject2,LargeFileReferencedEvent:()=>qh,LineIndex:()=>wg,LineLeaf:()=>LineLeaf,LineNode:()=>Tg,LogLevel:()=>xh,Msg:()=>Ch,OpenFileInfoTelemetryEvent:()=>Zh,Project:()=>zh,ProjectInfoTelemetryEvent:()=>Xh,ProjectKind:()=>Rh,ProjectLanguageServiceStateEvent:()=>Yh,ProjectLoadingFinishEvent:()=>Kh,ProjectLoadingStartEvent:()=>Gh,ProjectService:()=>fg,ProjectsUpdatedInBackgroundEvent:()=>Wh,ScriptInfo:()=>ScriptInfo,ScriptVersionCache:()=>Sg,Session:()=>_g,TextStorage:()=>TextStorage,ThrottledOperations:()=>Th,TypingsInstallerAdapter:()=>Og,allFilesAreJsOrDts:()=>allFilesAreJsOrDts,allRootFilesAreJsOrDts:()=>allRootFilesAreJsOrDts,asNormalizedPath:()=>asNormalizedPath,convertCompilerOptions:()=>convertCompilerOptions,convertFormatOptions:()=>convertFormatOptions,convertScriptKindName:()=>convertScriptKindName,convertTypeAcquisition:()=>convertTypeAcquisition,convertUserPreferences:()=>convertUserPreferences,convertWatchOptions:()=>convertWatchOptions,countEachFileTypes:()=>countEachFileTypes,createInstallTypingsRequest:()=>createInstallTypingsRequest,createModuleSpecifierCache:()=>createModuleSpecifierCache,createNormalizedPathMap:()=>createNormalizedPathMap,createPackageJsonCache:()=>createPackageJsonCache,createSortedArray:()=>createSortedArray2,emptyArray:()=>Sh,findArgument:()=>findArgument,formatDiagnosticToProtocol:()=>formatDiagnosticToProtocol,formatMessage:()=>formatMessage2,getBaseConfigFileName:()=>getBaseConfigFileName,getDetailWatchInfo:()=>getDetailWatchInfo,getLocationInNewDocument:()=>getLocationInNewDocument,hasArgument:()=>hasArgument,hasNoTypeScriptSource:()=>hasNoTypeScriptSource,indent:()=>indent2,isBackgroundProject:()=>isBackgroundProject,isConfigFile:()=>isConfigFile,isConfiguredProject:()=>isConfiguredProject,isDynamicFileName:()=>isDynamicFileName,isExternalProject:()=>isExternalProject,isInferredProject:()=>isInferredProject,isInferredProjectName:()=>isInferredProjectName,isProjectDeferredClose:()=>isProjectDeferredClose,makeAutoImportProviderProjectName:()=>makeAutoImportProviderProjectName,makeAuxiliaryProjectName:()=>makeAuxiliaryProjectName,makeInferredProjectName:()=>makeInferredProjectName,maxFileSize:()=>Uh,maxProgramSizeForNonTsFiles:()=>Hh,normalizedPathToPath:()=>normalizedPathToPath,nowString:()=>nowString,nullCancellationToken:()=>pg,nullTypingsInstaller:()=>cg,protocol:()=>Dh,scriptInfoIsContainedByBackgroundProject:()=>scriptInfoIsContainedByBackgroundProject,scriptInfoIsContainedByDeferredClosedProject:()=>scriptInfoIsContainedByDeferredClosedProject,stringifyIndented:()=>stringifyIndented,toEvent:()=>toEvent,toNormalizedPath:()=>toNormalizedPath,tryConvertScriptKindName:()=>tryConvertScriptKindName,typingsInstaller:()=>yh,updateProjectIfDirty:()=>updateProjectIfDirty}),ge!==void 0&&(Q.loggingHost={log(t,n){switch(t){case 1:return ge.error(n);case 2:return ge.warn(n);case 3:return ge.log(n);case 4:return ge.log(n)}}})})({get exports(){return I},set exports(t){I=t,n!==void 0&&n.exports&&(n.exports=t)}})})),Kg=__commonJSMin((t=>{var n=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.loadTs=t.loadTsSync=t.loadYaml=t.loadJson=t.loadJs=t.loadJsSync=void 0;let S=(Md(),__toCommonJS(Ad)),C=(hd(),__toCommonJS(fd)),N=n((jn(),__toCommonJS(gn))),F=(Hn(),__toCommonJS(Mn)),I=(Kc(),__toCommonJS(Wc)),H;t.loadJsSync=function loadJsSync(t){return H===void 0&&(H=nh()),H(t)},t.loadJs=async function loadJs(n){try{let{href:t}=(0,F.pathToFileURL)(await(0,C.realpath)(n));return(await import(t)).default}catch(S){try{return(0,t.loadJsSync)(n,``)}catch(t){throw t.code===`ERR_REQUIRE_ESM`||t instanceof SyntaxError&&t.toString().includes(`Cannot use import statement outside a module`)?S:t}}};let W;t.loadJson=function loadJson(t,n){W===void 0&&(W=ph());try{return W(n)}catch(n){throw n.message=`JSON Error in ${t}:\n${n.message}`,n}};let q;t.loadYaml=function loadYaml(t,n){q===void 0&&(q=zh());try{return q.load(n)}catch(n){throw n.message=`YAML Error in ${t}:\n${n.message}`,n}};let Y;t.loadTsSync=function loadTsSync(n,C){Y===void 0&&(Y=Gg());let F=`${n}.${(0,I.randomUUID)()}.cjs`;try{let I=resolveTsConfig(N.default.dirname(n))??{};return I.compilerOptions={...I.compilerOptions,module:Y.ModuleKind.NodeNext,moduleResolution:Y.ModuleResolutionKind.NodeNext,target:Y.ScriptTarget.ES2022,noEmit:!1},C=Y.transpileModule(C,I).outputText,(0,S.writeFileSync)(F,C),(0,t.loadJsSync)(F,C).default}catch(t){throw t.message=`TypeScript Error in ${n}:\n${t.message}`,t}finally{(0,S.existsSync)(F)&&(0,S.rmSync)(F)}},t.loadTs=async function loadTs(n,F){Y===void 0&&(Y=(await Promise.resolve().then(()=>__toESM(Gg()))).default);let H=`${n}.${(0,I.randomUUID)()}.mjs`,W;try{try{let t=resolveTsConfig(N.default.dirname(n))??{};t.compilerOptions={...t.compilerOptions,module:Y.ModuleKind.ES2022,moduleResolution:Y.ModuleResolutionKind.Bundler,target:Y.ScriptTarget.ES2022,noEmit:!1},W=Y.transpileModule(F,t).outputText,await(0,C.writeFile)(H,W)}catch(t){throw t.message=`TypeScript Error in ${n}:\n${t.message}`,t}return await(0,t.loadJs)(H,W)}finally{(0,S.existsSync)(H)&&await(0,C.rm)(H)}};function resolveTsConfig(t){let n=Y.findConfigFile(t,t=>Y.sys.fileExists(t));if(n!==void 0){let{config:t,error:S}=Y.readConfigFile(n,t=>Y.sys.readFile(t));if(S)throw Error(`Error in ${n}: ${S.messageText.toString()}`);return t}}})),qg=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultLoadersSync=t.defaultLoaders=t.metaSearchPlaces=t.globalConfigSearchPlacesSync=t.globalConfigSearchPlaces=void 0,t.getDefaultSearchPlaces=getDefaultSearchPlaces,t.getDefaultSearchPlacesSync=getDefaultSearchPlacesSync;let n=Kg();function getDefaultSearchPlaces(t){return[`package.json`,`.${t}rc`,`.${t}rc.json`,`.${t}rc.yaml`,`.${t}rc.yml`,`.${t}rc.js`,`.${t}rc.ts`,`.${t}rc.cjs`,`.${t}rc.mjs`,`.config/${t}rc`,`.config/${t}rc.json`,`.config/${t}rc.yaml`,`.config/${t}rc.yml`,`.config/${t}rc.js`,`.config/${t}rc.ts`,`.config/${t}rc.cjs`,`.config/${t}rc.mjs`,`${t}.config.js`,`${t}.config.ts`,`${t}.config.cjs`,`${t}.config.mjs`]}function getDefaultSearchPlacesSync(t){return[`package.json`,`.${t}rc`,`.${t}rc.json`,`.${t}rc.yaml`,`.${t}rc.yml`,`.${t}rc.js`,`.${t}rc.ts`,`.${t}rc.cjs`,`.config/${t}rc`,`.config/${t}rc.json`,`.config/${t}rc.yaml`,`.config/${t}rc.yml`,`.config/${t}rc.js`,`.config/${t}rc.ts`,`.config/${t}rc.cjs`,`${t}.config.js`,`${t}.config.ts`,`${t}.config.cjs`]}t.globalConfigSearchPlaces=[`config`,`config.json`,`config.yaml`,`config.yml`,`config.js`,`config.ts`,`config.cjs`,`config.mjs`],t.globalConfigSearchPlacesSync=[`config`,`config.json`,`config.yaml`,`config.yml`,`config.js`,`config.ts`,`config.cjs`],t.metaSearchPlaces=[`package.json`,`package.yaml`,`.config/config.json`,`.config/config.yaml`,`.config/config.yml`,`.config/config.js`,`.config/config.ts`,`.config/config.cjs`,`.config/config.mjs`],t.defaultLoaders=Object.freeze({".mjs":n.loadJs,".cjs":n.loadJs,".js":n.loadJs,".ts":n.loadTs,".json":n.loadJson,".yaml":n.loadYaml,".yml":n.loadYaml,noExt:n.loadYaml}),t.defaultLoadersSync=Object.freeze({".cjs":n.loadJsSync,".js":n.loadJsSync,".ts":n.loadTsSync,".json":n.loadJson,".yaml":n.loadYaml,".yml":n.loadYaml,noExt:n.loadYaml})})),Jg=__commonJSMin(((t,n)=>{let S=(jn(),__toCommonJS(gn)),C=(Dg(),__toCommonJS(yg)),N=C.homedir(),F=C.tmpdir(),{env:I}=process,macos=t=>{let n=S.join(N,`Library`);return{data:S.join(n,`Application Support`,t),config:S.join(n,`Preferences`,t),cache:S.join(n,`Caches`,t),log:S.join(n,`Logs`,t),temp:S.join(F,t)}},windows=t=>{let n=I.APPDATA||S.join(N,`AppData`,`Roaming`),C=I.LOCALAPPDATA||S.join(N,`AppData`,`Local`);return{data:S.join(C,t,`Data`),config:S.join(n,t,`Config`),cache:S.join(C,t,`Cache`),log:S.join(C,t,`Log`),temp:S.join(F,t)}},linux=t=>{let n=S.basename(N);return{data:S.join(I.XDG_DATA_HOME||S.join(N,`.local`,`share`),t),config:S.join(I.XDG_CONFIG_HOME||S.join(N,`.config`),t),cache:S.join(I.XDG_CACHE_HOME||S.join(N,`.cache`),t),log:S.join(I.XDG_STATE_HOME||S.join(N,`.local`,`state`),t),temp:S.join(F,n,t)}},envPaths=(t,n)=>{if(typeof t!=`string`)throw TypeError(`Expected string, got ${typeof t}`);return n=Object.assign({suffix:`nodejs`},n),n.suffix&&(t+=`-${n.suffix}`),process.platform===`darwin`?macos(t):process.platform===`win32`?windows(t):linux(t)};n.exports=envPaths,n.exports.default=envPaths})),Yg=__commonJSMin((t=>{var n=t&&t.__createBinding||(Object.create?(function(t,n,S,C){C===void 0&&(C=S);var N=Object.getOwnPropertyDescriptor(n,S);(!N||(`get`in N?!n.__esModule:N.writable||N.configurable))&&(N={enumerable:!0,get:function(){return n[S]}}),Object.defineProperty(t,C,N)}):(function(t,n,S,C){C===void 0&&(C=S),t[C]=n[S]})),S=t&&t.__setModuleDefault||(Object.create?(function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}):function(t,n){t.default=n}),C=t&&t.__importStar||(function(){var ownKeys=function(t){return ownKeys=Object.getOwnPropertyNames||function(t){var n=[];for(var S in t)Object.prototype.hasOwnProperty.call(t,S)&&(n[n.length]=S);return n},ownKeys(t)};return function(t){if(t&&t.__esModule)return t;var C={};if(t!=null)for(var N=ownKeys(t),F=0;F<N.length;F++)N[F]!=="default"&&n(C,t,N[F]);return S(C,t),C}})();Object.defineProperty(t,"__esModule",{value:!0}),t.emplace=emplace,t.getPropertyByPath=getPropertyByPath,t.removeUndefinedValuesFromObject=removeUndefinedValuesFromObject,t.isDirectory=isDirectory,t.isDirectorySync=isDirectorySync;let N=C((Md(),__toCommonJS(Ad)));function emplace(t,n,S){let C=t.get(n);if(C!==void 0)return C;let N=S();return t.set(n,N),N}function getPropertyByPath(t,n){return typeof n==`string`&&Object.prototype.hasOwnProperty.call(t,n)?t[n]:(typeof n==`string`?n.split(`.`):n).reduce((t,n)=>t===void 0?t:t[n],t)}function removeUndefinedValuesFromObject(t){return Object.fromEntries(Object.entries(t).filter(([,t])=>t!==void 0))}async function isDirectory(t){try{return(await N.promises.stat(t)).isDirectory()}catch(t){if(t.code===`ENOENT`)return!1;throw t}}function isDirectorySync(t){try{return N.default.statSync(t).isDirectory()}catch(t){if(t.code===`ENOENT`)return!1;throw t}}})),Xg=__commonJSMin((t=>{var n=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.ExplorerBase=void 0,t.getExtensionDescription=getExtensionDescription;let S=n(Jg()),C=n((Dg(),__toCommonJS(yg))),N=n((jn(),__toCommonJS(gn))),F=Yg();var ExplorerBase=class{#e=!1;config;loadCache;searchCache;constructor(t){this.config=t,t.cache&&(this.loadCache=new Map,this.searchCache=new Map),this.#t()}set loadingMetaConfig(t){this.#e=t}#t(){let t=this.config;for(let n of t.searchPlaces){let t=N.default.extname(n),S=this.config.loaders[t||`noExt`]??this.config.loaders.default;if(S===void 0)throw Error(`Missing loader for ${getExtensionDescription(n)}.`);if(typeof S!=`function`)throw Error(`Loader for ${getExtensionDescription(n)} is not a function: Received ${typeof S}.`)}}clearLoadCache(){this.loadCache&&this.loadCache.clear()}clearSearchCache(){this.searchCache&&this.searchCache.clear()}clearCaches(){this.clearLoadCache(),this.clearSearchCache()}toCosmiconfigResult(t,n){if(n===null)return null;if(n===void 0)return{filepath:t,config:void 0,isEmpty:!0};if(this.config.applyPackagePropertyPathToConfiguration||this.#e){let t=this.config.packageProp??this.config.moduleName;n=(0,F.getPropertyByPath)(n,t)}return n===void 0?{filepath:t,config:void 0,isEmpty:!0}:{config:n,filepath:t}}validateImports(t,n,S){let C=N.default.dirname(t);for(let F of n){if(typeof F!=`string`)throw Error(`${t}: Key $import must contain a string or a list of strings`);let n=N.default.resolve(C,F);if(n===t)throw Error(`Self-import detected in ${t}`);let I=S.indexOf(n);if(I!==-1)throw Error(`Circular import detected:
650
650
  ${[...S,n].map((t,n)=>`${n+1}. ${t}`).join(`
651
- `)} (same as ${I+1}.)`)}}getSearchPlacesForDir(t,n){return(t.isGlobalConfig?n:this.config.searchPlaces).map(n=>N.default.join(t.path,n))}getGlobalConfigDir(){return(0,S.default)(this.config.moduleName,{suffix:``}).config}*getGlobalDirs(t){let n=N.default.resolve(this.config.stopDir??C.default.homedir());yield{path:t,isGlobalConfig:!1};let S=t;for(;S!==n;){let t=N.default.dirname(S);if(t===S)break;yield{path:t,isGlobalConfig:!1},S=t}yield{path:this.getGlobalConfigDir(),isGlobalConfig:!0}}};t.ExplorerBase=ExplorerBase;function getExtensionDescription(t){return t?`extension "${t}"`:`files without extensions`}})),Zg=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.hasOwn=void 0,t.mergeAll=mergeAll,t.hasOwn=Function.prototype.call.bind(Object.prototype.hasOwnProperty);let n=Function.prototype.call.bind(Object.prototype.toString);function isPlainObject(t){return n(t)===`[object Object]`}function merge(n,S,C){for(let N of Object.keys(S)){if(N===`__proto__`||N===`constructor`)continue;let F=S[N];if((0,t.hasOwn)(n,N)){if(Array.isArray(n[N])&&Array.isArray(F)){if(C.mergeArrays){n[N].push(...F);continue}}else if(isPlainObject(n[N])&&isPlainObject(F)){n[N]=merge(n[N],F,C);continue}}n[N]=F}return n}function mergeAll(t,n){return t.reduce((t,S)=>merge(t,S,n),{})}})),Qg=__commonJSMin((t=>{var n=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.Explorer=void 0;let S=n((hd(),__toCommonJS(fd))),C=n((jn(),__toCommonJS(gn))),N=qg(),F=Xg(),I=Zg(),H=Yg();var Explorer=class extends F.ExplorerBase{async load(t){t=C.default.resolve(t);let load=async()=>await this.config.transform(await this.#e(t));return this.loadCache?await(0,H.emplace)(this.loadCache,t,load):await load()}async search(t=``){if(this.config.metaConfigFilePath){this.loadingMetaConfig=!0;let t=await this.load(this.config.metaConfigFilePath);if(this.loadingMetaConfig=!1,t&&!t.isEmpty)return t}t=C.default.resolve(t);let n=this.#i(t),S=await n.next();if(S.done)throw Error(`Could not find any folders to iterate through (start from ${t})`);let F=S.value,search=async()=>{if(await(0,H.isDirectory)(F.path))for(let t of this.getSearchPlacesForDir(F,N.globalConfigSearchPlaces))try{let n=await this.#e(t);if(n!==null&&!(n.isEmpty&&this.config.ignoreEmptySearchPlaces))return await this.config.transform(n)}catch(t){if(t.code===`ENOENT`||t.code===`EISDIR`||t.code===`ENOTDIR`||t.code===`EACCES`)continue;throw t}let t=await n.next();return t.done?await this.config.transform(null):(F=t.value,this.searchCache?await(0,H.emplace)(this.searchCache,F.path,search):await search())};return this.searchCache?await(0,H.emplace)(this.searchCache,t,search):await search()}async#e(t,n=[]){let C=await S.default.readFile(t,{encoding:`utf-8`});return this.toCosmiconfigResult(t,await this.#t(t,C,n))}async#t(t,n,S){let N=await this.#n(t,n);if(!N||!(0,I.hasOwn)(N,`$import`))return N;let F=C.default.dirname(t),{$import:H,...W}=N,q=Array.isArray(H)?H:[H],Y=[...S,t];this.validateImports(t,q,Y);let X=await Promise.all(q.map(async t=>{let n=C.default.resolve(F,t);return(await this.#e(n,Y))?.config}));return(0,I.mergeAll)([...X,W],{mergeArrays:this.config.mergeImportArrays})}async#n(t,n){if(n.trim()===``)return;let S=C.default.extname(t),N=this.config.loaders[S||`noExt`]??this.config.loaders.default;if(!N)throw Error(`No loader specified for ${(0,F.getExtensionDescription)(S)}`);try{let F=await N(t,n);return C.default.basename(t,S)===`package`?(0,H.getPropertyByPath)(F,this.config.packageProp??this.config.moduleName)??null:F}catch(n){throw n.filepath=t,n}}async#r(t){try{return await S.default.stat(t),!0}catch{return!1}}async*#i(t){switch(this.config.searchStrategy){case`none`:yield{path:t,isGlobalConfig:!1};return;case`project`:{let n=t;for(;;){yield{path:n,isGlobalConfig:!1};let t=!1;for(let S of[`json`,`yaml`]){let N=C.default.join(n,`package.${S}`);if(await this.#r(N)){t=!0;break}}if(t)return;let S=C.default.dirname(n);if(S===n)return;n=S}}case`global`:yield*this.getGlobalDirs(t)}}};t.Explorer=Explorer})),$g=__commonJSMin((t=>{var n=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.ExplorerSync=void 0;let S=n((Md(),__toCommonJS(Ad))),C=n((jn(),__toCommonJS(gn))),N=qg(),F=Xg(),I=Zg(),H=Yg();var ExplorerSync=class extends F.ExplorerBase{load(t){t=C.default.resolve(t);let load=()=>this.config.transform(this.#e(t));return this.loadCache?(0,H.emplace)(this.loadCache,t,load):load()}search(t=``){if(this.config.metaConfigFilePath){this.loadingMetaConfig=!0;let t=this.load(this.config.metaConfigFilePath);if(this.loadingMetaConfig=!1,t&&!t.isEmpty)return t}t=C.default.resolve(t);let n=this.#i(t),S=n.next();if(S.done)throw Error(`Could not find any folders to iterate through (start from ${t})`);let F=S.value,search=()=>{if((0,H.isDirectorySync)(F.path))for(let t of this.getSearchPlacesForDir(F,N.globalConfigSearchPlacesSync))try{let n=this.#e(t);if(n!==null&&!(n.isEmpty&&this.config.ignoreEmptySearchPlaces))return this.config.transform(n)}catch(t){if(t.code===`ENOENT`||t.code===`EISDIR`||t.code===`ENOTDIR`||t.code===`EACCES`)continue;throw t}let t=n.next();return t.done?this.config.transform(null):(F=t.value,this.searchCache?(0,H.emplace)(this.searchCache,F.path,search):search())};return this.searchCache?(0,H.emplace)(this.searchCache,t,search):search()}#e(t,n=[]){let C=S.default.readFileSync(t,`utf8`);return this.toCosmiconfigResult(t,this.#t(t,C,n))}#t(t,n,S){let N=this.#n(t,n);if(!N||!(0,I.hasOwn)(N,`$import`))return N;let F=C.default.dirname(t),{$import:H,...W}=N,q=Array.isArray(H)?H:[H],Y=[...S,t];this.validateImports(t,q,Y);let X=q.map(t=>{let n=C.default.resolve(F,t);return this.#e(n,Y)?.config});return(0,I.mergeAll)([...X,W],{mergeArrays:this.config.mergeImportArrays})}#n(t,n){if(n.trim()===``)return;let S=C.default.extname(t),N=this.config.loaders[S||`noExt`]??this.config.loaders.default;if(!N)throw Error(`No loader specified for ${(0,F.getExtensionDescription)(S)}`);try{let F=N(t,n);return C.default.basename(t,S)===`package`?(0,H.getPropertyByPath)(F,this.config.packageProp??this.config.moduleName)??null:F}catch(n){throw n.filepath=t,n}}#r(t){try{return S.default.statSync(t),!0}catch{return!1}}*#i(t){switch(this.config.searchStrategy){case`none`:yield{path:t,isGlobalConfig:!1};return;case`project`:{let n=t;for(;;){yield{path:n,isGlobalConfig:!1};let t=!1;for(let S of[`json`,`yaml`]){let N=C.default.join(n,`package.${S}`);if(this.#r(N)){t=!0;break}}if(t)return;let S=C.default.dirname(n);if(S===n)return;n=S}}case`global`:yield*this.getGlobalDirs(t)}}loadSync(t){return this.load(t)}searchSync(t=``){return this.search(t)}};t.ExplorerSync=ExplorerSync})),e_=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultLoadersSync=t.defaultLoaders=t.globalConfigSearchPlacesSync=t.globalConfigSearchPlaces=t.getDefaultSearchPlacesSync=t.getDefaultSearchPlaces=void 0,t.cosmiconfig=cosmiconfig;let n=qg();Object.defineProperty(t,"defaultLoaders",{enumerable:!0,get:function(){return n.defaultLoaders}}),Object.defineProperty(t,"defaultLoadersSync",{enumerable:!0,get:function(){return n.defaultLoadersSync}}),Object.defineProperty(t,"getDefaultSearchPlaces",{enumerable:!0,get:function(){return n.getDefaultSearchPlaces}}),Object.defineProperty(t,"getDefaultSearchPlacesSync",{enumerable:!0,get:function(){return n.getDefaultSearchPlacesSync}}),Object.defineProperty(t,"globalConfigSearchPlaces",{enumerable:!0,get:function(){return n.globalConfigSearchPlaces}}),Object.defineProperty(t,"globalConfigSearchPlacesSync",{enumerable:!0,get:function(){return n.globalConfigSearchPlacesSync}});let S=Qg(),C=$g(),N=Yg(),F=function identity(t){return t};function getUserDefinedOptionsFromMetaConfig(){let t=new C.ExplorerSync({moduleName:`cosmiconfig`,stopDir:process.cwd(),searchPlaces:n.metaSearchPlaces,ignoreEmptySearchPlaces:!1,applyPackagePropertyPathToConfiguration:!0,loaders:n.defaultLoaders,transform:F,cache:!0,metaConfigFilePath:null,mergeImportArrays:!0,mergeSearchPlaces:!0,searchStrategy:`none`}).search();if(!t)return null;if(t.config?.loaders)throw Error(`Can not specify loaders in meta config file`);if(t.config?.searchStrategy)throw Error(`Can not specify searchStrategy in meta config file`);let S={mergeSearchPlaces:!0,...t.config??{}};return{config:(0,N.removeUndefinedValuesFromObject)(S),filepath:t.filepath}}function getResolvedSearchPlaces(t,n,S){let C=S.searchPlaces?.map(n=>n.replace(`{name}`,t));return S.mergeSearchPlaces?[...C??[],...n]:C??n}function mergeOptionsBase(t,n,S){let C=getUserDefinedOptionsFromMetaConfig();if(!C)return{...n,...(0,N.removeUndefinedValuesFromObject)(S),loaders:{...n.loaders,...S.loaders}};let F=C.config,I=S.searchPlaces??n.searchPlaces;return{...n,...(0,N.removeUndefinedValuesFromObject)(S),metaConfigFilePath:C.filepath,...F,searchPlaces:getResolvedSearchPlaces(t,I,F),loaders:{...n.loaders,...S.loaders}}}function validateOptions(t){if(t.searchStrategy!=null&&t.searchStrategy!==`global`&&t.stopDir)throw Error('Can not supply `stopDir` option with `searchStrategy` other than "global"')}function mergeOptions(t,S){return validateOptions(S),mergeOptionsBase(t,{moduleName:t,searchPlaces:(0,n.getDefaultSearchPlaces)(t),ignoreEmptySearchPlaces:!0,cache:!0,transform:F,loaders:n.defaultLoaders,metaConfigFilePath:null,mergeImportArrays:!0,mergeSearchPlaces:!0,searchStrategy:S.stopDir?`global`:`none`},S)}function cosmiconfig(t,n={}){let C=mergeOptions(t,n),N=new S.Explorer(C);return{search:N.search.bind(N),load:N.load.bind(N),clearLoadCache:N.clearLoadCache.bind(N),clearSearchCache:N.clearSearchCache.bind(N),clearCaches:N.clearCaches.bind(N)}}}));function isBun(){return globalThis.Bun!==void 0}function isDeno(){return globalThis.Deno!==void 0}function isGjs(){return globalThis.imports?.gi!==void 0}function hostRuntime$1(){return isBun()?`bun`:isDeno()?`deno`:isGjs()?`gjs`:`node`}function isNode(){return isBun()||isDeno()||isGjs()?!1:typeof globalThis.process?.versions?.node==`string`}function gjsSystemVersion(){return globalThis.imports?.system?.version}function gjsExit(t){let n=globalThis.imports?.system;return n?.exit?(n.exit(t),!0):!1}var t_=__esmMin(()=>{__name$1(hostRuntime$1,`hostRuntime`)}),n_,__exportAll,r_=__esmMin(()=>{n_=Object.defineProperty,__exportAll=(t,n)=>{let S={};for(var C in t)n_(S,C,{get:t[C],enumerable:!0});return n||n_(S,Symbol.toStringTag,{value:`Module`}),S}});function communicateWithTimeout(t,n,S,C){let N={stdout:null,stderr:null,timedOut:!1,error:null},F=lt.MainContext.new(),I=null,H=!1;F.push_thread_default();try{for(t.communicate_async(n,null,(n,S)=>{try{let n=t.communicate_finish(S);N.stdout=n[1]??null,N.stderr=n[2]??null}catch(t){N.error=t}H=!0}),I=lt.timeout_source_new(S),I.set_callback(()=>(N.timedOut=!0,C(),lt.SOURCE_REMOVE)),I.attach(F);!H;)F.iteration(!0)}finally{I!==null&&I.destroy(),F.pop_thread_default()}return N}var i_=__esmMin(()=>{ut()});function defaultShell$1(){return o_===null&&(o_=!lt.file_test(`/bin/sh`,lt.FileTest.IS_EXECUTABLE)&&lt.file_test(`/system/bin/sh`,lt.FileTest.IS_EXECUTABLE)?`/system/bin/sh`:`/bin/sh`),o_}function shellArgv$2(t,n){return[typeof n==`string`&&n.length>0?n:defaultShell$1(),`-c`,t]}function argv0Shell(){return s_===void 0&&(s_=lt.find_program_in_path(`bash`)??lt.find_program_in_path(`zsh`)),s_??defaultShell$1()}function applyArgv0$2(t,n){return[argv0Shell(),`-c`,`exec -a "$0" "$@"`,t,...n]}function detachedPrefix$2(){return c_===void 0&&(c_=lt.find_program_in_path(`setsid`)),c_===null?null:[c_]}function killProcess$4(t,n,S){let C=n??`SIGTERM`;if(C===`SIGKILL`||C===9){t.force_exit();return}let N=typeof C==`number`?C:S[C]??S.SIGTERM;t.send_signal(N)}var a_,o_,s_,c_,l_=__esmMin(()=>{ut(),a_=Object.freeze({SIGHUP:1,SIGINT:2,SIGQUIT:3,SIGILL:4,SIGTRAP:5,SIGABRT:6,SIGIOT:6,SIGFPE:8,SIGKILL:9,SIGSEGV:11,SIGPIPE:13,SIGALRM:14,SIGTERM:15,SIGXCPU:24,SIGXFSZ:25,SIGVTALRM:26,SIGPROF:27,SIGWINCH:28}),o_=null,__name$1(defaultShell$1,`defaultShell`),__name$1(shellArgv$2,`shellArgv`),__name$1(applyArgv0$2,`applyArgv0`),__name$1(detachedPrefix$2,`detachedPrefix`),__name$1(killProcess$4,`killProcess`)});function killProcess$3(t,n){killProcess$4(t,n,d_)}var u_,d_,f_=__esmMin(()=>{r_(),l_(),u_=__exportAll({SIGNALS:()=>d_,applyArgv0:()=>applyArgv0$2,defaultShell:()=>defaultShell$1,detachedPrefix:()=>detachedPrefix$2,killProcess:()=>killProcess$3,shellArgv:()=>shellArgv$2}),d_=Object.freeze({...a_,SIGEMT:7,SIGBUS:10,SIGSYS:12,SIGURG:16,SIGSTOP:17,SIGTSTP:18,SIGCONT:19,SIGCHLD:20,SIGTTIN:21,SIGTTOU:22,SIGIO:23,SIGUSR1:30,SIGUSR2:31}),__name$1(killProcess$3,`killProcess`)});function killProcess$2(t,n){killProcess$4(t,n,m_)}var p_,m_,h_=__esmMin(()=>{r_(),l_(),p_=__exportAll({SIGNALS:()=>m_,applyArgv0:()=>applyArgv0$2,defaultShell:()=>defaultShell$1,detachedPrefix:()=>detachedPrefix$2,killProcess:()=>killProcess$2,shellArgv:()=>shellArgv$2}),m_=Object.freeze({...a_,SIGBUS:7,SIGUSR1:10,SIGUSR2:12,SIGCHLD:17,SIGCONT:18,SIGSTOP:19,SIGTSTP:20,SIGTTIN:21,SIGTTOU:22,SIGURG:23,SIGIO:29,SIGPOLL:29,SIGPWR:30,SIGSYS:31}),__name$1(killProcess$2,`killProcess`)});function defaultShell(){return lt.getenv(`ComSpec`)||`cmd.exe`}function shellArgv$1(t,n){let S=typeof n==`string`&&n.length>0?n:defaultShell();return __.test(S)?[S,`/d`,`/s`,`/c`,`"${t}"`]:[S,`-c`,t]}function detachedPrefix$1(){return null}function applyArgv0$1(t,n){let S=Error(`options.argv0 (${t}) is not supported on Windows: GSubprocess cannot decouple the executable path from the child's argv[0]`);throw S.code=`ERR_UNSUPPORTED_OPERATION`,S}function killProcess$1(t,n){t.force_exit()}var g_,__,v_,y_=__esmMin(()=>{r_(),ut(),g_=__exportAll({SIGNALS:()=>v_,applyArgv0:()=>applyArgv0$1,defaultShell:()=>defaultShell,detachedPrefix:()=>detachedPrefix$1,killProcess:()=>killProcess$1,shellArgv:()=>shellArgv$1}),__=/^(?:.*\\)?cmd(?:\.exe)?$/i,__name$1(shellArgv$1,`shellArgv`),__name$1(detachedPrefix$1,`detachedPrefix`),__name$1(applyArgv0$1,`applyArgv0`),__name$1(killProcess$1,`killProcess`),v_=Object.freeze({SIGINT:2,SIGKILL:9,SIGTERM:15})});function detectPlatform(){return x_===null&&(x_=lt.get_current_dir().startsWith(`/`)?lt.file_test(`/proc/self/status`,lt.FileTest.EXISTS)?!lt.file_test(`/bin/sh`,lt.FileTest.IS_EXECUTABLE)&&lt.file_test(`/system/bin/sh`,lt.FileTest.IS_EXECUTABLE)?`android`:`linux`:lt.file_test(`/System/Library/CoreServices/SystemVersion.plist`,lt.FileTest.EXISTS)?`darwin`:`posix`:`win32`),x_}function ops(){switch(detectPlatform()){case`win32`:return g_;case`darwin`:return u_;case`linux`:case`android`:return p_;default:return b_}}function shellArgv(t,n){return ops().shellArgv(t,n)}function detachedPrefix(){return ops().detachedPrefix()}function applyArgv0(t,n){return ops().applyArgv0(t,n)}function killProcess(t,n){ops().killProcess(t,n)}var b_,x_,S_=__esmMin(()=>{l_(),f_(),h_(),y_(),ut(),b_={defaultShell:defaultShell$1,shellArgv:shellArgv$2,detachedPrefix:detachedPrefix$2,applyArgv0:applyArgv0$2,killProcess:(t,n)=>killProcess$4(t,n,a_),SIGNALS:a_},x_=null});function _gioErrorToNodeError(t,n,S){let C=t??Error(`Unknown spawn error`),N=C,F=C.code,I=C.matches,H=!1;if(typeof I==`function`)try{H=I.call(C,lt.SpawnError,lt.SpawnError.NOENT)===!0}catch{}if(!H&&F===lt.SpawnError.NOENT&&(H=!0),!H&&typeof C.message==`string`&&/No such file or directory|ENOENT|Failed to execute|nicht gefunden|nicht ausgeführt/i.test(C.message)&&(H=!0),H){let t=Error(`spawn ${n} ENOENT`);return t.code=`ENOENT`,t.errno=-2,t.syscall=`spawn ${n}`,t.path=n,t.spawnargs=S.slice(),t}if(C instanceof Error)return N;let W=C,q=typeof W.message==`string`?W.message:String(C),Y=Error(q);return(typeof F==`number`||typeof F==`string`)&&(Y.code=F),Y}function _normalizeCwd(t){if(t!=null){if(typeof t==`string`)return t;if(typeof t==`object`&&t&&typeof t.href==`string`&&typeof t.protocol==`string`){let n=t;if(n.protocol!==`file:`)throw TypeError(`The URL must be of scheme file:; received '${n.protocol}' for 'options.cwd'`);return fileURLToPath(n)}return t instanceof Uint8Array?new TextDecoder().decode(t):String(t)}}function _encodeEnvValue(t){if(t!==void 0)return`${t}`}function _spawnSubprocess(t,n,S){let C=new di.SubprocessLauncher({flags:n}),N=_normalizeCwd(S?.cwd);if(N!==void 0&&C.set_cwd(N),S?.env){let t=S.env;C.set_environ([]);let n=new Set;for(let S in t){if(n.has(S))continue;n.add(S);let N=_encodeEnvValue(t[S]);N!==void 0&&C.setenv(S,N,!0)}}let F=t;if(S?.argv0!==void 0&&S.argv0!==null){if(typeof S.argv0!=`string`)throw TypeError(`The "options.argv0" property must be of type string. Received type ${typeof S.argv0}`);F=applyArgv0(S.argv0,t)}if(S?.detached===!0){let t=detachedPrefix();t!==null&&(F=[...t,...F])}let I=C.spawnv(F);return{proc:I,pid:_capturePidAtSpawn(I)}}function _capturePidAtSpawn(t){let n=t.get_identifier();if(n){let t=parseInt(n,10);if(t>0)return t}return 0}function _watchStdioForClose(t){let n=[t.stdout,t.stderr].filter(t=>t!==null);if(n.length===0)return(n,S)=>{t.emit(`exit`,n,S),t.emit(`close`,n,S)};let S=n.length,C=!1,N=null,F=null,closeIfDone=()=>{C&&S===0&&t.emit(`close`,N,F)};for(let t of n){let n=!1,settleOnce=()=>{n||(n=!0,--S,closeIfDone())};t.once(`end`,settleOnce),t.once(`close`,settleOnce)}return(S,I)=>{N=S,F=I,C=!0,t.emit(`exit`,S,I),queueMicrotask(()=>{for(let t of n)t.destroyed||t.readableEnded||t.listenerCount(`data`)>0||t.listenerCount(`readable`)>0||t.resume()}),closeIfDone()}}function _communicateSync(t,n,S,C){if(S<=0){let S=t.communicate(n,null);return{stdout:S[1]??null,stderr:S[2]??null,timedOut:!1}}let N=communicateWithTimeout(t,n,S,()=>{killProcess(t,C??`SIGTERM`)});if(N.error)throw N.error;return{stdout:N.stdout,stderr:N.stderr,timedOut:N.timedOut}}function _syncTimeoutError(t,n,S,C,N){let F=n?gbytesToUint8Array(n):new Uint8Array,I=S?gbytesToUint8Array(S):new Uint8Array,H=new TextDecoder().decode(I),W=Error(`Command failed: ${t}\n${H}`);return W.code=`ETIMEDOUT`,W.killed=!0,W.signal=typeof N==`string`?N:`SIGTERM`,W.status=null,C===`buffer`||C===null?(W.stdout=Xe.from(F),W.stderr=Xe.from(I)):(W.stdout=new TextDecoder().decode(F),W.stderr=H),W}function _decodeExecOutput(t,n){let S=t??new Uint8Array;if(n===`buffer`||n===null)return Xe.from(S);let C=n&&Xe.isEncoding(n)?n:`utf8`;return Xe.from(S).toString(C)}function _normalizeKillSignal(t){return t??`SIGTERM`}function _absorbExecError(){}function _execImpl(t,n,S,C,N){t.on(`error`,_absorbExecError);let F=null,I=!1,H=null,W=null,armTimeout=n=>{N.timeoutMs&&(F=setTimeout(()=>{I=!0;try{killProcess(n,N.killSignal)}catch{}t.killed=!0},N.timeoutMs))},disarmTimeout=()=>{F!==null&&(clearTimeout(F),F=null)},armAbort=n=>{if(!N.abortSignal)return;let fire=()=>{H=Error(`The operation was aborted`),H.name=`AbortError`;try{killProcess(n,N.killSignal)}catch{}t.killed=!0};if(N.abortSignal.aborted){queueMicrotask(fire);return}W=fire,N.abortSignal.addEventListener(`abort`,W,{once:!0})},disarmAbort=()=>{N.abortSignal&&W&&(N.abortSignal.removeEventListener(`abort`,W),W=null)};try{let{proc:F,pid:W}=_spawnSubprocess(n,S,C);t._setSubprocess(F,W),C_.add(t),ensureMainLoop(),armTimeout(F),armAbort(F);let q=_watchStdioForClose(t);F.communicate_async(null,null,(n,S)=>{disarmTimeout(),disarmAbort(),C_.delete(t);try{let[,n,C]=F.communicate_finish(S),W=n?gbytesToUint8Array(n):null,Y=C?gbytesToUint8Array(C):null,X=null;N.maxBuffer!==1/0&&W&&W.length>N.maxBuffer&&(W=W.subarray(0,N.maxBuffer),X=RangeError(`stdout maxBuffer length exceeded`),X.code=`ERR_CHILD_PROCESS_STDIO_MAXBUFFER`),!X&&N.maxBuffer!==1/0&&Y&&Y.length>N.maxBuffer&&(Y=Y.subarray(0,N.maxBuffer),X=RangeError(`stderr maxBuffer length exceeded`),X.code=`ERR_CHILD_PROCESS_STDIO_MAXBUFFER`);let Z=_decodeExecOutput(W,N.encoding),te=_decodeExecOutput(Y,N.encoding),ne=F.get_if_exited()?F.get_exit_status():null,re=F.get_if_signaled()?typeof N.killSignal==`string`?N.killSignal:`SIGTERM`:null;t.exitCode=ne,t.signalCode=re;let ie=null;if(H)ie=H,ie.killed=!0,ie.signal=re,ie.stdout=Z,ie.stderr=te,ie.cmd=N.cmd;else if(X)ie=X,ie.killed=t.killed,ie.signal=re,ie.stdout=Z,ie.stderr=te,ie.cmd=N.cmd;else if(I)ie=Error(`Command failed: ${N.cmd}`),ie.killed=!0,ie.code=null,ie.signal=typeof N.killSignal==`string`?N.killSignal:`SIGTERM`,ie.stdout=Z,ie.stderr=te,ie.cmd=N.cmd;else if(ne!==0&&ne!==null){let n=typeof te==`string`?te:te.toString();ie=Error(`Command failed: ${N.cmd}\n${n}`),ie.code=ne,ie.killed=t.killed,ie.signal=re,ie.stdout=Z,ie.stderr=te,ie.cmd=N.cmd}else re&&(ie=Error(`Command failed: ${N.cmd}`),ie.killed=!0,ie.signal=re,ie.code=null,ie.stdout=Z,ie.stderr=te,ie.cmd=N.cmd);N.callback&&N.callback(ie,Z,te),q(ne,re)}catch(n){let S=n instanceof Error?n:Error(String(n));N.callback&&N.callback(S,``,``),t.emit(`error`,S)}}),queueMicrotask(()=>t.emit(`spawn`))}catch(S){disarmTimeout(),disarmAbort();let C=_gioErrorToNodeError(S,n[0]??``,n.slice(1));setTimeout(()=>{N.callback&&N.callback(C,``,``),t.emit(`error`,C)},0)}return t}function execFile(t,n,S,C){let N=[],F={},I;typeof n==`function`?I=n:Array.isArray(n)?(N=n,typeof S==`function`?I=S:(F=S||{},I=C)):n&&typeof n==`object`&&(F=n,I=typeof S==`function`?S:C);let H=new ChildProcess,W=di.SubprocessFlags.STDOUT_PIPE|di.SubprocessFlags.STDERR_PIPE,q=F.maxBuffer??1024*1024,Y=F.timeout&&F.timeout>0?F.timeout:0,X=_normalizeKillSignal(F.killSignal);return _execImpl(H,[t,...N],W,F,{cmd:t,encoding:F.encoding,maxBuffer:q,timeoutMs:Y,killSignal:X,abortSignal:F.signal,callback:I})}function execFileSync(t,n,S){let C=[],N;Array.isArray(n)?(C=n,N=S):n&&typeof n==`object`&&(N=n);let F=N?.encoding,I=N?.input,H=di.SubprocessFlags.STDOUT_PIPE|di.SubprocessFlags.STDERR_PIPE|(I?di.SubprocessFlags.STDIN_PIPE:di.SubprocessFlags.NONE),W;try{({proc:W}=_spawnSubprocess([t,...C],H,N))}catch(n){throw _gioErrorToNodeError(n,t,C)}let q=I?new lt.Bytes(typeof I==`string`?new TextEncoder().encode(I):I):null,Y=N?.timeout&&N.timeout>0?N.timeout:0,{stdout:X,stderr:Z,timedOut:te}=_communicateSync(W,q,Y,N?.killSignal);if(te)throw _syncTimeoutError(`${t} ${C.join(` `)}`.trim(),X,Z,F,N?.killSignal);let ne=W.get_exit_status();if(ne!==0){let n=Z?new TextDecoder().decode(gbytesToUint8Array(Z)):``,S=X?new TextDecoder().decode(gbytesToUint8Array(X)):``,N=Error(`Command failed: ${t} ${C.join(` `)}`);throw N.status=ne,F===`buffer`||F===null?(N.stderr=Z?Xe.from(gbytesToUint8Array(Z)):Xe.alloc(0),N.stdout=X?Xe.from(gbytesToUint8Array(X)):Xe.alloc(0)):(N.stderr=n,N.stdout=S),N}if(!X)return F===`buffer`||F==null?Xe.alloc(0):``;let re=gbytesToUint8Array(X);if(F===`buffer`||F==null)return Xe.from(re);let ie=Xe.isEncoding(F)?F:`utf8`;return Xe.from(re).toString(ie)}function spawn(t,n,S){let C,N;if(Array.isArray(n))C=n,N=S;else if(n!=null){if(typeof n!=`object`)throw TypeError(`The "args" argument must be of type object. Received type ${typeof n}`);C=void 0,N=n}else C=void 0,N=n;if(N!=null&&typeof N!=`object`)throw TypeError(`The "options" argument must be of type object. Received type ${typeof N}`);if(N?.argv0!==void 0&&N.argv0!==null&&typeof N.argv0!=`string`)throw TypeError(`The "options.argv0" property must be of type string. Received type ${typeof N.argv0}`);N?.cwd!==void 0&&_normalizeCwd(N.cwd);let F=C||[],I=new ChildProcess,H=N?.shell,W;W=H?shellArgv([t,...F].join(` `),H):[t,...F];let q=N?.stdio,Y=Array.isArray(q)?[typeof q[0]==`string`?q[0]:`pipe`,typeof q[1]==`string`?q[1]:`pipe`,typeof q[2]==`string`?q[2]:`pipe`]:typeof q==`string`?[q,q,q]:[`pipe`,`pipe`,`pipe`],X=di.SubprocessFlags.NONE;Y[0]===`pipe`?X|=di.SubprocessFlags.STDIN_PIPE:Y[0]===`inherit`&&(X|=di.SubprocessFlags.STDIN_INHERIT),Y[1]===`pipe`&&(X|=di.SubprocessFlags.STDOUT_PIPE),Y[1]===`ignore`&&(X|=di.SubprocessFlags.STDOUT_SILENCE),Y[2]===`pipe`&&(X|=di.SubprocessFlags.STDERR_PIPE),Y[2]===`ignore`&&(X|=di.SubprocessFlags.STDERR_SILENCE);try{let{proc:t,pid:n}=_spawnSubprocess(W,X,N);if(I._setSubprocess(t,n),C_.add(I),Y[0]===`pipe`){let n=t.get_stdin_pipe();n&&(I.stdin=new GioOutputStreamWritable(n))}let S=t.get_stdout_pipe();S&&(I.stdout=new GioInputStreamReadable(S));let C=t.get_stderr_pipe();C&&(I.stderr=new GioInputStreamReadable(C));let F=_watchStdioForClose(I),H=N?.signal,q=null,emitAbortError=()=>{let t=N?.killSignal??`SIGTERM`;I.kill(t);let n=Error(`The operation was aborted`);n.name=`AbortError`,I.emit(`error`,n)};H&&(H.aborted?queueMicrotask(emitAbortError):(q=emitAbortError,H.addEventListener(`abort`,q,{once:!0})));let Z=null;if(N?.timeout&&N.timeout>0){let t=N.killSignal??`SIGTERM`;Z=setTimeout(()=>{I.kill(t),Z=null},N.timeout)}ensureMainLoop(),t.wait_async(null,(n,S)=>{try{t.wait_finish(S);let n=t.get_if_exited()?t.get_exit_status():null,C=null;if(t.get_if_signaled()){let t=N?.killSignal;C=typeof t==`string`?t:`SIGTERM`}I.exitCode=n,I.signalCode=C,Z!==null&&(clearTimeout(Z),Z=null),H&&q&&H.removeEventListener(`abort`,q),I.stdin&&!I.stdin.destroyed&&I.stdin.destroy(),F(n,C)}catch(t){I.emit(`error`,t instanceof Error?t:Error(String(t)))}C_.delete(I)}),queueMicrotask(()=>I.emit(`spawn`))}catch(n){deferEmit(I,`error`,_gioErrorToNodeError(n,H?t:W[0]??``,H?F:W.slice(1)))}return I}function spawnSync(t,n,S){let C,N;if(Array.isArray(n))C=n,N=S;else if(n!=null){if(typeof n!=`object`)throw TypeError(`The "args" argument must be of type object. Received type ${typeof n}`);C=void 0,N=n}else C=void 0,N=n;if(N!=null&&typeof N!=`object`)throw TypeError(`The "options" argument must be of type object. Received type ${typeof N}`);if(N?.argv0!==void 0&&N.argv0!==null&&typeof N.argv0!=`string`)throw TypeError(`The "options.argv0" property must be of type string. Received type ${typeof N.argv0}`);N?.cwd!==void 0&&_normalizeCwd(N.cwd);let F=C||[],I=N?.shell,H=N?.input,W;W=I?shellArgv([t,...F].join(` `),I):[t,...F];let q=N?.timeout&&N.timeout>0?N.timeout:0,Y=di.SubprocessFlags.STDOUT_PIPE|di.SubprocessFlags.STDERR_PIPE|(H?di.SubprocessFlags.STDIN_PIPE:di.SubprocessFlags.NONE),X=H;if(X!=null&&typeof X!=`string`&&!(X instanceof Uint8Array)&&!(X instanceof ArrayBuffer)&&!ArrayBuffer.isView(X))throw TypeError(`The "input" property must be of type string, Buffer, TypedArray, or DataView. Received type ${typeof X}`);let Z=N?.encoding,te=Z===`buffer`||Z==null?Xe.alloc(0):``,ne,re=0;try{({proc:ne,pid:re}=_spawnSubprocess(W,Y,N))}catch(n){let S=I?t:W[0]??``,C=I?F:W.slice(1);return{pid:0,output:[null,te,te],stdout:te,stderr:te,status:null,signal:null,error:_gioErrorToNodeError(n,S,C)}}let ie=H?new lt.Bytes(typeof H==`string`?new TextEncoder().encode(H):H):null,ae,oe,Q=null,se=!1;try{if(q>0){let t=communicateWithTimeout(ne,ie,q,()=>{killProcess(ne,N?.killSignal??`SIGTERM`)});if(se=t.timedOut,t.error)throw t.error;ae=t.stdout,oe=t.stderr}else{let t=ne.communicate(ie,null);ae=t[1]??null,oe=t[2]??null}}catch(t){Q=t instanceof Error?t:Error(String(t)),ae=null,oe=null}let ce=ae?Xe.from(gbytesToUint8Array(ae)):Xe.alloc(0),le=oe?Xe.from(gbytesToUint8Array(oe)):Xe.alloc(0),decode=t=>{if(Z===`buffer`||Z==null)return t;let n=Xe.isEncoding(Z)?Z:`utf8`;return t.toString(n)},ue=decode(ce),de=decode(le),fe=ne.get_if_exited()?ne.get_exit_status():null,pe=null;if(ne.get_if_signaled()){let t=N?.killSignal;pe=typeof t==`string`?t:`SIGTERM`}se&&(pe=typeof N?.killSignal==`string`?N.killSignal:`SIGTERM`);let me={pid:re,output:[null,ue,de],stdout:ue,stderr:de,status:se?null:fe,signal:pe};if(se){let t=Error(`Command failed: ${W.join(` `)}\n${typeof de==`string`?de:de.toString()}`);t.code=`ETIMEDOUT`,t.killed=!0,t.signal=pe,me.error=t}else Q&&(me.error=Q);return me}var GioInputStreamReadable,GioOutputStreamWritable,C_,ChildProcess,w_=__esmMin(()=>{i_(),S_(),ut(),fi(),qt(),ot(),Qi(),Hn(),$a(),GioInputStreamReadable=class extends Ki{_stream;_cancellable=new di.Cancellable;constructor(t){super(),this._stream=t}_read(t){this._stream.read_bytes_async(Math.max(t,4096),lt.PRIORITY_DEFAULT,this._cancellable,(t,n)=>{try{let t=this._stream.read_bytes_finish(n).get_data();!t||t.length===0?this.push(null):this.push(Xe.from(t))}catch(t){this._cancellable.is_cancelled()||this.destroy(t)}})}_destroy(t,n){this._cancellable.cancel(),n(t)}},GioOutputStreamWritable=class extends qi{_stream;_cancellable=new di.Cancellable;_closed=!1;constructor(t){super(),this._stream=t}_write(t,n,S){if(this._closed){S(Error(`write after end`));return}let C=typeof t==`string`?Xe.from(t):t instanceof Uint8Array?t:Xe.from(t);this._stream.write_bytes_async(new lt.Bytes(C),lt.PRIORITY_DEFAULT,this._cancellable,(t,n)=>{try{this._stream.write_bytes_finish(n),S()}catch(t){this._cancellable.is_cancelled()?S():S(t)}})}_final(t){if(this._closed){t();return}this._closed=!0;try{this._stream.close(null)}catch{}t()}_destroy(t,n){if(this._cancellable.cancel(),!this._closed){this._closed=!0;try{this._stream.close(null)}catch{}}n(t)}},C_=new Set,ChildProcess=class extends It{pid;exitCode=null;signalCode=null;killed=!1;connected=!1;stdin=null;stdout=null;stderr=null;get stdio(){return[this.stdin,this.stdout,this.stderr]}_subprocess=null;_setSubprocess(t,n){this._subprocess=t,n>0&&(this.pid=n)}kill(t){if(!this._subprocess)return!1;try{return killProcess(this._subprocess,t??`SIGTERM`),this.killed=!0,!0}catch{return!1}}ref(){return this}unref(){return this}}});function lookupEnv(t,n){let S=n.toLowerCase();for(let n of Object.keys(t))if(n.toLowerCase()===S&&t[n]!==void 0)return t[n]}function escapeCmdCommand(t){return t.replace(O_,`^$1`)}function escapeCmdArgument(t,n=!1){let S=`${t}`;return S=S.replace(/(?=(\\+?)?)\1"/g,`$1$1\\"`),S=S.replace(/(?=(\\+?)?)\1$/,`$1$1`),S=`"${S}"`,S=S.replace(O_,`^$1`),n&&(S=S.replace(O_,`^$1`)),S}function buildCmdExeInvocation(t,n,S=`cmd.exe`){let C=D_.test(t);return{cmd:S,args:[`/d`,`/s`,`/c`,`"${[escapeCmdCommand(t),...n.map(t=>escapeCmdArgument(t,C))].join(` `)}"`],windowsVerbatimArguments:!0}}function isBareName(t){return!t.includes(`/`)&&!t.includes(`\\`)&&!/\.[^.]+$/.test(t)}function findOnPath(t,n){let S=n.platform===`win32`,C=(lookupEnv(n.env,`PATH`)??``).split(S?`;`:`:`).filter(Boolean),N=S&&!/\.[^.\\/]+$/.test(t)?(lookupEnv(n.env,`PATHEXT`)??T_).split(`;`).filter(Boolean):[``];for(let S of C)for(let C of N){let N=n.join(S,t+C);if(n.exists(N))return N}}function resolveWin32Command(t,n,S){if(S.platform!==`win32`||!isBareName(t))return;let C=findOnPath(t,S);if(C)return E_.test(C)?{cmd:C,args:[...n]}:buildCmdExeInvocation(C,n,lookupEnv(S.env,`COMSPEC`)??`cmd.exe`)}var T_,E_,D_,O_,k_=__esmMin(()=>{T_=`.COM;.EXE;.BAT;.CMD`,E_=/\.(?:com|exe)$/i,D_=/node_modules[\\/]\.bin[\\/][^\\/]+\.cmd$/i,O_=/([()\][%!^"`<>&|;, *?])/g});function resolveEnv(t){if(!t.color)return t.env;let n=t.env??process.env,S=process.env.FORCE_COLOR!==void 0||process.env.NO_COLOR!==void 0?{}:{FORCE_COLOR:`1`};return{...n,...S}}function toSpawnable(t,n,S){return resolveWin32Command(t,n,{platform:process.platform,env:S??process.env,exists:existsSync,join:xn})??{cmd:t,args:[...n]}}function mapSpawnError(t,n){return t.code===`ENOENT`&&n.notFound?n.notFound(t):t}function mustBlock(t){return isGjs()&&t.completion===`return`}function spawnToCompletion(t,n,S){let C=resolveEnv(S),N=S.shell?{cmd:t,args:[...n],windowsVerbatimArguments:!1}:toSpawnable(t,n,C);if(mustBlock(S)){let t=spawnSync(N.cmd,N.args,{stdio:[`inherit`,`pipe`,`pipe`],cwd:S.cwd,env:C,shell:S.shell,maxBuffer:S.maxBuffer??A_,windowsVerbatimArguments:N.windowsVerbatimArguments});if(t.error)return Promise.reject(mapSpawnError(t.error,S));if(S.stdio===`capture`)return Promise.resolve({code:t.status,signal:t.signal??null,stdout:String(t.stdout??``),stderr:String(t.stderr??``)});let n=S.stdio===`inherit-stderr`?process.stderr:process.stdout;return t.stdout&&t.stdout.length>0&&n.write(t.stdout),t.stderr&&t.stderr.length>0&&process.stderr.write(t.stderr),Promise.resolve({code:t.status,signal:t.signal??null})}return new Promise((t,n)=>{let F=N,I={cwd:S.cwd,stdio:S.stdio===`pipe`?[`ignore`,`pipe`,`pipe`]:S.stdio===`capture`?[`inherit`,`pipe`,`pipe`]:S.stdio===`inherit-stderr`?[`inherit`,2,2]:`inherit`};S.shell&&(I.shell=!0),C&&(I.env=C),F.windowsVerbatimArguments&&(I.windowsVerbatimArguments=!0);let H=spawn(F.cmd,F.args,I);S.onSpawn?.(H);let W;if(S.stdio===`capture`){let t={stdout:``,stderr:``};W=t,H.stdout?.on(`data`,n=>t.stdout+=String(n)),H.stderr?.on(`data`,n=>t.stderr+=String(n))}H.on(`close`,(n,S)=>{t(W?{code:n,signal:S,...W}:{code:n,signal:S})}),H.on(`error`,t=>{n(mapSpawnError(t,S))})})}function describeExit(t){return t.signal===null?`code ${t.code}`:`signal ${t.signal}`}var A_,j_=__esmMin(()=>{w_(),Md(),jn(),t_(),k_(),A_=64*1024*1024});function isExampleRuntime(t){return M_.includes(t)}function buildAppForRuntime(t){return N_[t].buildApp}function requiresGjsSystemDeps(t){return buildAppForRuntime(t)===`gjs`}function isRuntimeOnPath(t){let n=toSpawnable(t,[`--version`]),S=spawnSync(n.cmd,n.args,{stdio:`ignore`,timeout:15e3,windowsVerbatimArguments:n.windowsVerbatimArguments});return!S.error&&S.status===0}function isRuntimeAvailable(t){return t===hostRuntime$1()?!0:isRuntimeOnPath(N_[t].probe)}function defaultExampleRuntime(){return isRuntimeAvailable(`gjs`)?`gjs`:hostRuntime$1()}function readDeclaredRuntimes(t){let n=t?.gjsify?.example?.runtimes;return Array.isArray(n)?n.filter(t=>typeof t==`string`&&isExampleRuntime(t)):null}function checkRuntimeSupported(t,n,S){return n===null||n.includes(t)?{ok:!0}:{ok:!1,message:`"${S}" does not support --runtime ${t}.\n Declared runtimes: ${n.length>0?n.join(`, `):`(none)`}.\n Run it on one of the declared runtimes, e.g. --runtime ${n[0]??`gjs`}.`}}var M_,N_,P_=__esmMin(()=>{w_(),t_(),j_(),M_=[`gjs`,`node`,`bun`,`deno`],N_={gjs:{probe:`gjs`,buildApp:`gjs`,launch:(t,n=[])=>[`gjs`,[`-m`,t,...n]]},node:{probe:`node`,buildApp:`node`,launch:(t,n=[])=>[`node`,[t,...n]]},bun:{probe:`bun`,buildApp:`node`,launch:(t,n=[])=>[`bun`,[t,...n]]},deno:{probe:`deno`,buildApp:`node`,launch:(t,n=[])=>[`deno`,[`run`,`-A`,`--node-modules-dir=manual`,t,...n]]}}});function isSourceDialect(t){return typeof t==`string`&&F_.includes(t)}var F_,I_,L_=__esmMin(()=>{F_=[`react-native`],I_=new Set([`gjs`,`node`])}),R_=__esmMin(()=>{}),z_=__esmMin(()=>{}),B_=__esmMin(()=>{}),V_=__esmMin(()=>{L_(),R_(),z_(),B_()});function collectPlatformEntries(t){let n=new Set;if(!t||typeof t!=`object`)return n;for(let S of U_)S!==`gjs`&&Object.prototype.hasOwnProperty.call(t,`./${S}`)&&n.add(S);return n}function findScanRoots(){let t=[],n=wn(fileURLToPath(import.meta.url));for(let S=0;S<8;S++){let S=vn(n,`packages`);existsSync(S)&&[`node`,`web`,`dom`,`framework`,`infra`].some(t=>existsSync(xn(S,t)))&&t.push({kind:`workspace`,dir:S});let C=vn(n,`node_modules`,`@gjsify`);existsSync(C)&&t.push({kind:`installed`,dir:C});let N=wn(n);if(N===n)break;n=N}try{let n=vn(process.cwd(),`node_modules`,`@gjsify`);existsSync(n)&&t.push({kind:`installed`,dir:n})}catch{}return t}function ingestPackageDirSync(t,n){let S=xn(t,`package.json`);if(existsSync(S))try{let C=readFileSync(S,`utf8`),N=JSON.parse(C),F=typeof N.name==`string`?N.name:null,I=N?.gjsify?.runtimes;if(F&&F.startsWith(`@gjsify/`)&&!n.has(F)&&I&&typeof I==`object`){let S={};for(let t of U_){let n=I[t];typeof n==`string`&&H_.has(n)&&(S[t]=n)}let C=existsSync(xn(t,`globals.mjs`)),H=collectPlatformEntries(N?.exports);n.set(F,{name:F,dir:t,runtimes:S,hasGlobals:C,platformEntries:H})}}catch{}}function getCacheSync(){if(W_)return W_;let t=findScanRoots(),n=new Map;if(t.length===0)return W_=n,W_;function walkWorkspace(t){let S;try{S=readdirSync(t,{withFileTypes:!0})}catch{return}if(existsSync(xn(t,`package.json`))){ingestPackageDirSync(t,n);return}for(let n of S)n.isDirectory()&&(n.name===`node_modules`||n.name===`lib`||n.name===`dist`||n.name.startsWith(`.`)||walkWorkspace(xn(t,n.name)))}function walkInstalled(t){let S;try{S=readdirSync(t,{withFileTypes:!0})}catch{return}for(let C of S)!C.isDirectory()&&!C.isSymbolicLink()||C.name.startsWith(`.`)||ingestPackageDirSync(xn(t,C.name),n)}for(let n of t)n.kind===`workspace`?walkWorkspace(n.dir):walkInstalled(n.dir);return W_=n,W_}function warnOnce(t,n){G_.has(t)||(G_.add(t),ge.warn(`[@gjsify/resolve-npm] ${n}`))}function resolveSlot(t,n){let S=t.runtimes[n];if(!S)return null;switch(S){case`polyfill`:return n!==`gjs`&&t.platformEntries?.has(n)?`${t.name}/${n}`:null;case`partial`:return null;case`native`:return t.hasGlobals?`${t.name}/globals`:(warnOnce(`${t.name}-${n}-native-missing-globals`,`${t.name} declares runtimes.${n}="native" but ships no globals.mjs — resolving it normally for --app ${n} builds.`),null);case`none`:return null;default:return null}}function getDerivedAliasesSync(t){if(!U_.has(t))return{};let n=getCacheSync(),S={};for(let C of n.values()){let n=resolveSlot(C,t);n!==null&&n!==C.name&&(S[C.name]=n)}return S}var H_,U_,W_,G_,K_=__esmMin(()=>{_e(),hd(),Md(),jn(),Hn(),H_=new Set([`polyfill`,`native`,`partial`,`none`]),U_=new Set([`gjs`,`node`,`browser`,`nativescript`,`react-native`]),W_=null,G_=new Set}),q_,J_,Y_=__esmMin(()=>{q_={browser:{renderer:`@gjsify/adwaita-web`,namespaces:{Adw:`1`,Gtk:`4.0`,GObject:`2.0`,Gio:`2.0`,GLib:`2.0`,GtkSource:`5`}},nativescript:{renderer:`@gjsify/adwaita-nativescript`,namespaces:{Adw:`1`,Gtk:`4.0`,GObject:`2.0`,Gio:`2.0`,GLib:`2.0`,GtkSource:`5`},specifiers:{GObject:`@gjsify/adwaita-nativescript/gobject`,GtkSource:`@gjsify/gtksource-nativescript/gtksource`}}},J_=Object.freeze(Object.keys(q_))});function withDerivedSlotRouting(t,n){let S=null,materialise=()=>{if(S)return S;let C=getDerivedAliasesSync(n),N={};for(let[n,S]of Object.entries(t))N[n]=Object.prototype.hasOwnProperty.call(C,S)?C[S]:S;return S=N,S};return new Proxy(t,{get:(n,S)=>typeof S==`string`?materialise()[S]:Reflect.get(t,S),has:(t,n)=>Reflect.has(materialise(),n),ownKeys:()=>Reflect.ownKeys(materialise()),getOwnPropertyDescriptor:(t,n)=>Reflect.getOwnPropertyDescriptor(materialise(),n)})}var X_,Z_,Q_,$_,ev,tv,nv,rv,iv,av,ov,sv=__esmMin(()=>{K_(),Y_(),X_=`assert.assert/strict.async_hooks.buffer.child_process.cluster.console.constants.crypto.dgram.diagnostics_channel.dns.dns/promises.domain.events.fs.fs/promises.http.http2.https.inspector.module.net.os.path.path/posix.path/win32.perf_hooks.process.punycode.querystring.readline.readline/promises.repl.stream.stream/web.stream/consumers.stream/promises.string_decoder.sys.test.timers.timers/promises.tls.tty.url.util.util/types.v8.vm.wasi.sqlite.worker_threads.zlib`.split(`.`),Z_=[`readable-stream`,`node-fetch`],Q_={jsdom:`@gjsify/empty`,"./polling-xhr.node.js":`./polling-xhr.js`,"./websocket.node.js":`./websocket.js`,"./globals.node.js":`./globals.js`},$_={assert:`@gjsify/assert`,"assert/strict":`@gjsify/assert/strict`,async_hooks:`@gjsify/async_hooks`,buffer:`@gjsify/buffer`,child_process:`@gjsify/child_process`,cluster:`@gjsify/cluster`,console:`@gjsify/console`,constants:`@gjsify/constants`,crypto:`@gjsify/crypto`,dgram:`@gjsify/dgram`,diagnostics_channel:`@gjsify/diagnostics_channel`,dns:`@gjsify/dns`,"dns/promises":`@gjsify/dns/promises`,domain:`@gjsify/domain`,events:`@gjsify/events`,fs:`@gjsify/fs`,"fs/promises":`@gjsify/fs/promises`,http:`@gjsify/http`,http2:`@gjsify/http2`,https:`@gjsify/https`,inspector:`@gjsify/inspector`,module:`@gjsify/module`,net:`@gjsify/net`,os:`@gjsify/os`,path:`@gjsify/path`,"path/posix":`@gjsify/path/posix`,"path/win32":`@gjsify/path/win32`,perf_hooks:`@gjsify/perf_hooks`,process:`@gjsify/process`,punycode:`@gjsify/punycode`,querystring:`@gjsify/querystring`,readline:`@gjsify/readline`,"readline/promises":`@gjsify/readline/promises`,repl:`@gjsify/repl`,stream:`@gjsify/stream`,"stream/web":`@gjsify/stream/web`,"stream/consumers":`@gjsify/stream/consumers`,"stream/promises":`@gjsify/stream/promises`,string_decoder:`@gjsify/string_decoder`,sys:`@gjsify/sys`,timers:`@gjsify/timers`,"timers/promises":`@gjsify/timers/promises`,tls:`@gjsify/tls`,tty:`@gjsify/tty`,url:`@gjsify/url`,util:`@gjsify/util`,"util/types":`@gjsify/util/types`,v8:`@gjsify/v8`,vm:`@gjsify/vm`,wasi:`@gjsify/wasi`,sqlite:`@gjsify/sqlite`,worker_threads:`@gjsify/worker_threads`,zlib:`@gjsify/zlib`,"node-fetch":`@gjsify/fetch`,ws:`@gjsify/ws`,"isomorphic-ws":`@gjsify/websocket`},ev={assert:`@gjsify/assert`,"assert/strict":`@gjsify/assert/strict`,async_hooks:`@gjsify/async_hooks`,buffer:`@gjsify/buffer`,child_process:`@gjsify/child_process/browser`,cluster:`@gjsify/empty`,console:`@gjsify/console`,constants:`@gjsify/constants`,crypto:`@gjsify/crypto/browser`,dgram:`@gjsify/empty`,diagnostics_channel:`@gjsify/diagnostics_channel`,dns:`@gjsify/dns/browser`,"dns/promises":`@gjsify/empty`,domain:`@gjsify/domain`,events:`@gjsify/events`,fs:`@gjsify/fs/browser`,"fs/promises":`@gjsify/fs/browser/promises`,http:`@gjsify/http/browser`,http2:`@gjsify/empty`,https:`@gjsify/https/browser`,inspector:`@gjsify/empty`,module:`@gjsify/module/browser`,net:`@gjsify/net/browser`,os:`@gjsify/os`,path:`@gjsify/path`,"path/posix":`@gjsify/path/posix`,"path/win32":`@gjsify/path/win32`,perf_hooks:`@gjsify/perf_hooks`,process:`@gjsify/process`,punycode:`@gjsify/punycode`,querystring:`@gjsify/querystring`,readline:`@gjsify/empty`,"readline/promises":`@gjsify/empty`,repl:`@gjsify/empty`,stream:`@gjsify/stream`,"stream/web":`@gjsify/stream/web`,"stream/consumers":`@gjsify/stream/consumers`,"stream/promises":`@gjsify/stream/promises`,string_decoder:`@gjsify/string_decoder`,sys:`@gjsify/sys`,timers:`@gjsify/timers`,"timers/promises":`@gjsify/timers/promises`,tls:`@gjsify/tls/browser`,tty:`@gjsify/empty`,url:`@gjsify/url`,util:`@gjsify/util`,"util/types":`@gjsify/util/types`,v8:`@gjsify/empty`,vm:`@gjsify/vm`,wasi:`@gjsify/empty`,sqlite:`@gjsify/sqlite/browser`,worker_threads:`@gjsify/worker_threads/browser`,zlib:`@gjsify/zlib/browser`,"node-fetch":`@gjsify/empty`,ws:`@gjsify/ws/browser`,"isomorphic-ws":`@gjsify/empty`},tv=withDerivedSlotRouting(ev,`browser`),nv={child_process:`@gjsify/empty`,cluster:`@gjsify/empty`,dgram:`@gjsify/empty`,dns:`@gjsify/empty`,"dns/promises":`@gjsify/empty`,inspector:`@gjsify/empty`,net:`@gjsify/empty`,tls:`@gjsify/empty`,tty:`@gjsify/empty`,http:`@gjsify/empty`,https:`@gjsify/empty`,http2:`@gjsify/empty`,readline:`@gjsify/empty`,repl:`@gjsify/empty`,v8:`@gjsify/empty`,vm:`@gjsify/empty`,worker_threads:`@gjsify/empty`,perf_hooks:`@gjsify/empty`,diagnostics_channel:`@gjsify/empty`,domain:`@gjsify/empty`,sqlite:`@gjsify/empty`,sys:`@gjsify/empty`,zlib:`@gjsify/empty`,assert:`@gjsify/assert`,"assert/strict":`@gjsify/assert`,async_hooks:`@gjsify/async_hooks`,buffer:`@gjsify/buffer`,module:`@gjsify/module`,crypto:`@gjsify/crypto`,events:`@gjsify/events`,fs:`@gjsify/native-fs-bridge`,"fs/promises":`@gjsify/native-fs-bridge`,os:`@gjsify/os`,path:`@gjsify/path`,"path/posix":`@gjsify/path/posix`,"path/win32":`@gjsify/path/win32`,process:`@gjsify/process`,stream:`@gjsify/stream`,"stream/promises":`@gjsify/stream/promises`,"stream/web":`@gjsify/stream/web`,string_decoder:`@gjsify/string_decoder`,url:`@gjsify/url`,util:`@gjsify/util`,"util/types":`@gjsify/util/types`,querystring:`@gjsify/querystring`,console:`@gjsify/console`,timers:`@gjsify/timers`,"timers/promises":`@gjsify/timers/promises`,"node-fetch":`@gjsify/empty`,ws:`@gjsify/empty`,"isomorphic-ws":`@gjsify/empty`},rv={"abort-controller":`@gjsify/abort-controller`,"compression-streams":`@gjsify/compression-streams`,"dom-events":`@gjsify/dom-events`,"dom-exception":`@gjsify/dom-exception`,"event-target-shim":`@gjsify/dom-events`,"message-channel":`@gjsify/message-channel`,eventsource:`@gjsify/eventsource`,fetch:`@gjsify/fetch`,formdata:`@gjsify/formdata`,"html-image-element":`@gjsify/html-image-element`,webcrypto:`@gjsify/webcrypto`,webgl:`@gjsify/webgl`,websocket:`@gjsify/websocket`,webstorage:`@gjsify/webstorage`,"abort-controller/register":`@gjsify/abort-controller/register`,"compression-streams/register":`@gjsify/compression-streams/register`,"dom-events/register":`@gjsify/dom-events/register`,"dom-events/register/event-target":`@gjsify/dom-events/register/event-target`,"dom-events/register/custom-events":`@gjsify/dom-events/register/custom-events`,"dom-events/register/ui-events":`@gjsify/dom-events/register/ui-events`,"dom-events/register/global-event-target":`@gjsify/dom-events/register/global-event-target`,"dom-exception/register":`@gjsify/dom-exception/register`,"message-channel/register":`@gjsify/message-channel/register`,"eventsource/register":`@gjsify/eventsource/register`,"websocket/register":`@gjsify/websocket/register`,"fetch/register":`@gjsify/fetch/register`,"fetch/register/fetch":`@gjsify/fetch/register/fetch`,"fetch/register/xhr":`@gjsify/fetch/register/xhr`,"webcrypto/register":`@gjsify/webcrypto/register`,"web-streams/register":`@gjsify/web-streams/register`,"web-streams/register/readable":`@gjsify/web-streams/register/readable`,"web-streams/register/writable":`@gjsify/web-streams/register/writable`,"web-streams/register/transform":`@gjsify/web-streams/register/transform`,"web-streams/register/text-streams":`@gjsify/web-streams/register/text-streams`,"web-streams/register/queuing":`@gjsify/web-streams/register/queuing`,xmlhttprequest:`@gjsify/fetch`,"xmlhttprequest/register":`@gjsify/fetch/register/xhr`,"@gjsify/xmlhttprequest":`@gjsify/fetch`,"@gjsify/xmlhttprequest/register":`@gjsify/fetch/register/xhr`,domparser:`@gjsify/domparser`,"domparser/register":`@gjsify/domparser/register`,webaudio:`@gjsify/webaudio`,"webaudio/register":`@gjsify/webaudio/register`,gamepad:`@gjsify/gamepad`,"gamepad/register":`@gjsify/gamepad/register`,webrtc:`@gjsify/webrtc`,"webrtc/register":`@gjsify/webrtc/register`,"webrtc/register/peer-connection":`@gjsify/webrtc/register/peer-connection`,"webrtc/register/data-channel":`@gjsify/webrtc/register/data-channel`,"webrtc/register/error":`@gjsify/webrtc/register/error`,"webrtc/register/media":`@gjsify/webrtc/register/media`,"webrtc/register/media-devices":`@gjsify/webrtc/register/media-devices`,webassembly:`@gjsify/webassembly`,"webassembly/register":`@gjsify/webassembly/register`,"webassembly/register/promise":`@gjsify/webassembly/register/promise`},iv={"@gjsify/node-globals":`@gjsify/empty`,"@gjsify/node-globals/register":`@gjsify/empty`,"@gjsify/node-globals/register/process":`@gjsify/empty`,"@gjsify/node-globals/register/buffer":`@gjsify/empty`,"@gjsify/node-globals/register/timers":`@gjsify/empty`,"@gjsify/node-globals/register/encoding":`@gjsify/empty`,"@gjsify/node-globals/register/url":`@gjsify/empty`,"@gjsify/node-globals/register/structured-clone":`@gjsify/empty`,"@gjsify/node-globals/register/microtask":`@gjsify/empty`,"@gjsify/node-globals/register/navigator":`@gjsify/empty`,"@gjsify/web-globals":`@gjsify/empty`,"@gjsify/web-globals/register":`@gjsify/empty`,"@gjsify/web-globals/register/performance":`@gjsify/empty`,"@gjsify/web-globals/register/formdata":`@gjsify/empty`},av={system:`@gjsify/node-gi/system`,gettext:`@gjsify/node-gi/gettext`,cairo:`@gjsify/node-gi/cairo`},ov={"abort-controller":`@gjsify/abort-controller/globals`,"compression-streams":`@gjsify/compression-streams/globals`,"dom-events":`@gjsify/dom-events`,"dom-exception":`@gjsify/dom-exception/globals`,"message-channel":`@gjsify/message-channel/globals`,eventsource:`@gjsify/eventsource`,fetch:`@gjsify/fetch/globals`,formdata:`@gjsify/formdata/globals`,"html-image-element":`@gjsify/html-image-element`,webcrypto:`@gjsify/webcrypto/globals`,webgl:`@gjsify/webgl`,websocket:`@gjsify/websocket/globals`,webstorage:`@gjsify/webstorage`,"abort-controller/register":`@gjsify/empty`,"compression-streams/register":`@gjsify/empty`,"dom-events/register":`@gjsify/empty`,"dom-events/register/event-target":`@gjsify/empty`,"dom-events/register/custom-events":`@gjsify/empty`,"dom-events/register/ui-events":`@gjsify/empty`,"dom-events/register/global-event-target":`@gjsify/empty`,"dom-exception/register":`@gjsify/empty`,"message-channel/register":`@gjsify/empty`,"eventsource/register":`@gjsify/empty`,"websocket/register":`@gjsify/empty`,"fetch/register":`@gjsify/empty`,"fetch/register/fetch":`@gjsify/empty`,"fetch/register/xhr":`@gjsify/empty`,"webcrypto/register":`@gjsify/empty`,"web-streams/register":`@gjsify/empty`,"web-streams/register/readable":`@gjsify/empty`,"web-streams/register/writable":`@gjsify/empty`,"web-streams/register/transform":`@gjsify/empty`,"web-streams/register/text-streams":`@gjsify/empty`,"web-streams/register/queuing":`@gjsify/empty`,"@gjsify/abort-controller/register":`@gjsify/empty`,"@gjsify/compression-streams/register":`@gjsify/empty`,"@gjsify/dom-events/register":`@gjsify/empty`,"@gjsify/dom-events/register/event-target":`@gjsify/empty`,"@gjsify/dom-events/register/custom-events":`@gjsify/empty`,"@gjsify/dom-events/register/ui-events":`@gjsify/empty`,"@gjsify/dom-events/register/global-event-target":`@gjsify/empty`,"@gjsify/dom-exception/register":`@gjsify/empty`,"@gjsify/message-channel/register":`@gjsify/empty`,"@gjsify/eventsource/register":`@gjsify/empty`,"@gjsify/websocket/register":`@gjsify/empty`,"@gjsify/fetch/register":`@gjsify/empty`,"@gjsify/fetch/register/fetch":`@gjsify/empty`,"@gjsify/fetch/register/xhr":`@gjsify/empty`,"@gjsify/webcrypto/register":`@gjsify/empty`,"@gjsify/web-streams/register":`@gjsify/empty`,"@gjsify/web-streams/register/readable":`@gjsify/empty`,"@gjsify/web-streams/register/writable":`@gjsify/empty`,"@gjsify/web-streams/register/transform":`@gjsify/empty`,"@gjsify/web-streams/register/text-streams":`@gjsify/empty`,"@gjsify/web-streams/register/queuing":`@gjsify/empty`,"@gjsify/dom-elements/register":`@gjsify/empty`,"@gjsify/dom-elements/register/document":`@gjsify/empty`,"@gjsify/dom-elements/register/canvas":`@gjsify/empty`,"@gjsify/dom-elements/register/image":`@gjsify/empty`,"@gjsify/dom-elements/register/observers":`@gjsify/empty`,"@gjsify/dom-elements/register/font-face":`@gjsify/empty`,"@gjsify/dom-elements/register/match-media":`@gjsify/empty`,"@gjsify/dom-elements/register/location":`@gjsify/empty`,"@gjsify/dom-elements/register/navigator":`@gjsify/empty`,"@gjsify/canvas2d/register":`@gjsify/empty`,"@gjsify/iframe/register":`@gjsify/empty`,"@gjsify/webgl/register":`@gjsify/empty`,"@gjsify/buffer/register":`@gjsify/empty`,xmlhttprequest:`@gjsify/empty`,"xmlhttprequest/register":`@gjsify/empty`,"@gjsify/xmlhttprequest":`@gjsify/empty`,"@gjsify/xmlhttprequest/register":`@gjsify/empty`,domparser:`@gjsify/empty`,"domparser/register":`@gjsify/empty`,"@gjsify/domparser/register":`@gjsify/empty`,webaudio:`@gjsify/empty`,"webaudio/register":`@gjsify/empty`,"@gjsify/webaudio/register":`@gjsify/empty`,gamepad:`@gjsify/empty`,"gamepad/register":`@gjsify/empty`,"@gjsify/gamepad/register":`@gjsify/empty`,webrtc:`@gjsify/empty`,"webrtc/register":`@gjsify/empty`,"webrtc/register/peer-connection":`@gjsify/empty`,"webrtc/register/data-channel":`@gjsify/empty`,"webrtc/register/error":`@gjsify/empty`,"webrtc/register/media":`@gjsify/empty`,"webrtc/register/media-devices":`@gjsify/empty`,"@gjsify/webrtc":`@gjsify/empty`,"@gjsify/webrtc/register":`@gjsify/empty`,"@gjsify/webrtc/register/peer-connection":`@gjsify/empty`,"@gjsify/webrtc/register/data-channel":`@gjsify/empty`,"@gjsify/webrtc/register/error":`@gjsify/empty`,"@gjsify/webrtc/register/media":`@gjsify/empty`,"@gjsify/webrtc/register/media-devices":`@gjsify/empty`,webassembly:`@gjsify/webassembly/globals`,"webassembly/register":`@gjsify/empty`,"webassembly/register/promise":`@gjsify/empty`,"@gjsify/webassembly/register":`@gjsify/empty`,"@gjsify/webassembly/register/promise":`@gjsify/empty`}}),setNodeAliasPrefix,getAliasesGeneralForGjs,getAliasesNodeForGjs,getAliasesWebForGjs,getAliasesGeneralForNode,getAliasesGjsForNode,getAliasesWebForNode,getAliasesForGjs,getAliasesForNode,cv=__esmMin(()=>{sv(),setNodeAliasPrefix=t=>{for(let n in t){if(n.startsWith(`node:`))continue;let S=`node:${n}`;t[S]||(t[S]=t[n])}return t},getAliasesGeneralForGjs=t=>Q_,getAliasesNodeForGjs=t=>setNodeAliasPrefix($_),getAliasesWebForGjs=t=>rv,getAliasesGeneralForNode=t=>iv,getAliasesGjsForNode=t=>av,getAliasesWebForNode=t=>ov,getAliasesForGjs=t=>({...getDerivedAliasesSync(`gjs`),...getAliasesGeneralForGjs(t),...getAliasesNodeForGjs(t),...getAliasesWebForGjs(t)}),getAliasesForNode=t=>({...getDerivedAliasesSync(`node`),...getAliasesGeneralForNode(t),...getAliasesGjsForNode(t),...getAliasesWebForNode(t)}),[...X_,...X_.map(t=>`node:${t}`)],[...Z_]}),lv=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.splitWhen=t.flatten=void 0;function flatten(t){return t.reduce((t,n)=>[].concat(t,n),[])}t.flatten=flatten;function splitWhen(t,n){let S=[[]],C=0;for(let N of t)n(N)?(C++,S[C]=[]):S[C].push(N);return S}t.splitWhen=splitWhen})),uv=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isEnoentCodeError=void 0;function isEnoentCodeError(t){return t.code===`ENOENT`}t.isEnoentCodeError=isEnoentCodeError})),dv=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDirentFromStats=void 0;var DirentFromStats=class{constructor(t,n){this.name=t,this.isBlockDevice=n.isBlockDevice.bind(n),this.isCharacterDevice=n.isCharacterDevice.bind(n),this.isDirectory=n.isDirectory.bind(n),this.isFIFO=n.isFIFO.bind(n),this.isFile=n.isFile.bind(n),this.isSocket=n.isSocket.bind(n),this.isSymbolicLink=n.isSymbolicLink.bind(n)}};function createDirentFromStats(t,n){return new DirentFromStats(t,n)}t.createDirentFromStats=createDirentFromStats})),fv=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.convertPosixPathToPattern=t.convertWindowsPathToPattern=t.convertPathToPattern=t.escapePosixPath=t.escapeWindowsPath=t.escape=t.removeLeadingDotSegment=t.makeAbsolute=t.unixify=void 0;let n=(Dg(),__toCommonJS(yg)),S=(jn(),__toCommonJS(gn)),C=n.platform()===`win32`,N=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,F=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,I=/^\\\\([.?])/,H=/\\(?![!()+@[\]{}])/g;function unixify(t){return t.replace(/\\/g,`/`)}t.unixify=unixify;function makeAbsolute(t,n){return S.resolve(t,n)}t.makeAbsolute=makeAbsolute;function removeLeadingDotSegment(t){if(t.charAt(0)===`.`){let n=t.charAt(1);if(n===`/`||n===`\\`)return t.slice(2)}return t}t.removeLeadingDotSegment=removeLeadingDotSegment,t.escape=C?escapeWindowsPath:escapePosixPath;function escapeWindowsPath(t){return t.replace(F,`\\$2`)}t.escapeWindowsPath=escapeWindowsPath;function escapePosixPath(t){return t.replace(N,`\\$2`)}t.escapePosixPath=escapePosixPath,t.convertPathToPattern=C?convertWindowsPathToPattern:convertPosixPathToPattern;function convertWindowsPathToPattern(t){return escapeWindowsPath(t).replace(I,`//$1`).replace(H,`/`)}t.convertWindowsPathToPattern=convertWindowsPathToPattern;function convertPosixPathToPattern(t){return escapePosixPath(t)}t.convertPosixPathToPattern=convertPosixPathToPattern})),pv=__commonJSMin(((t,n)=>{
651
+ `)} (same as ${I+1}.)`)}}getSearchPlacesForDir(t,n){return(t.isGlobalConfig?n:this.config.searchPlaces).map(n=>N.default.join(t.path,n))}getGlobalConfigDir(){return(0,S.default)(this.config.moduleName,{suffix:``}).config}*getGlobalDirs(t){let n=N.default.resolve(this.config.stopDir??C.default.homedir());yield{path:t,isGlobalConfig:!1};let S=t;for(;S!==n;){let t=N.default.dirname(S);if(t===S)break;yield{path:t,isGlobalConfig:!1},S=t}yield{path:this.getGlobalConfigDir(),isGlobalConfig:!0}}};t.ExplorerBase=ExplorerBase;function getExtensionDescription(t){return t?`extension "${t}"`:`files without extensions`}})),Zg=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.hasOwn=void 0,t.mergeAll=mergeAll,t.hasOwn=Function.prototype.call.bind(Object.prototype.hasOwnProperty);let n=Function.prototype.call.bind(Object.prototype.toString);function isPlainObject(t){return n(t)===`[object Object]`}function merge(n,S,C){for(let N of Object.keys(S)){if(N===`__proto__`||N===`constructor`)continue;let F=S[N];if((0,t.hasOwn)(n,N)){if(Array.isArray(n[N])&&Array.isArray(F)){if(C.mergeArrays){n[N].push(...F);continue}}else if(isPlainObject(n[N])&&isPlainObject(F)){n[N]=merge(n[N],F,C);continue}}n[N]=F}return n}function mergeAll(t,n){return t.reduce((t,S)=>merge(t,S,n),{})}})),Qg=__commonJSMin((t=>{var n=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.Explorer=void 0;let S=n((hd(),__toCommonJS(fd))),C=n((jn(),__toCommonJS(gn))),N=qg(),F=Xg(),I=Zg(),H=Yg();var Explorer=class extends F.ExplorerBase{async load(t){t=C.default.resolve(t);let load=async()=>await this.config.transform(await this.#e(t));return this.loadCache?await(0,H.emplace)(this.loadCache,t,load):await load()}async search(t=``){if(this.config.metaConfigFilePath){this.loadingMetaConfig=!0;let t=await this.load(this.config.metaConfigFilePath);if(this.loadingMetaConfig=!1,t&&!t.isEmpty)return t}t=C.default.resolve(t);let n=this.#i(t),S=await n.next();if(S.done)throw Error(`Could not find any folders to iterate through (start from ${t})`);let F=S.value,search=async()=>{if(await(0,H.isDirectory)(F.path))for(let t of this.getSearchPlacesForDir(F,N.globalConfigSearchPlaces))try{let n=await this.#e(t);if(n!==null&&!(n.isEmpty&&this.config.ignoreEmptySearchPlaces))return await this.config.transform(n)}catch(t){if(t.code===`ENOENT`||t.code===`EISDIR`||t.code===`ENOTDIR`||t.code===`EACCES`)continue;throw t}let t=await n.next();return t.done?await this.config.transform(null):(F=t.value,this.searchCache?await(0,H.emplace)(this.searchCache,F.path,search):await search())};return this.searchCache?await(0,H.emplace)(this.searchCache,t,search):await search()}async#e(t,n=[]){let C=await S.default.readFile(t,{encoding:`utf-8`});return this.toCosmiconfigResult(t,await this.#t(t,C,n))}async#t(t,n,S){let N=await this.#n(t,n);if(!N||!(0,I.hasOwn)(N,`$import`))return N;let F=C.default.dirname(t),{$import:H,...W}=N,q=Array.isArray(H)?H:[H],Y=[...S,t];this.validateImports(t,q,Y);let X=await Promise.all(q.map(async t=>{let n=C.default.resolve(F,t);return(await this.#e(n,Y))?.config}));return(0,I.mergeAll)([...X,W],{mergeArrays:this.config.mergeImportArrays})}async#n(t,n){if(n.trim()===``)return;let S=C.default.extname(t),N=this.config.loaders[S||`noExt`]??this.config.loaders.default;if(!N)throw Error(`No loader specified for ${(0,F.getExtensionDescription)(S)}`);try{let F=await N(t,n);return C.default.basename(t,S)===`package`?(0,H.getPropertyByPath)(F,this.config.packageProp??this.config.moduleName)??null:F}catch(n){throw n.filepath=t,n}}async#r(t){try{return await S.default.stat(t),!0}catch{return!1}}async*#i(t){switch(this.config.searchStrategy){case`none`:yield{path:t,isGlobalConfig:!1};return;case`project`:{let n=t;for(;;){yield{path:n,isGlobalConfig:!1};let t=!1;for(let S of[`json`,`yaml`]){let N=C.default.join(n,`package.${S}`);if(await this.#r(N)){t=!0;break}}if(t)return;let S=C.default.dirname(n);if(S===n)return;n=S}}case`global`:yield*this.getGlobalDirs(t)}}};t.Explorer=Explorer})),$g=__commonJSMin((t=>{var n=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.ExplorerSync=void 0;let S=n((Md(),__toCommonJS(Ad))),C=n((jn(),__toCommonJS(gn))),N=qg(),F=Xg(),I=Zg(),H=Yg();var ExplorerSync=class extends F.ExplorerBase{load(t){t=C.default.resolve(t);let load=()=>this.config.transform(this.#e(t));return this.loadCache?(0,H.emplace)(this.loadCache,t,load):load()}search(t=``){if(this.config.metaConfigFilePath){this.loadingMetaConfig=!0;let t=this.load(this.config.metaConfigFilePath);if(this.loadingMetaConfig=!1,t&&!t.isEmpty)return t}t=C.default.resolve(t);let n=this.#i(t),S=n.next();if(S.done)throw Error(`Could not find any folders to iterate through (start from ${t})`);let F=S.value,search=()=>{if((0,H.isDirectorySync)(F.path))for(let t of this.getSearchPlacesForDir(F,N.globalConfigSearchPlacesSync))try{let n=this.#e(t);if(n!==null&&!(n.isEmpty&&this.config.ignoreEmptySearchPlaces))return this.config.transform(n)}catch(t){if(t.code===`ENOENT`||t.code===`EISDIR`||t.code===`ENOTDIR`||t.code===`EACCES`)continue;throw t}let t=n.next();return t.done?this.config.transform(null):(F=t.value,this.searchCache?(0,H.emplace)(this.searchCache,F.path,search):search())};return this.searchCache?(0,H.emplace)(this.searchCache,t,search):search()}#e(t,n=[]){let C=S.default.readFileSync(t,`utf8`);return this.toCosmiconfigResult(t,this.#t(t,C,n))}#t(t,n,S){let N=this.#n(t,n);if(!N||!(0,I.hasOwn)(N,`$import`))return N;let F=C.default.dirname(t),{$import:H,...W}=N,q=Array.isArray(H)?H:[H],Y=[...S,t];this.validateImports(t,q,Y);let X=q.map(t=>{let n=C.default.resolve(F,t);return this.#e(n,Y)?.config});return(0,I.mergeAll)([...X,W],{mergeArrays:this.config.mergeImportArrays})}#n(t,n){if(n.trim()===``)return;let S=C.default.extname(t),N=this.config.loaders[S||`noExt`]??this.config.loaders.default;if(!N)throw Error(`No loader specified for ${(0,F.getExtensionDescription)(S)}`);try{let F=N(t,n);return C.default.basename(t,S)===`package`?(0,H.getPropertyByPath)(F,this.config.packageProp??this.config.moduleName)??null:F}catch(n){throw n.filepath=t,n}}#r(t){try{return S.default.statSync(t),!0}catch{return!1}}*#i(t){switch(this.config.searchStrategy){case`none`:yield{path:t,isGlobalConfig:!1};return;case`project`:{let n=t;for(;;){yield{path:n,isGlobalConfig:!1};let t=!1;for(let S of[`json`,`yaml`]){let N=C.default.join(n,`package.${S}`);if(this.#r(N)){t=!0;break}}if(t)return;let S=C.default.dirname(n);if(S===n)return;n=S}}case`global`:yield*this.getGlobalDirs(t)}}loadSync(t){return this.load(t)}searchSync(t=``){return this.search(t)}};t.ExplorerSync=ExplorerSync})),e_=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultLoadersSync=t.defaultLoaders=t.globalConfigSearchPlacesSync=t.globalConfigSearchPlaces=t.getDefaultSearchPlacesSync=t.getDefaultSearchPlaces=void 0,t.cosmiconfig=cosmiconfig;let n=qg();Object.defineProperty(t,"defaultLoaders",{enumerable:!0,get:function(){return n.defaultLoaders}}),Object.defineProperty(t,"defaultLoadersSync",{enumerable:!0,get:function(){return n.defaultLoadersSync}}),Object.defineProperty(t,"getDefaultSearchPlaces",{enumerable:!0,get:function(){return n.getDefaultSearchPlaces}}),Object.defineProperty(t,"getDefaultSearchPlacesSync",{enumerable:!0,get:function(){return n.getDefaultSearchPlacesSync}}),Object.defineProperty(t,"globalConfigSearchPlaces",{enumerable:!0,get:function(){return n.globalConfigSearchPlaces}}),Object.defineProperty(t,"globalConfigSearchPlacesSync",{enumerable:!0,get:function(){return n.globalConfigSearchPlacesSync}});let S=Qg(),C=$g(),N=Yg(),F=function identity(t){return t};function getUserDefinedOptionsFromMetaConfig(){let t=new C.ExplorerSync({moduleName:`cosmiconfig`,stopDir:process.cwd(),searchPlaces:n.metaSearchPlaces,ignoreEmptySearchPlaces:!1,applyPackagePropertyPathToConfiguration:!0,loaders:n.defaultLoaders,transform:F,cache:!0,metaConfigFilePath:null,mergeImportArrays:!0,mergeSearchPlaces:!0,searchStrategy:`none`}).search();if(!t)return null;if(t.config?.loaders)throw Error(`Can not specify loaders in meta config file`);if(t.config?.searchStrategy)throw Error(`Can not specify searchStrategy in meta config file`);let S={mergeSearchPlaces:!0,...t.config??{}};return{config:(0,N.removeUndefinedValuesFromObject)(S),filepath:t.filepath}}function getResolvedSearchPlaces(t,n,S){let C=S.searchPlaces?.map(n=>n.replace(`{name}`,t));return S.mergeSearchPlaces?[...C??[],...n]:C??n}function mergeOptionsBase(t,n,S){let C=getUserDefinedOptionsFromMetaConfig();if(!C)return{...n,...(0,N.removeUndefinedValuesFromObject)(S),loaders:{...n.loaders,...S.loaders}};let F=C.config,I=S.searchPlaces??n.searchPlaces;return{...n,...(0,N.removeUndefinedValuesFromObject)(S),metaConfigFilePath:C.filepath,...F,searchPlaces:getResolvedSearchPlaces(t,I,F),loaders:{...n.loaders,...S.loaders}}}function validateOptions(t){if(t.searchStrategy!=null&&t.searchStrategy!==`global`&&t.stopDir)throw Error('Can not supply `stopDir` option with `searchStrategy` other than "global"')}function mergeOptions(t,S){return validateOptions(S),mergeOptionsBase(t,{moduleName:t,searchPlaces:(0,n.getDefaultSearchPlaces)(t),ignoreEmptySearchPlaces:!0,cache:!0,transform:F,loaders:n.defaultLoaders,metaConfigFilePath:null,mergeImportArrays:!0,mergeSearchPlaces:!0,searchStrategy:S.stopDir?`global`:`none`},S)}function cosmiconfig(t,n={}){let C=mergeOptions(t,n),N=new S.Explorer(C);return{search:N.search.bind(N),load:N.load.bind(N),clearLoadCache:N.clearLoadCache.bind(N),clearSearchCache:N.clearSearchCache.bind(N),clearCaches:N.clearCaches.bind(N)}}}));function isBun(){return globalThis.Bun!==void 0}function isDeno(){return globalThis.Deno!==void 0}function isGjs(){return globalThis.imports?.gi!==void 0}function hostRuntime$1(){return isBun()?`bun`:isDeno()?`deno`:isGjs()?`gjs`:`node`}function isNode(){return isBun()||isDeno()||isGjs()?!1:typeof globalThis.process?.versions?.node==`string`}function gjsSystemVersion(){return globalThis.imports?.system?.version}function gjsExit(t){let n=globalThis.imports?.system;return n?.exit?(n.exit(t),!0):!1}var t_=__esmMin(()=>{__name$1(hostRuntime$1,`hostRuntime`)}),n_,__exportAll,r_=__esmMin(()=>{n_=Object.defineProperty,__exportAll=(t,n)=>{let S={};for(var C in t)n_(S,C,{get:t[C],enumerable:!0});return n||n_(S,Symbol.toStringTag,{value:`Module`}),S}});function communicateWithTimeout(t,n,S,C){let N={stdout:null,stderr:null,timedOut:!1,error:null},F=lt.MainContext.new(),I=null,H=!1;F.push_thread_default();try{for(t.communicate_async(n,null,(n,S)=>{try{let n=t.communicate_finish(S);N.stdout=n[1]??null,N.stderr=n[2]??null}catch(t){N.error=t}H=!0}),I=lt.timeout_source_new(S),I.set_callback(()=>(N.timedOut=!0,C(),lt.SOURCE_REMOVE)),I.attach(F);!H;)F.iteration(!0)}finally{I!==null&&I.destroy(),F.pop_thread_default()}return N}var i_=__esmMin(()=>{ut()});function defaultShell$1(){return o_===null&&(o_=!lt.file_test(`/bin/sh`,lt.FileTest.IS_EXECUTABLE)&&lt.file_test(`/system/bin/sh`,lt.FileTest.IS_EXECUTABLE)?`/system/bin/sh`:`/bin/sh`),o_}function shellArgv$2(t,n){return[typeof n==`string`&&n.length>0?n:defaultShell$1(),`-c`,t]}function argv0Shell(){return s_===void 0&&(s_=lt.find_program_in_path(`bash`)??lt.find_program_in_path(`zsh`)),s_??defaultShell$1()}function applyArgv0$2(t,n){return[argv0Shell(),`-c`,`exec -a "$0" "$@"`,t,...n]}function detachedPrefix$2(){return c_===void 0&&(c_=lt.find_program_in_path(`setsid`)),c_===null?null:[c_]}function killProcess$4(t,n,S){let C=n??`SIGTERM`;if(C===`SIGKILL`||C===9){t.force_exit();return}let N=typeof C==`number`?C:S[C]??S.SIGTERM;t.send_signal(N)}var a_,o_,s_,c_,l_=__esmMin(()=>{ut(),a_=Object.freeze({SIGHUP:1,SIGINT:2,SIGQUIT:3,SIGILL:4,SIGTRAP:5,SIGABRT:6,SIGIOT:6,SIGFPE:8,SIGKILL:9,SIGSEGV:11,SIGPIPE:13,SIGALRM:14,SIGTERM:15,SIGXCPU:24,SIGXFSZ:25,SIGVTALRM:26,SIGPROF:27,SIGWINCH:28}),o_=null,__name$1(defaultShell$1,`defaultShell`),__name$1(shellArgv$2,`shellArgv`),__name$1(applyArgv0$2,`applyArgv0`),__name$1(detachedPrefix$2,`detachedPrefix`),__name$1(killProcess$4,`killProcess`)});function killProcess$3(t,n){killProcess$4(t,n,d_)}var u_,d_,f_=__esmMin(()=>{r_(),l_(),u_=__exportAll({SIGNALS:()=>d_,applyArgv0:()=>applyArgv0$2,defaultShell:()=>defaultShell$1,detachedPrefix:()=>detachedPrefix$2,killProcess:()=>killProcess$3,shellArgv:()=>shellArgv$2}),d_=Object.freeze({...a_,SIGEMT:7,SIGBUS:10,SIGSYS:12,SIGURG:16,SIGSTOP:17,SIGTSTP:18,SIGCONT:19,SIGCHLD:20,SIGTTIN:21,SIGTTOU:22,SIGIO:23,SIGUSR1:30,SIGUSR2:31}),__name$1(killProcess$3,`killProcess`)});function killProcess$2(t,n){killProcess$4(t,n,m_)}var p_,m_,h_=__esmMin(()=>{r_(),l_(),p_=__exportAll({SIGNALS:()=>m_,applyArgv0:()=>applyArgv0$2,defaultShell:()=>defaultShell$1,detachedPrefix:()=>detachedPrefix$2,killProcess:()=>killProcess$2,shellArgv:()=>shellArgv$2}),m_=Object.freeze({...a_,SIGBUS:7,SIGUSR1:10,SIGUSR2:12,SIGCHLD:17,SIGCONT:18,SIGSTOP:19,SIGTSTP:20,SIGTTIN:21,SIGTTOU:22,SIGURG:23,SIGIO:29,SIGPOLL:29,SIGPWR:30,SIGSYS:31}),__name$1(killProcess$2,`killProcess`)});function defaultShell(){return lt.getenv(`ComSpec`)||`cmd.exe`}function shellArgv$1(t,n){let S=typeof n==`string`&&n.length>0?n:defaultShell();return __.test(S)?[S,`/d`,`/s`,`/c`,`"${t}"`]:[S,`-c`,t]}function detachedPrefix$1(){return null}function applyArgv0$1(t,n){let S=Error(`options.argv0 (${t}) is not supported on Windows: GSubprocess cannot decouple the executable path from the child's argv[0]`);throw S.code=`ERR_UNSUPPORTED_OPERATION`,S}function killProcess$1(t,n){t.force_exit()}var g_,__,v_,y_=__esmMin(()=>{r_(),ut(),g_=__exportAll({SIGNALS:()=>v_,applyArgv0:()=>applyArgv0$1,defaultShell:()=>defaultShell,detachedPrefix:()=>detachedPrefix$1,killProcess:()=>killProcess$1,shellArgv:()=>shellArgv$1}),__=/^(?:.*\\)?cmd(?:\.exe)?$/i,__name$1(shellArgv$1,`shellArgv`),__name$1(detachedPrefix$1,`detachedPrefix`),__name$1(applyArgv0$1,`applyArgv0`),__name$1(killProcess$1,`killProcess`),v_=Object.freeze({SIGINT:2,SIGKILL:9,SIGTERM:15})});function detectPlatform(){return x_===null&&(x_=lt.get_current_dir().startsWith(`/`)?lt.file_test(`/proc/self/status`,lt.FileTest.EXISTS)?!lt.file_test(`/bin/sh`,lt.FileTest.IS_EXECUTABLE)&&lt.file_test(`/system/bin/sh`,lt.FileTest.IS_EXECUTABLE)?`android`:`linux`:lt.file_test(`/System/Library/CoreServices/SystemVersion.plist`,lt.FileTest.EXISTS)?`darwin`:`posix`:`win32`),x_}function ops(){switch(detectPlatform()){case`win32`:return g_;case`darwin`:return u_;case`linux`:case`android`:return p_;default:return b_}}function shellArgv(t,n){return ops().shellArgv(t,n)}function detachedPrefix(){return ops().detachedPrefix()}function applyArgv0(t,n){return ops().applyArgv0(t,n)}function killProcess(t,n){ops().killProcess(t,n)}var b_,x_,S_=__esmMin(()=>{l_(),f_(),h_(),y_(),ut(),b_={defaultShell:defaultShell$1,shellArgv:shellArgv$2,detachedPrefix:detachedPrefix$2,applyArgv0:applyArgv0$2,killProcess:(t,n)=>killProcess$4(t,n,a_),SIGNALS:a_},x_=null});function _gioErrorToNodeError(t,n,S){let C=t??Error(`Unknown spawn error`),N=C,F=C.code,I=C.matches,H=!1;if(typeof I==`function`)try{H=I.call(C,lt.SpawnError,lt.SpawnError.NOENT)===!0}catch{}if(!H&&F===lt.SpawnError.NOENT&&(H=!0),!H&&typeof C.message==`string`&&/No such file or directory|ENOENT|Failed to execute|nicht gefunden|nicht ausgeführt/i.test(C.message)&&(H=!0),H){let t=Error(`spawn ${n} ENOENT`);return t.code=`ENOENT`,t.errno=-2,t.syscall=`spawn ${n}`,t.path=n,t.spawnargs=S.slice(),t}if(C instanceof Error)return N;let W=C,q=typeof W.message==`string`?W.message:String(C),Y=Error(q);return(typeof F==`number`||typeof F==`string`)&&(Y.code=F),Y}function _normalizeCwd(t){if(t!=null){if(typeof t==`string`)return t;if(typeof t==`object`&&t&&typeof t.href==`string`&&typeof t.protocol==`string`){let n=t;if(n.protocol!==`file:`)throw TypeError(`The URL must be of scheme file:; received '${n.protocol}' for 'options.cwd'`);return fileURLToPath(n)}return t instanceof Uint8Array?new TextDecoder().decode(t):String(t)}}function _encodeEnvValue(t){if(t!==void 0)return`${t}`}function _spawnSubprocess(t,n,S){let C=new di.SubprocessLauncher({flags:n}),N=_normalizeCwd(S?.cwd);if(N!==void 0&&C.set_cwd(N),S?.env){let t=S.env;C.set_environ([]);let n=new Set;for(let S in t){if(n.has(S))continue;n.add(S);let N=_encodeEnvValue(t[S]);N!==void 0&&C.setenv(S,N,!0)}}let F=t;if(S?.argv0!==void 0&&S.argv0!==null){if(typeof S.argv0!=`string`)throw TypeError(`The "options.argv0" property must be of type string. Received type ${typeof S.argv0}`);F=applyArgv0(S.argv0,t)}if(S?.detached===!0){let t=detachedPrefix();t!==null&&(F=[...t,...F])}let I=C.spawnv(F);return{proc:I,pid:_capturePidAtSpawn(I)}}function _capturePidAtSpawn(t){let n=t.get_identifier();if(n){let t=parseInt(n,10);if(t>0)return t}return 0}function _watchStdioForClose(t){let n=[t.stdout,t.stderr].filter(t=>t!==null);if(n.length===0)return(n,S)=>{t.emit(`exit`,n,S),t.emit(`close`,n,S)};let S=n.length,C=!1,N=null,F=null,closeIfDone=()=>{C&&S===0&&t.emit(`close`,N,F)};for(let t of n){let n=!1,settleOnce=()=>{n||(n=!0,--S,closeIfDone())};t.once(`end`,settleOnce),t.once(`close`,settleOnce)}return(S,I)=>{N=S,F=I,C=!0,t.emit(`exit`,S,I),queueMicrotask(()=>{for(let t of n)t.destroyed||t.readableEnded||t.listenerCount(`data`)>0||t.listenerCount(`readable`)>0||t.resume()}),closeIfDone()}}function _communicateSync(t,n,S,C){if(S<=0){let S=t.communicate(n,null);return{stdout:S[1]??null,stderr:S[2]??null,timedOut:!1}}let N=communicateWithTimeout(t,n,S,()=>{killProcess(t,C??`SIGTERM`)});if(N.error)throw N.error;return{stdout:N.stdout,stderr:N.stderr,timedOut:N.timedOut}}function _syncTimeoutError(t,n,S,C,N){let F=n?gbytesToUint8Array(n):new Uint8Array,I=S?gbytesToUint8Array(S):new Uint8Array,H=new TextDecoder().decode(I),W=Error(`Command failed: ${t}\n${H}`);return W.code=`ETIMEDOUT`,W.killed=!0,W.signal=typeof N==`string`?N:`SIGTERM`,W.status=null,C===`buffer`||C===null?(W.stdout=Xe.from(F),W.stderr=Xe.from(I)):(W.stdout=new TextDecoder().decode(F),W.stderr=H),W}function _decodeExecOutput(t,n){let S=t??new Uint8Array;if(n===`buffer`||n===null)return Xe.from(S);let C=n&&Xe.isEncoding(n)?n:`utf8`;return Xe.from(S).toString(C)}function _normalizeKillSignal(t){return t??`SIGTERM`}function _absorbExecError(){}function _execImpl(t,n,S,C,N){t.on(`error`,_absorbExecError);let F=null,I=!1,H=null,W=null,armTimeout=n=>{N.timeoutMs&&(F=setTimeout(()=>{I=!0;try{killProcess(n,N.killSignal)}catch{}t.killed=!0},N.timeoutMs))},disarmTimeout=()=>{F!==null&&(clearTimeout(F),F=null)},armAbort=n=>{if(!N.abortSignal)return;let fire=()=>{H=Error(`The operation was aborted`),H.name=`AbortError`;try{killProcess(n,N.killSignal)}catch{}t.killed=!0};if(N.abortSignal.aborted){queueMicrotask(fire);return}W=fire,N.abortSignal.addEventListener(`abort`,W,{once:!0})},disarmAbort=()=>{N.abortSignal&&W&&(N.abortSignal.removeEventListener(`abort`,W),W=null)};try{let{proc:F,pid:W}=_spawnSubprocess(n,S,C);t._setSubprocess(F,W),C_.add(t),ensureMainLoop(),armTimeout(F),armAbort(F);let q=_watchStdioForClose(t);F.communicate_async(null,null,(n,S)=>{disarmTimeout(),disarmAbort(),C_.delete(t);try{let[,n,C]=F.communicate_finish(S),W=n?gbytesToUint8Array(n):null,Y=C?gbytesToUint8Array(C):null,X=null;N.maxBuffer!==1/0&&W&&W.length>N.maxBuffer&&(W=W.subarray(0,N.maxBuffer),X=RangeError(`stdout maxBuffer length exceeded`),X.code=`ERR_CHILD_PROCESS_STDIO_MAXBUFFER`),!X&&N.maxBuffer!==1/0&&Y&&Y.length>N.maxBuffer&&(Y=Y.subarray(0,N.maxBuffer),X=RangeError(`stderr maxBuffer length exceeded`),X.code=`ERR_CHILD_PROCESS_STDIO_MAXBUFFER`);let Z=_decodeExecOutput(W,N.encoding),te=_decodeExecOutput(Y,N.encoding),ne=F.get_if_exited()?F.get_exit_status():null,re=F.get_if_signaled()?typeof N.killSignal==`string`?N.killSignal:`SIGTERM`:null;t.exitCode=ne,t.signalCode=re;let ie=null;if(H)ie=H,ie.killed=!0,ie.signal=re,ie.stdout=Z,ie.stderr=te,ie.cmd=N.cmd;else if(X)ie=X,ie.killed=t.killed,ie.signal=re,ie.stdout=Z,ie.stderr=te,ie.cmd=N.cmd;else if(I)ie=Error(`Command failed: ${N.cmd}`),ie.killed=!0,ie.code=null,ie.signal=typeof N.killSignal==`string`?N.killSignal:`SIGTERM`,ie.stdout=Z,ie.stderr=te,ie.cmd=N.cmd;else if(ne!==0&&ne!==null){let n=typeof te==`string`?te:te.toString();ie=Error(`Command failed: ${N.cmd}\n${n}`),ie.code=ne,ie.killed=t.killed,ie.signal=re,ie.stdout=Z,ie.stderr=te,ie.cmd=N.cmd}else re&&(ie=Error(`Command failed: ${N.cmd}`),ie.killed=!0,ie.signal=re,ie.code=null,ie.stdout=Z,ie.stderr=te,ie.cmd=N.cmd);N.callback&&N.callback(ie,Z,te),q(ne,re)}catch(n){let S=n instanceof Error?n:Error(String(n));N.callback&&N.callback(S,``,``),t.emit(`error`,S)}}),queueMicrotask(()=>t.emit(`spawn`))}catch(S){disarmTimeout(),disarmAbort();let C=_gioErrorToNodeError(S,n[0]??``,n.slice(1));setTimeout(()=>{N.callback&&N.callback(C,``,``),t.emit(`error`,C)},0)}return t}function execFile(t,n,S,C){let N=[],F={},I;typeof n==`function`?I=n:Array.isArray(n)?(N=n,typeof S==`function`?I=S:(F=S||{},I=C)):n&&typeof n==`object`&&(F=n,I=typeof S==`function`?S:C);let H=new ChildProcess,W=di.SubprocessFlags.STDOUT_PIPE|di.SubprocessFlags.STDERR_PIPE,q=F.maxBuffer??1024*1024,Y=F.timeout&&F.timeout>0?F.timeout:0,X=_normalizeKillSignal(F.killSignal);return _execImpl(H,[t,...N],W,F,{cmd:t,encoding:F.encoding,maxBuffer:q,timeoutMs:Y,killSignal:X,abortSignal:F.signal,callback:I})}function execFileSync(t,n,S){let C=[],N;Array.isArray(n)?(C=n,N=S):n&&typeof n==`object`&&(N=n);let F=N?.encoding,I=N?.input,H=di.SubprocessFlags.STDOUT_PIPE|di.SubprocessFlags.STDERR_PIPE|(I?di.SubprocessFlags.STDIN_PIPE:di.SubprocessFlags.NONE),W;try{({proc:W}=_spawnSubprocess([t,...C],H,N))}catch(n){throw _gioErrorToNodeError(n,t,C)}let q=I?new lt.Bytes(typeof I==`string`?new TextEncoder().encode(I):I):null,Y=N?.timeout&&N.timeout>0?N.timeout:0,{stdout:X,stderr:Z,timedOut:te}=_communicateSync(W,q,Y,N?.killSignal);if(te)throw _syncTimeoutError(`${t} ${C.join(` `)}`.trim(),X,Z,F,N?.killSignal);let ne=W.get_exit_status();if(ne!==0){let n=Z?new TextDecoder().decode(gbytesToUint8Array(Z)):``,S=X?new TextDecoder().decode(gbytesToUint8Array(X)):``,N=Error(`Command failed: ${t} ${C.join(` `)}`);throw N.status=ne,F===`buffer`||F===null?(N.stderr=Z?Xe.from(gbytesToUint8Array(Z)):Xe.alloc(0),N.stdout=X?Xe.from(gbytesToUint8Array(X)):Xe.alloc(0)):(N.stderr=n,N.stdout=S),N}if(!X)return F===`buffer`||F==null?Xe.alloc(0):``;let re=gbytesToUint8Array(X);if(F===`buffer`||F==null)return Xe.from(re);let ie=Xe.isEncoding(F)?F:`utf8`;return Xe.from(re).toString(ie)}function spawn(t,n,S){let C,N;if(Array.isArray(n))C=n,N=S;else if(n!=null){if(typeof n!=`object`)throw TypeError(`The "args" argument must be of type object. Received type ${typeof n}`);C=void 0,N=n}else C=void 0,N=n;if(N!=null&&typeof N!=`object`)throw TypeError(`The "options" argument must be of type object. Received type ${typeof N}`);if(N?.argv0!==void 0&&N.argv0!==null&&typeof N.argv0!=`string`)throw TypeError(`The "options.argv0" property must be of type string. Received type ${typeof N.argv0}`);N?.cwd!==void 0&&_normalizeCwd(N.cwd);let F=C||[],I=new ChildProcess,H=N?.shell,W;W=H?shellArgv([t,...F].join(` `),H):[t,...F];let q=N?.stdio,Y=Array.isArray(q)?[typeof q[0]==`string`?q[0]:`pipe`,typeof q[1]==`string`?q[1]:`pipe`,typeof q[2]==`string`?q[2]:`pipe`]:typeof q==`string`?[q,q,q]:[`pipe`,`pipe`,`pipe`],X=di.SubprocessFlags.NONE;Y[0]===`pipe`?X|=di.SubprocessFlags.STDIN_PIPE:Y[0]===`inherit`&&(X|=di.SubprocessFlags.STDIN_INHERIT),Y[1]===`pipe`&&(X|=di.SubprocessFlags.STDOUT_PIPE),Y[1]===`ignore`&&(X|=di.SubprocessFlags.STDOUT_SILENCE),Y[2]===`pipe`&&(X|=di.SubprocessFlags.STDERR_PIPE),Y[2]===`ignore`&&(X|=di.SubprocessFlags.STDERR_SILENCE);try{let{proc:t,pid:n}=_spawnSubprocess(W,X,N);if(I._setSubprocess(t,n),C_.add(I),Y[0]===`pipe`){let n=t.get_stdin_pipe();n&&(I.stdin=new GioOutputStreamWritable(n))}let S=t.get_stdout_pipe();S&&(I.stdout=new GioInputStreamReadable(S));let C=t.get_stderr_pipe();C&&(I.stderr=new GioInputStreamReadable(C));let F=_watchStdioForClose(I),H=N?.signal,q=null,emitAbortError=()=>{let t=N?.killSignal??`SIGTERM`;I.kill(t);let n=Error(`The operation was aborted`);n.name=`AbortError`,I.emit(`error`,n)};H&&(H.aborted?queueMicrotask(emitAbortError):(q=emitAbortError,H.addEventListener(`abort`,q,{once:!0})));let Z=null;if(N?.timeout&&N.timeout>0){let t=N.killSignal??`SIGTERM`;Z=setTimeout(()=>{I.kill(t),Z=null},N.timeout)}ensureMainLoop(),t.wait_async(null,(n,S)=>{try{t.wait_finish(S);let n=t.get_if_exited()?t.get_exit_status():null,C=null;if(t.get_if_signaled()){let t=N?.killSignal;C=typeof t==`string`?t:`SIGTERM`}I.exitCode=n,I.signalCode=C,Z!==null&&(clearTimeout(Z),Z=null),H&&q&&H.removeEventListener(`abort`,q),I.stdin&&!I.stdin.destroyed&&I.stdin.destroy(),F(n,C)}catch(t){I.emit(`error`,t instanceof Error?t:Error(String(t)))}C_.delete(I)}),queueMicrotask(()=>I.emit(`spawn`))}catch(n){deferEmit(I,`error`,_gioErrorToNodeError(n,H?t:W[0]??``,H?F:W.slice(1)))}return I}function spawnSync(t,n,S){let C,N;if(Array.isArray(n))C=n,N=S;else if(n!=null){if(typeof n!=`object`)throw TypeError(`The "args" argument must be of type object. Received type ${typeof n}`);C=void 0,N=n}else C=void 0,N=n;if(N!=null&&typeof N!=`object`)throw TypeError(`The "options" argument must be of type object. Received type ${typeof N}`);if(N?.argv0!==void 0&&N.argv0!==null&&typeof N.argv0!=`string`)throw TypeError(`The "options.argv0" property must be of type string. Received type ${typeof N.argv0}`);N?.cwd!==void 0&&_normalizeCwd(N.cwd);let F=C||[],I=N?.shell,H=N?.input,W;W=I?shellArgv([t,...F].join(` `),I):[t,...F];let q=N?.timeout&&N.timeout>0?N.timeout:0,Y=di.SubprocessFlags.STDOUT_PIPE|di.SubprocessFlags.STDERR_PIPE|(H?di.SubprocessFlags.STDIN_PIPE:di.SubprocessFlags.NONE),X=H;if(X!=null&&typeof X!=`string`&&!(X instanceof Uint8Array)&&!(X instanceof ArrayBuffer)&&!ArrayBuffer.isView(X))throw TypeError(`The "input" property must be of type string, Buffer, TypedArray, or DataView. Received type ${typeof X}`);let Z=N?.encoding,te=Z===`buffer`||Z==null?Xe.alloc(0):``,ne,re=0;try{({proc:ne,pid:re}=_spawnSubprocess(W,Y,N))}catch(n){let S=I?t:W[0]??``,C=I?F:W.slice(1);return{pid:0,output:[null,te,te],stdout:te,stderr:te,status:null,signal:null,error:_gioErrorToNodeError(n,S,C)}}let ie=H?new lt.Bytes(typeof H==`string`?new TextEncoder().encode(H):H):null,ae,oe,Q=null,se=!1;try{if(q>0){let t=communicateWithTimeout(ne,ie,q,()=>{killProcess(ne,N?.killSignal??`SIGTERM`)});if(se=t.timedOut,t.error)throw t.error;ae=t.stdout,oe=t.stderr}else{let t=ne.communicate(ie,null);ae=t[1]??null,oe=t[2]??null}}catch(t){Q=t instanceof Error?t:Error(String(t)),ae=null,oe=null}let ce=ae?Xe.from(gbytesToUint8Array(ae)):Xe.alloc(0),le=oe?Xe.from(gbytesToUint8Array(oe)):Xe.alloc(0),decode=t=>{if(Z===`buffer`||Z==null)return t;let n=Xe.isEncoding(Z)?Z:`utf8`;return t.toString(n)},ue=decode(ce),de=decode(le),fe=ne.get_if_exited()?ne.get_exit_status():null,pe=null;if(ne.get_if_signaled()){let t=N?.killSignal;pe=typeof t==`string`?t:`SIGTERM`}se&&(pe=typeof N?.killSignal==`string`?N.killSignal:`SIGTERM`);let me={pid:re,output:[null,ue,de],stdout:ue,stderr:de,status:se?null:fe,signal:pe};if(se){let t=Error(`Command failed: ${W.join(` `)}\n${typeof de==`string`?de:de.toString()}`);t.code=`ETIMEDOUT`,t.killed=!0,t.signal=pe,me.error=t}else Q&&(me.error=Q);return me}var GioInputStreamReadable,GioOutputStreamWritable,C_,ChildProcess,w_=__esmMin(()=>{i_(),S_(),ut(),fi(),qt(),ot(),Qi(),Hn(),$a(),GioInputStreamReadable=class extends Ki{_stream;_cancellable=new di.Cancellable;constructor(t){super(),this._stream=t}_read(t){this._stream.read_bytes_async(Math.max(t,4096),lt.PRIORITY_DEFAULT,this._cancellable,(t,n)=>{try{let t=this._stream.read_bytes_finish(n).get_data();!t||t.length===0?this.push(null):this.push(Xe.from(t))}catch(t){this._cancellable.is_cancelled()||this.destroy(t)}})}_destroy(t,n){this._cancellable.cancel(),n(t)}},GioOutputStreamWritable=class extends qi{_stream;_cancellable=new di.Cancellable;_closed=!1;constructor(t){super(),this._stream=t}_write(t,n,S){if(this._closed){S(Error(`write after end`));return}let C=typeof t==`string`?Xe.from(t):t instanceof Uint8Array?t:Xe.from(t);this._stream.write_bytes_async(new lt.Bytes(C),lt.PRIORITY_DEFAULT,this._cancellable,(t,n)=>{try{this._stream.write_bytes_finish(n),S()}catch(t){this._cancellable.is_cancelled()?S():S(t)}})}_final(t){if(this._closed){t();return}this._closed=!0;try{this._stream.close(null)}catch{}t()}_destroy(t,n){if(this._cancellable.cancel(),!this._closed){this._closed=!0;try{this._stream.close(null)}catch{}}n(t)}},C_=new Set,ChildProcess=class extends It{pid;exitCode=null;signalCode=null;killed=!1;connected=!1;stdin=null;stdout=null;stderr=null;get stdio(){return[this.stdin,this.stdout,this.stderr]}_subprocess=null;_setSubprocess(t,n){this._subprocess=t,n>0&&(this.pid=n)}kill(t){if(!this._subprocess)return!1;try{return killProcess(this._subprocess,t??`SIGTERM`),this.killed=!0,!0}catch{return!1}}ref(){return this}unref(){return this}}});function lookupEnv(t,n){let S=n.toLowerCase();for(let n of Object.keys(t))if(n.toLowerCase()===S&&t[n]!==void 0)return t[n]}function escapeCmdCommand(t){return t.replace(O_,`^$1`)}function escapeCmdArgument(t,n=!1){let S=`${t}`;return S=S.replace(/(?=(\\+?)?)\1"/g,`$1$1\\"`),S=S.replace(/(?=(\\+?)?)\1$/,`$1$1`),S=`"${S}"`,S=S.replace(O_,`^$1`),n&&(S=S.replace(O_,`^$1`)),S}function buildCmdExeInvocation(t,n,S=`cmd.exe`){let C=D_.test(t);return{cmd:S,args:[`/d`,`/s`,`/c`,`"${[escapeCmdCommand(t),...n.map(t=>escapeCmdArgument(t,C))].join(` `)}"`],windowsVerbatimArguments:!0}}function isBareName(t){return!t.includes(`/`)&&!t.includes(`\\`)&&!/\.[^.]+$/.test(t)}function findOnPath(t,n){let S=n.platform===`win32`,C=(lookupEnv(n.env,`PATH`)??``).split(S?`;`:`:`).filter(Boolean),N=S&&!/\.[^.\\/]+$/.test(t)?(lookupEnv(n.env,`PATHEXT`)??T_).split(`;`).filter(Boolean):[``];for(let S of C)for(let C of N){let N=n.join(S,t+C);if(n.exists(N))return N}}function resolveWin32Command(t,n,S){if(S.platform!==`win32`||!isBareName(t))return;let C=findOnPath(t,S);if(C)return E_.test(C)?{cmd:C,args:[...n]}:buildCmdExeInvocation(C,n,lookupEnv(S.env,`COMSPEC`)??`cmd.exe`)}var T_,E_,D_,O_,k_=__esmMin(()=>{T_=`.COM;.EXE;.BAT;.CMD`,E_=/\.(?:com|exe)$/i,D_=/node_modules[\\/]\.bin[\\/][^\\/]+\.cmd$/i,O_=/([()\][%!^"`<>&|;, *?])/g});function resolveEnv(t){if(!t.color)return t.env;let n=t.env??process.env,S=process.env.FORCE_COLOR!==void 0||process.env.NO_COLOR!==void 0?{}:{FORCE_COLOR:`1`};return{...n,...S}}function toSpawnable(t,n,S){return resolveWin32Command(t,n,{platform:process.platform,env:S??process.env,exists:existsSync,join:xn})??{cmd:t,args:[...n]}}function mapSpawnError(t,n){return t.code===`ENOENT`&&n.notFound?n.notFound(t):t}function mustBlock(t){return isGjs()&&t.completion===`return`}function spawnToCompletion(t,n,S){let C=resolveEnv(S),N=S.shell?{cmd:t,args:[...n],windowsVerbatimArguments:!1}:toSpawnable(t,n,C);if(mustBlock(S)){let t=spawnSync(N.cmd,N.args,{stdio:[`inherit`,`pipe`,`pipe`],cwd:S.cwd,env:C,shell:S.shell,maxBuffer:S.maxBuffer??A_,windowsVerbatimArguments:N.windowsVerbatimArguments});if(t.error)return Promise.reject(mapSpawnError(t.error,S));if(S.stdio===`capture`)return Promise.resolve({code:t.status,signal:t.signal??null,stdout:String(t.stdout??``),stderr:String(t.stderr??``)});let n=S.stdio===`inherit-stderr`?process.stderr:process.stdout;return t.stdout&&t.stdout.length>0&&n.write(t.stdout),t.stderr&&t.stderr.length>0&&process.stderr.write(t.stderr),Promise.resolve({code:t.status,signal:t.signal??null})}return new Promise((t,n)=>{let F=N,I={cwd:S.cwd,stdio:S.stdio===`pipe`?[`ignore`,`pipe`,`pipe`]:S.stdio===`capture`?[`inherit`,`pipe`,`pipe`]:S.stdio===`inherit-stderr`?[`inherit`,2,2]:`inherit`};S.shell&&(I.shell=!0),C&&(I.env=C),F.windowsVerbatimArguments&&(I.windowsVerbatimArguments=!0);let H=spawn(F.cmd,F.args,I);S.onSpawn?.(H);let W;if(S.stdio===`capture`){let t={stdout:``,stderr:``};W=t,H.stdout?.on(`data`,n=>t.stdout+=String(n)),H.stderr?.on(`data`,n=>t.stderr+=String(n))}H.on(`close`,(n,S)=>{t(W?{code:n,signal:S,...W}:{code:n,signal:S})}),H.on(`error`,t=>{n(mapSpawnError(t,S))})})}function describeExit(t){return t.signal===null?`code ${t.code}`:`signal ${t.signal}`}var A_,j_=__esmMin(()=>{w_(),Md(),jn(),t_(),k_(),A_=64*1024*1024});function isExampleRuntime(t){return M_.includes(t)}function buildAppForRuntime(t){return N_[t].buildApp}function requiresGjsSystemDeps(t){return buildAppForRuntime(t)===`gjs`}function isRuntimeOnPath(t){let n=toSpawnable(t,[`--version`]),S=spawnSync(n.cmd,n.args,{stdio:`ignore`,timeout:15e3,windowsVerbatimArguments:n.windowsVerbatimArguments});return!S.error&&S.status===0}function isRuntimeAvailable(t){return t===hostRuntime$1()?!0:isRuntimeOnPath(N_[t].probe)}function defaultExampleRuntime(){return isRuntimeAvailable(`gjs`)?`gjs`:hostRuntime$1()}function readDeclaredRuntimes(t){let n=t?.gjsify?.example?.runtimes;return Array.isArray(n)?n.filter(t=>typeof t==`string`&&isExampleRuntime(t)):null}function checkRuntimeSupported(t,n,S){return n===null||n.includes(t)?{ok:!0}:{ok:!1,message:`"${S}" does not support --runtime ${t}.\n Declared runtimes: ${n.length>0?n.join(`, `):`(none)`}.\n Run it on one of the declared runtimes, e.g. --runtime ${n[0]??`gjs`}.`}}var M_,N_,P_=__esmMin(()=>{w_(),t_(),j_(),M_=[`gjs`,`node`,`bun`,`deno`],N_={gjs:{probe:`gjs`,buildApp:`gjs`,launch:(t,n=[])=>[`gjs`,[`-m`,t,...n]]},node:{probe:`node`,buildApp:`node`,launch:(t,n=[])=>[`node`,[t,...n]]},bun:{probe:`bun`,buildApp:`node`,launch:(t,n=[])=>[`bun`,[t,...n]]},deno:{probe:`deno`,buildApp:`node`,launch:(t,n=[])=>[`deno`,[`run`,`-A`,`--node-modules-dir=manual`,t,...n]]}}});function isSourceDialect(t){return typeof t==`string`&&F_.includes(t)}var F_,I_,L_=__esmMin(()=>{F_=[`react-native`],I_=new Set([`gjs`,`node`])}),R_=__esmMin(()=>{}),z_=__esmMin(()=>{}),B_=__esmMin(()=>{}),V_=__esmMin(()=>{L_(),R_(),z_(),B_()});function collectPlatformEntries(t){let n=new Set;if(!t||typeof t!=`object`)return n;for(let S of U_)S!==`gjs`&&Object.prototype.hasOwnProperty.call(t,`./${S}`)&&n.add(S);return n}function findScanRoots(){let t=[],n=wn(fileURLToPath(import.meta.url));for(let S=0;S<8;S++){let S=vn(n,`packages`);existsSync(S)&&[`node`,`web`,`dom`,`framework`,`infra`].some(t=>existsSync(xn(S,t)))&&t.push({kind:`workspace`,dir:S});let C=vn(n,`node_modules`,`@gjsify`);existsSync(C)&&t.push({kind:`installed`,dir:C});let N=wn(n);if(N===n)break;n=N}try{let n=vn(process.cwd(),`node_modules`,`@gjsify`);existsSync(n)&&t.push({kind:`installed`,dir:n})}catch{}return t}function ingestPackageDirSync(t,n){let S=xn(t,`package.json`);if(existsSync(S))try{let C=readFileSync(S,`utf8`),N=JSON.parse(C),F=typeof N.name==`string`?N.name:null,I=N?.gjsify?.runtimes;if(F&&F.startsWith(`@gjsify/`)&&!n.has(F)&&I&&typeof I==`object`){let S={};for(let t of U_){let n=I[t];typeof n==`string`&&H_.has(n)&&(S[t]=n)}let C=existsSync(xn(t,`globals.mjs`)),H=collectPlatformEntries(N?.exports);n.set(F,{name:F,dir:t,runtimes:S,hasGlobals:C,platformEntries:H})}}catch{}}function getCacheSync(){if(W_)return W_;let t=findScanRoots(),n=new Map;if(t.length===0)return W_=n,W_;function walkWorkspace(t){let S;try{S=readdirSync(t,{withFileTypes:!0})}catch{return}if(existsSync(xn(t,`package.json`))){ingestPackageDirSync(t,n);return}for(let n of S)n.isDirectory()&&(n.name===`node_modules`||n.name===`lib`||n.name===`dist`||n.name.startsWith(`.`)||walkWorkspace(xn(t,n.name)))}function walkInstalled(t){let S;try{S=readdirSync(t,{withFileTypes:!0})}catch{return}for(let C of S)!C.isDirectory()&&!C.isSymbolicLink()||C.name.startsWith(`.`)||ingestPackageDirSync(xn(t,C.name),n)}for(let n of t)n.kind===`workspace`?walkWorkspace(n.dir):walkInstalled(n.dir);return W_=n,W_}function warnOnce(t,n){G_.has(t)||(G_.add(t),ge.warn(`[@gjsify/resolve-npm] ${n}`))}function resolveSlot(t,n){let S=t.runtimes[n];if(!S)return null;switch(S){case`polyfill`:return n!==`gjs`&&t.platformEntries?.has(n)?`${t.name}/${n}`:null;case`partial`:return null;case`native`:return t.hasGlobals?`${t.name}/globals`:(warnOnce(`${t.name}-${n}-native-missing-globals`,`${t.name} declares runtimes.${n}="native" but ships no globals.mjs — resolving it normally for --app ${n} builds.`),null);case`none`:return null;default:return null}}function getDerivedAliasesSync(t){if(!U_.has(t))return{};let n=getCacheSync(),S={};for(let C of n.values()){let n=resolveSlot(C,t);n!==null&&n!==C.name&&(S[C.name]=n)}return S}var H_,U_,W_,G_,K_=__esmMin(()=>{_e(),hd(),Md(),jn(),Hn(),H_=new Set([`polyfill`,`native`,`partial`,`none`]),U_=new Set([`gjs`,`node`,`browser`,`nativescript`,`react-native`]),W_=null,G_=new Set}),q_,J_,Y_=__esmMin(()=>{q_={browser:{renderer:`@gjsify/adwaita-web`,namespaces:{Adw:`1`,Gtk:`4.0`,GObject:`2.0`,Gio:`2.0`,GLib:`2.0`,Gdk:`4.0`,GtkSource:`5`}},nativescript:{renderer:`@gjsify/adwaita-nativescript`,namespaces:{Adw:`1`,Gtk:`4.0`,GObject:`2.0`,Gio:`2.0`,GLib:`2.0`,Gdk:`4.0`,GtkSource:`5`},specifiers:{GObject:`@gjsify/adwaita-nativescript/gobject`,GtkSource:`@gjsify/gtksource-nativescript/gtksource`}}},J_=Object.freeze(Object.keys(q_))});function withDerivedSlotRouting(t,n){let S=null,materialise=()=>{if(S)return S;let C=getDerivedAliasesSync(n),N={};for(let[n,S]of Object.entries(t))N[n]=Object.prototype.hasOwnProperty.call(C,S)?C[S]:S;return S=N,S};return new Proxy(t,{get:(n,S)=>typeof S==`string`?materialise()[S]:Reflect.get(t,S),has:(t,n)=>Reflect.has(materialise(),n),ownKeys:()=>Reflect.ownKeys(materialise()),getOwnPropertyDescriptor:(t,n)=>Reflect.getOwnPropertyDescriptor(materialise(),n)})}var X_,Z_,Q_,$_,ev,tv,nv,rv,iv,av,ov,sv=__esmMin(()=>{K_(),Y_(),X_=`assert.assert/strict.async_hooks.buffer.child_process.cluster.console.constants.crypto.dgram.diagnostics_channel.dns.dns/promises.domain.events.fs.fs/promises.http.http2.https.inspector.module.net.os.path.path/posix.path/win32.perf_hooks.process.punycode.querystring.readline.readline/promises.repl.stream.stream/web.stream/consumers.stream/promises.string_decoder.sys.test.timers.timers/promises.tls.tty.url.util.util/types.v8.vm.wasi.sqlite.worker_threads.zlib`.split(`.`),Z_=[`readable-stream`,`node-fetch`],Q_={jsdom:`@gjsify/empty`,"./polling-xhr.node.js":`./polling-xhr.js`,"./websocket.node.js":`./websocket.js`,"./globals.node.js":`./globals.js`},$_={assert:`@gjsify/assert`,"assert/strict":`@gjsify/assert/strict`,async_hooks:`@gjsify/async_hooks`,buffer:`@gjsify/buffer`,child_process:`@gjsify/child_process`,cluster:`@gjsify/cluster`,console:`@gjsify/console`,constants:`@gjsify/constants`,crypto:`@gjsify/crypto`,dgram:`@gjsify/dgram`,diagnostics_channel:`@gjsify/diagnostics_channel`,dns:`@gjsify/dns`,"dns/promises":`@gjsify/dns/promises`,domain:`@gjsify/domain`,events:`@gjsify/events`,fs:`@gjsify/fs`,"fs/promises":`@gjsify/fs/promises`,http:`@gjsify/http`,http2:`@gjsify/http2`,https:`@gjsify/https`,inspector:`@gjsify/inspector`,module:`@gjsify/module`,net:`@gjsify/net`,os:`@gjsify/os`,path:`@gjsify/path`,"path/posix":`@gjsify/path/posix`,"path/win32":`@gjsify/path/win32`,perf_hooks:`@gjsify/perf_hooks`,process:`@gjsify/process`,punycode:`@gjsify/punycode`,querystring:`@gjsify/querystring`,readline:`@gjsify/readline`,"readline/promises":`@gjsify/readline/promises`,repl:`@gjsify/repl`,stream:`@gjsify/stream`,"stream/web":`@gjsify/stream/web`,"stream/consumers":`@gjsify/stream/consumers`,"stream/promises":`@gjsify/stream/promises`,string_decoder:`@gjsify/string_decoder`,sys:`@gjsify/sys`,timers:`@gjsify/timers`,"timers/promises":`@gjsify/timers/promises`,tls:`@gjsify/tls`,tty:`@gjsify/tty`,url:`@gjsify/url`,util:`@gjsify/util`,"util/types":`@gjsify/util/types`,v8:`@gjsify/v8`,vm:`@gjsify/vm`,wasi:`@gjsify/wasi`,sqlite:`@gjsify/sqlite`,worker_threads:`@gjsify/worker_threads`,zlib:`@gjsify/zlib`,"node-fetch":`@gjsify/fetch`,ws:`@gjsify/ws`,"isomorphic-ws":`@gjsify/websocket`},ev={assert:`@gjsify/assert`,"assert/strict":`@gjsify/assert/strict`,async_hooks:`@gjsify/async_hooks`,buffer:`@gjsify/buffer`,child_process:`@gjsify/child_process/browser`,cluster:`@gjsify/empty`,console:`@gjsify/console`,constants:`@gjsify/constants`,crypto:`@gjsify/crypto/browser`,dgram:`@gjsify/empty`,diagnostics_channel:`@gjsify/diagnostics_channel`,dns:`@gjsify/dns/browser`,"dns/promises":`@gjsify/empty`,domain:`@gjsify/domain`,events:`@gjsify/events`,fs:`@gjsify/fs/browser`,"fs/promises":`@gjsify/fs/browser/promises`,http:`@gjsify/http/browser`,http2:`@gjsify/empty`,https:`@gjsify/https/browser`,inspector:`@gjsify/empty`,module:`@gjsify/module/browser`,net:`@gjsify/net/browser`,os:`@gjsify/os`,path:`@gjsify/path`,"path/posix":`@gjsify/path/posix`,"path/win32":`@gjsify/path/win32`,perf_hooks:`@gjsify/perf_hooks`,process:`@gjsify/process`,punycode:`@gjsify/punycode`,querystring:`@gjsify/querystring`,readline:`@gjsify/empty`,"readline/promises":`@gjsify/empty`,repl:`@gjsify/empty`,stream:`@gjsify/stream`,"stream/web":`@gjsify/stream/web`,"stream/consumers":`@gjsify/stream/consumers`,"stream/promises":`@gjsify/stream/promises`,string_decoder:`@gjsify/string_decoder`,sys:`@gjsify/sys`,timers:`@gjsify/timers`,"timers/promises":`@gjsify/timers/promises`,tls:`@gjsify/tls/browser`,tty:`@gjsify/empty`,url:`@gjsify/url`,util:`@gjsify/util`,"util/types":`@gjsify/util/types`,v8:`@gjsify/empty`,vm:`@gjsify/vm`,wasi:`@gjsify/empty`,sqlite:`@gjsify/sqlite/browser`,worker_threads:`@gjsify/worker_threads/browser`,zlib:`@gjsify/zlib/browser`,"node-fetch":`@gjsify/empty`,ws:`@gjsify/ws/browser`,"isomorphic-ws":`@gjsify/empty`},tv=withDerivedSlotRouting(ev,`browser`),nv={child_process:`@gjsify/empty`,cluster:`@gjsify/empty`,dgram:`@gjsify/empty`,dns:`@gjsify/empty`,"dns/promises":`@gjsify/empty`,inspector:`@gjsify/empty`,net:`@gjsify/empty`,tls:`@gjsify/empty`,tty:`@gjsify/empty`,http:`@gjsify/empty`,https:`@gjsify/empty`,http2:`@gjsify/empty`,readline:`@gjsify/empty`,repl:`@gjsify/empty`,v8:`@gjsify/empty`,vm:`@gjsify/empty`,worker_threads:`@gjsify/empty`,perf_hooks:`@gjsify/empty`,diagnostics_channel:`@gjsify/empty`,domain:`@gjsify/empty`,sqlite:`@gjsify/empty`,sys:`@gjsify/empty`,zlib:`@gjsify/empty`,assert:`@gjsify/assert`,"assert/strict":`@gjsify/assert`,async_hooks:`@gjsify/async_hooks`,buffer:`@gjsify/buffer`,module:`@gjsify/module`,crypto:`@gjsify/crypto`,events:`@gjsify/events`,fs:`@gjsify/native-fs-bridge`,"fs/promises":`@gjsify/native-fs-bridge`,os:`@gjsify/os`,path:`@gjsify/path`,"path/posix":`@gjsify/path/posix`,"path/win32":`@gjsify/path/win32`,process:`@gjsify/process`,stream:`@gjsify/stream`,"stream/promises":`@gjsify/stream/promises`,"stream/web":`@gjsify/stream/web`,string_decoder:`@gjsify/string_decoder`,url:`@gjsify/url`,util:`@gjsify/util`,"util/types":`@gjsify/util/types`,querystring:`@gjsify/querystring`,console:`@gjsify/console`,timers:`@gjsify/timers`,"timers/promises":`@gjsify/timers/promises`,"node-fetch":`@gjsify/empty`,ws:`@gjsify/empty`,"isomorphic-ws":`@gjsify/empty`},rv={"abort-controller":`@gjsify/abort-controller`,"compression-streams":`@gjsify/compression-streams`,"dom-events":`@gjsify/dom-events`,"dom-exception":`@gjsify/dom-exception`,"event-target-shim":`@gjsify/dom-events`,"message-channel":`@gjsify/message-channel`,eventsource:`@gjsify/eventsource`,fetch:`@gjsify/fetch`,formdata:`@gjsify/formdata`,"html-image-element":`@gjsify/html-image-element`,webcrypto:`@gjsify/webcrypto`,webgl:`@gjsify/webgl`,websocket:`@gjsify/websocket`,webstorage:`@gjsify/webstorage`,"abort-controller/register":`@gjsify/abort-controller/register`,"compression-streams/register":`@gjsify/compression-streams/register`,"dom-events/register":`@gjsify/dom-events/register`,"dom-events/register/event-target":`@gjsify/dom-events/register/event-target`,"dom-events/register/custom-events":`@gjsify/dom-events/register/custom-events`,"dom-events/register/ui-events":`@gjsify/dom-events/register/ui-events`,"dom-events/register/global-event-target":`@gjsify/dom-events/register/global-event-target`,"dom-exception/register":`@gjsify/dom-exception/register`,"message-channel/register":`@gjsify/message-channel/register`,"eventsource/register":`@gjsify/eventsource/register`,"websocket/register":`@gjsify/websocket/register`,"fetch/register":`@gjsify/fetch/register`,"fetch/register/fetch":`@gjsify/fetch/register/fetch`,"fetch/register/xhr":`@gjsify/fetch/register/xhr`,"webcrypto/register":`@gjsify/webcrypto/register`,"web-streams/register":`@gjsify/web-streams/register`,"web-streams/register/readable":`@gjsify/web-streams/register/readable`,"web-streams/register/writable":`@gjsify/web-streams/register/writable`,"web-streams/register/transform":`@gjsify/web-streams/register/transform`,"web-streams/register/text-streams":`@gjsify/web-streams/register/text-streams`,"web-streams/register/queuing":`@gjsify/web-streams/register/queuing`,xmlhttprequest:`@gjsify/fetch`,"xmlhttprequest/register":`@gjsify/fetch/register/xhr`,"@gjsify/xmlhttprequest":`@gjsify/fetch`,"@gjsify/xmlhttprequest/register":`@gjsify/fetch/register/xhr`,domparser:`@gjsify/domparser`,"domparser/register":`@gjsify/domparser/register`,webaudio:`@gjsify/webaudio`,"webaudio/register":`@gjsify/webaudio/register`,gamepad:`@gjsify/gamepad`,"gamepad/register":`@gjsify/gamepad/register`,webrtc:`@gjsify/webrtc`,"webrtc/register":`@gjsify/webrtc/register`,"webrtc/register/peer-connection":`@gjsify/webrtc/register/peer-connection`,"webrtc/register/data-channel":`@gjsify/webrtc/register/data-channel`,"webrtc/register/error":`@gjsify/webrtc/register/error`,"webrtc/register/media":`@gjsify/webrtc/register/media`,"webrtc/register/media-devices":`@gjsify/webrtc/register/media-devices`,webassembly:`@gjsify/webassembly`,"webassembly/register":`@gjsify/webassembly/register`,"webassembly/register/promise":`@gjsify/webassembly/register/promise`},iv={"@gjsify/node-globals":`@gjsify/empty`,"@gjsify/node-globals/register":`@gjsify/empty`,"@gjsify/node-globals/register/process":`@gjsify/empty`,"@gjsify/node-globals/register/buffer":`@gjsify/empty`,"@gjsify/node-globals/register/timers":`@gjsify/empty`,"@gjsify/node-globals/register/encoding":`@gjsify/empty`,"@gjsify/node-globals/register/url":`@gjsify/empty`,"@gjsify/node-globals/register/structured-clone":`@gjsify/empty`,"@gjsify/node-globals/register/microtask":`@gjsify/empty`,"@gjsify/node-globals/register/navigator":`@gjsify/empty`,"@gjsify/web-globals":`@gjsify/empty`,"@gjsify/web-globals/register":`@gjsify/empty`,"@gjsify/web-globals/register/performance":`@gjsify/empty`,"@gjsify/web-globals/register/formdata":`@gjsify/empty`},av={system:`@gjsify/node-gi/system`,gettext:`@gjsify/node-gi/gettext`,cairo:`@gjsify/node-gi/cairo`},ov={"abort-controller":`@gjsify/abort-controller/globals`,"compression-streams":`@gjsify/compression-streams/globals`,"dom-events":`@gjsify/dom-events`,"dom-exception":`@gjsify/dom-exception/globals`,"message-channel":`@gjsify/message-channel/globals`,eventsource:`@gjsify/eventsource`,fetch:`@gjsify/fetch/globals`,formdata:`@gjsify/formdata/globals`,"html-image-element":`@gjsify/html-image-element`,webcrypto:`@gjsify/webcrypto/globals`,webgl:`@gjsify/webgl`,websocket:`@gjsify/websocket/globals`,webstorage:`@gjsify/webstorage`,"abort-controller/register":`@gjsify/empty`,"compression-streams/register":`@gjsify/empty`,"dom-events/register":`@gjsify/empty`,"dom-events/register/event-target":`@gjsify/empty`,"dom-events/register/custom-events":`@gjsify/empty`,"dom-events/register/ui-events":`@gjsify/empty`,"dom-events/register/global-event-target":`@gjsify/empty`,"dom-exception/register":`@gjsify/empty`,"message-channel/register":`@gjsify/empty`,"eventsource/register":`@gjsify/empty`,"websocket/register":`@gjsify/empty`,"fetch/register":`@gjsify/empty`,"fetch/register/fetch":`@gjsify/empty`,"fetch/register/xhr":`@gjsify/empty`,"webcrypto/register":`@gjsify/empty`,"web-streams/register":`@gjsify/empty`,"web-streams/register/readable":`@gjsify/empty`,"web-streams/register/writable":`@gjsify/empty`,"web-streams/register/transform":`@gjsify/empty`,"web-streams/register/text-streams":`@gjsify/empty`,"web-streams/register/queuing":`@gjsify/empty`,"@gjsify/abort-controller/register":`@gjsify/empty`,"@gjsify/compression-streams/register":`@gjsify/empty`,"@gjsify/dom-events/register":`@gjsify/empty`,"@gjsify/dom-events/register/event-target":`@gjsify/empty`,"@gjsify/dom-events/register/custom-events":`@gjsify/empty`,"@gjsify/dom-events/register/ui-events":`@gjsify/empty`,"@gjsify/dom-events/register/global-event-target":`@gjsify/empty`,"@gjsify/dom-exception/register":`@gjsify/empty`,"@gjsify/message-channel/register":`@gjsify/empty`,"@gjsify/eventsource/register":`@gjsify/empty`,"@gjsify/websocket/register":`@gjsify/empty`,"@gjsify/fetch/register":`@gjsify/empty`,"@gjsify/fetch/register/fetch":`@gjsify/empty`,"@gjsify/fetch/register/xhr":`@gjsify/empty`,"@gjsify/webcrypto/register":`@gjsify/empty`,"@gjsify/web-streams/register":`@gjsify/empty`,"@gjsify/web-streams/register/readable":`@gjsify/empty`,"@gjsify/web-streams/register/writable":`@gjsify/empty`,"@gjsify/web-streams/register/transform":`@gjsify/empty`,"@gjsify/web-streams/register/text-streams":`@gjsify/empty`,"@gjsify/web-streams/register/queuing":`@gjsify/empty`,"@gjsify/dom-elements/register":`@gjsify/empty`,"@gjsify/dom-elements/register/document":`@gjsify/empty`,"@gjsify/dom-elements/register/canvas":`@gjsify/empty`,"@gjsify/dom-elements/register/image":`@gjsify/empty`,"@gjsify/dom-elements/register/observers":`@gjsify/empty`,"@gjsify/dom-elements/register/font-face":`@gjsify/empty`,"@gjsify/dom-elements/register/match-media":`@gjsify/empty`,"@gjsify/dom-elements/register/location":`@gjsify/empty`,"@gjsify/dom-elements/register/navigator":`@gjsify/empty`,"@gjsify/canvas2d/register":`@gjsify/empty`,"@gjsify/iframe/register":`@gjsify/empty`,"@gjsify/webgl/register":`@gjsify/empty`,"@gjsify/buffer/register":`@gjsify/empty`,xmlhttprequest:`@gjsify/empty`,"xmlhttprequest/register":`@gjsify/empty`,"@gjsify/xmlhttprequest":`@gjsify/empty`,"@gjsify/xmlhttprequest/register":`@gjsify/empty`,domparser:`@gjsify/empty`,"domparser/register":`@gjsify/empty`,"@gjsify/domparser/register":`@gjsify/empty`,webaudio:`@gjsify/empty`,"webaudio/register":`@gjsify/empty`,"@gjsify/webaudio/register":`@gjsify/empty`,gamepad:`@gjsify/empty`,"gamepad/register":`@gjsify/empty`,"@gjsify/gamepad/register":`@gjsify/empty`,webrtc:`@gjsify/empty`,"webrtc/register":`@gjsify/empty`,"webrtc/register/peer-connection":`@gjsify/empty`,"webrtc/register/data-channel":`@gjsify/empty`,"webrtc/register/error":`@gjsify/empty`,"webrtc/register/media":`@gjsify/empty`,"webrtc/register/media-devices":`@gjsify/empty`,"@gjsify/webrtc":`@gjsify/empty`,"@gjsify/webrtc/register":`@gjsify/empty`,"@gjsify/webrtc/register/peer-connection":`@gjsify/empty`,"@gjsify/webrtc/register/data-channel":`@gjsify/empty`,"@gjsify/webrtc/register/error":`@gjsify/empty`,"@gjsify/webrtc/register/media":`@gjsify/empty`,"@gjsify/webrtc/register/media-devices":`@gjsify/empty`,webassembly:`@gjsify/webassembly/globals`,"webassembly/register":`@gjsify/empty`,"webassembly/register/promise":`@gjsify/empty`,"@gjsify/webassembly/register":`@gjsify/empty`,"@gjsify/webassembly/register/promise":`@gjsify/empty`}}),setNodeAliasPrefix,getAliasesGeneralForGjs,getAliasesNodeForGjs,getAliasesWebForGjs,getAliasesGeneralForNode,getAliasesGjsForNode,getAliasesWebForNode,getAliasesForGjs,getAliasesForNode,cv=__esmMin(()=>{sv(),setNodeAliasPrefix=t=>{for(let n in t){if(n.startsWith(`node:`))continue;let S=`node:${n}`;t[S]||(t[S]=t[n])}return t},getAliasesGeneralForGjs=t=>Q_,getAliasesNodeForGjs=t=>setNodeAliasPrefix($_),getAliasesWebForGjs=t=>rv,getAliasesGeneralForNode=t=>iv,getAliasesGjsForNode=t=>av,getAliasesWebForNode=t=>ov,getAliasesForGjs=t=>({...getDerivedAliasesSync(`gjs`),...getAliasesGeneralForGjs(t),...getAliasesNodeForGjs(t),...getAliasesWebForGjs(t)}),getAliasesForNode=t=>({...getDerivedAliasesSync(`node`),...getAliasesGeneralForNode(t),...getAliasesGjsForNode(t),...getAliasesWebForNode(t)}),[...X_,...X_.map(t=>`node:${t}`)],[...Z_]}),lv=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.splitWhen=t.flatten=void 0;function flatten(t){return t.reduce((t,n)=>[].concat(t,n),[])}t.flatten=flatten;function splitWhen(t,n){let S=[[]],C=0;for(let N of t)n(N)?(C++,S[C]=[]):S[C].push(N);return S}t.splitWhen=splitWhen})),uv=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isEnoentCodeError=void 0;function isEnoentCodeError(t){return t.code===`ENOENT`}t.isEnoentCodeError=isEnoentCodeError})),dv=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDirentFromStats=void 0;var DirentFromStats=class{constructor(t,n){this.name=t,this.isBlockDevice=n.isBlockDevice.bind(n),this.isCharacterDevice=n.isCharacterDevice.bind(n),this.isDirectory=n.isDirectory.bind(n),this.isFIFO=n.isFIFO.bind(n),this.isFile=n.isFile.bind(n),this.isSocket=n.isSocket.bind(n),this.isSymbolicLink=n.isSymbolicLink.bind(n)}};function createDirentFromStats(t,n){return new DirentFromStats(t,n)}t.createDirentFromStats=createDirentFromStats})),fv=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.convertPosixPathToPattern=t.convertWindowsPathToPattern=t.convertPathToPattern=t.escapePosixPath=t.escapeWindowsPath=t.escape=t.removeLeadingDotSegment=t.makeAbsolute=t.unixify=void 0;let n=(Dg(),__toCommonJS(yg)),S=(jn(),__toCommonJS(gn)),C=n.platform()===`win32`,N=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,F=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,I=/^\\\\([.?])/,H=/\\(?![!()+@[\]{}])/g;function unixify(t){return t.replace(/\\/g,`/`)}t.unixify=unixify;function makeAbsolute(t,n){return S.resolve(t,n)}t.makeAbsolute=makeAbsolute;function removeLeadingDotSegment(t){if(t.charAt(0)===`.`){let n=t.charAt(1);if(n===`/`||n===`\\`)return t.slice(2)}return t}t.removeLeadingDotSegment=removeLeadingDotSegment,t.escape=C?escapeWindowsPath:escapePosixPath;function escapeWindowsPath(t){return t.replace(F,`\\$2`)}t.escapeWindowsPath=escapeWindowsPath;function escapePosixPath(t){return t.replace(N,`\\$2`)}t.escapePosixPath=escapePosixPath,t.convertPathToPattern=C?convertWindowsPathToPattern:convertPosixPathToPattern;function convertWindowsPathToPattern(t){return escapeWindowsPath(t).replace(I,`//$1`).replace(H,`/`)}t.convertWindowsPathToPattern=convertWindowsPathToPattern;function convertPosixPathToPattern(t){return escapePosixPath(t)}t.convertPosixPathToPattern=convertPosixPathToPattern})),pv=__commonJSMin(((t,n)=>{
652
652
  /*!
653
653
  * is-extglob <https://github.com/jonschlinkert/is-extglob>
654
654
  *
@@ -903,8 +903,8 @@ Add @gjsify/node-gi as a dependency to run the storybook on Node, e.g.:
903
903
  "devDependencies": { "@gjsify/node-gi": "^0.13.0" }`);let{env:N,envPrefix:F}=computeNativeEnvForBundle(t,C),I={...process.env,...N},H=nodeBinary(),W=[t,...n],q=[H,...W.map(t=>t.includes(` `)?`"${t}"`:t)].join(` `);ge.error(`$ ${F?`${F} `:``}${q}`);let Y;try{Y=await spawnToCompletion(H,W,{completion:S.completion,env:I})}catch(t){return ge.error(t.message),process.exit(1)}if(Y.code!==0)return ge.error(`node exited with ${describeExit(Y)}`),process.exit(Y.code??1);if(S.exitOnSuccess)return process.exit(0)}function bundleRequiresNodeGi(t){try{return readFileSync(t,`utf-8`).includes(`@gjsify/node-gi`)}catch{return!1}}async function runRuntimeBundle(t,n,S=[],C){let N=process.cwd(),F=vn(n);if(bundleRequiresNodeGi(F)&&!resolveNodeGiForBundle(F,N))throw Error(`Cannot run this bundle on ${t}: it uses gi:// via \`@gjsify/node-gi\`, which is not installed.\nAdd @gjsify/node-gi as a dependency to run gi:// code off GJS, e.g.:
904
904
  "dependencies": { "@gjsify/node-gi": "^0.13.0" }`);let{env:I,envPrefix:H}=computeNativeEnvForBundle(F,N),W={...process.env,...I},[,q]=N_[t].launch(F,S),Y=t===`node`?nodeBinary():N_[t].probe,X=[Y,...q.map(t=>t.includes(` `)?`"${t}"`:t)].join(` `);C.quiet||ge.error(`$ ${H?`${H} `:``}${X}`);let failed=t=>(process.exitCode=t,process.exit(t)),Z;try{Z=await spawnToCompletion(Y,q,{completion:C.completion,env:W})}catch(t){return ge.error(t.message),failed(1)}if(Z.code!==0)return C.quietExit||ge.error(`${t} exited with ${describeExit(Z)}`),failed(Z.code??1);if(C.exitOnSuccess)return process.exit(0)}var bI=__esmMin(()=>{_e(),Md(),jn(),t_(),vI(),P_(),j_()});function nearestNodeModules(t){let n=vn(t);for(;;){let t=xn(n,`node_modules`);if(existsSync(t))return t;let S=wn(n);if(S===n)return null;n=S}}async function rebuildForGjs(t,n,S){let C=t.nodeModules??nearestNodeModules(process.cwd())??xn(t.pkgDir,`node_modules`),N=findProjectLockfile(wn(C)),F=execCacheKey({pkgName:t.pkgName,pkgVersion:t.pkgVersion,entry:entryWithinPackage(t,n),cliVersion:cliVersion(),lockfileHash:N?hashFile(N):null}),I=execArtifactPath(execCacheRoot(C),t,n,t.installed?F:`local`),H=t.installed&&!S.rebuild;if(H&&existsSync(I))return S.verbose&&ge.error(`gjsify exec: reusing ${I}`),I;ge.error(`gjsify exec: rebuilding ${t.pkgName}@${t.pkgVersion} "${t.binName}" for GJS…`);let W=wn(I),q=`${W}.tmp-${process.pid.toString(16)}-${Date.now().toString(16)}`,Y=xn(q,Tn(I));try{let{BuildAction:C}=await Promise.resolve().then(()=>(GF(),HF));await C.bundleFileForGjs(n,Y,{verbose:S.verbose,preserveDefaultExport:!1,...t.installed?{}:{define:{"import.meta.url":JSON.stringify(pathToFileURL(n).href)}},toolchainAnchor:C.runningCliFile(),...S.verbose?{}:{logLevel:`silent`}})}catch(C){throw rmSync(q,{recursive:!0,force:!0}),new ExecRebuildError(t,n,C,S.verbose)}if(H&&existsSync(I))return rmSync(q,{recursive:!0,force:!0}),I;rmSync(W,{recursive:!0,force:!0});try{renameSync(q,W)}catch(t){if(rmSync(q,{recursive:!0,force:!0}),!existsSync(I))throw t}return pruneStaleArtifacts(wn(W),t,Tn(W)),I}function pruneStaleArtifacts(t,n,S){let C=`${n.pkgName}@${n.pkgVersion}`.replace(/[^a-zA-Z0-9._@-]/g,`_`),N;try{N=readdirSync(t)}catch{return}for(let n of N)n===S||!n.startsWith(`${C}-`)||n.includes(`.tmp-`)||rmSync(xn(t,n),{recursive:!0,force:!0})}var ExecRebuildError,xI,SI=__esmMin(()=>{_e(),Md(),jn(),Hn(),t_(),nI(),pI(),Xm(),vI(),bI(),ExecRebuildError=class extends Error{constructor(t,n,S,C){let N=S instanceof Error?S.message:String(S);super(`gjsify exec: rebuilding "${t.binName}" (${t.pkgName}@${t.pkgVersion}) for GJS failed.\n entry: ${n}\nNothing was run — gjsify exec never falls back to another runtime on its own. To run it on Node explicitly: \`gjsify exec --runtime node ${t.binName}\`.\n`+(C?``:`Re-run with \`gjsify exec --verbose ${t.binName}\` for the bundler's warnings.\n`)+`Bundler diagnostics:\n${N}`,{cause:S}),this.name=`ExecRebuildError`}},xI={command:`exec <entries..>`,description:"Run an installed npm bin on the runtime gjsify runs on: `gjsify exec [--runtime gjs|node|bun|deno] [--rebuild] [--verbose] <bin> [args…]`. On Node/Bun/Deno the bin runs unchanged; on GJS it is rebuilt `--app gjs` once, cached under node_modules/.cache/gjsify/exec/, and run with gjs. Options go BEFORE the bin; everything after it is the bin's own.",builder:t=>t.positional(`entries`,{description:`gjsify exec options, then the bin name and its arguments.`,type:`string`,array:!0}).version(!1).help(!1).parserConfiguration({"populate--":!0,"parse-positional-numbers":!1,"unknown-options-as-args":!0}),handler:async t=>{let n,S,C;try{n=splitExecArgv(t.entries??[],doubleDashArgs(t)),S=resolveExecBin(n.bin,process.cwd()),C=planExec(S,n.runtime??hostRuntime$1())}catch(t){if(t instanceof ExecBinNotFoundError)return ge.error(t.message),process.exit(127);if(t instanceof ExecPlanError)return ge.error(t.message),process.exit(1);throw t}let N={completion:`exit`,exitOnSuccess:!0,quiet:!n.verbose,quietExit:!0};if(C.kind===`direct`){await runRuntimeBundle(C.runtime,C.file,n.args,N);return}if(C.kind===`gjs-bundle`){await runGjsBundle(C.file,n.args,N);return}let F=await rebuildForGjs(S,C.entry,{rebuild:n.rebuild,verbose:n.verbose}),I=cliPackageDir();await runGjsBundle(F,n.args,{...N,nativeRoots:I?[I]:[]})}}});function bundleInputsPath(t){return`${t}.inputs.json`}function idToPath(t){if(t===``||t.startsWith(`\0`))return null;let n=t.search(/[?#]/);if(n===-1)return t;let S=t.slice(0,n);return isFile(S)?S:t}function isFile(t){try{return statSync(t).isFile()}catch{return!1}}function isToolchainScratch(t){return t.includes(`${On}node_modules${On}.cache${On}`)}function resolutionFilesFor(t){let n=[];for(let S=wn(t);;S=wn(S)){let t=xn(S,`package.json`);if(existsSync(t)){n.push(t);let C=xn(S,`tsconfig.json`);return existsSync(C)&&n.push(C),n}if(wn(S)===S)return n}}function createBundleInputsRecorder(t){let n=new Set,S=!0,record=t=>{let S=idToPath(t);S!==null&&n.add(S)},C={name:`gjsify:bundle-inputs`,transform(t,n){record(n)}},inputs=()=>{let t=[],S=new Set;for(let C of n){let n;try{n=statSync(C).isFile()}catch{continue}if(!n||isToolchainScratch(C))continue;t.push(C);let N=wn(C);if(!S.has(N)){S.add(N);for(let n of resolutionFilesFor(C))t.push(n)}}return[...new Set(t)].sort()};return{plugin:C,addWatchFiles(t){t.reportedByEngine||(S=!1);for(let n of t.files)record(n)},inputs,write(){let n=bundleInputsPath(t),C={version:2,inputs:inputs(),watchList:S},N=`${n}.tmp`;try{mkdirSync(wn(n),{recursive:!0}),writeFileSync(N,`${JSON.stringify(C,null,2)}\n`,`utf-8`),renameSync(N,n)}catch(t){try{rmSync(N,{force:!0})}catch{}ge.warn(`[gjsify test] could not record the build inputs beside ${n} (${t.message}) — the next run judges freshness by the package walk alone, which cannot see outside this package.`)}}}}function readBundleInputs(t){let n;try{n=JSON.parse(readFileSync(bundleInputsPath(t),`utf-8`))}catch{return null}return n?.version!==2||!Array.isArray(n.inputs)?null:{inputs:n.inputs.filter(t=>typeof t==`string`),watchList:n.watchList===!0}}function newestBundleInputMtimeMs(t){let n=0;for(let S of t)try{let{mtimeMs:t}=statSync(S);t>n&&(n=t)}catch{return 1/0}return n}var CI=__esmMin(()=>{_e(),Md(),jn()});async function buildTestBundle(t,n,S,C){let N=await new Config().forBuild({entryPoints:[t],outfile:n,app:S,verbose:C??!1,logLevel:`warning`,exclude:[]});N.library={...N.library};let F=createBundleInputsRecorder(n);N.bundler={...N.bundler,input:[t],output:{...N.bundler?.output,file:n},plugins:[...N.bundler?.plugins??[],F.plugin]},await new WF(N).start({app:S,library:!1,onWatchFiles:t=>F.addWatchFiles(t)}),F.write()}async function runTestBundle(t,n){if(n===`gjs`){await runGjsBundle(t,[],{completion:`exit`});return}let S=await spawnToCompletion(nodeBinary(),[t],{completion:`exit`});if(S.code!==0)throw Error(`node exited with ${describeExit(S)}`)}function isFresh(t,n,S,C){if(!existsSync(t))return!1;try{let N=statSync(t).mtimeMs,F=[],I=Sn(S,C).split(On).join(`/`);I!==``&&!I.startsWith(`../`)&&F.push(I);let H=readBundleInputs(t);return H!==null&&!H.watchList?!1:N>=Math.max(newestInputMtimeMs(packageBuildInputs(S,{extraOutputs:F})),H===null?0:newestBundleInputMtimeMs(H.inputs),statSync(n).mtimeMs,newestDepSignalMtimeMs(S))}catch{return!1}}var wI,TI=__esmMin(()=>{_e(),Md(),jn(),CI(),VF(),P_(),bI(),j_(),JF(),GF(),vI(),wI={command:`test`,description:"Build + run the package’s `src/test.mts` suite on GJS and Node and aggregate the results. Replaces the per-package `build:test:{gjs,node}` + `test:{gjs,node}` script boilerplate.",builder:t=>t.option(`runtime`,{description:`Target runtime. Default: both.`,type:`string`,choices:[`gjs`,`node`,`all`],default:`all`}).option(`entry`,{description:"Path to the test entry. Default: `src/test.mts` (or `gjsify.test.entry`).",type:`string`,normalize:!0}).option(`outdir`,{description:"Output directory for the built test bundles. Default: `dist/`.",type:`string`,normalize:!0}).option(`rebuild`,{description:`Always rebuild the test bundles, even when they look up-to-date.`,type:`boolean`,default:!1}).option(`build`,{description:`Build before running. Default: true (use --no-build to skip when bundles already exist).`,type:`boolean`,default:!0}).option(`verbose`,{description:`Print resolved entry/outdir + per-step timing.`,type:`boolean`,default:!1}),handler:async t=>{let n=process.cwd(),S=(await new Config().forBuild({}).catch(()=>({}))).test??{},C=vn(n,t.entry??S.entry??`src/test.mts`),N=vn(n,t.outdir??S.outdir??`dist`);if(!existsSync(C))return ge.error(`[gjsify test] no test entry at ${Sn(n,C)} — add an \`src/test.mts\` that aggregates your \`@gjsify/unit\` suites, or set \`gjsify.test.entry\` in package.json.`),process.exit(1);let F=t.runtime===`gjs`||t.runtime===`node`,I=t.runtime===`gjs`?[`gjs`]:t.runtime===`node`?[`node`]:S.runtimes&&S.runtimes.length>0?S.runtimes:[`gjs`,`node`],H=F?I:I.filter(t=>isRuntimeAvailable(t));for(let t of I.filter(t=>!H.includes(t)))ge.log(`[gjsify test] skipping ${t} — no \`${N_[t].probe}\` on PATH (not requested explicitly)`);if(H.length===0)return ge.error(`[gjsify test] none of the default runtimes (${I.join(`, `)}) is available on this host.\n Install one, or pin the set: \`gjsify test --runtime <rt>\` / \`gjsify.test.runtimes\` in package.json.`),process.exit(1);let W=[];for(let S of H){let F=xn(N,`test.${S}.mjs`);if(t.build!==!1)if(t.rebuild||!isFresh(F,C,n,N)){let N=Date.now();t.verbose&&ge.log(`[gjsify test] building → ${Sn(n,F)} (—app ${S})`);try{await buildTestBundle(C,F,S,t.verbose),t.verbose&&ge.log(`[gjsify test] built ${S} in ${Date.now()-N}ms`)}catch(t){ge.error(`[gjsify test] build failed for ${S}:`,t.message),W.push({runtime:S,ok:!1,durationMs:0,error:`build failed`});continue}}else t.verbose&&ge.log(`[gjsify test] ${S}: bundle is up-to-date — skipping build (use --rebuild to force)`);else if(!existsSync(F)){ge.error(`[gjsify test] --no-build but ${Sn(n,F)} doesn't exist. Build first or drop --no-build.`),W.push({runtime:S,ok:!1,durationMs:0,error:`no bundle`});continue}let I=Date.now();try{await runTestBundle(F,S),W.push({runtime:S,ok:!0,durationMs:Date.now()-I})}catch(t){W.push({runtime:S,ok:!1,durationMs:Date.now()-I,error:t.message})}}let q=W.map(t=>`${t.ok?`✅`:`❌`} ${t.runtime} (${t.durationMs}ms)${t.error?` — ${t.error}`:``}`).join(` `);if(ge.log(`[gjsify test] ${q}`),W.some(t=>!t.ok))return process.exit(1);process.exit(0)}}});function readPackageJson$1(t){if(!existsSync(t))return null;let n=readFileSync(t,`utf-8`);try{return JSON.parse(n)}catch(n){throw Error(`gjsify install: ${t} is not valid JSON: ${n.message}`)}}function writePackageJson(t,n){let S=sortKnownDepFields(n);writeFileSync(t,JSON.stringify(S,null,2)+`
905
905
  `,`utf-8`)}function parseSpec$2(t){if(t.startsWith(`@`)){let n=t.indexOf(`/`);if(n===-1)return{name:t};let S=t.indexOf(`@`,n+1);return S===-1?{name:t}:{name:t.slice(0,S),range:t.slice(S+1)}}let n=t.indexOf(`@`);return n===-1?{name:t}:{name:t.slice(0,n),range:t.slice(n+1)}}function projectSpecsFromPackageJson(t){let n=[];for(let S of[`dependencies`,`devDependencies`,`optionalDependencies`]){let C=t[S];if(C)for(let[t,S]of Object.entries(C))typeof S==`string`&&(/^(workspace|link|file|portal|git\+|https?):/.test(S)||n.push(`${t}@${S}`))}return n}function addDependencyEntry(t,n,S,C){t[C]===void 0&&(t[C]={}),t[C][n]=S}function defaultRangeFromVersion(t){return`^${t}`}function sortKnownDepFields(t){let n={...t};for(let t of[`dependencies`,`devDependencies`,`peerDependencies`,`optionalDependencies`]){let S=n[t];S&&(n[t]=Object.fromEntries(Object.entries(S).sort(([t],[n])=>t<n?-1:+(t>n))))}return n}var EI=__esmMin(()=>{Md(),__name$1(readPackageJson$1,`readPackageJson`),__name$1(parseSpec$2,`parseSpec`)});function scriptCacheEnabled(){let t=process.env.GJSIFY_NODE_SCRIPT_CACHE;return t===`1`||t===`true`||t===`yes`}async function runNodeScript(t,n=[],S){let C=vn(t);if(!existsSync(C)||!statSync(C).isFile())return ge.error(`gjsify run --node-script: no such file: ${C}`),process.exit(1);let N=hostRuntime$1();if(N!==`gjs`){await runRuntimeBundle(N,C,n,{completion:S.completion,exitOnSuccess:S.exitOnSuccess,quiet:!0});return}let{BuildAction:F}=await Promise.resolve().then(()=>(GF(),HF)),{globals:I,excludeGlobals:H}=await new Config().forNodeScript(C),W;try{W=await F.bundleFileForGjsCached(C,{cacheSubdir:`node-scripts`,label:Tn(C),cache:scriptCacheEnabled(),preserveDefaultExport:!1,define:{"import.meta.url":JSON.stringify(pathToFileURL(C).href)},globals:I,excludeGlobals:H,resolveFromToolchain:!0})}catch(t){throw Error(`gjsify run --node-script: failed to bundle ${C} for GJS. The script must import only what gjsify can provide under GJS (node: builtins, workspace packages, pure-JS npm deps). (${t.message})`)}await runGjsBundle(W,n,{completion:S.completion,exitOnSuccess:S.exitOnSuccess,quiet:!0})}var DI=__esmMin(()=>{_e(),Md(),jn(),Hn(),t_(),JF(),vI(),bI()});function makeProgressReporter(t={}){if(t.enabled===!1)return kI;let n=t.stream??process.stderr,S=!!n.isTTY;return t.enabled??!0?S?makeTtyReporter(n):makePlainReporter(n):kI}function makeTtyReporter(t){let n=0,S=``;function render(C,N=!1){let F=Date.now();!N&&F-n<33&&C===S||(n=F,S=C,t.write(`\r\x1B[2K`+C))}function clearLine(){t.write(`\r\x1B[2K`),S=``}return{beginPhase(n,S){render(formatBar(n,0,S,void 0,t.columns??80),!0)},update(n){render(formatBar(n.phase,n.current,n.total,n.name,t.columns??80))},endPhase(n){let S=OI[n];clearLine(),t.write(`gjsify install: ${S} done\n`)}}}function makePlainReporter(t){let n=0,S=0;return{beginPhase(C,N){n=Date.now(),S=0,t.write(`gjsify install: ${OI[C]} ${N} package(s)\n`)},update(C){let N=Date.now();if(N-n<AI||C.current<=S)return;n=N,S=C.current;let F=C.total>0?Math.round(C.current/C.total*100):0;t.write(`gjsify install: ${OI[C.phase]} ${C.current}/${C.total} (${F}%)\n`)},endPhase(n){t.write(`gjsify install: ${OI[n]} done\n`)}}}function formatBar(t,n,S,C,N){let F=OI[t],I=S>0?Math.min(1,n/S):0,H=`${n}/${S}`,W=`gjsify install: ${F} `,q=` ${H}`+(C?` ${C}`:``),Y=Math.max(8,Math.min(40,N-W.length-q.length-4)),X=Math.round(I*Y),Z=`█`.repeat(X)+`░`.repeat(Y-X),te=`${W}[${Z}]${q}`;if(te.length>N){let t=te.length-N+1,n=C&&C.length>t?C.slice(0,C.length-t-1)+`…`:``;te=`${W}[${Z}] ${H}${n?` `+n:``}`}return te}var OI,kI,AI,jI=__esmMin(()=>{OI={resolve:`resolving`,download:`downloading`,extract:`extracting`,link:`linking bins`},kI={update(){},beginPhase(){},endPhase(){}},AI=5e3});function parseTar(t){let n=[],S=null,C=null,N=null,F=0;for(;F+512<=t.length;){let I=t.subarray(F,F+512);if(allZeros(I)){let n=t.subarray(F+512,F+2*512);if(n.length===512&&allZeros(n))break;F+=512;continue}if(!validateChecksum(I))throw new TarParseError(`Bad header checksum at offset ${F} — file is not a valid tar archive`);let H=readString(I,0,100),W=parseOctal(I,100,8),q=parseOctal(I,124,12),Y=parseOctal(I,136,12),X=String.fromCharCode(I[156]||0),Z=readString(I,157,100),te=readString(I,257,6),ne=readString(I,345,155),re=readString(I,265,32),ie=readString(I,297,32);F+=512;let ae=t.subarray(F,F+q);if(F+=alignToBlock(q),X===`x`){S=parsePaxRecords(ae);continue}if(X===`g`)continue;if(X===`L`){C=bytesToString(ae).replace(/\0+$/,``);continue}if(X===`K`){N=bytesToString(ae).replace(/\0+$/,``);continue}let oe=H;te===`ustar`&&ne!==``&&(oe=`${ne}/${H}`),C!==null&&(oe=C,C=null);let Q=Z;if(N!==null&&(Q=N,N=null),S!==null){let C=S.get(`path`);C!==void 0&&(oe=C);let N=S.get(`linkpath`);N!==void 0&&(Q=N);let I=S.get(`size`);if(I!==void 0){let C=Number(I);if(Number.isFinite(C)){let N=F-alignToBlock(q),I=t.subarray(N,N+C);F=N+alignToBlock(C),S=null,n.push(buildEntry(oe,Q,X,W,Y,re,ie,I));continue}}S=null}n.push(buildEntry(oe,Q,X,W,Y,re,ie,ae))}return n}function buildEntry(t,n,S,C,N,F,I,H){return{name:t,linkname:n,type:typeflagToType(S,t),mode:C,mtime:N,body:H,uname:F,gname:I}}function typeflagToType(t,n){switch(t){case`0`:case`\0`:case``:return n.endsWith(`/`)?`directory`:`file`;case`1`:return`hardlink`;case`2`:return`symlink`;case`5`:return`directory`;case`x`:return`pax-header`;case`g`:return`pax-global`;case`L`:return`gnu-longname`;case`K`:return`gnu-longlink`;default:return`unknown`}}function parsePaxRecords(t){let n=new Map,S=0;for(;S<t.length;){let C=S;for(;C<t.length&&t[C]!==32;)C++;if(C>=t.length)break;let N=bytesToString(t.subarray(S,C)),F=Number(N);if(!Number.isFinite(F)||F<=0)break;let I=S+F;if(I>t.length)break;let H=bytesToString(t.subarray(C+1,I-1)),W=H.indexOf(`=`);if(W>0){let t=H.slice(0,W),S=H.slice(W+1);n.set(t,S)}S=I}return n}function readString(t,n,S){let C=n,N=n+S;for(;C<N&&t[C]!==0;)C++;return bytesToString(t.subarray(n,C))}function bytesToString(t){return new TextDecoder(`utf-8`,{fatal:!1}).decode(t)}function parseOctal(t,n,S){if(S>0&&t[n]&128){let C=t[n]&127;for(let N=1;N<S;N++)C=C*256+t[n+N];return C}let C=``;for(let N=0;N<S;N++){let S=t[n+N];S===0||S===32||(C+=String.fromCharCode(S))}return C===``?0:parseInt(C,8)}function alignToBlock(t){return Math.ceil(t/512)*512}function allZeros(t){for(let n=0;n<t.length;n++)if(t[n]!==0)return!1;return!0}function validateChecksum(t){let n=parseOctal(t,148,8),S=0,C=0;for(let n=0;n<512;n++){let N=n>=148&&n<156?32:t[n];S+=N,C+=N>127?N-256:N}return n===S||n===C}var TarParseError,MI=__esmMin(()=>{TarParseError=class extends Error{constructor(t){super(t),this.name=`TarParseError`}}});function createTarball(t){let n=[];for(let S of t){if(`directory`in S&&S.directory===!0){n.push(buildHeader$1(ensureTrailingSlash(S.name),0,`5`,S.mode??493,S.mtime??0));continue}let t=S,C=typeof t.body==`string`?new TextEncoder().encode(t.body):t.body,N=t.mode??defaultFileMode(C);n.push(buildHeader$1(t.name,C.byteLength,`0`,N,t.mtime??0)),n.push(C);let F=padTo512(C.byteLength);F>0&&n.push(new Uint8Array(F))}return n.push(new Uint8Array(512*2)),concatChunks(n)}function buildHeader$1(t,n,S,C,N){let{prefix:F,basename:I}=splitPathForUstar(t),H=new Uint8Array(512);writeAscii(H,I,0,100),writeOctal(H,C&4095,100,7),H[107]=0,writeOctal(H,0,108,7),H[115]=0,writeOctal(H,0,116,7),H[123]=0,writeOctal(H,n,124,11),H[135]=0,writeOctal(H,N,136,11),H[147]=0;for(let t=148;t<156;t++)H[t]=32;H[156]=S.charCodeAt(0),writeAscii(H,`ustar\0`,257,6),writeAscii(H,`00`,263,2),F&&writeAscii(H,F,345,155);let W=0;for(let t=0;t<512;t++)W+=H[t];return writeAscii(H,W.toString(8).padStart(6,`0`),148,6),H[154]=0,H[155]=32,H}function splitPathForUstar(t){if(t.length<=100)return{prefix:``,basename:t};if(t.length>255)throw Error(`createTarball: path too long (${t.length} > 255 chars): ${t}`);for(let n=Math.min(t.length-1,155);n>0;n--)if(t[n]===`/`&&t.length-n-1<=100)return{prefix:t.slice(0,n),basename:t.slice(n+1)};throw Error(`createTarball: cannot split path into ustar prefix+basename (basename slot is 100 chars): ${t}`)}function writeAscii(t,n,S,C){let N=new TextEncoder().encode(n);if(N.length>C)throw Error(`createTarball: field too long (${N.length} > ${C}): "${n}"`);t.set(N,S)}function writeOctal(t,n,S,C){writeAscii(t,n.toString(8).padStart(C,`0`),S,C)}function padTo512(t){let n=t%512;return n===0?0:512-n}function ensureTrailingSlash(t){return t.endsWith(`/`)?t:`${t}/`}function defaultFileMode(t){return t.length>=2&&t[0]===35&&t[1]===33?493:420}function concatChunks(t){let n=0;for(let S of t)n+=S.byteLength;let S=new Uint8Array(n),C=0;for(let n of t)S.set(n,C),C+=n.byteLength;return S}var NI=__esmMin(()=>{__name$1(buildHeader$1,`buildHeader`)});async function extractTarball(t,n,S={}){let C=t instanceof Uint8Array?t:new Uint8Array(t),N=parseTar(S.gzip??(C.length>=2&&C[0]===31&&C[1]===139)?await gunzip(C):C);mkdirSync(n,{recursive:!0});let F=S.strip??1,I=S.preventEscape??!0,H={files:[],directories:[],symlinks:[],skipped:0};for(let t of N){let C=stripComponents(t.name,F);if(C===null||C===``){H.skipped++;continue}let N=vn(n,C);if(I&&!isInside$2(N,n))throw Error(`tar: refusing to extract ${t.name} outside ${n} (resolved=${N})`);if(S.filter&&!S.filter(t,N)){H.skipped++;continue}if(t.type===`directory`){mkdirSync(N,{recursive:!0}),H.directories.push(N);continue}if(t.type===`file`){mkdirSync(wn(N),{recursive:!0}),writeFileSync(N,t.body);let n=S.chmod?.(t,N)??t.mode&511;if(n>0)try{chmodSync(N,n)}catch{}H.files.push(N);continue}if(t.type===`symlink`){mkdirSync(wn(N),{recursive:!0});try{symlinkSync(t.linkname,N),H.symlinks.push(N)}catch{writeFileSync(N,t.linkname),H.files.push(N)}continue}H.skipped++}return H}async function gunzip(t){let n=globalThis.DecompressionStream;if(typeof n!=`function`)throw Error(`@gjsify/tar: globalThis.DecompressionStream is not available — import '@gjsify/compression-streams/register' on GJS to register it`);return drainStream(new Blob([new Uint8Array(t)]).stream().pipeThrough(new n(`gzip`)))}async function gzip(t,n){if(n?.level!==void 0){let{gzipSync:S}=await Promise.resolve().then(()=>(ia(),ea));return new Uint8Array(S(t,{level:n.level}))}let S=globalThis.CompressionStream;if(typeof S!=`function`)throw Error(`@gjsify/tar: globalThis.CompressionStream is not available — import '@gjsify/compression-streams/register' on GJS to register it`);return drainStream(new Blob([new Uint8Array(t)]).stream().pipeThrough(new S(`gzip`)))}async function drainStream(t){let n=[],S=0,C=t.getReader();for(;;){let{value:t,done:N}=await C.read();if(N)break;let F=t instanceof Uint8Array?t:new Uint8Array(t);n.push(F),S+=F.length}let N=new Uint8Array(S),F=0;for(let t of n)N.set(t,F),F+=t.length;return N}function stripComponents(t,n){if(n<=0)return t;let S=t.split(`/`).filter(t=>t!==``);return S.length<=n?null:S.slice(n).join(`/`)}function isInside$2(t,n){let S=Sn(n,t);return S!==``&&!S.startsWith(`..`)&&!bn(S)}var PI=__esmMin(()=>{MI(),Md(),jn(),__name$1(isInside$2,`isInside`)}),FI=__exportAll$5({BLOCK_SIZE:()=>512,TarParseError:()=>TarParseError,createTarball:()=>createTarball,extractTarball:()=>extractTarball,gunzip:()=>gunzip,gzip:()=>gzip,parseTar:()=>parseTar}),II=__esmMin(()=>{MI(),NI(),PI()});function gjsifyCacheRoot(t,n){let S=process.env.XDG_CACHE_HOME;return xn(S&&S.length>0?S:xn(homedir(),`.cache`),`gjsify`,t,n)}function atomicWrite(t,n){try{atomicWriteStrict(t,n)}catch{}}function atomicWriteStrict(t,n){mkdirSync(xn(t,`..`),{recursive:!0});let S=`${t}.tmp.${process.pid}`;writeFileSync(S,n),renameSync(S,t)}function readCacheFile(t){if(!existsSync(t))return null;try{let n=readFileSync(t);return n.length===0?null:n}catch{return null}}var LI=__esmMin(()=>{Md(),Dg(),jn()});function isPidAlive(t){if(existsSync(`/proc/self`))return existsSync(`/proc/${t}`);try{return process.kill(t,0),!0}catch(t){return t.code!==`ESRCH`}}function parsePsPidPpid(t){let n=new Map;for(let S of t.split(`
906
- `)){let t=/^\s*(\d+)\s+(\d+)\s*$/.exec(S);if(!t)continue;let C=Number(t[1]),N=Number(t[2]);if(C<=0||N<=0||C===N)continue;let F=n.get(N);F?F.push(C):n.set(N,[C])}return n}function readProcChildren(t){let n;try{n=readdirSync(`/proc/${t}/task`)}catch{return null}let S=[],C=!1;for(let N of n)try{let n=readFileSync(`/proc/${t}/task/${N}/children`,`utf-8`);C=!0;for(let t of n.trim().split(/\s+/)){let n=Number(t);Number.isInteger(n)&&n>0&&S.push(n)}}catch{}return C?S:null}function procPpidMap(){let t=new Map,n=[];try{n=readdirSync(`/proc`)}catch{return t}for(let S of n){let n=Number(S);if(!(!Number.isInteger(n)||n<=0))try{let S=readFileSync(`/proc/${n}/stat`,`utf-8`),C=S.slice(S.lastIndexOf(`)`)+2).split(` `),N=Number(C[1]);if(!Number.isInteger(N)||N<=0)continue;let F=t.get(N);F?F.push(n):t.set(N,[n])}catch{}}return t}function osPpidMap(){let[t,n]=process.platform===`win32`?[`powershell.exe`,[`-NoProfile`,`-NonInteractive`,`-Command`,`Get-CimInstance Win32_Process | ForEach-Object { "$($_.ProcessId) $($_.ParentProcessId)" }`]]:[`ps`,[`-A`,`-o`,`pid=,ppid=`]];try{let S=spawnSync(t,n,{encoding:`utf-8`});return S.status!==0||typeof S.stdout!=`string`?new Map:parsePsPidPpid(S.stdout)}catch{return new Map}}function collectDescendants(t){let n=[],S=new Set([t]),C=[t],N=null;for(;C.length>0;){let t=C.shift(),F=N?null:readProcChildren(t);F===null&&(N||(N=procPpidMap(),N.size===0&&(N=osPpidMap())),F=N.get(t)??[]);for(let t of F)S.has(t)||(S.add(t),n.push(t),C.push(t))}return n}var RI=__esmMin(()=>{w_(),Md()});function staleMs(){let t=process.env.GJSIFY_INSTALL_LOCK_STALE_MS;if(t!==void 0){let n=Number(t);if(Number.isFinite(n)&&n>0)return n}return VI}function lockingDisabled(){let t=process.env.GJSIFY_INSTALL_LOCK;if(t===void 0)return!1;let n=t.trim();return n===`0`||n===`false`}function mtimeMs(t){try{return statSync(t).mtimeMs}catch{return null}}function assessLock(t){let n=xn(t,BI),S=null;try{S=JSON.parse(readFileSync(n,`utf-8`))}catch{S=null}let C=Date.now();if(S&&typeof S.pid==`number`){if(!isPidAlive(S.pid))return{stale:!0,reason:`owner pid ${S.pid} is gone`,ownerPid:S.pid};let t=typeof S.startedAt==`number`?S.startedAt:mtimeMs(n);return t!==null&&C-t>staleMs()?{stale:!0,reason:`owner pid ${S.pid} exceeded the ${staleMs()}ms staleness budget`,ownerPid:S.pid}:{stale:!1,ownerPid:S.pid}}let N=mtimeMs(t);return N===null?{stale:!1}:C-N>HI?{stale:!0,reason:`no owner recorded within the acquire grace period`}:{stale:!1}}function stealStaleLock(t){let n=`${t}.stale-${process.pid}-${++qI}`;try{renameSync(t,n)}catch{return!1}try{rmSync(n,{recursive:!0,force:!0})}catch{}return!0}function abortErr(t){let n=t&&`reason`in t?t.reason:void 0;if(n instanceof Error)return n;let S=Error(`Aborted`);return S.name=`AbortError`,S}function delay(t,n){return t<=0?Promise.resolve():new Promise((S,C)=>{let onAbort=()=>{clearTimeout(N),C(abortErr(n))},N=setTimeout(()=>{n?.removeEventListener?.(`abort`,onAbort),S()},t);if(n?.aborted){clearTimeout(N),C(abortErr(n));return}n?.addEventListener?.(`abort`,onAbort,{once:!0})})}function makeHandle(t){let n=!1;return{release(){if(n)return;n=!0;let S=KI.get(t);if(S&&(S.count--,!(S.count>0))){KI.delete(t);try{let n=JSON.parse(readFileSync(xn(t,BI),`utf-8`));if(n.nonce!==void 0&&n.nonce!==S.nonce)return}catch{}try{rmSync(t,{recursive:!0,force:!0})}catch{}}}}}async function acquireInstallLock(t,n={}){if(lockingDisabled())return{release(){}};let S;try{S=realpathSync(t)}catch{S=vn(t)}let C=xn(S,`node_modules`,zI),N=KI.get(C);if(N)return N.count++,makeHandle(C);mkdirSync(wn(C),{recursive:!0});let F=`${process.pid}-${Date.now()}-${Math.random().toString(36).slice(2)}`,I=WI,H=!1;for(;;){if(n.signal?.aborted)throw abortErr(n.signal);try{return mkdirSync(C),writeFileSync(xn(C,BI),JSON.stringify({pid:process.pid,nonce:F,startedAt:Date.now()})),KI.set(C,{count:1,nonce:F}),makeHandle(C)}catch(t){if(t.code!==`EEXIST`)throw t}let t=assessLock(C);if(t.stale){stealStaleLock(C)&&ge.warn(`gjsify install: removed stale install lock (${t.reason}) — ${C}`);continue}if(!H){H=!0;let n=t.ownerPid===void 0?``:` (pid ${t.ownerPid})`;ge.warn(`gjsify install: waiting for a concurrent install${n} to release ${C} …`)}await delay(I,n.signal),I=Math.min(Math.round(I*1.6),GI)}}var zI,BI,VI,HI,WI,GI,KI,qI,JI=__esmMin(()=>{_e(),Md(),jn(),RI(),zI=`.gjsify-install-lock`,BI=`owner.json`,VI=35*6e4,HI=15e3,WI=150,GI=1e3,KI=new Map,qI=0});function cacheRoot$1(){return gjsifyCacheRoot(`tarballs`,YI)}function parseSri$1(t){if(!t)return null;let n=t.indexOf(`-`);if(n<=0||n===t.length-1)return null;let S=t.slice(0,n),C=t.slice(n+1).replace(/=+$/,``),N=Xe.from(C,`base64`).toString(`hex`);return N.length<4?null:{algorithm:S,hex:N}}function pathFor$3(t){let n=parseSri$1(t);if(!n)return null;let S=n.hex.slice(0,2);return xn(cacheRoot$1(),n.algorithm,S,`${n.hex}.tgz`)}async function getCachedTarball(t){let n=pathFor$3(t);if(!n||!t)return null;let S=readCacheFile(n);if(!S)return null;if(await verifyIntegrity(S,t))return S;try{unlinkSync(n)}catch{}return null}function putCachedTarball(t,n){let S=pathFor$3(t);S&&(existsSync(S)||atomicWrite(S,n))}function npmCacacheContentDir(){let t=process.env.GJSIFY_NPM_CACHE;if(t!==void 0){let n=t.trim();return n===``||n===`0`||n===`false`?null:xn(n.endsWith(`_cacache`)?n:xn(n,`_cacache`),`content-v2`)}let n=process.env.npm_config_cache;return xn(n&&n.length>0?n:xn(homedir(),`.npm`),`_cacache`,`content-v2`)}function npmCachePathFor(t){let n=npmCacacheContentDir();if(!n)return null;let S=parseSri$1(t);return S?xn(n,S.algorithm,S.hex.slice(0,2),S.hex.slice(2,4),S.hex.slice(4)):null}async function getForeignCachedTarball(t){let n=npmCachePathFor(t);if(!n||!t)return null;let S=readCacheFile(n);return S&&await verifyIntegrity(S,t)?S:null}var YI,XI=__esmMin(()=>{ot(),Md(),Dg(),jn(),Jm(),LI(),YI=`v1`,__name$1(cacheRoot$1,`cacheRoot`),__name$1(parseSri$1,`parseSri`),__name$1(pathFor$3,`pathFor`)});function isEnabled(){let t=process.env.GJSIFY_PACKUMENT_CACHE;if(t===void 0)return!0;let n=t.trim();return!(n===`0`||n===`false`||n===``)}function cacheRoot(){return gjsifyCacheRoot(`metadata`,ZI)}function shardFor(t){let n=2166136261;for(let S=0;S<t.length;S++)n^=t.charCodeAt(S),n=Math.imul(n,16777619);return(n>>>0&255).toString(16).padStart(2,`0`)}function encodePart(t){return encodeURIComponent(t).replace(/\*/g,`%2A`)}function packumentCacheKey(t,n,S){return`${S},${encodePart(t)},${encodePart(n)}`}function pathFor$2(t,n,S){if(!isEnabled())return null;let C=packumentCacheKey(t,n,S);return xn(cacheRoot(),shardFor(C),`${C}.json`)}function getCachedPackument(t,n,S=`corgi`){let C=pathFor$2(t,n,S);if(!C)return null;let N=readCacheFile(C);if(!N)return null;try{let t=JSON.parse(N.toString(`utf-8`));return typeof t.etag!=`string`||!t.etag||!t.packument||typeof t.packument!=`object`?null:{etag:t.etag,packument:t.packument}}catch{return null}}function putCachedPackument(t,n,S,C,N=`corgi`){if(!S)return;let F=pathFor$2(t,n,N);F&&atomicWrite(F,JSON.stringify({etag:S,packument:C}))}var ZI,QI=__esmMin(()=>{jn(),LI(),ZI=`v3`,__name$1(pathFor$2,`pathFor`)});function parseNodeMajor(t){return Number.parseInt(String(t).split(`.`,1)[0]??``,10)}function nativeBackendNodeError(t,n){if(!n)return null;let S=parseNodeMajor(t);return!Number.isFinite(S)||S>=24?null:`gjsify install (native backend) requires Node ≥ 24, but this is Node ${t}. Its prebuilt native modules are ABI-locked to Node 24 and crash on older majors. Use Node 24 (nvm/asdf locally, actions/setup-node in CI), or run with --backend npm.`}function onRealNode(){return gjsSystemVersion()===void 0?isNode():!1}function assertNativeBackendNodeVersion(){let t=nativeBackendNodeError(process.versions.node,onRealNode());if(t)throw Error(t)}var $I=__esmMin(()=>{t_()});function normalizePath(t){let n=On===`/`?t:t.split(On).join(`/`);return n.endsWith(`/`)?n.slice(0,-1):n}function findExtraneous(t){let n=new Set(t.expected.map(t=>normalizePath(t.installPath))),S=[];for(let C of t.installed){if(C.linked)continue;let N=normalizePath(Sn(t.prefix,C.dir));N===``||N.startsWith(`..`)||n.has(N)||S.push({installPath:N,name:C.name,version:C.version})}S.sort((t,n)=>t.installPath<n.installPath?-1:+(t.installPath>n.installPath));let C=[];for(let t of S){let n=C[C.length-1];n&&t.installPath.startsWith(`${n.installPath}/`)||C.push(t)}return C}function formatExtraneousError(t,n){let S=t.slice(0,20),C=S.map(t=>` ${t.installPath} (${t.name}@${t.version})`);return t.length>S.length&&C.push(` … and ${t.length-S.length} more`),[`install: --immutable, but ${n}/node_modules holds ${t.length} package(s) that gjsify-lock.json does not describe.`,`--immutable installs the lockfile and removes nothing, so each of these would survive the install and be resolved, bundled and type-checked as if it belonged (gjsify#1683: a nested copy of an already-hoisted package → TS2883, one type with two identities).`,...C,"Fix: delete those directories — or the whole node_modules — and re-run. A plain `gjsify install` does NOT clear them: it only ever adds, and its prune pass judges foreign-PLATFORM packages alone (prune-prefix.ts), so an undescribed package survives both. Deleting is currently the only thing that removes one. In CI this usually means a cache entry was restored from a DIFFERENT lockfile."].join(`
907
- `)}var eL=__esmMin(()=>{jn()});function dirLinkTarget(t,n,S=tL){return S===`junction`?vn(n):Sn(wn(t),n)}function linkDirSync(t,n){assertAbsolute(n),symlinkSync(dirLinkTarget(t,n),t,nL)}function replicateLinkSync(t,n){let S=readlinkSync(t);if(!dirLinksAreJunctions()){symlinkSync(S,n);return}let C=vn(wn(t),S),N;try{N=statSync(C).isDirectory()}catch{symlinkSync(S,n);return}N?symlinkSync(C,n,`junction`):symlinkSync(S,n,`file`)}function assertAbsolute(t){if(vn(t)!==t)throw TypeError(`linkDir: target must be an absolute path, got ${JSON.stringify(t)}. Node resolves a Windows junction target against the process CWD rather than the link's own directory, so a relative target silently points somewhere else there.`)}var tL,nL,dirLinksAreJunctions,rL=__esmMin(()=>{Md(),hd(),jn(),tL=process.platform===`win32`?`junction`:`symlink`,nL=tL===`junction`?`junction`:void 0,dirLinksAreJunctions=()=>tL===`junction`});function checkList(t,n){let S=typeof n==`string`?[n]:n;if(S.length===1&&S[0]===`any`)return!0;let C=0,N=!1;for(let n of S){let S=n.charAt(0)===`!`,F=S?n.slice(1):n;if(S){if(C++,t===F)return!1}else N||=t===F}return N||C===S.length}function checkPlatform(t,n){let S=t.os?checkList(n.os,t.os):!0,C=t.cpu?checkList(n.cpu,t.cpu):!0,N=t.libc?checkList(n.libc,t.libc):!0;return t.libc&&!n.libc&&(N=!1),{ok:S&&C&&N,current:{os:n.os,cpu:n.cpu,libc:n.libc},required:{os:t.os,cpu:t.cpu,libc:t.libc}}}function declaresPlatform(t){return!!(t.os||t.cpu||t.libc)}function badPlatformError(t,n){let S=Error(`Unsupported platform for ${t}: wanted ${JSON.stringify(n.required)} (current: ${JSON.stringify(n.current)})`);return S.code=`EBADPLATFORM`,S.pkgid=t,S.current=n.current,S.required=n.required,S}function isMuslSharedObject(t){return t.includes(`libc.musl-`)||t.includes(`ld-musl-`)}function libcFromLddFile(t){let n=t.readTextFile(iL);if(n!==null)return n.includes(`musl`)?`musl`:n.includes(`GNU C Library`)?`glibc`:null}function libcFromReportData(t){return t.glibcVersionRuntime?`glibc`:Array.isArray(t.sharedObjects)&&t.sharedObjects.some(t=>isMuslSharedObject(String(t)))?`musl`:null}function libcFromLoaderScan(t,n=aL){let S=!1;for(let C of n){let n=t.listDir(C);if(n)for(let t of n){if(t.startsWith(`ld-linux`))return`glibc`;t.startsWith(`ld-musl-`)&&(S=!0)}}return S?`musl`:null}function detectLibc(t,n){if(t!==`linux`)return;let S=libcFromLddFile(n);if(S!==void 0)return S??void 0;let C=n.diagnosticReport();return C===null?libcFromLoaderScan(n)??void 0:libcFromReportData(C)??void 0}function defaultLibcProbeHost(){return{readTextFile(t){try{return readFileSync(t,`utf-8`)}catch{return null}},listDir(t){try{return readdirSync(t)}catch{return null}},diagnosticReport(){let t=process.report;if(!t||typeof t.getReport!=`function`)return null;let n=t.excludeNetwork;t.excludeNetwork=!0;try{let n=t.getReport();return{glibcVersionRuntime:n.header?.glibcVersionRuntime,sharedObjects:n.sharedObjects}}finally{t.excludeNetwork=n}}}}function hostLibc(t,n=defaultLibcProbeHost()){return sL||=(oL=detectLibc(t,n),!0),oL}function readPlatformOverrides(t){let pick=n=>{let S=t[n];if(typeof S!=`string`)return;let C=S.trim();return C===``?void 0:C},n={},S=pick(`npm_config_os`),C=pick(`npm_config_cpu`),N=pick(`npm_config_libc`);return S!==void 0&&(n.os=S),C!==void 0&&(n.cpu=C),N!==void 0&&(n.libc=N),n}function readPlatformForce(t){let n=t.npm_config_force;if(typeof n!=`string`)return!1;let S=n.trim().toLowerCase();return S===`true`||S===`1`}function resolveHostPlatform(t={}){let n=readPlatformOverrides(t.env??process.env),S=n.os??t.platform??process.platform;return{os:S,cpu:n.cpu??t.arch??process.arch,libc:n.libc??(S===`linux`?hostLibc(S,t.probe??defaultLibcProbeHost()):void 0)}}function describePlatformTarget(t){return`${t.os}-${t.cpu}${t.libc?`-${t.libc}`:``}`}var iL,aL,oL,sL,cL=__esmMin(()=>{Md(),iL=`/usr/bin/ldd`,aL=[`/lib`,`/lib64`,`/usr/lib`],sL=!1});function isReservedEntry(t){return t.startsWith(`.`)}function readManifest(t){try{let n=JSON.parse(readFileSync(xn(t,`package.json`),`utf8`)),S={os:n.os,cpu:n.cpu,libc:n.libc};return{name:typeof n.name==`string`?n.name:void 0,version:typeof n.version==`string`?n.version:void 0,platform:declaresPlatform(S)?S:void 0}}catch{return null}}function collect(t,n){let S;try{S=readdirSync(t,{withFileTypes:!0})}catch{return}for(let C of S){if(isReservedEntry(C.name))continue;let S=xn(t,C.name);if(C.name.startsWith(`@`)){let t;try{t=readdirSync(S,{withFileTypes:!0})}catch{continue}for(let C of t)isReservedEntry(C.name)||addPackage(xn(S,C.name),n);continue}addPackage(S,n)}}function addPackage(t,n){let S=!1;try{S=lstatSync(t).isSymbolicLink()}catch{return}let C=readManifest(t);n.push({name:C?.name??t,version:C?.version??`0.0.0`,dir:t,linked:S,platform:C?.platform}),S||collect(xn(t,`node_modules`),n)}function scanPrefix(t){let n=[];return collect(xn(t,`node_modules`),n),n}function planPlatformPrune(t,n){let S=[];for(let C of t){if(C.linked||!C.platform)continue;let t=checkPlatform(C.platform,n);t.ok||S.push({pkg:C,bytes:0,verdict:t})}return S}function dirBytes(t){let n=0,S=[t];for(;S.length>0;){let t=S.pop(),C;try{C=readdirSync(t,{withFileTypes:!0})}catch{continue}for(let N of C){let C=xn(t,N.name);if(N.isDirectory())S.push(C);else if(N.isFile())try{n+=statSync(C).size}catch{}}}return n}function planPrune(t){let n=scanPrefix(t.prefix),S=planPlatformPrune(n,t.target);for(let t of S)t.bytes=dirBytes(t.pkg.dir);return{prefix:t.prefix,target:t.target,scanned:n.length,entries:S,bytes:S.reduce((t,n)=>t+n.bytes,0)}}function executePrune(t,n={}){let S=[],C=[],N=[],F=n.remove??(t=>rmSync(t,{recursive:!0,force:!0,maxRetries:10}));if(!n.dryRun){for(let n of t.entries)try{F(n.pkg.dir),S.push(n)}catch(t){C.push({entry:n,error:t.message})}N.push(...pruneDeadBinLinks(t.prefix))}return{plan:t,removed:S,failed:C,bytes:S.reduce((t,n)=>t+n.bytes,0),binLinks:N}}function pruneDeadBinLinks(t){let n=xn(t,`node_modules`,`.bin`),S=[],C;try{C=readdirSync(n,{withFileTypes:!0})}catch{return S}for(let t of C){let C=xn(n,t.name);try{if(!lstatSync(C).isSymbolicLink()||existsSync(C))continue;unlinkSync(C),S.push(t.name)}catch{}}return S}function humanBytes(t){if(t<1024)return`${t} B`;let n=[`KB`,`MB`,`GB`],S=t/1024,C=0;for(;S>=1024&&C<n.length-1;)S/=1024,C+=1;return`${S.toFixed(1)} ${n[C]}`}function formatPruneReport(t,n){let{plan:S}=t,C=[`${S.prefix} · target ${describePlatformTarget(S.target)} · scanned ${S.scanned} package(s)`];if(S.entries.length===0)return C.push(`nothing to prune — no installed package declares a platform this target cannot use.`),C.join(`
906
+ `)){let t=/^\s*(\d+)\s+(\d+)\s*$/.exec(S);if(!t)continue;let C=Number(t[1]),N=Number(t[2]);if(C<=0||N<=0||C===N)continue;let F=n.get(N);F?F.push(C):n.set(N,[C])}return n}function readProcChildren(t){let n;try{n=readdirSync(`/proc/${t}/task`)}catch{return null}let S=[],C=!1;for(let N of n)try{let n=readFileSync(`/proc/${t}/task/${N}/children`,`utf-8`);C=!0;for(let t of n.trim().split(/\s+/)){let n=Number(t);Number.isInteger(n)&&n>0&&S.push(n)}}catch{}return C?S:null}function procPpidMap(){let t=new Map,n=[];try{n=readdirSync(`/proc`)}catch{return t}for(let S of n){let n=Number(S);if(!(!Number.isInteger(n)||n<=0))try{let S=readFileSync(`/proc/${n}/stat`,`utf-8`),C=S.slice(S.lastIndexOf(`)`)+2).split(` `),N=Number(C[1]);if(!Number.isInteger(N)||N<=0)continue;let F=t.get(N);F?F.push(n):t.set(N,[n])}catch{}}return t}function osPpidMap(){let[t,n]=process.platform===`win32`?[`powershell.exe`,[`-NoProfile`,`-NonInteractive`,`-Command`,`Get-CimInstance Win32_Process | ForEach-Object { "$($_.ProcessId) $($_.ParentProcessId)" }`]]:[`ps`,[`-A`,`-o`,`pid=,ppid=`]];try{let S=spawnSync(t,n,{encoding:`utf-8`});return S.status!==0||typeof S.stdout!=`string`?new Map:parsePsPidPpid(S.stdout)}catch{return new Map}}function collectDescendants(t){let n=[],S=new Set([t]),C=[t],N=null;for(;C.length>0;){let t=C.shift(),F=N?null:readProcChildren(t);F===null&&(N||(N=procPpidMap(),N.size===0&&(N=osPpidMap())),F=N.get(t)??[]);for(let t of F)S.has(t)||(S.add(t),n.push(t),C.push(t))}return n}var RI=__esmMin(()=>{w_(),Md()});function staleMs(){let t=process.env.GJSIFY_INSTALL_LOCK_STALE_MS;if(t!==void 0){let n=Number(t);if(Number.isFinite(n)&&n>0)return n}return VI}function lockingDisabled(){let t=process.env.GJSIFY_INSTALL_LOCK;if(t===void 0)return!1;let n=t.trim();return n===`0`||n===`false`}function mtimeMs(t){try{return statSync(t).mtimeMs}catch{return null}}function assessLock(t){let n=xn(t,BI),S=null;try{S=JSON.parse(readFileSync(n,`utf-8`))}catch{S=null}let C=Date.now();if(S&&typeof S.pid==`number`){if(!isPidAlive(S.pid))return{stale:!0,reason:`owner pid ${S.pid} is gone`,ownerPid:S.pid};let t=typeof S.startedAt==`number`?S.startedAt:mtimeMs(n);return t!==null&&C-t>staleMs()?{stale:!0,reason:`owner pid ${S.pid} exceeded the ${staleMs()}ms staleness budget`,ownerPid:S.pid}:{stale:!1,ownerPid:S.pid}}let N=mtimeMs(t);return N===null?{stale:!1}:C-N>HI?{stale:!0,reason:`no owner recorded within the acquire grace period`}:{stale:!1}}function stealStaleLock(t){let n=`${t}.stale-${process.pid}-${++qI}`;try{renameSync(t,n)}catch{return!1}try{rmSync(n,{recursive:!0,force:!0})}catch{}return!0}function abortErr(t){let n=t&&`reason`in t?t.reason:void 0;if(n instanceof Error)return n;let S=Error(`Aborted`);return S.name=`AbortError`,S}function delay(t,n){return t<=0?Promise.resolve():new Promise((S,C)=>{let onAbort=()=>{clearTimeout(N),C(abortErr(n))},N=setTimeout(()=>{n?.removeEventListener?.(`abort`,onAbort),S()},t);if(n?.aborted){clearTimeout(N),C(abortErr(n));return}n?.addEventListener?.(`abort`,onAbort,{once:!0})})}function makeHandle(t){let n=!1;return{release(){if(n)return;n=!0;let S=KI.get(t);if(S&&(S.count--,!(S.count>0))){KI.delete(t);try{let n=JSON.parse(readFileSync(xn(t,BI),`utf-8`));if(n.nonce!==void 0&&n.nonce!==S.nonce)return}catch{}try{rmSync(t,{recursive:!0,force:!0})}catch{}}}}}async function acquireInstallLock(t,n={}){if(lockingDisabled())return{release(){}};let S;try{S=realpathSync(t)}catch{S=vn(t)}let C=xn(S,`node_modules`,zI),N=KI.get(C);if(N)return N.count++,makeHandle(C);mkdirSync(wn(C),{recursive:!0});let F=`${process.pid}-${Date.now()}-${Math.random().toString(36).slice(2)}`,I=WI,H=!1;for(;;){if(n.signal?.aborted)throw abortErr(n.signal);try{return mkdirSync(C),writeFileSync(xn(C,BI),JSON.stringify({pid:process.pid,nonce:F,startedAt:Date.now()})),KI.set(C,{count:1,nonce:F}),makeHandle(C)}catch(t){if(t.code!==`EEXIST`)throw t}let t=assessLock(C);if(t.stale){stealStaleLock(C)&&ge.warn(`gjsify install: removed stale install lock (${t.reason}) — ${C}`);continue}if(!H){H=!0;let n=t.ownerPid===void 0?``:` (pid ${t.ownerPid})`;ge.warn(`gjsify install: waiting for a concurrent install${n} to release ${C} …`)}await delay(I,n.signal),I=Math.min(Math.round(I*1.6),GI)}}var zI,BI,VI,HI,WI,GI,KI,qI,JI=__esmMin(()=>{_e(),Md(),jn(),RI(),zI=`.gjsify-install-lock`,BI=`owner.json`,VI=35*6e4,HI=15e3,WI=150,GI=1e3,KI=new Map,qI=0});function cacheRoot$1(){return gjsifyCacheRoot(`tarballs`,YI)}function parseSri$1(t){if(!t)return null;let n=t.indexOf(`-`);if(n<=0||n===t.length-1)return null;let S=t.slice(0,n),C=t.slice(n+1).replace(/=+$/,``),N=Xe.from(C,`base64`).toString(`hex`);return N.length<4?null:{algorithm:S,hex:N}}function pathFor$3(t){let n=parseSri$1(t);if(!n)return null;let S=n.hex.slice(0,2);return xn(cacheRoot$1(),n.algorithm,S,`${n.hex}.tgz`)}async function getCachedTarball(t){let n=pathFor$3(t);if(!n||!t)return null;let S=readCacheFile(n);if(!S)return null;if(await verifyIntegrity(S,t))return S;try{unlinkSync(n)}catch{}return null}function putCachedTarball(t,n){let S=pathFor$3(t);S&&(existsSync(S)||atomicWrite(S,n))}function npmCacacheContentDir(){let t=process.env.GJSIFY_NPM_CACHE;if(t!==void 0){let n=t.trim();return n===``||n===`0`||n===`false`?null:xn(n.endsWith(`_cacache`)?n:xn(n,`_cacache`),`content-v2`)}let n=process.env.npm_config_cache;return xn(n&&n.length>0?n:xn(homedir(),`.npm`),`_cacache`,`content-v2`)}function npmCachePathFor(t){let n=npmCacacheContentDir();if(!n)return null;let S=parseSri$1(t);return S?xn(n,S.algorithm,S.hex.slice(0,2),S.hex.slice(2,4),S.hex.slice(4)):null}async function getForeignCachedTarball(t){let n=npmCachePathFor(t);if(!n||!t)return null;let S=readCacheFile(n);return S&&await verifyIntegrity(S,t)?S:null}var YI,XI=__esmMin(()=>{ot(),Md(),Dg(),jn(),Jm(),LI(),YI=`v1`,__name$1(cacheRoot$1,`cacheRoot`),__name$1(parseSri$1,`parseSri`),__name$1(pathFor$3,`pathFor`)});function isEnabled(){let t=process.env.GJSIFY_PACKUMENT_CACHE;if(t===void 0)return!0;let n=t.trim();return!(n===`0`||n===`false`||n===``)}function cacheRoot(){return gjsifyCacheRoot(`metadata`,ZI)}function shardFor(t){let n=2166136261;for(let S=0;S<t.length;S++)n^=t.charCodeAt(S),n=Math.imul(n,16777619);return(n>>>0&255).toString(16).padStart(2,`0`)}function encodePart(t){return encodeURIComponent(t).replace(/\*/g,`%2A`)}function packumentCacheKey(t,n,S){return`${S},${encodePart(t)},${encodePart(n)}`}function pathFor$2(t,n,S){if(!isEnabled())return null;let C=packumentCacheKey(t,n,S);return xn(cacheRoot(),shardFor(C),`${C}.json`)}function getCachedPackument(t,n,S=`corgi`){let C=pathFor$2(t,n,S);if(!C)return null;let N=readCacheFile(C);if(!N)return null;try{let t=JSON.parse(N.toString(`utf-8`));return typeof t.etag!=`string`||!t.etag||!t.packument||typeof t.packument!=`object`?null:{etag:t.etag,packument:t.packument}}catch{return null}}function putCachedPackument(t,n,S,C,N=`corgi`){if(!S)return;let F=pathFor$2(t,n,N);F&&atomicWrite(F,JSON.stringify({etag:S,packument:C}))}var ZI,QI=__esmMin(()=>{jn(),LI(),ZI=`v3`,__name$1(pathFor$2,`pathFor`)});function parseNodeMajor(t){return Number.parseInt(String(t).split(`.`,1)[0]??``,10)}function nativeBackendNodeError(t,n){if(!n)return null;let S=parseNodeMajor(t);return!Number.isFinite(S)||S>=24?null:`gjsify install (native backend) requires Node ≥ 24, but this is Node ${t}. Its prebuilt native modules are ABI-locked to Node 24 and crash on older majors. Use Node 24 (nvm/asdf locally, actions/setup-node in CI), or run with --backend npm.`}function onRealNode(){return gjsSystemVersion()===void 0?isNode():!1}function assertNativeBackendNodeVersion(){let t=nativeBackendNodeError(process.versions.node,onRealNode());if(t)throw Error(t)}var $I=__esmMin(()=>{t_()});function normalizePath(t){let n=On===`/`?t:t.split(On).join(`/`);return n.endsWith(`/`)?n.slice(0,-1):n}function findExtraneous(t){let n=new Set(t.expected.map(t=>normalizePath(t.installPath))),S=t.installed.filter(t=>t.bundles&&!t.linked).map(n=>`${normalizePath(Sn(t.prefix,n.dir))}/node_modules/`),C=[];for(let N of t.installed){if(N.linked)continue;let F=normalizePath(Sn(t.prefix,N.dir));F===``||F.startsWith(`..`)||n.has(F)||S.some(t=>F.startsWith(t))||C.push({installPath:F,name:N.name,version:N.version})}C.sort((t,n)=>t.installPath<n.installPath?-1:+(t.installPath>n.installPath));let N=[];for(let t of C){let n=N[N.length-1];n&&t.installPath.startsWith(`${n.installPath}/`)||N.push(t)}return N}function formatExtraneousError(t,n){let S=t.slice(0,20),C=S.map(t=>` ${t.installPath} (${t.name}@${t.version})`);return t.length>S.length&&C.push(` … and ${t.length-S.length} more`),[`install: --immutable, but ${n}/node_modules holds ${t.length} package(s) that gjsify-lock.json does not describe.`,`--immutable installs the lockfile and removes nothing, so each of these would survive the install and be resolved, bundled and type-checked as if it belonged (gjsify#1683: a nested copy of an already-hoisted package → TS2883, one type with two identities).`,...C,"Fix: delete those directories — or the whole node_modules — and re-run. A plain `gjsify install` does NOT clear them: it only ever adds, and its prune pass judges foreign-PLATFORM packages alone (prune-prefix.ts), so an undescribed package survives both. Deleting is currently the only thing that removes one. In CI this usually means a cache entry was restored from a DIFFERENT lockfile."].join(`
907
+ `)}var eL=__esmMin(()=>{jn()});function dirLinkTarget(t,n,S=tL){return S===`junction`?vn(n):Sn(wn(t),n)}function linkDirSync(t,n){assertAbsolute(n),symlinkSync(dirLinkTarget(t,n),t,nL)}function replicateLinkSync(t,n){let S=readlinkSync(t);if(!dirLinksAreJunctions()){symlinkSync(S,n);return}let C=vn(wn(t),S),N;try{N=statSync(C).isDirectory()}catch{symlinkSync(S,n);return}N?symlinkSync(C,n,`junction`):symlinkSync(S,n,`file`)}function assertAbsolute(t){if(vn(t)!==t)throw TypeError(`linkDir: target must be an absolute path, got ${JSON.stringify(t)}. Node resolves a Windows junction target against the process CWD rather than the link's own directory, so a relative target silently points somewhere else there.`)}var tL,nL,dirLinksAreJunctions,rL=__esmMin(()=>{Md(),hd(),jn(),tL=process.platform===`win32`?`junction`:`symlink`,nL=tL===`junction`?`junction`:void 0,dirLinksAreJunctions=()=>tL===`junction`});function checkList(t,n){let S=typeof n==`string`?[n]:n;if(S.length===1&&S[0]===`any`)return!0;let C=0,N=!1;for(let n of S){let S=n.charAt(0)===`!`,F=S?n.slice(1):n;if(S){if(C++,t===F)return!1}else N||=t===F}return N||C===S.length}function checkPlatform(t,n){let S=t.os?checkList(n.os,t.os):!0,C=t.cpu?checkList(n.cpu,t.cpu):!0,N=t.libc?checkList(n.libc,t.libc):!0;return t.libc&&!n.libc&&(N=!1),{ok:S&&C&&N,current:{os:n.os,cpu:n.cpu,libc:n.libc},required:{os:t.os,cpu:t.cpu,libc:t.libc}}}function declaresPlatform(t){return!!(t.os||t.cpu||t.libc)}function badPlatformError(t,n){let S=Error(`Unsupported platform for ${t}: wanted ${JSON.stringify(n.required)} (current: ${JSON.stringify(n.current)})`);return S.code=`EBADPLATFORM`,S.pkgid=t,S.current=n.current,S.required=n.required,S}function isMuslSharedObject(t){return t.includes(`libc.musl-`)||t.includes(`ld-musl-`)}function libcFromLddFile(t){let n=t.readTextFile(iL);if(n!==null)return n.includes(`musl`)?`musl`:n.includes(`GNU C Library`)?`glibc`:null}function libcFromReportData(t){return t.glibcVersionRuntime?`glibc`:Array.isArray(t.sharedObjects)&&t.sharedObjects.some(t=>isMuslSharedObject(String(t)))?`musl`:null}function libcFromLoaderScan(t,n=aL){let S=!1;for(let C of n){let n=t.listDir(C);if(n)for(let t of n){if(t.startsWith(`ld-linux`))return`glibc`;t.startsWith(`ld-musl-`)&&(S=!0)}}return S?`musl`:null}function detectLibc(t,n){if(t!==`linux`)return;let S=libcFromLddFile(n);if(S!==void 0)return S??void 0;let C=n.diagnosticReport();return C===null?libcFromLoaderScan(n)??void 0:libcFromReportData(C)??void 0}function defaultLibcProbeHost(){return{readTextFile(t){try{return readFileSync(t,`utf-8`)}catch{return null}},listDir(t){try{return readdirSync(t)}catch{return null}},diagnosticReport(){let t=process.report;if(!t||typeof t.getReport!=`function`)return null;let n=t.excludeNetwork;t.excludeNetwork=!0;try{let n=t.getReport();return{glibcVersionRuntime:n.header?.glibcVersionRuntime,sharedObjects:n.sharedObjects}}finally{t.excludeNetwork=n}}}}function hostLibc(t,n=defaultLibcProbeHost()){return sL||=(oL=detectLibc(t,n),!0),oL}function readPlatformOverrides(t){let pick=n=>{let S=t[n];if(typeof S!=`string`)return;let C=S.trim();return C===``?void 0:C},n={},S=pick(`npm_config_os`),C=pick(`npm_config_cpu`),N=pick(`npm_config_libc`);return S!==void 0&&(n.os=S),C!==void 0&&(n.cpu=C),N!==void 0&&(n.libc=N),n}function readPlatformForce(t){let n=t.npm_config_force;if(typeof n!=`string`)return!1;let S=n.trim().toLowerCase();return S===`true`||S===`1`}function resolveHostPlatform(t={}){let n=readPlatformOverrides(t.env??process.env),S=n.os??t.platform??process.platform;return{os:S,cpu:n.cpu??t.arch??process.arch,libc:n.libc??(S===`linux`?hostLibc(S,t.probe??defaultLibcProbeHost()):void 0)}}function describePlatformTarget(t){return`${t.os}-${t.cpu}${t.libc?`-${t.libc}`:``}`}var iL,aL,oL,sL,cL=__esmMin(()=>{Md(),iL=`/usr/bin/ldd`,aL=[`/lib`,`/lib64`,`/usr/lib`],sL=!1});function isReservedEntry(t){return t.startsWith(`.`)}function readManifest(t){try{let n=JSON.parse(readFileSync(xn(t,`package.json`),`utf8`)),S={os:n.os,cpu:n.cpu,libc:n.libc};return{name:typeof n.name==`string`?n.name:void 0,version:typeof n.version==`string`?n.version:void 0,platform:declaresPlatform(S)?S:void 0,bundles:[n.bundleDependencies,n.bundledDependencies].some(t=>t===!0||Array.isArray(t)&&t.length>0)}}catch{return null}}function collect(t,n){let S;try{S=readdirSync(t,{withFileTypes:!0})}catch{return}for(let C of S){if(isReservedEntry(C.name))continue;let S=xn(t,C.name);if(C.name.startsWith(`@`)){let t;try{t=readdirSync(S,{withFileTypes:!0})}catch{continue}for(let C of t)isReservedEntry(C.name)||addPackage(xn(S,C.name),n);continue}addPackage(S,n)}}function addPackage(t,n){let S=!1;try{S=lstatSync(t).isSymbolicLink()}catch{return}let C=readManifest(t);n.push({name:C?.name??t,version:C?.version??`0.0.0`,dir:t,linked:S,platform:C?.platform,bundles:C?.bundles}),S||collect(xn(t,`node_modules`),n)}function scanPrefix(t){let n=[];return collect(xn(t,`node_modules`),n),n}function planPlatformPrune(t,n){let S=[];for(let C of t){if(C.linked||!C.platform)continue;let t=checkPlatform(C.platform,n);t.ok||S.push({pkg:C,bytes:0,verdict:t})}return S}function dirBytes(t){let n=0,S=[t];for(;S.length>0;){let t=S.pop(),C;try{C=readdirSync(t,{withFileTypes:!0})}catch{continue}for(let N of C){let C=xn(t,N.name);if(N.isDirectory())S.push(C);else if(N.isFile())try{n+=statSync(C).size}catch{}}}return n}function planPrune(t){let n=scanPrefix(t.prefix),S=planPlatformPrune(n,t.target);for(let t of S)t.bytes=dirBytes(t.pkg.dir);return{prefix:t.prefix,target:t.target,scanned:n.length,entries:S,bytes:S.reduce((t,n)=>t+n.bytes,0)}}function executePrune(t,n={}){let S=[],C=[],N=[],F=n.remove??(t=>rmSync(t,{recursive:!0,force:!0,maxRetries:10}));if(!n.dryRun){for(let n of t.entries)try{F(n.pkg.dir),S.push(n)}catch(t){C.push({entry:n,error:t.message})}N.push(...pruneDeadBinLinks(t.prefix))}return{plan:t,removed:S,failed:C,bytes:S.reduce((t,n)=>t+n.bytes,0),binLinks:N}}function pruneDeadBinLinks(t){let n=xn(t,`node_modules`,`.bin`),S=[],C;try{C=readdirSync(n,{withFileTypes:!0})}catch{return S}for(let t of C){let C=xn(n,t.name);try{if(!lstatSync(C).isSymbolicLink()||existsSync(C))continue;unlinkSync(C),S.push(t.name)}catch{}}return S}function humanBytes(t){if(t<1024)return`${t} B`;let n=[`KB`,`MB`,`GB`],S=t/1024,C=0;for(;S>=1024&&C<n.length-1;)S/=1024,C+=1;return`${S.toFixed(1)} ${n[C]}`}function formatPruneReport(t,n){let{plan:S}=t,C=[`${S.prefix} · target ${describePlatformTarget(S.target)} · scanned ${S.scanned} package(s)`];if(S.entries.length===0)return C.push(`nothing to prune — no installed package declares a platform this target cannot use.`),C.join(`
908
908
  `);let N=n.verbose?S.entries:S.entries.slice(0,lL);for(let t of N){let n=JSON.stringify(t.verdict.required);C.push(` ${t.pkg.name}@${t.pkg.version} ${humanBytes(t.bytes)} requires ${n}`)}N.length<S.entries.length&&C.push(` … and ${S.entries.length-N.length} more (--verbose to list them)`),C.push(n.dryRun?`would free ${humanBytes(S.bytes)} across ${S.entries.length} package(s) (apparent size)`:`freed ${humanBytes(t.bytes)} across ${t.removed.length} package(s) (apparent size)`),t.binLinks.length>0&&C.push(`removed ${t.binLinks.length} dangling .bin link(s): ${t.binLinks.join(`, `)}`);for(let n of t.failed)C.push(`FAILED ${n.entry.pkg.name}: ${n.error}`);return C.join(`
909
909
  `)}function automaticPruneRefusal(t,n){return Object.keys(readPlatformOverrides(t)).length>0?`the platform target was overridden on the command line`:n?`--immutable`:null}function pruneAfterInstall(t,n,S={}){try{if(automaticPruneRefusal(S.env??process.env,S.immutable??!1))return;let C=planPrune({prefix:t,target:n});if(C.entries.length===0)return;let N=executePrune(C);if(N.removed.length===0)return;let F=S.hint?` (${S.hint} to review)`:``;ge.log(`gjsify: pruned ${N.removed.length} package(s) this host cannot use, freeing ${humanBytes(N.bytes)}${F}`)}catch(t){process.env.GJSIFY_DEBUG&&ge.error(`gjsify: prune skipped — ${t.message}`)}}var lL,uL=__esmMin(()=>{_e(),Md(),jn(),cL(),lL=10});function devLinkPath(t){return xn(t,dL)}function readDevLinkOverride(t){let n=devLinkPath(t);if(!existsSync(n))return null;let S;try{S=JSON.parse(readFileSync(n,`utf-8`))}catch(t){throw Error(`gjsify link: ${n} is not valid JSON (${t instanceof Error?t.message:String(t)}). Fix it or run \`gjsify unlink\`.`)}if(!S||typeof S!=`object`)throw Error(`gjsify link: ${n} must contain a JSON object.`);let C=S;if(C.version!==1)throw Error(`gjsify link: ${n} declares version ${JSON.stringify(C.version)}; this CLI understands version 1 only.`);if(typeof C.checkout!=`string`||C.checkout.trim()===``)throw Error(`gjsify link: ${n} has no "checkout" path.`);return{version:1,checkout:bn(C.checkout)?C.checkout:vn(t,C.checkout),packages:Array.isArray(C.packages)?C.packages.filter(t=>typeof t==`string`):[]}}function writeDevLinkOverride(t,n){let S=devLinkPath(t);return writeFileSync(S,JSON.stringify(n,null,2)+`
910
910
  `),S}function removeDevLinkOverride(t){let n=devLinkPath(t);return existsSync(n)?(rmSync(n),n):null}function devLinkRoot(t){if(existsSync(devLinkPath(t)))return t;let n=findWorkspaceRoot(t);return n&&existsSync(devLinkPath(n))?n:t}function resolveCheckoutWorkspaces(t,n){if(!existsSync(t))throw Error(`gjsify link: the linked checkout ${t} does not exist (named by ${n}). Point it at a gjsify checkout, or run \`gjsify unlink\`.`);let S=readPackageJson$2(xn(t,`package.json`));if(!S||S.workspaces===void 0)throw Error(`gjsify link: ${t} is not a gjsify workspace — ${xn(t,`package.json`)} ${S?`declares no "workspaces" field`:`is missing or unreadable`} (named by ${n}).`);let C;try{C=discoverWorkspaces(t)}catch(S){throw Error(`gjsify link: ${t} declares "workspaces" but they could not be discovered (${S instanceof Error?S.message:String(S)}); named by ${n}.`)}if(C.length===0)throw Error(`gjsify link: ${t} declares "workspaces" but none were found (named by ${n}).`);return C}function consumerKnownNames(t){let n=new Set,S=[readPackageJson$2(xn(t,`package.json`))];try{for(let n of discoverWorkspaces(t))S.push(n.manifest)}catch{}for(let t of S)if(t)for(let S of[`dependencies`,`devDependencies`,`optionalDependencies`,`peerDependencies`]){let C=t[S];if(!(!C||typeof C!=`object`))for(let t of Object.keys(C))n.add(t)}for(let S of scanPrefix(t))n.add(S.name);return n}function planDevLinks(t){let n=t.patterns.length>0?filterWorkspaces(t.workspaces,{include:[...t.patterns]}):[...t.workspaces],S=[];for(let C of n)C.name&&t.knownNames.has(C.name)&&S.push({name:C.name,target:C.location,linkPath:xn(t.consumerRoot,`node_modules`,C.name)});return S.sort((t,n)=>t.name<n.name?-1:+(t.name>n.name)),S}function prepareDevLinks(t){let n=readDevLinkOverride(t);if(!n)return null;let S=devLinkPath(t),C=planDevLinks({consumerRoot:t,workspaces:resolveCheckoutWorkspaces(n.checkout,S),patterns:n.packages,knownNames:consumerKnownNames(t)});return{overridePath:S,consumerRoot:t,checkout:n.checkout,links:C,names:new Set(C.map(t=>t.name))}}function applyDevLinks(t){assertDevLinksBuilt(t);let n=[];for(let S of t)linkAlreadyPointsAt(S.linkPath,S.target)||(mkdirSync(wn(S.linkPath),{recursive:!0}),rmSync(S.linkPath,{recursive:!0,force:!0,maxRetries:10,retryDelay:100}),linkDirSync(S.linkPath,S.target),n.push(S));return n}function removeDevLinks(t){let n=[];for(let S of t){let t=!1;try{t=lstatSync(S.linkPath).isSymbolicLink()}catch{continue}t&&linkAlreadyPointsAt(S.linkPath,S.target)&&(rmSync(S.linkPath,{recursive:!0,force:!0,maxRetries:10,retryDelay:100}),n.push(S))}return n}function linkAlreadyPointsAt(t,n){try{return lstatSync(t).isSymbolicLink()?realpathSync(t)===realpathSync(n):!1}catch{return!1}}function scanDevLinks(t,n){let S=[];for(let t of n)try{S.push(realpathSync(t))}catch{}if(S.length===0)return[];let C=xn(t,`node_modules`),N=[],consider=t=>{let n=xn(C,t),F;try{if(!lstatSync(n).isSymbolicLink())return;F=realpathSync(n)}catch{return}S.some(t=>F===t||F.startsWith(t+On))&&N.push({name:t,target:F,linkPath:n})},F;try{F=readdirSync(C)}catch{return[]}for(let t of F)if(!t.startsWith(`.`)){if(t.startsWith(`@`)){let n;try{n=readdirSync(xn(C,t))}catch{continue}for(let S of n)consider(`${t}/${S}`);continue}consider(t)}return N.sort((t,n)=>t.name<n.name?-1:+(t.name>n.name)),N}function retireDevLinks(t,n,S){return removeDevLinks(scanDevLinks(t,n).filter(t=>!S.has(t.name)))}function unbuiltDevLinks(t){let n=[];for(let S of t){let t;try{t=JSON.parse(readFileSync(xn(S.target,`package.json`),`utf-8`))}catch(t){n.push({link:S,reason:`its package.json is missing or unreadable (${t instanceof Error?t.message:String(t)})`});continue}let C=[];for(let n of[`main`,`module`]){let S=t[n];typeof S==`string`&&C.push(S)}let N=t.exports;typeof N==`string`?C.push(N):N&&typeof N==`object`&&collectStringLeaves(N[`.`],C),C.length!==0&&(C.some(t=>existsSync(xn(S.target,t)))||n.push({link:S,reason:`none of its declared entry points exist yet (${C.join(`, `)})`}))}return n}function formatUnbuiltDevLinks(t){let n=t.map(t=>` ${t.link.name} ${t.link.target}\n ${t.reason}`).join(`
@@ -59,7 +59,10 @@ export interface ExtraneousPackage {
59
59
  * - a dot-entry like `.bin` or `.cache`, already dropped by the scan;
60
60
  * - a package the lockfile describes but the PLATFORM filter skipped on this host.
61
61
  * It is described, so it is not a stranger; removing the foreign-platform residue
62
- * is `prune-prefix.ts`'s separate job under a separate rule.
62
+ * is `prune-prefix.ts`'s separate job under a separate rule;
63
+ * - anything inside the `node_modules` of a package that declares
64
+ * `bundleDependencies`: its tarball put it there, so a second `--immutable` run
65
+ * over the first run's own output must not refuse it.
63
66
  *
64
67
  * Descendants of an extraneous directory are collapsed away: reporting the parent
65
68
  * says everything, and the nested `@girs` tree of the incident would otherwise list
@@ -52,7 +52,10 @@ function normalizePath(p) {
52
52
  * - a dot-entry like `.bin` or `.cache`, already dropped by the scan;
53
53
  * - a package the lockfile describes but the PLATFORM filter skipped on this host.
54
54
  * It is described, so it is not a stranger; removing the foreign-platform residue
55
- * is `prune-prefix.ts`'s separate job under a separate rule.
55
+ * is `prune-prefix.ts`'s separate job under a separate rule;
56
+ * - anything inside the `node_modules` of a package that declares
57
+ * `bundleDependencies`: its tarball put it there, so a second `--immutable` run
58
+ * over the first run's own output must not refuse it.
56
59
  *
57
60
  * Descendants of an extraneous directory are collapsed away: reporting the parent
58
61
  * says everything, and the nested `@girs` tree of the incident would otherwise list
@@ -60,6 +63,12 @@ function normalizePath(p) {
60
63
  */
61
64
  export function findExtraneous(opts) {
62
65
  const described = new Set(opts.expected.map((n) => normalizePath(n.installPath)));
66
+ // A package with `bundleDependencies` ships its own `node_modules` in the tarball
67
+ // (nativescript → universal-analytics + its debug/ms/uuid). Extracting it creates
68
+ // those directories, so the install's own output must not be refused on the next run.
69
+ const bundlerRoots = opts.installed
70
+ .filter((p) => p.bundles && !p.linked)
71
+ .map((p) => `${normalizePath(relative(opts.prefix, p.dir))}/node_modules/`);
63
72
  const found = [];
64
73
  for (const pkg of opts.installed) {
65
74
  if (pkg.linked)
@@ -70,6 +79,8 @@ export function findExtraneous(opts) {
70
79
  continue;
71
80
  if (described.has(installPath))
72
81
  continue;
82
+ if (bundlerRoots.some((root) => installPath.startsWith(root)))
83
+ continue;
73
84
  found.push({ installPath, name: pkg.name, version: pkg.version });
74
85
  }
75
86
  found.sort((a, b) => (a.installPath < b.installPath ? -1 : a.installPath > b.installPath ? 1 : 0));
@@ -15,6 +15,11 @@ export interface InstalledPackage {
15
15
  linked: boolean;
16
16
  /** The `os`/`cpu`/`libc` slice, absent when the manifest declares none. */
17
17
  platform?: PlatformDeclaration;
18
+ /**
19
+ * The manifest names `bundleDependencies`: its tarball ships a `node_modules` of
20
+ * its own, so whatever sits there came from extracting THIS package.
21
+ */
22
+ bundles?: boolean;
18
23
  }
19
24
  export interface PruneEntry {
20
25
  pkg: InstalledPackage;
@@ -47,6 +47,7 @@ function readManifest(dir) {
47
47
  name: typeof raw.name === 'string' ? raw.name : undefined,
48
48
  version: typeof raw.version === 'string' ? raw.version : undefined,
49
49
  platform: declaresPlatform(platform) ? platform : undefined,
50
+ bundles: [raw.bundleDependencies, raw.bundledDependencies].some((b) => b === true || (Array.isArray(b) && b.length > 0)),
50
51
  };
51
52
  }
52
53
  catch {
@@ -102,6 +103,7 @@ function addPackage(dir, out) {
102
103
  dir,
103
104
  linked,
104
105
  platform: manifest?.platform,
106
+ bundles: manifest?.bundles,
105
107
  });
106
108
  // A linked package is the user's own source tree — its `node_modules` is not
107
109
  // this prefix's to prune.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/cli",
3
- "version": "0.57.0",
3
+ "version": "0.59.0",
4
4
  "description": "CLI for Gjsify",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -142,22 +142,22 @@
142
142
  "cli"
143
143
  ],
144
144
  "dependencies": {
145
- "@gjsify/blueprint": "^0.57.0",
146
- "@gjsify/buffer": "^0.57.0",
147
- "@gjsify/create-app": "^0.57.0",
148
- "@gjsify/node-globals": "^0.57.0",
149
- "@gjsify/node-polyfills": "^0.57.0",
150
- "@gjsify/npm-registry": "^0.57.0",
151
- "@gjsify/resolve-npm": "^0.57.0",
152
- "@gjsify/rolldown-plugin-gjsify": "^0.57.0",
153
- "@gjsify/vite-plugin-blueprint": "^0.57.0",
154
- "@gjsify/rolldown-plugin-pnp": "^0.57.0",
155
- "@gjsify/semver": "^0.57.0",
156
- "@gjsify/tar": "^0.57.0",
157
- "@gjsify/tsc": "^0.57.0",
158
- "@gjsify/utils": "^0.57.0",
159
- "@gjsify/web-polyfills": "^0.57.0",
160
- "@gjsify/workspace": "^0.57.0",
145
+ "@gjsify/blueprint": "^0.59.0",
146
+ "@gjsify/buffer": "^0.59.0",
147
+ "@gjsify/create-app": "^0.59.0",
148
+ "@gjsify/node-globals": "^0.59.0",
149
+ "@gjsify/node-polyfills": "^0.59.0",
150
+ "@gjsify/npm-registry": "^0.59.0",
151
+ "@gjsify/resolve-npm": "^0.59.0",
152
+ "@gjsify/rolldown-plugin-gjsify": "^0.59.0",
153
+ "@gjsify/vite-plugin-blueprint": "^0.59.0",
154
+ "@gjsify/rolldown-plugin-pnp": "^0.59.0",
155
+ "@gjsify/semver": "^0.59.0",
156
+ "@gjsify/tar": "^0.59.0",
157
+ "@gjsify/tsc": "^0.59.0",
158
+ "@gjsify/utils": "^0.59.0",
159
+ "@gjsify/web-polyfills": "^0.59.0",
160
+ "@gjsify/workspace": "^0.59.0",
161
161
  "acorn": "^8.17.0",
162
162
  "cosmiconfig": "^9.0.2",
163
163
  "get-tsconfig": "^4.14.0",
@@ -166,13 +166,13 @@
166
166
  "yargs": "^18.0.0"
167
167
  },
168
168
  "devDependencies": {
169
- "@gjsify/unit": "^0.57.0",
169
+ "@gjsify/unit": "^0.59.0",
170
170
  "@types/yargs": "^17.0.35",
171
171
  "typescript": "^6.0.3"
172
172
  },
173
173
  "peerDependencies": {
174
- "@gjsify/oxfmt-native": "^0.57.0",
175
- "@gjsify/rolldown-native": "^0.57.0"
174
+ "@gjsify/oxfmt-native": "^0.59.0",
175
+ "@gjsify/rolldown-native": "^0.59.0"
176
176
  },
177
177
  "peerDependenciesMeta": {
178
178
  "@gjsify/oxfmt-native": {