@gjsify/cli 0.64.29 → 0.64.31

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
@@ -7,7 +7,7 @@ if(globalThis.__gjsifyBundleUrl??=import.meta.url,Symbol.dispose||(Symbol.dispos
7
7
  `).slice(1).join(`
8
8
  `)||``;this._write(`stderr`,`Trace:`,...t,`
9
9
  `+n)}profile(t){}profileEnd(t){}timeStamp(t){}},pe=new Console,log=(...t)=>pe.log(...t),info=(...t)=>pe.info(...t),me=__name$1((...t)=>pe.debug(...t),`debug`),warn=(...t)=>pe.warn(...t),error=(...t)=>pe.error(...t),dir=(t,n)=>pe.dir(t,n),dirxml=(...t)=>pe.dirxml(...t),table=(t,n)=>pe.table(t,n),clear=()=>pe.clear(),assert=(t,...n)=>pe.assert(t,...n),trace=(...t)=>pe.trace(...t),time=t=>pe.time(t),timeEnd=t=>pe.timeEnd(t),timeLog=(t,...n)=>pe.timeLog(t,...n),count=t=>pe.count(t),countReset=t=>pe.countReset(t),group=(...t)=>pe.group(...t),groupCollapsed=(...t)=>pe.groupCollapsed(...t),groupEnd=()=>pe.groupEnd(),profile=t=>{},profileEnd=t=>{},timeStamp=t=>{}}),ge,_e=__esmMin(()=>{he(),ge={log,info,debug:me,warn,error,dir,dirxml,table,time,timeEnd,timeLog,trace,assert,clear,count,countReset,group,groupCollapsed,groupEnd,profile,profileEnd,timeStamp}}),ve,ye=__esmMin(()=>{ve=__name$1(t=>{Promise.resolve().then(t)},`queueMicrotask`)});function isWindowsPath(t){return/^[A-Za-z]:[\\/]/.test(t)||t.startsWith(`\\\\`)}function lastPathSeparatorIndex(t){let n=t.lastIndexOf(`/`);return isWindowsPath(t)?Math.max(n,t.lastIndexOf(`\\`)):n}function splitPathComponents(t){return isWindowsPath(t)?t.split(/[\\/]/):t.split(`/`)}function pathToFileUrlHref(t,n){let S=n?.windows??isWindowsPath(t),C=S?t.replace(/\\/g,`/`):t;if(S&&C.startsWith(`//`)){let t=C.indexOf(`/`,2);return`file://${t===-1?C.slice(2):C.slice(2,t)}${encodePathForFileUrl(t===-1?``:C.slice(t))}`}return`${C.startsWith(`/`)?`file://`:`file:///`}${encodePathForFileUrl(C)}`}function encodePathForFileUrl(t){let n=``;for(let S of t)n+=be.test(S)?S:percentEncode$1(S);return n}function percentEncode$1(t){let n=``;for(let S of new TextEncoder().encode(t))n+=`%${S.toString(16).toUpperCase().padStart(2,`0`)}`;return n}var be,xe=__esmMin(()=>{be=/^[A-Za-z0-9!$&'()*+,\-./:;=@_]$/,__name$1(percentEncode$1,`percentEncode`)});function decodeXmlEntities(t){return t.includes(`&`)?t.replace(/&(#[Xx][0-9A-Fa-f]+|#[0-9]+|[A-Za-z][A-Za-z0-9]*);/g,(t,n)=>{if(n.charAt(0)!==`#`)return Se[n]??t;let S=n.charAt(1)===`x`||n.charAt(1)===`X`,C=Number.parseInt(S?n.slice(2):n.slice(1),S?16:10);return!Number.isFinite(C)||C<1||C>1114111||C>=55296&&C<=57343?t:String.fromCodePoint(C)}):t}function findTagEnd(t,n){let S=``;for(let C=n+1;C<t.length;C++){let n=t.charAt(C);if(S)n===S&&(S=``);else if(n===`"`||n===`'`)S=n;else if(n===`>`)return C}return-1}function parseAttributes(t){let n={};Ce.lastIndex=0;let S=Ce.exec(t);for(;S!==null;)S[1]in n||(n[S[1]]=decodeXmlEntities(S[2]??S[3]??``)),S=Ce.exec(t);return n}function scanXml(t){let n=[],pushText=t=>{n.push({kind:`text`,text:decodeXmlEntities(t)})},S=0;for(;S<t.length;){let C=t.indexOf(`<`,S);if(C<0){pushText(t.slice(S));break}if(C>S&&pushText(t.slice(S,C)),t.startsWith(`<!--`,C)){let n=t.indexOf(`-->`,C+4);S=n<0?t.length:n+3;continue}if(t.startsWith(`<![CDATA[`,C)){let N=t.indexOf(`]]>`,C+9);n.push({kind:`text`,text:t.slice(C+9,N<0?t.length:N)}),S=N<0?t.length:N+3;continue}if(t.startsWith(`<?`,C)){let n=t.indexOf(`?>`,C+2);S=n<0?t.length:n+2;continue}if(t.startsWith(`<!`,C)){let n=t.indexOf(`>`,C+2);S=n<0?t.length:n+1;continue}let N=findTagEnd(t,C);if(N<0){pushText(t.slice(C));break}let F=t.slice(C+1,N);if(S=N+1,F.charAt(0)===`/`){let t=F.slice(1).trim();t!==``&&n.push({kind:`close`,name:t});continue}let I=F,H=!1;I.endsWith(`/`)&&(H=!0,I=I.slice(0,-1));let W=/^([^\s/<>]+)/.exec(I);if(W===null)continue;let q=W[1];n.push({kind:`open`,name:q,attributes:parseAttributes(I.slice(q.length)),selfClosing:H})}return n}var Se,Ce,we=__esmMin(()=>{Se={amp:`&`,lt:`<`,gt:`>`,quot:`"`,apos:`'`},Ce=/([^\s=/<>]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g});function mapSysname(t){let n=t.trim();switch(n){case`Linux`:return`linux`;case`Darwin`:return`darwin`;case`FreeBSD`:return`freebsd`;case`OpenBSD`:return`openbsd`;case`NetBSD`:return`netbsd`;case`SunOS`:return`sunos`;case`AIX`:return`aix`;case`Haiku`:return`haiku`;default:return/^CYGWIN/i.test(n)?`cygwin`:/^(MINGW|MSYS|Windows)/i.test(n)?`win32`:void 0}}function mapMachine(t){let n=t.trim().toLowerCase();switch(n){case`x86_64`:case`amd64`:return`x64`;case`aarch64`:case`arm64`:return`arm64`;case`i386`:case`i486`:case`i586`:case`i686`:return`ia32`;case`ppc64le`:case`ppc64`:return`ppc64`;case`s390x`:return`s390x`;case`riscv64`:return`riscv64`;case`loongarch64`:return`loong64`;case`mipsel`:return`mipsel`;case`mips`:return`mips`;default:return n.startsWith(`arm`)?`arm`:void 0}}var Te=__esmMin(()=>{});function classOf(t){return Ee.call(t).slice(8,-1)}function throwDataCloneError(t){let n=globalThis.DOMException;if(typeof n==`function`)throw new n(t,`DataCloneError`);let S=Error(t);throw S.name=`DataCloneError`,S}function internalClone(t,n,S){if(t==null)return t;let C=typeof t;if(C===`boolean`||C===`number`||C===`string`||C===`bigint`)return t;C===`symbol`&&throwDataCloneError(`Symbol cannot be cloned`),C===`function`&&throwDataCloneError(`Function cannot be cloned`);let N=t;if(n.has(N))return n.get(N);let F=classOf(N);if(F===`Date`)return new Date(N.getTime());if(F===`RegExp`)return new RegExp(N.source,N.flags);if(F===`Boolean`||F===`Number`||F===`String`)return Object(N.valueOf());if(F===`BigInt`)return Object(BigInt.prototype.valueOf.call(N));if(N instanceof Error){let t=N,C=t.constructor?.name,F=new(C&&De[C]||De[t.name]||Error)(t.message);return F.name=t.name,`cause`in t&&Object.defineProperty(F,"cause",{value:internalClone(t.cause,n,S),writable:!0,enumerable:!1,configurable:!0}),F}if(F===`DOMException`){let t=globalThis.DOMException;if(typeof t==`function`){let n=N;return new t(n.message,n.name)}}if(F===`ArrayBuffer`){let t=N;if(S&&S.transferred.has(t)){let C=S.transferred.get(t);return n.set(N,C),C}(t.detached===!0||t.byteLength===0&&t.detached)&&throwDataCloneError(`ArrayBuffer is detached and cannot be cloned`);let C=t.slice(0);return n.set(N,C),C}if(F===`SharedArrayBuffer`||N&&typeof N==`object`&&N.constructor?.name===`SharedBuffer`)return N;if(F===`DataView`){let t=N,C=S?.viewSnapshots.get(N),F=internalClone(t.buffer,n,S),I=C?C.byteOffset:t.byteOffset,H=C?C.byteLength:t.byteLength,W=new DataView(F,I,H);return n.set(N,W),W}if(Oe.has(F)){let t=N,C=S?.viewSnapshots.get(N),F=internalClone(t.buffer,n,S),I=t.constructor,H=new I(F,C?C.byteOffset:t.byteOffset,C?C.length:t.length);return n.set(N,H),H}if(F===`Map`){let t=new Map;n.set(N,t);for(let[C,F]of N)t.set(internalClone(C,n,S),internalClone(F,n,S));return t}if(F===`Set`){let t=new Set;n.set(N,t);for(let C of N)t.add(internalClone(C,n,S));return t}{let t=globalThis,n=t.Blob,S=t.File;if(typeof S==`function`&&N instanceof S){let t=N;return new S([N],t.name,{type:t.type,lastModified:t.lastModified})}if(typeof n==`function`&&N instanceof n)return new n([N],{type:N.type})}if(N instanceof WeakMap&&throwDataCloneError(`WeakMap cannot be cloned`),N instanceof WeakSet&&throwDataCloneError(`WeakSet cannot be cloned`),N instanceof WeakRef&&throwDataCloneError(`WeakRef cannot be cloned`),typeof globalThis.Promise==`function`&&N instanceof Promise&&throwDataCloneError(`Promise cannot be cloned`),F===`Array`){let t=N,C=[];n.set(N,C);for(let N=0;N<t.length;N++)N in t&&(C[N]=internalClone(t[N],n,S));return C}if(F===`Object`||typeof N==`object`){let t={};n.set(N,t);for(let C of Object.keys(N))t[C]=internalClone(N[C],n,S);return t}throwDataCloneError(`${F} cannot be cloned`)}function structuredClone$1(t,n){let S=n?.transfer;if(!S||S.length===0)return internalClone(t,new Map);let C=new Set;for(let t of S)if(classOf(t)===`ArrayBuffer`){let n=t;n.detached===!0&&throwDataCloneError(`ArrayBuffer in transfer list is detached`),C.add(n)}let N=new Map;C.size>0&&snapshotViewsBackedByTransferredBuffers(t,C,N,new Set);let F=new Map;for(let t of C){let n=t;typeof n.transfer!=`function`&&throwDataCloneError(`ArrayBuffer.prototype.transfer() not available — runtime is not SM140+`),F.set(t,n.transfer())}return internalClone(t,new Map,{transferred:F,viewSnapshots:N})}function snapshotViewsBackedByTransferredBuffers(t,n,S,C){if(typeof t!=`object`||!t)return;let N=t;if(C.has(N))return;C.add(N);let F=classOf(N);if(F===`DataView`){let t=N;n.has(t.buffer)&&S.set(N,{byteOffset:t.byteOffset,length:0,byteLength:t.byteLength});return}if(Oe.has(F)){let t=N;n.has(t.buffer)&&S.set(N,{byteOffset:t.byteOffset,length:t.length,byteLength:t.byteLength});return}if(Array.isArray(N)){for(let t=0;t<N.length;t++)t in N&&snapshotViewsBackedByTransferredBuffers(N[t],n,S,C);return}if(F===`Map`){for(let[t,F]of N)snapshotViewsBackedByTransferredBuffers(t,n,S,C),snapshotViewsBackedByTransferredBuffers(F,n,S,C);return}if(F===`Set`){for(let t of N)snapshotViewsBackedByTransferredBuffers(t,n,S,C);return}if(F===`Object`)for(let t of Object.keys(N))snapshotViewsBackedByTransferredBuffers(N[t],n,S,C)}var Ee,De,Oe,ke=__esmMin(()=>{({toString:Ee}=Object.prototype),De={Error,EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError},Oe=new Set([`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`Float64Array`,`BigInt64Array`,`BigUint64Array`]),__name$1(structuredClone$1,`structuredClone`)});function hostGlib(){try{return globalThis.imports?.gi?.GLib}catch{return}}function readText(t,n){try{let[S,C]=t.file_get_contents(n);return!S||!C?null:new TextDecoder().decode(C)}catch{return null}}function shellOut(t,n){try{let[S,C]=t.spawn_command_line_sync(n);if(!S||!C)return null;let N=new TextDecoder().decode(C).trim();return N.length>0?N:null}catch{return null}}function hasProcfs(){let t=hostGlib();if(!t)return!1;try{return t.file_test(`/proc/self/status`,16)}catch{return!1}}function hostPid(){if(Ae!==null)return Ae>0?Ae:void 0;let t=hostGlib();if(!t)return;let n=0,S=hasProcfs()?readText(t,`/proc/self/stat`):null;if(S)n=parseInt(S,10);else{let S=shellOut(t,`sh -c 'echo $PPID'`);S&&(n=parseInt(S,10))}return Ae=Number.isInteger(n)&&n>0?n:0,Ae>0?Ae:void 0}function hostPpid(){let t=hostGlib();if(!t)return;let n=hasProcfs()?readText(t,`/proc/self/status`):null;if(n){let t=/PPid:\s+(\d+)/.exec(n);if(t){let n=parseInt(t[1],10);return Number.isInteger(n)?n:void 0}}let S=hostPid();if(S===void 0)return;let C=shellOut(t,`ps -o ppid= -p ${S}`);if(!C)return;let N=parseInt(C,10);return Number.isInteger(N)?N:void 0}function hostExecPath(){let t=hostGlib();if(t){if(hasProcfs())try{let n=t.file_read_link(`/proc/self/exe`);if(n)return n}catch{}try{let n=t.get_prgname();if(n){let S=t.find_program_in_path(n);if(S)return S}}catch{return}}}function readProcessMemory$4(){let t=hostGlib();if(!t)return null;let n=hasProcfs()?readText(t,`/proc/self/status`):null;if(n){let t=new Map;for(let S of n.split(`
10
- `)){let n=/^(\w+):\s+(\d+)(\s+kB)?/.exec(S);n&&t.set(n[1],parseInt(n[2],10)*(n[3]?1024:1))}if(t.size>0)return{virtual:t.get(`VmSize`)??0,resident:t.get(`VmRSS`)??0,data:t.get(`VmData`)??0,peak:t.get(`VmPeak`)??0}}let S=shellOut(t,`sh -c 'ps -o rss=,vsz= -p $PPID'`);if(!S)return null;let C=/^(\d+)\s+(\d+)$/.exec(S);return C?{virtual:parseInt(C[2],10)*1024,resident:parseInt(C[1],10)*1024,data:0,peak:0}:null}var Ae,je=__esmMin(()=>{Ae=null,__name$1(readProcessMemory$4,`readProcessMemory`)});function glib$1(){let t=globalThis;if(typeof t.process?.versions?.gjs==`string`||t.process===void 0)return t.imports?.gi?.GLib}function arm(t){Ie||(Ie=!0,t.runAsync().catch(()=>{}))}function ensureMainLoop(){return Re=!1,createLoop()}function createLoop(){let t=glib$1();if(t)return Fe?Me:(Me=new t.MainLoop(null,!1),Fe=!0,t.main_depth()===0&&arm(Me),Me)}function holdMainLoop(){let t=ensureMainLoop();return t&&arm(t),t}function acquireMainLoop(){let t=Fe,n=createLoop();if(n)return Le===0&&!Ve&&(Re=!t),Le+=1,n}function releaseMainLoop(){Le===0||!Me||(--Le,drainIfIdle())}function trackTimer(){ze+=1}function untrackTimer(){dropPending()}function trackRequest(){ze+=1}function untrackRequest(){dropPending()}function trackedCallback(t){return trackRequest(),(...n)=>{try{t(...n)}finally{untrackRequest()}}}function dropPending(){ze!==0&&(--ze,ze===0&&drainIfIdle())}function drainIfIdle(){if(Le!==0||!Me||!Re)return;let t=Me;if(!Ie){quitMainLoop();return}if(ze!==0){Ve=!0;return}if(!t.is_running()){Ve=!0,awaitEntrySettle(t);return}exitParked()}function awaitEntrySettle(t){let n=glib$1();!n||He||(He=!0,n.timeout_add(n.PRIORITY_DEFAULT,20,()=>Me!==t||Le!==0||ze!==0?(He=!1,n.SOURCE_REMOVE):t.is_running()?(He=!1,exitParked(),n.SOURCE_REMOVE):n.SOURCE_CONTINUE))}function exitParked(){let t=globalThis.process,n=glib$1();if(typeof t?.exit!=`function`||!n){quitMainLoop(),t?.exit?.(t.exitCode??0);return}if(Be)return;Be=!0;let S=Me;n.timeout_add(n.PRIORITY_DEFAULT,0,()=>{if(Be=!1,Me!==S||Le!==0)return n.SOURCE_REMOVE;if(ze!==0)return Ve=!0,n.SOURCE_REMOVE;let C=t.exitCode??0;return quitMainLoop(),t.exit(C),n.SOURCE_REMOVE})}function quitMainLoop(){Me&&(Me.quit(),Fe=!1,Ie=!1,Me=null,Le=0,Re=!1,Ve=!1)}var Me,Fe,Ie,Le,Re,ze,Be,Ve,He,Ue=__esmMin(()=>{Me=null,Fe=!1,Ie=!1,Le=0,Re=!1,ze=0,Be=!1,Ve=!1,He=!1,__name$1(glib$1,`glib`)});function hostGi(){return globalThis.imports?.gi}function directoryOf(t){return/^(.*)[\\/][^\\/]*$/.exec(t)?.[1]}function colocateNativeLibrary(t,n=hostGi()){try{let S=n?.GIRepository?.Repository?.dup_default?.(),C=S?.get_typelib_path(t),N=C?directoryOf(C):void 0;return!S||!N?!1:(S.prepend_library_path(N),!0)}catch{return!1}}function probeNativeLibrary(t,n=hostGi()){try{let S=n?.GIRepository?.Repository?.dup_default?.(),C=S?.get_typelib_path(t);if(!n||!S||!C)return null;let N=firstSymbol(S,t);if(!N||(n.GModule?.module_error(),N.info.get_typelib().symbol(N.name)[0]))return null;let F=directoryOf(C)??`.`,I=C.includes(`\\`)&&!C.includes(`/`)?`\\`:`/`;for(let H of S.get_shared_libraries(t)??[]){let S=`${F}${I}${H}`,W=n.GLib?.file_test(S,n.GLib.FileTest.EXISTS)?S:H,q=loaderError(n,t,C,W,N.name);if(q!==void 0)return{namespace:t,library:W,reason:q,missingDependency:missingLibraryDependency(q,W)}}let H=(S.get_shared_libraries(t)??[]).join(`, `)||`(none named)`;return{namespace:t,library:H,reason:`symbol ${N.name} not found in ${H}, and the loader reported no error`}}catch{return null}}function firstSymbol(t,n){let S=t.get_n_infos(n),C=null;for(let N=0;N<S;N++){let S=t.get_info(n,N),F=S.get_type_init_function_name?.();if(F)return{info:S,name:F};let I=S.get_symbol?.();I&&!C&&(C={info:S,name:I})}return C}function loaderError(t,n,S,C,N){let{GIRepository:F,GLib:I,GModule:H}=t;if(!F?.Repository||!F.Typelib||!I||!H)return;let[,W]=I.file_get_contents(S),q=new TextEncoder().encode(`${C}\0`),Y=new Uint8Array(W.length+q.length);Y.set(W),Y.set(q,W.length);let X=new DataView(Y.buffer);X.setUint32(40,Y.length,!0),X.setUint32(52,W.length,!0);let Z=new F.Repository,te=firstSymbol(Z,Z.load_typelib(F.Typelib.new_from_bytes(new I.Bytes(Y)),0));if(te&&(H.module_error(),!te.info.get_typelib().symbol(N)[0]))return H.module_error()??`${n}: ${C} could not be opened (the loader reported no error)`}function missingLibraryDependency(t,n){let S=/Library not loaded: (\S+)/.exec(t)?.[1]??/Error loading shared library ([^\s:]+): .*\(needed by /.exec(t)?.[1]??/(?:^|\s)([^\s:]+): cannot open shared object file/.exec(t)?.[1];if(!S)return;let C=S.replace(/^.*[\\/]/,``);if(!(n&&C===n.replace(/^.*[\\/]/,``)))return C}function openNativeLibrary(t,n=hostGi()){colocateNativeLibrary(t,n);let S=probeNativeLibrary(t,n);return S?new NativeLibraryLoadError(S):null}function loadOptionalNativeModule(t,n,S=hostGi()){if(!S)return{module:null,error:Error(`${t}: imports.gi is not available (not running on GJS)`)};try{let C=S[t];if(!C)return{module:null,error:Error(`${t}: typelib not found`)};let N=openNativeLibrary(t,S);if(N)return ge.debug(N.message),{module:null,error:N};for(let t of n)C[t];return{module:C,error:null}}catch(t){return{module:null,error:t instanceof Error?t:Error(String(t))}}}var NativeLibraryLoadError,Ge=__esmMin(()=>{_e(),NativeLibraryLoadError=class extends Error{failure;constructor(t,n){let S=t.missingDependency?`It needs ${t.missingDependency}, which the loader could not find: not installed, or not on its search path.`:`The loader could not open it.`;super(`${t.namespace}: the native library ${t.library} could not be loaded. ${S}\nLoader: ${t.reason.trim()}\n`+(n??"`gjsify system-check` lists the system libraries the installed @gjsify packages need, with the install command for this host.")),this.name=`NativeLibraryLoadError`,this.failure=t}}});function setDrainerArmed(t){qe!==t&&(qe=t,t?trackRequest():untrackRequest())}function drainOnce(t){let n=Math.min(64,Ke.length);for(let S=0;S<n;S++){let n=Ke.shift();try{n()}catch(n){try{t.log_default_handler(`gjsify-nextTick`,t.LogLevelFlags.LEVEL_WARNING,String(n?.stack||n),null)}catch{}}}Ke.length>0?t.timeout_add(t.PRIORITY_DEFAULT,1,()=>(drainOnce(t),!1)):setDrainerArmed(!1)}function tryGLibTimeout(t){let n=globalThis.imports?.gi?.GLib;return n?.timeout_add?(Ke.push(t),qe||(setDrainerArmed(!0),n.timeout_add(n.PRIORITY_DEFAULT,0,()=>(drainOnce(n),!1))),!0):!1}var Ke,qe,nextTick,Je=__esmMin(()=>{Ue(),Ke=[],qe=!1,nextTick=(t,...n)=>{let S=n.length>0?()=>t(...n):t;if(!tryGLibTimeout(S)){if(typeof globalThis.process?.nextTick==`function`){globalThis.process.nextTick(t,...n);return}if(typeof queueMicrotask==`function`){queueMicrotask(S);return}Promise.resolve().then(S)}}}),Ye=__esmMin(()=>{ie(),oe(),se(),ce(),ue(),ye(),xe(),we(),Te(),ke(),je(),Ue(),Ge(),Je()});re(),Ye(),registerGlobal(`Blob`,te),registerGlobal(`File`,ne);function atobPolyfill(t){if(typeof globalThis.atob==`function`)return globalThis.atob(t);let n=t.replace(/[=\s]/g,``),S=``,C=0,N=0;for(let t=0;t<n.length;t++)C=C<<6|Ze[n.charCodeAt(t)],N+=6,N>=8&&(N-=8,S+=String.fromCharCode(C>>N&255));return S}function btoaPolyfill(t){if(typeof globalThis.btoa==`function`)return globalThis.btoa(t);let n=``,S=0;for(;S+2<t.length;S+=3){let C=t.charCodeAt(S)<<16|t.charCodeAt(S+1)<<8|t.charCodeAt(S+2);n+=Xe[C>>18&63]+Xe[C>>12&63]+Xe[C>>6&63]+Xe[C&63]}if(S+1===t.length){let C=t.charCodeAt(S)<<16;n+=Xe[C>>18&63]+Xe[C>>12&63]+`==`}else if(S+2===t.length){let C=t.charCodeAt(S)<<16|t.charCodeAt(S+1)<<8;n+=Xe[C>>18&63]+Xe[C>>12&63]+Xe[C>>6&63]+`=`}return n}function base64Decode$2(t){let n=t.replace(/[=\s]/g,``),S=new Uint8Array(n.length*3>>2),C=0,N=0,F=0;for(let t=0;t<n.length;t++)C=C<<6|Ze[n.charCodeAt(t)],N+=6,N>=8&&(N-=8,S[F++]=C>>N&255);return S.subarray(0,F)}function base64Encode$1(t){let n=``,S=t.length;for(let C=0;C<S;C+=3){let N=t[C],F=C+1<S?t[C+1]:0,I=C+2<S?t[C+2]:0;n+=Xe[N>>2],n+=Xe[(N&3)<<4|F>>4],n+=C+1<S?Xe[(F&15)<<2|I>>6]:`=`,n+=C+2<S?Xe[I&63]:`=`}return n}var Xe,Ze,Qe=__esmMin(()=>{Xe=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Ze=new Uint8Array(256);for(let t=0;t<64;t++)Ze[Xe.charCodeAt(t)]=t;__name$1(base64Decode$2,`base64Decode`),__name$1(base64Encode$1,`base64Encode`)});function normalizeEncoding(t){if(!t||t===`utf8`||t===`utf-8`)return`utf8`;switch((``+t).toLowerCase().replace(/-/g,``)){case`utf8`:return`utf8`;case`ascii`:return`ascii`;case`latin1`:case`binary`:return`latin1`;case`base64`:return`base64`;case`base64url`:return`base64url`;case`hex`:return`hex`;case`ucs2`:case`utf16le`:return`utf16le`;default:return`utf8`}}function checkEncoding(t){let n=(``+t).toLowerCase().replace(/-/g,``);if(!$e.includes(n))throw TypeError(`Unknown encoding: ${t}`)}var $e,et=__esmMin(()=>{$e=[`utf8`,`ascii`,`latin1`,`binary`,`base64`,`base64url`,`hex`,`ucs2`,`utf16le`]});function encodeString(t,n){switch(n){case`utf8`:return textEncoder().encode(t);case`ascii`:{let n=new Uint8Array(t.length);for(let S=0;S<t.length;S++)n[S]=t.charCodeAt(S)&127;return n}case`latin1`:{let n=new Uint8Array(t.length);for(let S=0;S<t.length;S++)n[S]=t.charCodeAt(S)&255;return n}case`base64`:return base64Decode$2(t.replace(/-/g,`+`).replace(/_/g,`/`));case`base64url`:return encodeString(t.replace(/-/g,`+`).replace(/_/g,`/`),`base64`);case`hex`:{let n=t.length>>>1,S=new Uint8Array(n);for(let C=0;C<n;C++){let n=parseInt(t[C*2],16),N=parseInt(t[C*2+1],16);if(Number.isNaN(n)||Number.isNaN(N))break;S[C]=n<<4|N}return S}case`utf16le`:{let n=new Uint8Array(t.length*2);for(let S=0;S<t.length;S++){let C=t.charCodeAt(S);n[S*2]=C&255,n[S*2+1]=C>>8&255}return n}default:return textEncoder().encode(t)}}function decodeString(t,n,S,C){let N=S!==void 0||C!==void 0?t.subarray(S??0,C??t.length):t;switch(n){case`utf8`:return textDecoder().decode(N);case`ascii`:{let t=``;for(let n=0;n<N.length;n++)t+=String.fromCharCode(N[n]&127);return t}case`latin1`:{let t=``;for(let n=0;n<N.length;n++)t+=String.fromCharCode(N[n]);return t}case`base64`:{let t=``;for(let n=0;n<N.length;n++)t+=String.fromCharCode(N[n]);return btoaPolyfill(t)}case`base64url`:return decodeString(N,`base64`).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``);case`hex`:{let t=``;for(let n=0;n<N.length;n++)t+=N[n].toString(16).padStart(2,`0`);return t}case`utf16le`:{let t=``;for(let n=0;n+1<N.length;n+=2)t+=String.fromCharCode(N[n]|N[n+1]<<8);return t}default:return textDecoder().decode(N)}}function checkOffset(t,n,S){if(t+n>S)throw RangeError(`Attempt to access memory outside buffer bounds`)}var tt,nt,textEncoder,textDecoder,rt=__esmMin(()=>{Qe(),textEncoder=()=>tt??=new TextEncoder,textDecoder=()=>nt??=new TextDecoder}),it,ot,st,ct,lt,SlowBuffer,ut=__esmMin(()=>{rt(),et(),it=typeof SharedArrayBuffer<`u`,ot=class Buffer extends Uint8Array{static _isBuffer=!0;static alloc(t,n,S){if(typeof t!=`number`)throw TypeError(`The "size" argument must be of type number. Received type ${typeof t}`);if(t<0)throw RangeError(`The value "${t}" is invalid for option "size"`);let C=new Buffer(t);return n!==void 0&&n!==0&&C.fill(n,0,t,S),C}static allocUnsafe(t){if(typeof t!=`number`)throw TypeError(`The "size" argument must be of type number. Received type ${typeof t}`);return new Buffer(t)}static allocUnsafeSlow(t){return Buffer.allocUnsafe(t)}static from(t,n,S){if(typeof t==`string`){let S=normalizeEncoding(n);if(n&&typeof n==`string`){let t=(``+n).toLowerCase().replace(/-/g,``);[`utf8`,`ascii`,`latin1`,`binary`,`base64`,`base64url`,`hex`,`ucs2`,`utf16le`,``].includes(t)||checkEncoding(n)}let C=encodeString(t,S);return new Buffer(C.buffer,C.byteOffset,C.byteLength)}if(ArrayBuffer.isView(t)){let n=new Buffer(t.buffer,t.byteOffset,t.byteLength),S=new Buffer(n.length);return S.set(n),S}if(t instanceof ArrayBuffer){let C=n||0,N=S===void 0?t.byteLength-C:S;return new Buffer(t,C,N)}if(it&&t instanceof SharedArrayBuffer){let C=n||0,N=S===void 0?t.byteLength-C:S;return new Buffer(new Uint8Array(t,C,N))}if(typeof t==`object`&&t&&typeof t.viewBytes==`function`&&typeof t.byteLength==`number`&&t.constructor?.name===`SharedBuffer`){let C=t,N=n||0,F=S===void 0?C.byteLength-N:S,I=C.viewBytes(N,F);return new Buffer(I.buffer,I.byteOffset,I.byteLength)}if(Array.isArray(t)){let n=new Buffer(t.length);for(let S=0;S<t.length;S++)n[S]=t[S]&255;return n}throw TypeError(`The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array`)}static isBuffer(t){return t instanceof Buffer}static isEncoding(t){if(typeof t!=`string`)return!1;let n=t.toLowerCase().replace(/-/g,``);return[`utf8`,`ascii`,`latin1`,`binary`,`base64`,`base64url`,`hex`,`ucs2`,`utf16le`].includes(n)}static byteLength(t,n){if(typeof t!=`string`){if(ArrayBuffer.isView(t)||t instanceof ArrayBuffer||it&&t instanceof SharedArrayBuffer)return t.byteLength;throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer`)}switch(normalizeEncoding(n)){case`utf8`:return new TextEncoder().encode(t).byteLength;case`ascii`:case`latin1`:return t.length;case`base64`:case`base64url`:{let n=t.length;for(;n>0&&(t[n-1]===`=`||t[n-1]===` `);)n--;return n*3>>>2}case`hex`:return t.length>>>1;case`utf16le`:return t.length*2;default:return new TextEncoder().encode(t).byteLength}}static compare(t,n){if(!(t instanceof Uint8Array)||!(n instanceof Uint8Array))throw TypeError(`Arguments must be Buffers or Uint8Arrays`);let S=Math.min(t.length,n.length);for(let C=0;C<S;C++){if(t[C]<n[C])return-1;if(t[C]>n[C])return 1}return t.length<n.length?-1:+(t.length>n.length)}static concat(t,n){if(t.length===0)return Buffer.alloc(0);if(n===void 0){n=0;for(let S=0;S<t.length;S++)n+=t[S].length}let S=Buffer.alloc(n),C=0;for(let N=0;N<t.length;N++){let F=t[N],I=Math.min(F.length,n-C);I<=0||(S.set(F.subarray(0,I),C),C+=I)}return S}static poolSize=65536;toString(t,n,S){let C=normalizeEncoding(t);return decodeString(this,C,n,S)}toJSON(){return{type:`Buffer`,data:Array.from(this)}}equals(t){if(!(t instanceof Uint8Array))throw TypeError(`Argument must be a Buffer or Uint8Array`);if(this.length!==t.length)return!1;for(let n=0;n<this.length;n++)if(this[n]!==t[n])return!1;return!0}compare(t,n,S,C,N){if(!(t instanceof Uint8Array))throw TypeError(`Argument must be a Buffer or Uint8Array`);let F=C!==void 0||N!==void 0?this.subarray(C??0,N??this.length):this,I=n!==void 0||S!==void 0?t.subarray(n??0,S??t.length):t;return Buffer.compare(F,I)}copy(t,n=0,S=0,C){let N=C??this.length,F=Math.min(N-S,t.length-n);return F<=0?0:(t.set(this.subarray(S,S+F),n),F)}slice(t,n){let S=t??0,C=n??this.length,N=super.subarray(S,C);return new Buffer(N.buffer,N.byteOffset,N.byteLength)}subarray(t,n){let S=super.subarray(t,n);return new Buffer(S.buffer,S.byteOffset,S.byteLength)}write(t,n,S,C){n??=0;let N=encodeString(t,normalizeEncoding(C||(typeof S==`string`?S:void 0))),F=S!==void 0&&typeof S==`number`?Math.min(S,this.length-n):this.length-n,I=Math.min(N.length,F);return this.set(N.subarray(0,I),n),I}fill(t,n,S,C){let N=n??0,F=S??this.length;if(typeof t==`number`)super.fill(t&255,N,F);else if(typeof t==`string`){let n=encodeString(t,normalizeEncoding(C));if(n.length===0)super.fill(0,N,F);else if(n.length===1)super.fill(n[0],N,F);else for(let t=N;t<F;t++)this[t]=n[(t-N)%n.length]}else if(t instanceof Uint8Array)if(t.length===0)super.fill(0,N,F);else for(let n=N;n<F;n++)this[n]=t[(n-N)%t.length];return this}indexOf(t,n,S){if(typeof t==`number`)return super.indexOf(t&255,n);let C=typeof t==`string`?encodeString(t,normalizeEncoding(S)):t,N=n??0;outer:for(let t=N;t<=this.length-C.length;t++){for(let n=0;n<C.length;n++)if(this[t+n]!==C[n])continue outer;return t}return-1}lastIndexOf(t,n,S){if(typeof t==`number`)return n===void 0?super.lastIndexOf(t&255):super.lastIndexOf(t&255,n);let C=typeof t==`string`?encodeString(t,normalizeEncoding(S)):t,N=n===void 0?this.length-C.length:Math.min(n,this.length-C.length);outer:for(let t=N;t>=0;t--){for(let n=0;n<C.length;n++)if(this[t+n]!==C[n])continue outer;return t}return-1}includes(t,n,S){return this.indexOf(t,n,S)!==-1}readUInt8(t=0){return checkOffset(t,1,this.length),this[t]}readUInt16BE(t=0){return checkOffset(t,2,this.length),this[t]<<8|this[t+1]}readUInt16LE(t=0){return checkOffset(t,2,this.length),this[t]|this[t+1]<<8}readUInt32BE(t=0){return checkOffset(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])}readUInt32LE(t=0){return checkOffset(t,4,this.length),this[t+3]*16777216+(this[t+2]<<16|this[t+1]<<8|this[t])>>>0}readInt8(t=0){return checkOffset(t,1,this.length),this[t]|(this[t]&128?4294967040:0)}readInt16BE(t=0){checkOffset(t,2,this.length);let n=this[t]<<8|this[t+1];return n&32768?n|4294901760:n}readInt16LE(t=0){checkOffset(t,2,this.length);let n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n}readInt32BE(t=0){return checkOffset(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]}readInt32LE(t=0){return checkOffset(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24}readFloatBE(t=0){return checkOffset(t,4,this.length),new DataView(this.buffer,this.byteOffset+t,4).getFloat32(0,!1)}readFloatLE(t=0){return checkOffset(t,4,this.length),new DataView(this.buffer,this.byteOffset+t,4).getFloat32(0,!0)}readDoubleBE(t=0){return checkOffset(t,8,this.length),new DataView(this.buffer,this.byteOffset+t,8).getFloat64(0,!1)}readDoubleLE(t=0){return checkOffset(t,8,this.length),new DataView(this.buffer,this.byteOffset+t,8).getFloat64(0,!0)}readBigInt64BE(t=0){return checkOffset(t,8,this.length),new DataView(this.buffer,this.byteOffset+t,8).getBigInt64(0,!1)}readBigInt64LE(t=0){return checkOffset(t,8,this.length),new DataView(this.buffer,this.byteOffset+t,8).getBigInt64(0,!0)}readBigUInt64BE(t=0){return checkOffset(t,8,this.length),new DataView(this.buffer,this.byteOffset+t,8).getBigUint64(0,!1)}readBigUInt64LE(t=0){return checkOffset(t,8,this.length),new DataView(this.buffer,this.byteOffset+t,8).getBigUint64(0,!0)}readUIntBE(t,n){checkOffset(t,n,this.length);let S=0;for(let C=0;C<n;C++)S=S*256+this[t+C];return S}readUIntLE(t,n){checkOffset(t,n,this.length);let S=0,C=1;for(let N=0;N<n;N++)S+=this[t+N]*C,C*=256;return S}readIntBE(t,n){checkOffset(t,n,this.length);let S=0;for(let C=0;C<n;C++)S=S*256+this[t+C];return S>=2**(8*n-1)&&(S-=2**(8*n)),S}readIntLE(t,n){checkOffset(t,n,this.length);let S=0,C=1;for(let N=0;N<n;N++)S+=this[t+N]*C,C*=256;return S>=2**(8*n-1)&&(S-=2**(8*n)),S}writeUInt8(t,n=0){return checkOffset(n,1,this.length),this[n]=t&255,n+1}writeUInt16BE(t,n=0){return checkOffset(n,2,this.length),this[n]=t>>>8&255,this[n+1]=t&255,n+2}writeUInt16LE(t,n=0){return checkOffset(n,2,this.length),this[n]=t&255,this[n+1]=t>>>8&255,n+2}writeUInt32BE(t,n=0){return checkOffset(n,4,this.length),this[n]=t>>>24&255,this[n+1]=t>>>16&255,this[n+2]=t>>>8&255,this[n+3]=t&255,n+4}writeUInt32LE(t,n=0){return checkOffset(n,4,this.length),this[n]=t&255,this[n+1]=t>>>8&255,this[n+2]=t>>>16&255,this[n+3]=t>>>24&255,n+4}writeInt8(t,n=0){return checkOffset(n,1,this.length),t<0&&(t=255+t+1),this[n]=t&255,n+1}writeInt16BE(t,n=0){return checkOffset(n,2,this.length),this[n]=t>>>8&255,this[n+1]=t&255,n+2}writeInt16LE(t,n=0){return checkOffset(n,2,this.length),this[n]=t&255,this[n+1]=t>>>8&255,n+2}writeInt32BE(t,n=0){return checkOffset(n,4,this.length),this[n]=t>>>24&255,this[n+1]=t>>>16&255,this[n+2]=t>>>8&255,this[n+3]=t&255,n+4}writeInt32LE(t,n=0){return checkOffset(n,4,this.length),this[n]=t&255,this[n+1]=t>>>8&255,this[n+2]=t>>>16&255,this[n+3]=t>>>24&255,n+4}writeFloatBE(t,n=0){return checkOffset(n,4,this.length),new DataView(this.buffer,this.byteOffset+n,4).setFloat32(0,t,!1),n+4}writeFloatLE(t,n=0){return checkOffset(n,4,this.length),new DataView(this.buffer,this.byteOffset+n,4).setFloat32(0,t,!0),n+4}writeDoubleBE(t,n=0){return checkOffset(n,8,this.length),new DataView(this.buffer,this.byteOffset+n,8).setFloat64(0,t,!1),n+8}writeDoubleLE(t,n=0){return checkOffset(n,8,this.length),new DataView(this.buffer,this.byteOffset+n,8).setFloat64(0,t,!0),n+8}writeBigInt64BE(t,n=0){return checkOffset(n,8,this.length),new DataView(this.buffer,this.byteOffset+n,8).setBigInt64(0,t,!1),n+8}writeBigInt64LE(t,n=0){return checkOffset(n,8,this.length),new DataView(this.buffer,this.byteOffset+n,8).setBigInt64(0,t,!0),n+8}writeBigUInt64BE(t,n=0){return checkOffset(n,8,this.length),new DataView(this.buffer,this.byteOffset+n,8).setBigUint64(0,t,!1),n+8}writeBigUInt64LE(t,n=0){return checkOffset(n,8,this.length),new DataView(this.buffer,this.byteOffset+n,8).setBigUint64(0,t,!0),n+8}readUint8(t=0){return this.readUInt8(t)}readUint16BE(t=0){return this.readUInt16BE(t)}readUint16LE(t=0){return this.readUInt16LE(t)}readUint32BE(t=0){return this.readUInt32BE(t)}readUint32LE(t=0){return this.readUInt32LE(t)}readUintBE(t,n){return this.readUIntBE(t,n)}readUintLE(t,n){return this.readUIntLE(t,n)}readBigUint64BE(t=0){return this.readBigUInt64BE(t)}readBigUint64LE(t=0){return this.readBigUInt64LE(t)}writeUint8(t,n=0){return this.writeUInt8(t,n)}writeUint16BE(t,n=0){return this.writeUInt16BE(t,n)}writeUint16LE(t,n=0){return this.writeUInt16LE(t,n)}writeUint32BE(t,n=0){return this.writeUInt32BE(t,n)}writeUint32LE(t,n=0){return this.writeUInt32LE(t,n)}writeBigUint64BE(t,n=0){return this.writeBigUInt64BE(t,n)}writeBigUint64LE(t,n=0){return this.writeBigUInt64LE(t,n)}swap16(){let t=this.length;if(t%2!=0)throw RangeError(`Buffer size must be a multiple of 16-bits`);for(let n=0;n<t;n+=2){let t=this[n];this[n]=this[n+1],this[n+1]=t}return this}swap32(){let t=this.length;if(t%4!=0)throw RangeError(`Buffer size must be a multiple of 32-bits`);for(let n=0;n<t;n+=4){let t=this[n],S=this[n+1];this[n]=this[n+3],this[n+1]=this[n+2],this[n+2]=S,this[n+3]=t}return this}swap64(){let t=this.length;if(t%8!=0)throw RangeError(`Buffer size must be a multiple of 64-bits`);for(let n=0;n<t;n+=8){let t=this[n],S=this[n+1],C=this[n+2],N=this[n+3];this[n]=this[n+7],this[n+1]=this[n+6],this[n+2]=this[n+5],this[n+3]=this[n+4],this[n+4]=N,this[n+5]=C,this[n+6]=S,this[n+7]=t}return this}},st=2**31-1,ct=2**28-16,lt={MAX_LENGTH:st,MAX_STRING_LENGTH:ct},SlowBuffer=class extends ot{constructor(t){super(t)}}}),dt=__exportAll$5({Blob:()=>te,Buffer:()=>ot,File:()=>ne,INSPECT_MAX_BYTES:()=>50,SlowBuffer:()=>SlowBuffer,atob:()=>ft,atobPolyfill:()=>atobPolyfill,base64Decode:()=>base64Decode$2,base64Encode:()=>base64Encode$1,btoa:()=>pt,btoaPolyfill:()=>btoaPolyfill,checkEncoding:()=>checkEncoding,constants:()=>lt,default:()=>mt,kMaxLength:()=>st,kStringMaxLength:()=>ct,normalizeEncoding:()=>normalizeEncoding}),ft,pt,mt,ht=__esmMin(()=>{Qe(),re(),et(),ut(),ft=globalThis.atob,pt=globalThis.btoa,mt={Buffer:ot,SlowBuffer,Blob:te,File:ne,atob:ft,btoa:pt,kMaxLength:st,kStringMaxLength:ct,constants:lt,INSPECT_MAX_BYTES:50}});ht(),`Buffer`in globalThis||Object.defineProperty(globalThis,"Buffer",{value:ot,enumerable:!1,writable:!0,configurable:!0});var gt,_t=__esmMin(()=>{gt=t}),vt,yt=__esmMin(()=>{_t(),vt=gt});yt(),typeof globalThis.btoa!=`function`&&Object.defineProperty(globalThis,"btoa",{value:function btoa(t){let n=new Uint8Array(t.length);for(let S=0;S<t.length;S++)n[S]=t.charCodeAt(S)&255;return vt.base64_encode(n)},enumerable:!0,writable:!0,configurable:!0}),typeof globalThis.atob!=`function`&&Object.defineProperty(globalThis,"atob",{value:function atob(t){let n=vt.base64_decode(t),S=``;for(let t=0;t<n.length;t++)S+=String.fromCharCode(n[t]);return S},enumerable:!0,writable:!0,configurable:!0}),Ye(),typeof queueMicrotask!=`function`&&Object.defineProperty(globalThis,"queueMicrotask",{value:ve,enumerable:!0,writable:!0,configurable:!0});function getGjsGlobal(){return globalThis}function getGioNamespace(){let t=getGjsGlobal().imports?.gi;if(!t)return null;let n=null;try{n=t.GioUnix??null}catch{}if(!n)try{n=t.Gio??null}catch{}return n}var bt=__esmMin(()=>{});function getMonotonicTime(){try{let t=getGjsGlobal().imports?.gi?.GLib;if(t?.get_monotonic_time)return BigInt(t.get_monotonic_time())*1000n}catch{}return typeof performance?.now==`function`?BigInt(Math.round(performance.now()*1e6)):BigInt(Date.now())*1000000n}function hrtime(t){let n=getMonotonicTime()-xt,S=Number(n/1000000000n),C=Number(n%1000000000n);if(t){let n=S-t[0],N=C-t[1];return N<0&&(n--,N+=1e9),[n,N]}return[S,C]}function hrtimeBigint(){return getMonotonicTime()-xt}var xt,St=__esmMin(()=>{bt(),xt=getMonotonicTime()});function probeUname(){if(Ct!==void 0)return Ct;Ct=null;try{let t=getGjsGlobal().imports?.gi?.GLib;if(!t)return Ct;let n=t.spawn_sync,S=t.SpawnFlags?.SEARCH_PATH;if(!n||S===void 0)return Ct;let[C,N]=n(null,[`uname`,`-sm`],null,S,null);if(!C||!N)return Ct;let F=new TextDecoder().decode(N).trim().split(/\s+/);if(F.length<2)return Ct;let I=mapSysname(F[0]),H=mapMachine(F[F.length-1]);if(!I||!H)return Ct;Ct={platform:I,arch:H}}catch{}return Ct}var Ct,wt=__esmMin(()=>{bt(),Ye()});function detectGjsVersion(){try{let t=getGjsGlobal().imports?.system;if(t?.version!==void 0){let n=Number(t.version);return`${Math.floor(n/1e4)}.${Math.floor(n%1e4/100)}.${n%100}`}}catch{}}function detectNodeVersion(){if(typeof globalThis.process?.versions?.node==`string`)return globalThis.process.versions.node}function detectVersionInfo(){if(detectNodeVersion())return{version:globalThis.process.version,versions:{...globalThis.process.versions},title:globalThis.process?.title||`node`};let t=detectGjsVersion(),n={node:`20.0.0`};return t&&(n.gjs=t),{version:`v20.0.0`,versions:n,title:`gjs`}}function detectPpid(){let t=runtimeProcess();return t&&typeof t.ppid==`number`?t.ppid:hostPpid()??0}function runtimeProcess(){let t=globalThis.process;return typeof t?.release?.name==`string`?t:void 0}function onGjs(){try{return getGjsGlobal().imports?.gi!==void 0}catch{return!1}}function detectPlatform$1(){let t=runtimeProcess();if(t)return t.platform;if(onGjs()){let t=probeUname();if(t)return t.platform}return`linux`}function detectArch(){let t=runtimeProcess();if(t)return t.arch;if(onGjs()){let t=probeUname();if(t)return t.arch}return`x64`}function getPid$1(){let t=runtimeProcess();return t&&typeof t.pid==`number`?t.pid:hostPid()??0}var Tt=__esmMin(()=>{bt(),wt(),Ye(),__name$1(detectPlatform$1,`detectPlatform`),__name$1(getPid$1,`getPid`)});function getEnvProxy(){if(typeof globalThis.process?.env==`object`)return globalThis.process.env;try{let t=getGjsGlobal().imports?.gi?.GLib;if(t)return new Proxy({},{get(n,S){if(typeof S==`string`)return t.getenv(S)??void 0},set(n,S,C){return typeof S==`string`?(t.setenv(S,String(C),!0),!0):!1},deleteProperty(n,S){return typeof S==`string`?(t.unsetenv(S),!0):!1},has(n,S){return typeof S==`string`?t.getenv(S)!==null:!1},ownKeys(n){return t.listenv()},getOwnPropertyDescriptor(n,S){if(typeof S!=`string`)return;let C=t.getenv(S);if(C!==null)return{configurable:!0,enumerable:!0,writable:!0,value:C}}})}catch{}return{}}function getArgv(){if(globalThis.process?.argv!==void 0)return globalThis.process.argv;try{let t=getGjsGlobal().imports?.system;if(t?.programArgs)return[`gjs`,t.programInvocationName||``,...t.programArgs]}catch{}return[`gjs`]}function getExecPath(){let t=globalThis.process;return!isGjsHost()&&typeof t?.execPath==`string`?t.execPath:hostExecPath()??`/usr/bin/gjs`}function isGjsHost(){try{return getGjsGlobal().imports?.gi!==void 0}catch{return!1}}function getCwd(){try{let t=getGjsGlobal().imports?.gi?.GLib;if(t?.get_current_dir)return t.get_current_dir()}catch{}return`/`}function chdir(t){let n=getGjsGlobal().imports?.gi?.GLib;try{if(n?.chdir){if(!n.file_test(t,16)){let n=Error(`ENOENT: no such file or directory, chdir '${t}'`);throw n.code=`ENOENT`,n.syscall=`chdir`,n.path=t,n}n.chdir(t);return}}catch(t){if(t&&typeof t==`object`&&t.code===`ENOENT`)throw t}if(!n){let n=globalThis.process;if(n&&typeof n.chdir==`function`){n.chdir(t);return}}throw Error(`process.chdir() is not supported in this environment`)}function getExecArgv(){if(!isGjsHost()){let t=globalThis.process;return Array.isArray(t?.execArgv)?t.execArgv:[]}try{let t=getGjsGlobal().imports?.gi?.GLib;if(t?.file_get_contents){let[,n]=t.file_get_contents(`/proc/self/cmdline`);if(n){let t=n instanceof Uint8Array?n:new Uint8Array(n),S=new TextDecoder().decode(t).split(`\0`).filter(t=>t.length>0),C=[];for(let t=1;t<S.length&&S[t].startsWith(`-`);t++)C.push(S[t]);return C}}}catch{}return[]}var Et=__esmMin(()=>{bt(),Ye()});function exitProcess(t){let n=getGjsGlobal().imports,S=n?.gi?.GLib,C=n?.system,N=S?.idle_add,F=S?.SOURCE_REMOVE,I=S?.PRIORITY_DEFAULT,H=S?.MainContext;if(C?.exit&&N&&typeof I==`number`&&typeof F==`boolean`&&typeof H?.default==`function`){N(I,()=>(C.exit(t),F));let n=H.default();for(;;)n.iteration(!0)}try{C?.exit&&C.exit(t)}catch{}let W=globalThis.process;throw W&&typeof W.exit==`function`&&W.exit(t),Error(`process.exit(${t})`)}var Dt=__esmMin(()=>{bt()});function isGjs$1(){return getGjsGlobal().imports?.gi?.GLib!==void 0}function classifyKillFailure(t){if(/No such process/i.test(t))return`ESRCH`;if(/Operation not permitted/i.test(t))return`EPERM`}function killPid(t,n){let S=getGjsGlobal().imports?.gi?.GLib;if(S){let C=typeof n==`number`?String(n):n||`SIGTERM`,N=[`kill`,C.startsWith(`SIG`)?`-${C.slice(3)}`:`-${C}`,`--`,String(t)],F=S.environ_setenv(S.get_environ(),`LC_ALL`,`C`,!0),[,,I,H]=S.spawn_sync(null,N,F,4,null),W=!1;try{W=S.spawn_check_wait_status(H)}catch{W=!1}if(W)return!0;let q=I?new TextDecoder().decode(I).trim():``,Y=classifyKillFailure(q),X=Error(Y?`kill ${Y}`:`kill failed${q?`: ${q}`:``}`);throw Y&&(X.code=Y,X.errno=Y===`ESRCH`?-3:-1,X.syscall=`kill`),X}let C=globalThis.process;if(C&&typeof C.kill==`function`)return C.kill(t,n);throw Error(`process.kill() is not supported in this environment`)}function memoryUsage(){let t=readProcessMemory$4();if(t)return{rss:t.resident,heapTotal:t.resident,heapUsed:t.resident,external:0,arrayBuffers:0};if(!isGjs$1()){let t=globalThis.process;if(t&&typeof t.memoryUsage==`function`)return t.memoryUsage()}return{rss:0,heapTotal:0,heapUsed:0,external:0,arrayBuffers:0}}function cpuUsage(t){if(!isGjs$1()){let n=globalThis.process;if(n&&typeof n.cpuUsage==`function`)return n.cpuUsage(t)}return{user:0,system:0}}function readUmask(){try{let t=getGjsGlobal().imports?.gi?.GLib;if(t){let[n,S]=t.file_get_contents(`/proc/self/status`);if(n){let t=/^Umask:\s*([0-7]+)/m.exec(new TextDecoder().decode(S));if(t)return parseInt(t[1],8)}}}catch{}return 18}var Ot=__esmMin(()=>{bt(),Ye(),__name$1(isGjs$1,`isGjs`)});function resolveSignalAdd(){let t=getGjsGlobal().imports?.gi;if(!t)return null;for(let[n,S]of[[`GLibUnix`,`signal_add`],[`GLib`,`unix_signal_add`]])try{let C=t[n]?.[S];if(typeof C==`function`)return C}catch{}return null}function isDeliverableSignal(t){return typeof t==`string`&&t in kt}function armSignal(t,n){if(At.has(t))return;let S=kt[t],C=resolveSignalAdd(),N=getGjsGlobal().imports?.gi?.GLib;if(S===void 0||C===null||!N)return;let F=N.PRIORITY_DEFAULT,I=C(F,S,()=>(n(t),!0));At.set(t,I)}function disarmSignal(t){let n=At.get(t);if(n===void 0)return;At.delete(t);let S=getGjsGlobal().imports?.gi?.GLib;S&&typeof S.source_remove==`function`&&S.source_remove(n)}var kt,At,jt=__esmMin(()=>{bt(),kt={SIGHUP:1,SIGINT:2,SIGTERM:15},At=new Map});function claimRawMode(t,n){Pt.set(t,n)}function releaseRawMode(t){Pt.delete(t)}function noteRawMode(t,n,S){let C=S(n);return n?C&&claimRawMode(t,()=>{S(!1)}):releaseRawMode(t),C}function restoreClaimedRawModes(){let t=[...Pt.entries()];Pt.clear();let n=0,S;for(let[,C]of t)try{C(),n+=1}catch(t){S??=t}if(S!==void 0)throw S;return n}var Mt,Nt,Pt,Ft=__esmMin(()=>{Mt=Symbol.for(`@gjsify/terminal-native:raw-mode-claims`),Nt=globalThis,Pt=Nt[Mt]??=new Map});function callableModule(){if(!Lt)return null;try{return Lt.Terminal.is_tty(2),Lt}catch{return null}}function nativeIsTty(t){try{return callableModule()?.Terminal.is_tty(t)??null}catch{return null}}function nativeTerminalSize(t){try{let[n,S,C]=callableModule()?.Terminal.get_size(t)??[!1,0,0];return!n||C<=0?null:{rows:S,columns:C}}catch{return null}}function nativeSetRawMode(t,n){try{return callableModule()?.Terminal.set_raw_mode(t,n)??null}catch{return null}}var It,Lt,Rt,zt=__esmMin(()=>{Ft(),Ye(),It=loadOptionalNativeModule(`GjsifyTerminal`,[`Terminal`,`ResizeWatcher`]),Lt=It.module,Rt=Lt});function onceWrapper(){let{target:t,type:n,listener:S}=this;return this.wrapperFn&&t.removeListener(n,this.wrapperFn),S.apply(t,Array.from(arguments))}function _onceWrap(t,n,S){let C={target:t,type:n,listener:S,wrapperFn:void 0},N=onceWrapper.bind(C);return C.wrapperFn=N,N.listener=S,N}function arrayClone(t){switch(t.length){case 0:return[];case 1:return[t[0]];case 2:return[t[0],t[1]];case 3:return[t[0],t[1],t[2]];default:return t.slice()}}function checkListener(t){if(typeof t!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof t)}function validateNumber(t,n){if(typeof t!=`number`||t!==t)throw TypeError(`The "${n}" argument must be of type number. Received type ${typeof t}`)}function spliceOne(t,n){for(;n+1<t.length;n++)t[n]=t[n+1];t.pop()}function unwrapListeners(t){let n=Array.from({length:t.length});for(let S=0;S<n.length;++S)n[S]=t[S].listener??t[S];return n}function createAbortError$2(t){let n=Error(`The operation was aborted`);return n.name=`AbortError`,n.code=`ABORT_ERR`,t?.reason&&(n.cause=t.reason),n}var Bt,Vt,Ht,Ut=__esmMin(()=>{_e(),Bt=Symbol(`kCapture`),Vt=Symbol.for(`nodejs.rejection`),Ht=class EventEmitter{static defaultMaxListeners=10;static errorMonitor=Symbol(`events.errorMonitor`);static captureRejectionSymbol=Vt;static _captureRejections=!1;static get captureRejections(){return EventEmitter._captureRejections}static set captureRejections(t){if(typeof t!=`boolean`)throw TypeError(`The "captureRejections" argument must be of type boolean.`);EventEmitter._captureRejections=t}_events;_eventsCount;_maxListeners;[Bt];constructor(t){this._events=Object.create(null),this._eventsCount=0,this._maxListeners=void 0,this[Bt]=t?.captureRejections??EventEmitter._captureRejections}setMaxListeners(t){if(validateNumber(t,`n`),t<0)throw RangeError(`The value of "n" is out of range. It must be a non-negative number. Received `+t);return this._maxListeners=t,this}getMaxListeners(){return this._maxListeners??EventEmitter.defaultMaxListeners}emit(t,...n){let S=this._events,C=t===`error`;if(S!==void 0)C&&S[EventEmitter.errorMonitor]!==void 0&&this.emit(EventEmitter.errorMonitor,...n),C&&=S.error===void 0;else if(!C)return!1;if(C){let t;if(t=n.length>0?n[0]:Error(`Unhandled error.`),t instanceof Error)throw t;let S=Error(`Unhandled error. (`+t+`)`);throw S.context=t,S}let N=S[t];if(N===void 0)return!1;if(typeof N==`function`){let S=N.apply(this,n);S!=null&&this[Bt]&&this._addCatch(S,t,n)}else{let S=arrayClone(N),C=S.length;for(let N=0;N<C;++N){let C=S[N].apply(this,n);C!=null&&this[Bt]&&this._addCatch(C,t,n)}}return!0}_addCatch(t,n,S){typeof t?.then==`function`&&t.then(void 0,t=>{let C=this[Vt];if(typeof C==`function`)C.call(this,t,n,...S);else{let n=this[Bt];try{this[Bt]=!1,this.emit(`error`,t)}finally{this[Bt]=n}}})}addListener(t,n){return this._addListener(t,n,!1)}on(t,n){return this._addListener(t,n,!1)}prependListener(t,n){return this._addListener(t,n,!0)}_addListener(t,n,S){checkListener(n);let C=this._events;C===void 0?(C=this._events=Object.create(null),this._eventsCount=0):C.newListener!==void 0&&(this.emit(`newListener`,t,n.listener??n),C=this._events);let N=C[t];N===void 0?(C[t]=n,++this._eventsCount):typeof N==`function`?C[t]=S?[n,N]:[N,n]:S?N.unshift(n):N.push(n);let F=this.getMaxListeners();if(F>0){let n=typeof C[t]==`function`?1:C[t].length;if(n>F&&!C[t].warned){typeof C[t]!=`function`&&(C[t].warned=!0);let S=Error(`Possible EventEmitter memory leak detected. ${n} ${String(t)} listeners added to [${this.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);S.name=`MaxListenersExceededWarning`,ge.warn(S.message)}}return this}once(t,n){return checkListener(n),this.on(t,_onceWrap(this,t,n)),this}prependOnceListener(t,n){return checkListener(n),this.prependListener(t,_onceWrap(this,t,n)),this}removeListener(t,n){checkListener(n);let S=this._events;if(S===void 0)return this;let C=S[t];if(C===void 0)return this;if(C===n||C.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete S[t],S.removeListener&&this.emit(`removeListener`,t,C.listener??n));else if(typeof C!=`function`){let N=-1;for(let t=C.length-1;t>=0;t--)if(C[t]===n||C[t].listener===n){N=t;break}if(N<0)return this;N===0?C.shift():spliceOne(C,N),C.length===1&&(S[t]=C[0]),S.removeListener!==void 0&&this.emit(`removeListener`,t,n.listener??n)}return this}off(t,n){return this.removeListener(t,n)}removeAllListeners(t){let n=this._events;if(n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[t]),this;if(arguments.length===0){let t=Object.keys(n);for(let n=0;n<t.length;++n){let S=t[n];S!==`removeListener`&&this.removeAllListeners(S)}return this.removeAllListeners(`removeListener`),this._events=Object.create(null),this._eventsCount=0,this}let S=n[t];if(typeof S==`function`)this.removeListener(t,S);else if(S!==void 0)for(let n=S.length-1;n>=0;n--)this.removeListener(t,S[n]);return this}listeners(t){let n=this._events;if(n===void 0)return[];let S=n[t];return S===void 0?[]:typeof S==`function`?[S.listener??S]:unwrapListeners(S)}rawListeners(t){let n=this._events;if(n===void 0)return[];let S=n[t];return S===void 0?[]:typeof S==`function`?[S]:arrayClone(S)}listenerCount(t){let n=this._events;if(n===void 0)return 0;let S=n[t];return S===void 0?0:typeof S==`function`?1:S.length}eventNames(){return(this._eventsCount??0)>0?Reflect.ownKeys(this._events):[]}static once(t,n,S){return new Promise((C,N)=>{let F=S?.signal;if(F?.aborted){N(createAbortError$2(F));return}if(typeof t.addEventListener==`function`){let S=t,handler=(...t)=>{F&&F.removeEventListener(`abort`,abortHandler),C(t)},errorHandler=t=>{F&&F.removeEventListener(`abort`,abortHandler),S.removeEventListener(`error`,errorHandler),N(t)},abortHandler=()=>{S.removeEventListener(n,handler),S.removeEventListener(`error`,errorHandler),N(createAbortError$2(F))};S.addEventListener(n,handler,{once:!0}),n!==`error`&&S.addEventListener(`error`,errorHandler,{once:!0}),F&&F.addEventListener(`abort`,abortHandler,{once:!0});return}let I=t,eventHandler=(...t)=>{F&&F.removeEventListener(`abort`,abortHandler),errorHandler!==void 0&&I.removeListener(`error`,errorHandler),C(t)},errorHandler;n!==`error`&&(errorHandler=t=>{I.removeListener(n,eventHandler),F&&F.removeEventListener(`abort`,abortHandler),N(t)},I.once(`error`,errorHandler)),I.once(n,eventHandler);let abortHandler=()=>{I.removeListener(n,eventHandler),errorHandler&&I.removeListener(`error`,errorHandler),N(createAbortError$2(F))};F&&F.addEventListener(`abort`,abortHandler,{once:!0})})}static on(t,n,S){let C=S?.signal;if(C?.aborted)throw createAbortError$2(C);let N=S?.highWaterMark??2**53-1,F=S?.lowWaterMark??1;validateNumber(N,`highWaterMark`),validateNumber(F,`lowWaterMark`);let I=[],H=[],W=null,q=!1,Y=!1,eventHandler=(...n)=>{if(H.length>0){let{resolve:t}=H.shift();t({value:n,done:!1})}else I.push(n),I.length>=N&&!Y&&(Y=!0,typeof t.pause==`function`&&t.pause())},errorHandler=t=>{if(W=t,H.length>0){let{reject:n}=H.shift();n(t)}X.return()},abortHandler=()=>{errorHandler(createAbortError$2(C))};t.on(n,eventHandler),n!==`error`&&t.on(`error`,errorHandler),C&&C.addEventListener(`abort`,abortHandler,{once:!0});let cleanup=()=>{t.removeListener(n,eventHandler),t.removeListener(`error`,errorHandler),C&&C.removeEventListener(`abort`,abortHandler),q=!0;for(let{resolve:t}of H)t({value:void 0,done:!0});H.length=0,I.length=0},X={next(){if(I.length>0){let n=I.shift();return Y&&I.length<F&&(Y=!1,typeof t.resume==`function`&&t.resume()),Promise.resolve({value:n,done:!1})}if(W){let t=Promise.reject(W);return W=null,t}return q?Promise.resolve({value:void 0,done:!0}):new Promise((t,n)=>{H.push({resolve:t,reject:n})})},return(){return cleanup(),Promise.resolve({value:void 0,done:!0})},throw(t){return q||(W=t,cleanup()),Promise.reject(t)},[Symbol.asyncIterator](){return this}};return X}static listenerCount(t,n){return t.listenerCount(n)}static getEventListeners(t,n){return typeof t.listeners==`function`?t.listeners(n):[]}static setMaxListeners(t,...n){if(validateNumber(t,`n`),t<0)throw RangeError(`The value of "n" is out of range.`);if(n.length===0)EventEmitter.defaultMaxListeners=t;else for(let S of n)typeof S.setMaxListeners==`function`&&S.setMaxListeners(t)}static getMaxListeners(t){return typeof t.getMaxListeners==`function`?t.getMaxListeners():EventEmitter.defaultMaxListeners}static addAbortListener(t,n){t.aborted&&Promise.resolve().then(()=>n());let handler=()=>n();return t.addEventListener(`abort`,handler,{once:!0}),{[Symbol.dispose](){t.removeEventListener(`abort`,handler)}}}},Ht.EventEmitter=Ht;for(let t of[`setMaxListeners`,`getMaxListeners`,`emit`,`addListener`,`on`,`prependListener`,`once`,`prependOnceListener`,`removeListener`,`off`,`removeAllListeners`,`listeners`,`rawListeners`,`listenerCount`,`eventNames`]){let n=Ht.prototype[t];typeof n==`function`&&Object.defineProperty(Ht.prototype,t,{enumerable:!0,configurable:!0,writable:!0,value:n})}Object.defineProperty(Ht.prototype,"_events",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(Ht.prototype,"_eventsCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(Ht.prototype,"_maxListeners",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),__name$1(createAbortError$2,`createAbortError`)}),Wt=__exportAll$5({EventEmitter:()=>Gt,addAbortListener:()=>tn,captureRejectionSymbol:()=>Kt,default:()=>Gt,defaultMaxListeners:()=>Jt,errorMonitor:()=>qt,getEventListeners:()=>$t,getMaxListeners:()=>Xt,listenerCount:()=>en,"module.exports":()=>Gt,on:()=>Qt,once:()=>Zt,setMaxListeners:()=>Yt}),Gt,Kt,qt,Jt,Yt,Xt,Zt,Qt,$t,en,tn,nn=__esmMin(()=>{Ut(),Ye(),Gt=makeCallable(Ht),Gt.EventEmitter=Gt,Kt=Gt.captureRejectionSymbol,qt=Gt.errorMonitor,Jt=Gt.defaultMaxListeners,Yt=Gt.setMaxListeners,Xt=Gt.getMaxListeners,Zt=Gt.once,Qt=Gt.on,$t=Gt.getEventListeners,en=Gt.listenerCount,tn=Gt.addAbortListener}),rn=__exportAll$5({StringDecoder:()=>an,default:()=>on});function normalizeAndValidateEncoding(t){return t&&checkEncoding(t),normalizeEncoding(t)}function utf8DecodeMaximalSubpart(t,n,S){let C=``,N=n;for(;N<S;){let n=t[N];if(n<=127){C+=String.fromCharCode(n),N++;continue}if(n>=194&&n<=223){N+1<S&&t[N+1]>=128&&t[N+1]<=191?(C+=String.fromCharCode((n&31)<<6|t[N+1]&63),N+=2):(C+=`�`,N++);continue}if(n>=224&&n<=239){let F,I;if(n===224?(F=160,I=191):n===237?(F=128,I=159):(F=128,I=191),N+1>=S){C+=`�`,N++;continue}let H=t[N+1];if(H<F||H>I){C+=`�`,N++;continue}if(N+2>=S){C+=`�`,N+=2;continue}let W=t[N+2];if(W<128||W>191){C+=`�`,N+=2;continue}let q=(n&15)<<12|(H&63)<<6|W&63;C+=String.fromCharCode(q),N+=3;continue}if(n>=240&&n<=244){let F,I;if(n===240?(F=144,I=191):n===244?(F=128,I=143):(F=128,I=191),N+1>=S){C+=`�`,N++;continue}let H=t[N+1];if(H<F||H>I){C+=`�`,N++;continue}if(N+2>=S){C+=`�`,N+=2;continue}let W=t[N+2];if(W<128||W>191){C+=`�`,N+=2;continue}if(N+3>=S){C+=`�`,N+=3;continue}let q=t[N+3];if(q<128||q>191){C+=`�`,N+=3;continue}let Y=(n&7)<<18|(H&63)<<12|(W&63)<<6|q&63;C+=String.fromCharCode(55296+(Y-65536>>10),56320+(Y-65536&1023)),N+=4;continue}C+=`�`,N++}return C}function utf8CharLength(t){return t&128?t>=194&&t<=223?2:t>=224&&t<=239?3:t>=240&&t<=244?4:0:1}function isValidContinuation(t,n,S,C){if(S===1){if(n===3)return t===224?C>=160&&C<=191:t===237?C>=128&&C<=159:C>=128&&C<=191;if(n===4)return t===240?C>=144&&C<=191:t===244?C>=128&&C<=143:C>=128&&C<=191}return C>=128&&C<=191}function writeUtf8(t,n){let S=0,C=``;if(t._lastNeed>0){for(;S<n.length&&t._lastNeed>0;){let N=n[S],F=t._lastTotal-t._lastNeed;if(isValidContinuation(t._lastLeadByte,t._lastTotal,F,N))t._lastChar[F]=N,t._lastNeed--,S++;else{C+=`�`,t._lastNeed=0,t._lastTotal=0,t._lastLeadByte=0;break}}if(t._lastNeed===0&&t._lastTotal>0&&(C+=utf8DecodeMaximalSubpart(t._lastChar,0,t._lastTotal),t._lastTotal=0,t._lastLeadByte=0),t._lastNeed>0)return C}let N=n.length;for(let C=0;C<Math.min(4,n.length-S);C++){let F=n.length-1-C;if(F<S)break;let I=n[F];if((I&192)!=128){let S=utf8CharLength(I);if(S>0&&I>=128){let C=n.length-F;if(C<S){let H=!0;for(let t=1;t<C;t++)if(!isValidContinuation(I,S,t,n[F+t])){H=!1;break}if(H){N=F;for(let S=0;S<C;S++)t._lastChar[S]=n[F+S];t._lastNeed=S-C,t._lastTotal=S,t._lastLeadByte=I}}}break}}return N>S&&(C+=utf8DecodeMaximalSubpart(n,S,N)),C}function writeUtf16le(t,n){let S=``,C=0;if(t._lastNeed>0){let N=t._lastTotal-t._lastNeed,F=Math.min(t._lastNeed,n.length);for(let S=0;S<F;S++)t._lastChar[N+S]=n[S];if(t._lastNeed-=F,C=F,t._lastNeed>0)return``;let I=t._lastTotal,H=0;for(;H+1<I;){let N=t._lastChar[H]|t._lastChar[H+1]<<8;if(H+=2,N>=55296&&N<=56319){if(H+1<I){let n=t._lastChar[H]|t._lastChar[H+1]<<8;if(n>=56320&&n<=57343){S+=String.fromCharCode(N,n),H+=2;continue}}if(C+1<n.length){let t=n[C]|n[C+1]<<8;if(t>=56320&&t<=57343){S+=String.fromCharCode(N,t),C+=2;continue}}else if(C>=n.length)return t._lastChar[0]=t._lastChar[H-2],t._lastChar[1]=t._lastChar[H-1],t._lastNeed=2,t._lastTotal=4,S}S+=String.fromCharCode(N)}t._lastTotal=0}for(;C+1<n.length;){let N=n[C]|n[C+1]<<8;if(C+=2,N>=55296&&N<=56319)if(C+1<n.length){let t=n[C]|n[C+1]<<8;if(t>=56320&&t<=57343){S+=String.fromCharCode(N,t),C+=2;continue}}else if(C<n.length)return S+=String.fromCharCode(N),t._lastChar[0]=n[C],t._lastNeed=1,t._lastTotal=2,S;else return t._lastChar[0]=n[C-2],t._lastChar[1]=n[C-1],t._lastNeed=2,t._lastTotal=4,S;S+=String.fromCharCode(N)}return C<n.length&&(t._lastChar[0]=n[C],t._lastNeed=1,t._lastTotal=2),S}function writeBase64(t,n){let S=0;if(t._lastNeed>0){let C=Math.min(t._lastNeed,n.length);for(let S=0;S<C;S++)t._lastChar[t._lastTotal-t._lastNeed+S]=n[S],t._lastNeed--;if(S=C,t._lastNeed>0)return``}let C=n.length-S,N=C-C%3,F=``;t._lastTotal>0&&t._lastNeed===0&&(F+=base64Encode$1(t._lastChar.subarray(0,t._lastTotal)),t._lastTotal=0),N>0&&(F+=base64Encode$1(n.subarray(S,S+N)));let I=C-N;if(I>0){for(let C=0;C<I;C++)t._lastChar[C]=n[S+N+C];t._lastNeed=3-I,t._lastTotal=3}return F}function decodeAscii(t){let n=``;for(let S=0;S<t.length;S++)n+=String.fromCharCode(t[S]&127);return n}function decodeLatin1(t){let n=``;for(let S=0;S<t.length;S++)n+=String.fromCharCode(t[S]);return n}function decodeHex(t){let n=``;for(let S=0;S<t.length;S++)n+=t[S].toString(16).padStart(2,`0`);return n}var an,on,sn=__esmMin(()=>{ht(),an=function StringDecoder(t){this.encoding=normalizeAndValidateEncoding(t),this._lastNeed=0,this._lastTotal=0,this._lastLeadByte=0,this.encoding===`utf8`||this.encoding===`utf16le`?this._lastChar=new Uint8Array(4):this.encoding===`base64`?this._lastChar=new Uint8Array(3):this._lastChar=new Uint8Array},an.prototype.write=function write(t){if(t.length===0)return``;switch(this.encoding){case`utf8`:return writeUtf8(this,t);case`utf16le`:return writeUtf16le(this,t);case`base64`:return writeBase64(this,t);case`ascii`:return decodeAscii(t);case`latin1`:return decodeLatin1(t);case`hex`:return decodeHex(t);default:return decodeAscii(t)}},an.prototype.end=function end(t){let n=``;if(t&&t.length>0&&(n=this.write(t)),this.encoding===`utf8`&&this._lastNeed>0)n+=`�`,this._lastNeed=0,this._lastTotal=0;else if(this.encoding===`utf16le`&&this._lastNeed>0){let t=this._lastTotal-this._lastNeed;for(let S=0;S+1<t;S+=2)n+=String.fromCharCode(this._lastChar[S]|this._lastChar[S+1]<<8);this._lastNeed=0,this._lastTotal=0}else if(this.encoding===`base64`&&this._lastNeed>0){let t=this._lastChar.subarray(0,this._lastTotal-this._lastNeed);n+=base64Encode$1(t),this._lastNeed=0,this._lastTotal=0}return n},on={StringDecoder:an}}),cn,ProcessWriteStream,ProcessReadStream,ln=__esmMin(()=>{_e(),bt(),zt(),nn(),Ye(),sn(),cn=new TextEncoder,ProcessWriteStream=class extends Gt{fd;writable=!0;_outGio=null;constructor(t){super(),this.fd=t;let n=getGioNamespace();if(n){let t=n.UnixOutputStream??n.OutputStream;if(t)try{this._outGio=t.new(this.fd,!1)}catch{}}}write(t){if(this._outGio)try{let n=typeof t==`string`?cn.encode(t):t;return this._outGio.write_all(n,null),!0}catch{}return this.fd===2?ge.error(t):ge.log(t),!0}get isTTY(){let t=nativeIsTty(this.fd);if(t!==null)return t;try{let t=getGjsGlobal().imports?.gi?.GLib;if(t)return!!t.log_writer_supports_color(this.fd)}catch{}return!1}get columns(){let t=nativeTerminalSize(this.fd);if(t)return t.columns;try{let t=getGjsGlobal().imports?.gi?.GLib;if(t){let n=parseInt(t.getenv(`COLUMNS`)??`0`,10);if(n>0)return n}}catch{}return 80}end(){}destroy(){}get rows(){let t=nativeTerminalSize(this.fd);if(t)return t.rows;try{let t=getGjsGlobal().imports?.gi?.GLib;if(t){let n=parseInt(t.getenv(`LINES`)??`0`,10);if(n>0)return n}}catch{}return 24}},ProcessReadStream=class extends Gt{fd;isRaw=!1;_gio=null;_stdinGio=null;_reading=!1;_flowing=!1;_mainLoopHeld=!1;_pendingRead=!1;_decoder=null;constructor(t){super(),this.fd=t,this._gio=getGioNamespace()}get isTTY(){return nativeIsTty(this.fd)??!1}setRawMode(t){return noteRawMode(this.fd,t,t=>nativeSetRawMode(this.fd,t)===!0)?(this.isRaw=t,this):(noteRawMode(this.fd,t,t=>this._setRawModeViaStty(t)),this.isRaw=t,this)}_setRawModeViaStty(t){try{let n=globalThis.imports?.gi,S=n?.Gio??n?.Gio;if(!S)return!1;let C=S.SubprocessFlags?.STDIN_INHERIT??2,N=t?[`stty`,`-icanon`,`-echo`,`-icrnl`,`-isig`,`min`,`1`,`time`,`0`]:[`stty`,`icanon`,`echo`,`icrnl`,`isig`],F=new S.SubprocessLauncher({flags:C}).spawnv(N);return F.wait(null),F.get_successful()}catch{return!1}}setEncoding(t){return this._decoder=new an(t),this}_pushData(t){if(this._decoder){let n=this._decoder.write(t);n.length>0&&this.emit(`data`,n)}else this.emit(`data`,t)}on(t,n){let S=t===`data`&&this.listenerCount(`data`)===0;return super.on(t,n),S&&t===`data`&&this.resume(),this}addListener(t,n){return this.on(t,n)}once(t,n){return super.once(t,n),this}removeListener(t,n){return super.removeListener(t,n),t===`data`&&this.listenerCount(`data`)===0&&this.pause(),this}off(t,n){return this.removeListener(t,n)}removeAllListeners(t){let n=t===void 0||t===`data`?this.listenerCount(`data`)>0:!1;return super.removeAllListeners(t),n&&this.listenerCount(`data`)===0&&this.pause(),this}resume(){return this._flowing=!0,this._gio&&this.fd===0&&!this._reading&&this._startReading(),this}pause(){if(this._flowing=!1,this._reading=!1,this._mainLoopHeld){this._mainLoopHeld=!1;let t=globalThis.imports?.gi,n=t?.GLib??t?.GLib;n?.idle_add?n.idle_add(300,()=>(this._mainLoopHeld||quitMainLoop(),!1)):quitMainLoop()}return this}read(){return null}[Symbol.asyncIterator](){let t=[],n=!1,S=null,C=null,notify=()=>{let t=C;C=null,t?.()},onData=n=>{t.push(n),notify()},onEnd=()=>{n=!0,notify()},onError=t=>{S=t instanceof Error?t:Error(String(t)),notify()},stop=()=>{this.off(`data`,onData),this.off(`end`,onEnd),this.off(`error`,onError)};return this.on(`error`,onError),this.on(`end`,onEnd),this.on(`data`,onData),{next:async()=>{for(;;){if(t.length>0)return{value:t.shift(),done:!1};if(S)throw stop(),S;if(n)return stop(),{value:void 0,done:!0};await new Promise(t=>{C=t})}},return:async()=>(stop(),{value:void 0,done:!0}),[Symbol.asyncIterator](){return this}}}_startReading(){if(!this._gio||this._reading)return;if(this._pendingRead){this._reading=!0,this._mainLoopHeld||(this._mainLoopHeld=!0,ensureMainLoop());return}if(this._reading=!0,this._mainLoopHeld||(this._mainLoopHeld=!0,ensureMainLoop()),!this._stdinGio){let t=this._gio.UnixInputStream??this._gio.InputStream;if(!t){this._reading=!1;return}try{this._stdinGio=t.new(this.fd,!1)}catch{this._reading=!1;return}}let loop=()=>{if(!this._reading){this._pendingRead=!1;return}this._pendingRead=!0,this._stdinGio.read_bytes_async(4096,0,null,(t,n)=>{this._pendingRead=!1;try{let S=t.read_bytes_finish(n)?.get_data?.()??null;if(S&&S.byteLength>0)this._pushData(Buffer.from(S));else if(S!==null&&S.byteLength===0){if(this._reading=!1,this._decoder){let t=this._decoder.end();t.length>0&&this.emit(`data`,t)}this.emit(`end`);return}}catch{this._reading=!1;return}this._reading&&loop()})};loop()}}});function defineLazy(t,n,S){Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){let C=S();return Object.defineProperty(t,n,{value:C,configurable:!0,enumerable:!0,writable:!1}),C}})}var un,Process,dn=__esmMin(()=>{_e(),Tt(),Et(),Dt(),St(),Ot(),jt(),ln(),zt(),nn(),un=Date.now(),Process=class extends Gt{platform;arch;env;argv;argv0;execPath;pid;ppid;version;versions;title;execArgv;config;exitCode;constructor(){super(),this.on(`exit`,()=>{try{restoreClaimedRawModes()}catch(t){ge.error(`@gjsify/process: raw mode could not be restored:`,t)}}),defineLazy(this,`platform`,detectPlatform$1),defineLazy(this,`arch`,detectArch),this.env=getEnvProxy(),this.argv=getArgv(),this.argv0=this.argv[0]||`gjs`,this.execPath=getExecPath(),this.execArgv=getExecArgv(),this.config=globalThis.process?.config??{target_defaults:{},variables:{}},this.pid=getPid$1(),this.ppid=detectPpid();let t=detectVersionInfo();this.version=t.version,this.versions=t.versions,this.title=t.title,this.on(`newListener`,t=>{isDeliverableSignal(t)&&armSignal(t,t=>this.emit(t,t))}),this.on(`removeListener`,t=>{isDeliverableSignal(t)&&this.listenerCount(t)===0&&disarmSignal(t)})}cwd(){return getCwd()}chdir(t){chdir(t)}kill(t,n){return killPid(t,n)}exit(t){return this.exitCode=t??this.exitCode??0,this.emit(`exit`,this.exitCode),exitProcess(this.exitCode)}nextTick(t,...n){typeof queueMicrotask==`function`?queueMicrotask(()=>t(...n)):Promise.resolve().then(()=>t(...n))}hrtime(t){return hrtime(t)}uptime(){return(Date.now()-un)/1e3}memoryUsage(){return memoryUsage()}cpuUsage(t){return cpuUsage(t)}stdout=new ProcessWriteStream(1);stderr=new ProcessWriteStream(2);stdin=new ProcessReadStream(0);abort(){this.exit(1)}umask(t){let n=readUmask();return t!==void 0&&!this._umaskWarned&&(this._umaskWarned=!0,this.emitWarning(`process.umask(0${t.toString(8)}) cannot change the file-creation mask under GJS — there is no umask(2) binding, so the mask is UNCHANGED. Pass an explicit \`mode\` to open/mkdir/writeFile instead; the kernel applies it atomically at creation.`,`UnsupportedWarning`)),n}_umaskWarned=!1;emitWarning(t,n){ge.warn(typeof t==`string`?`(${n||`Warning`}): ${t}`:t.message)}},Process.prototype.hrtime.bigint=function(){return hrtimeBigint()}});function gi(){let t=globalThis.imports?.gi;if(!t?.Gio||!t.GLib)throw Error(`@gjsify/ipc-channel needs a GJS host (imports.gi)`);return{Gio:t.Gio,GLib:t.GLib}}var gio,glib,fn=__esmMin(()=>{gio=()=>gi().Gio,glib=()=>gi().GLib}),pn,LineChannel,mn=__esmMin(()=>{fn(),pn=new TextEncoder,LineChannel=class{_output;_input;constructor(t,n=null){this._output=t,this._input=n?gio().DataInputStream.new(n):null}get writable(){return this._output!==null}writeLine(t){if(!this._output)throw Error(`LineChannel: output is closed`);this._output.write_all(pn.encode(t),null)}send(t){this.writeLine(JSON.stringify(t)+`
10
+ `)){let n=/^(\w+):\s+(\d+)(\s+kB)?/.exec(S);n&&t.set(n[1],parseInt(n[2],10)*(n[3]?1024:1))}if(t.size>0)return{virtual:t.get(`VmSize`)??0,resident:t.get(`VmRSS`)??0,data:t.get(`VmData`)??0,peak:t.get(`VmPeak`)??0}}let S=shellOut(t,`sh -c 'ps -o rss=,vsz= -p $PPID'`);if(!S)return null;let C=/^(\d+)\s+(\d+)$/.exec(S);return C?{virtual:parseInt(C[2],10)*1024,resident:parseInt(C[1],10)*1024,data:0,peak:0}:null}var Ae,je=__esmMin(()=>{Ae=null,__name$1(readProcessMemory$4,`readProcessMemory`)});function glib$1(){let t=globalThis;if(typeof t.process?.versions?.gjs==`string`||t.process===void 0)return t.imports?.gi?.GLib}function arm(t){Ie||(Ie=!0,t.runAsync().catch(()=>{}))}function ensureMainLoop(){return Re=!1,createLoop()}function createLoop(){let t=glib$1();if(t)return Fe?Me:(Me=new t.MainLoop(null,!1),Fe=!0,t.main_depth()===0&&arm(Me),Me)}function holdMainLoop(){let t=ensureMainLoop();return t&&arm(t),t}function acquireMainLoop(){let t=Fe,n=createLoop();if(n)return Le===0&&!Ve&&(Re=!t),Le+=1,n}function releaseMainLoop(){Le===0||!Me||(--Le,drainIfIdle())}function trackTimer(){ze+=1}function untrackTimer(){dropPending()}function trackRequest(){ze+=1}function untrackRequest(){dropPending()}function trackedCallback(t){return trackRequest(),(...n)=>{try{t(...n)}finally{untrackRequest()}}}function dropPending(){ze!==0&&(--ze,ze===0&&drainIfIdle())}function drainIfIdle(){if(Le!==0||!Me||!Re)return;let t=Me;if(!Ie){quitMainLoop();return}if(ze!==0){Ve=!0;return}if(!t.is_running()){Ve=!0,awaitEntrySettle(t);return}exitParked()}function awaitEntrySettle(t){let n=glib$1();!n||He||(He=!0,n.timeout_add(n.PRIORITY_DEFAULT,20,()=>Me!==t||Le!==0||ze!==0?(He=!1,n.SOURCE_REMOVE):t.is_running()?(He=!1,exitParked(),n.SOURCE_REMOVE):n.SOURCE_CONTINUE))}function exitParked(){let t=globalThis.process,n=glib$1();if(typeof t?.exit!=`function`||!n){quitMainLoop(),t?.exit?.(t.exitCode??0);return}if(Be)return;Be=!0;let S=Me;n.timeout_add(n.PRIORITY_DEFAULT,0,()=>{if(Be=!1,Me!==S||Le!==0)return n.SOURCE_REMOVE;if(ze!==0)return Ve=!0,n.SOURCE_REMOVE;let C=t.exitCode??0;return quitMainLoop(),t.exit(C),n.SOURCE_REMOVE})}function quitMainLoop(){Me&&(Me.quit(),Fe=!1,Ie=!1,Me=null,Le=0,Re=!1,Ve=!1)}var Me,Fe,Ie,Le,Re,ze,Be,Ve,He,Ue=__esmMin(()=>{Me=null,Fe=!1,Ie=!1,Le=0,Re=!1,ze=0,Be=!1,Ve=!1,He=!1,__name$1(glib$1,`glib`)});function hostGi(){return globalThis.imports?.gi}function directoryOf(t){return/^(.*)[\\/][^\\/]*$/.exec(t)?.[1]}function colocateNativeLibrary(t,n=hostGi()){try{let S=n?.GIRepository?.Repository?.dup_default?.(),C=S?.get_typelib_path(t),N=C?directoryOf(C):void 0;return!S||!N?!1:(S.prepend_library_path(N),!0)}catch{return!1}}function probeNativeLibrary(t,n=hostGi()){try{let S=n?.GIRepository?.Repository?.dup_default?.(),C=S?.get_typelib_path(t);if(!n||!S||!C)return null;let N=firstSymbol(S,t);if(!N||(n.GModule?.module_error(),N.info.get_typelib().symbol(N.name)[0]))return null;let F=directoryOf(C)??`.`,I=C.includes(`\\`)&&!C.includes(`/`)?`\\`:`/`;for(let H of S.get_shared_libraries(t)??[]){let S=`${F}${I}${H}`,W=n.GLib?.file_test(S,n.GLib.FileTest.EXISTS)?S:H,q=loaderError(n,t,C,W,N.name);if(q!==void 0)return{namespace:t,library:W,reason:q,missingDependency:missingLibraryDependency(q,W)}}let H=(S.get_shared_libraries(t)??[]).join(`, `)||`(none named)`;return{namespace:t,library:H,reason:`symbol ${N.name} not found in ${H}, and the loader reported no error`}}catch{return null}}function firstSymbol(t,n){let S=t.get_n_infos(n),C=null;for(let N=0;N<S;N++){let S=t.get_info(n,N),F=S.get_type_init_function_name?.();if(F)return{info:S,name:F};let I=S.get_symbol?.();I&&!C&&(C={info:S,name:I})}return C}function loaderError(t,n,S,C,N){let{GIRepository:F,GLib:I,GModule:H}=t;if(!F?.Repository||!F.Typelib||!I||!H)return;let[,W]=I.file_get_contents(S),q=new TextEncoder().encode(`${C}\0`),Y=new Uint8Array(W.length+q.length);Y.set(W),Y.set(q,W.length);let X=new DataView(Y.buffer);X.setUint32(40,Y.length,!0),X.setUint32(52,W.length,!0);let Z=new F.Repository,te=firstSymbol(Z,Z.load_typelib(F.Typelib.new_from_bytes(new I.Bytes(Y)),0));if(te&&(H.module_error(),!te.info.get_typelib().symbol(N)[0]))return H.module_error()??`${n}: ${C} could not be opened (the loader reported no error)`}function missingLibraryDependency(t,n){let S=/Library not loaded: (\S+)/.exec(t)?.[1]??/Error loading shared library ([^\s:]+): .*\(needed by /.exec(t)?.[1]??/(?:^|\s)([^\s:]+): cannot open shared object file/.exec(t)?.[1];if(!S)return;let C=S.replace(/^.*[\\/]/,``);if(!(n&&C===n.replace(/^.*[\\/]/,``)))return C}function openNativeLibrary(t,n=hostGi()){colocateNativeLibrary(t,n);let S=probeNativeLibrary(t,n);return S?new NativeLibraryLoadError(S):null}function loadOptionalNativeModule(t,n,S=hostGi()){if(!S)return{module:null,error:Error(`${t}: imports.gi is not available (not running on GJS)`)};try{let C=S[t];if(!C)return{module:null,error:Error(`${t}: typelib not found`)};let N=openNativeLibrary(t,S);if(N)return ge.debug(N.message),{module:null,error:N};for(let t of n)C[t];return{module:C,error:null}}catch(t){return{module:null,error:t instanceof Error?t:Error(String(t))}}}var NativeLibraryLoadError,Ge=__esmMin(()=>{_e(),NativeLibraryLoadError=class extends Error{failure;constructor(t,n){let S=t.missingDependency?`It needs ${t.missingDependency}, which the loader could not find: not installed, or not on its search path.`:`The loader could not open it.`;super(`${t.namespace}: the native library ${t.library} could not be loaded. ${S}\nLoader: ${t.reason.trim()}\n`+(n??"`gjsify system-check` lists the system libraries the installed @gjsify packages need, with the install command for this host.")),this.name=`NativeLibraryLoadError`,this.failure=t}}});function setDrainerArmed(t){qe!==t&&(qe=t,t?trackRequest():untrackRequest())}function drainOnce(t){let n=Math.min(64,Ke.length);for(let S=0;S<n;S++){let n=Ke.shift();try{n()}catch(n){try{t.log_default_handler(`gjsify-nextTick`,t.LogLevelFlags.LEVEL_WARNING,String(n?.stack||n),null)}catch{}}}Ke.length>0?t.timeout_add(t.PRIORITY_DEFAULT,1,()=>(drainOnce(t),!1)):setDrainerArmed(!1)}function tryGLibTimeout(t){let n=globalThis.imports?.gi?.GLib;return n?.timeout_add?(Ke.push(t),qe||(setDrainerArmed(!0),n.timeout_add(n.PRIORITY_DEFAULT,0,()=>(drainOnce(n),!1))),!0):!1}var Ke,qe,nextTick,Je=__esmMin(()=>{Ue(),Ke=[],qe=!1,nextTick=(t,...n)=>{let S=n.length>0?()=>t(...n):t;if(!tryGLibTimeout(S)){if(typeof globalThis.process?.nextTick==`function`){globalThis.process.nextTick(t,...n);return}if(typeof queueMicrotask==`function`){queueMicrotask(S);return}Promise.resolve().then(S)}}}),Ye=__esmMin(()=>{ie(),oe(),se(),ce(),ue(),ye(),xe(),we(),Te(),ke(),je(),Ue(),Ge(),Je()});re(),Ye(),registerGlobal(`Blob`,te),registerGlobal(`File`,ne);function atobPolyfill(t){if(typeof globalThis.atob==`function`)return globalThis.atob(t);let n=t.replace(/[=\s]/g,``),S=``,C=0,N=0;for(let t=0;t<n.length;t++)C=C<<6|Ze[n.charCodeAt(t)],N+=6,N>=8&&(N-=8,S+=String.fromCharCode(C>>N&255));return S}function btoaPolyfill(t){if(typeof globalThis.btoa==`function`)return globalThis.btoa(t);let n=``,S=0;for(;S+2<t.length;S+=3){let C=t.charCodeAt(S)<<16|t.charCodeAt(S+1)<<8|t.charCodeAt(S+2);n+=Xe[C>>18&63]+Xe[C>>12&63]+Xe[C>>6&63]+Xe[C&63]}if(S+1===t.length){let C=t.charCodeAt(S)<<16;n+=Xe[C>>18&63]+Xe[C>>12&63]+`==`}else if(S+2===t.length){let C=t.charCodeAt(S)<<16|t.charCodeAt(S+1)<<8;n+=Xe[C>>18&63]+Xe[C>>12&63]+Xe[C>>6&63]+`=`}return n}function base64Decode$2(t){let n=t.replace(/[=\s]/g,``),S=new Uint8Array(n.length*3>>2),C=0,N=0,F=0;for(let t=0;t<n.length;t++)C=C<<6|Ze[n.charCodeAt(t)],N+=6,N>=8&&(N-=8,S[F++]=C>>N&255);return S.subarray(0,F)}function base64Encode$1(t){let n=``,S=t.length;for(let C=0;C<S;C+=3){let N=t[C],F=C+1<S?t[C+1]:0,I=C+2<S?t[C+2]:0;n+=Xe[N>>2],n+=Xe[(N&3)<<4|F>>4],n+=C+1<S?Xe[(F&15)<<2|I>>6]:`=`,n+=C+2<S?Xe[I&63]:`=`}return n}var Xe,Ze,Qe=__esmMin(()=>{Xe=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Ze=new Uint8Array(256);for(let t=0;t<64;t++)Ze[Xe.charCodeAt(t)]=t;__name$1(base64Decode$2,`base64Decode`),__name$1(base64Encode$1,`base64Encode`)});function normalizeEncoding(t){if(!t||t===`utf8`||t===`utf-8`)return`utf8`;switch((``+t).toLowerCase().replace(/-/g,``)){case`utf8`:return`utf8`;case`ascii`:return`ascii`;case`latin1`:case`binary`:return`latin1`;case`base64`:return`base64`;case`base64url`:return`base64url`;case`hex`:return`hex`;case`ucs2`:case`utf16le`:return`utf16le`;default:return`utf8`}}function checkEncoding(t){let n=(``+t).toLowerCase().replace(/-/g,``);if(!$e.includes(n))throw TypeError(`Unknown encoding: ${t}`)}var $e,et=__esmMin(()=>{$e=[`utf8`,`ascii`,`latin1`,`binary`,`base64`,`base64url`,`hex`,`ucs2`,`utf16le`]});function encodeString(t,n){switch(n){case`utf8`:return textEncoder().encode(t);case`ascii`:{let n=new Uint8Array(t.length);for(let S=0;S<t.length;S++)n[S]=t.charCodeAt(S)&127;return n}case`latin1`:{let n=new Uint8Array(t.length);for(let S=0;S<t.length;S++)n[S]=t.charCodeAt(S)&255;return n}case`base64`:return base64Decode$2(t.replace(/-/g,`+`).replace(/_/g,`/`));case`base64url`:return encodeString(t.replace(/-/g,`+`).replace(/_/g,`/`),`base64`);case`hex`:{let n=t.length>>>1,S=new Uint8Array(n);for(let C=0;C<n;C++){let n=parseInt(t[C*2],16),N=parseInt(t[C*2+1],16);if(Number.isNaN(n)||Number.isNaN(N))break;S[C]=n<<4|N}return S}case`utf16le`:{let n=new Uint8Array(t.length*2);for(let S=0;S<t.length;S++){let C=t.charCodeAt(S);n[S*2]=C&255,n[S*2+1]=C>>8&255}return n}default:return textEncoder().encode(t)}}function decodeString(t,n,S,C){let N=S!==void 0||C!==void 0?t.subarray(S??0,C??t.length):t;switch(n){case`utf8`:return textDecoder().decode(N);case`ascii`:{let t=``;for(let n=0;n<N.length;n++)t+=String.fromCharCode(N[n]&127);return t}case`latin1`:{let t=``;for(let n=0;n<N.length;n++)t+=String.fromCharCode(N[n]);return t}case`base64`:{let t=``;for(let n=0;n<N.length;n++)t+=String.fromCharCode(N[n]);return btoaPolyfill(t)}case`base64url`:return decodeString(N,`base64`).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``);case`hex`:{let t=``;for(let n=0;n<N.length;n++)t+=N[n].toString(16).padStart(2,`0`);return t}case`utf16le`:{let t=``;for(let n=0;n+1<N.length;n+=2)t+=String.fromCharCode(N[n]|N[n+1]<<8);return t}default:return textDecoder().decode(N)}}function checkOffset(t,n,S){if(t+n>S)throw RangeError(`Attempt to access memory outside buffer bounds`)}var tt,nt,textEncoder,textDecoder,rt=__esmMin(()=>{Qe(),textEncoder=()=>tt??=new TextEncoder,textDecoder=()=>nt??=new TextDecoder}),it,ot,st,ct,lt,SlowBuffer,ut=__esmMin(()=>{rt(),et(),it=typeof SharedArrayBuffer<`u`,ot=class Buffer extends Uint8Array{static _isBuffer=!0;static alloc(t,n,S){if(typeof t!=`number`)throw TypeError(`The "size" argument must be of type number. Received type ${typeof t}`);if(t<0)throw RangeError(`The value "${t}" is invalid for option "size"`);let C=new Buffer(t);return n!==void 0&&n!==0&&C.fill(n,0,t,S),C}static allocUnsafe(t){if(typeof t!=`number`)throw TypeError(`The "size" argument must be of type number. Received type ${typeof t}`);return new Buffer(t)}static allocUnsafeSlow(t){return Buffer.allocUnsafe(t)}static from(t,n,S){if(typeof t==`string`){let S=normalizeEncoding(n);if(n&&typeof n==`string`){let t=(``+n).toLowerCase().replace(/-/g,``);[`utf8`,`ascii`,`latin1`,`binary`,`base64`,`base64url`,`hex`,`ucs2`,`utf16le`,``].includes(t)||checkEncoding(n)}let C=encodeString(t,S);return new Buffer(C.buffer,C.byteOffset,C.byteLength)}if(ArrayBuffer.isView(t)){let n=new Buffer(t.buffer,t.byteOffset,t.byteLength),S=new Buffer(n.length);return S.set(n),S}if(t instanceof ArrayBuffer){let C=n||0,N=S===void 0?t.byteLength-C:S;return new Buffer(t,C,N)}if(it&&t instanceof SharedArrayBuffer){let C=n||0,N=S===void 0?t.byteLength-C:S;return new Buffer(new Uint8Array(t,C,N))}if(typeof t==`object`&&t&&typeof t.viewBytes==`function`&&typeof t.byteLength==`number`&&t.constructor?.name===`SharedBuffer`){let C=t,N=n||0,F=S===void 0?C.byteLength-N:S,I=C.viewBytes(N,F);return new Buffer(I.buffer,I.byteOffset,I.byteLength)}if(Array.isArray(t)){let n=new Buffer(t.length);for(let S=0;S<t.length;S++)n[S]=t[S]&255;return n}throw TypeError(`The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array`)}static isBuffer(t){return t instanceof Buffer}static isEncoding(t){if(typeof t!=`string`)return!1;let n=t.toLowerCase().replace(/-/g,``);return[`utf8`,`ascii`,`latin1`,`binary`,`base64`,`base64url`,`hex`,`ucs2`,`utf16le`].includes(n)}static byteLength(t,n){if(typeof t!=`string`){if(ArrayBuffer.isView(t)||t instanceof ArrayBuffer||it&&t instanceof SharedArrayBuffer)return t.byteLength;throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer`)}switch(normalizeEncoding(n)){case`utf8`:return new TextEncoder().encode(t).byteLength;case`ascii`:case`latin1`:return t.length;case`base64`:case`base64url`:{let n=t.length;for(;n>0&&(t[n-1]===`=`||t[n-1]===` `);)n--;return n*3>>>2}case`hex`:return t.length>>>1;case`utf16le`:return t.length*2;default:return new TextEncoder().encode(t).byteLength}}static compare(t,n){if(!(t instanceof Uint8Array)||!(n instanceof Uint8Array))throw TypeError(`Arguments must be Buffers or Uint8Arrays`);let S=Math.min(t.length,n.length);for(let C=0;C<S;C++){if(t[C]<n[C])return-1;if(t[C]>n[C])return 1}return t.length<n.length?-1:+(t.length>n.length)}static concat(t,n){if(t.length===0)return Buffer.alloc(0);if(n===void 0){n=0;for(let S=0;S<t.length;S++)n+=t[S].length}let S=Buffer.alloc(n),C=0;for(let N=0;N<t.length;N++){let F=t[N],I=Math.min(F.length,n-C);I<=0||(S.set(F.subarray(0,I),C),C+=I)}return S}static poolSize=65536;toString(t,n,S){let C=normalizeEncoding(t);return decodeString(this,C,n,S)}toJSON(){return{type:`Buffer`,data:Array.from(this)}}equals(t){if(!(t instanceof Uint8Array))throw TypeError(`Argument must be a Buffer or Uint8Array`);if(this.length!==t.length)return!1;for(let n=0;n<this.length;n++)if(this[n]!==t[n])return!1;return!0}compare(t,n,S,C,N){if(!(t instanceof Uint8Array))throw TypeError(`Argument must be a Buffer or Uint8Array`);let F=C!==void 0||N!==void 0?this.subarray(C??0,N??this.length):this,I=n!==void 0||S!==void 0?t.subarray(n??0,S??t.length):t;return Buffer.compare(F,I)}copy(t,n=0,S=0,C){let N=C??this.length,F=Math.min(N-S,t.length-n);return F<=0?0:(t.set(this.subarray(S,S+F),n),F)}slice(t,n){let S=t??0,C=n??this.length,N=super.subarray(S,C);return new Buffer(N.buffer,N.byteOffset,N.byteLength)}subarray(t,n){let S=super.subarray(t,n);return new Buffer(S.buffer,S.byteOffset,S.byteLength)}write(t,n,S,C){n??=0;let N=encodeString(t,normalizeEncoding(C||(typeof S==`string`?S:void 0))),F=S!==void 0&&typeof S==`number`?Math.min(S,this.length-n):this.length-n,I=Math.min(N.length,F);return this.set(N.subarray(0,I),n),I}fill(t,n,S,C){let N=n??0,F=S??this.length;if(typeof t==`number`)super.fill(t&255,N,F);else if(typeof t==`string`){let n=encodeString(t,normalizeEncoding(C));if(n.length===0)super.fill(0,N,F);else if(n.length===1)super.fill(n[0],N,F);else for(let t=N;t<F;t++)this[t]=n[(t-N)%n.length]}else if(t instanceof Uint8Array)if(t.length===0)super.fill(0,N,F);else for(let n=N;n<F;n++)this[n]=t[(n-N)%t.length];return this}indexOf(t,n,S){if(typeof t==`number`)return super.indexOf(t&255,n);let C=typeof t==`string`?encodeString(t,normalizeEncoding(S)):t,N=n??0;outer:for(let t=N;t<=this.length-C.length;t++){for(let n=0;n<C.length;n++)if(this[t+n]!==C[n])continue outer;return t}return-1}lastIndexOf(t,n,S){if(typeof t==`number`)return n===void 0?super.lastIndexOf(t&255):super.lastIndexOf(t&255,n);let C=typeof t==`string`?encodeString(t,normalizeEncoding(S)):t,N=n===void 0?this.length-C.length:Math.min(n,this.length-C.length);outer:for(let t=N;t>=0;t--){for(let n=0;n<C.length;n++)if(this[t+n]!==C[n])continue outer;return t}return-1}includes(t,n,S){return this.indexOf(t,n,S)!==-1}readUInt8(t=0){return checkOffset(t,1,this.length),this[t]}readUInt16BE(t=0){return checkOffset(t,2,this.length),this[t]<<8|this[t+1]}readUInt16LE(t=0){return checkOffset(t,2,this.length),this[t]|this[t+1]<<8}readUInt32BE(t=0){return checkOffset(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])}readUInt32LE(t=0){return checkOffset(t,4,this.length),this[t+3]*16777216+(this[t+2]<<16|this[t+1]<<8|this[t])>>>0}readInt8(t=0){return checkOffset(t,1,this.length),this[t]|(this[t]&128?4294967040:0)}readInt16BE(t=0){checkOffset(t,2,this.length);let n=this[t]<<8|this[t+1];return n&32768?n|4294901760:n}readInt16LE(t=0){checkOffset(t,2,this.length);let n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n}readInt32BE(t=0){return checkOffset(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]}readInt32LE(t=0){return checkOffset(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24}readFloatBE(t=0){return checkOffset(t,4,this.length),new DataView(this.buffer,this.byteOffset+t,4).getFloat32(0,!1)}readFloatLE(t=0){return checkOffset(t,4,this.length),new DataView(this.buffer,this.byteOffset+t,4).getFloat32(0,!0)}readDoubleBE(t=0){return checkOffset(t,8,this.length),new DataView(this.buffer,this.byteOffset+t,8).getFloat64(0,!1)}readDoubleLE(t=0){return checkOffset(t,8,this.length),new DataView(this.buffer,this.byteOffset+t,8).getFloat64(0,!0)}readBigInt64BE(t=0){return checkOffset(t,8,this.length),new DataView(this.buffer,this.byteOffset+t,8).getBigInt64(0,!1)}readBigInt64LE(t=0){return checkOffset(t,8,this.length),new DataView(this.buffer,this.byteOffset+t,8).getBigInt64(0,!0)}readBigUInt64BE(t=0){return checkOffset(t,8,this.length),new DataView(this.buffer,this.byteOffset+t,8).getBigUint64(0,!1)}readBigUInt64LE(t=0){return checkOffset(t,8,this.length),new DataView(this.buffer,this.byteOffset+t,8).getBigUint64(0,!0)}readUIntBE(t,n){checkOffset(t,n,this.length);let S=0;for(let C=0;C<n;C++)S=S*256+this[t+C];return S}readUIntLE(t,n){checkOffset(t,n,this.length);let S=0,C=1;for(let N=0;N<n;N++)S+=this[t+N]*C,C*=256;return S}readIntBE(t,n){checkOffset(t,n,this.length);let S=0;for(let C=0;C<n;C++)S=S*256+this[t+C];return S>=2**(8*n-1)&&(S-=2**(8*n)),S}readIntLE(t,n){checkOffset(t,n,this.length);let S=0,C=1;for(let N=0;N<n;N++)S+=this[t+N]*C,C*=256;return S>=2**(8*n-1)&&(S-=2**(8*n)),S}writeUInt8(t,n=0){return checkOffset(n,1,this.length),this[n]=t&255,n+1}writeUInt16BE(t,n=0){return checkOffset(n,2,this.length),this[n]=t>>>8&255,this[n+1]=t&255,n+2}writeUInt16LE(t,n=0){return checkOffset(n,2,this.length),this[n]=t&255,this[n+1]=t>>>8&255,n+2}writeUInt32BE(t,n=0){return checkOffset(n,4,this.length),this[n]=t>>>24&255,this[n+1]=t>>>16&255,this[n+2]=t>>>8&255,this[n+3]=t&255,n+4}writeUInt32LE(t,n=0){return checkOffset(n,4,this.length),this[n]=t&255,this[n+1]=t>>>8&255,this[n+2]=t>>>16&255,this[n+3]=t>>>24&255,n+4}writeInt8(t,n=0){return checkOffset(n,1,this.length),t<0&&(t=255+t+1),this[n]=t&255,n+1}writeInt16BE(t,n=0){return checkOffset(n,2,this.length),this[n]=t>>>8&255,this[n+1]=t&255,n+2}writeInt16LE(t,n=0){return checkOffset(n,2,this.length),this[n]=t&255,this[n+1]=t>>>8&255,n+2}writeInt32BE(t,n=0){return checkOffset(n,4,this.length),this[n]=t>>>24&255,this[n+1]=t>>>16&255,this[n+2]=t>>>8&255,this[n+3]=t&255,n+4}writeInt32LE(t,n=0){return checkOffset(n,4,this.length),this[n]=t&255,this[n+1]=t>>>8&255,this[n+2]=t>>>16&255,this[n+3]=t>>>24&255,n+4}writeFloatBE(t,n=0){return checkOffset(n,4,this.length),new DataView(this.buffer,this.byteOffset+n,4).setFloat32(0,t,!1),n+4}writeFloatLE(t,n=0){return checkOffset(n,4,this.length),new DataView(this.buffer,this.byteOffset+n,4).setFloat32(0,t,!0),n+4}writeDoubleBE(t,n=0){return checkOffset(n,8,this.length),new DataView(this.buffer,this.byteOffset+n,8).setFloat64(0,t,!1),n+8}writeDoubleLE(t,n=0){return checkOffset(n,8,this.length),new DataView(this.buffer,this.byteOffset+n,8).setFloat64(0,t,!0),n+8}writeBigInt64BE(t,n=0){return checkOffset(n,8,this.length),new DataView(this.buffer,this.byteOffset+n,8).setBigInt64(0,t,!1),n+8}writeBigInt64LE(t,n=0){return checkOffset(n,8,this.length),new DataView(this.buffer,this.byteOffset+n,8).setBigInt64(0,t,!0),n+8}writeBigUInt64BE(t,n=0){return checkOffset(n,8,this.length),new DataView(this.buffer,this.byteOffset+n,8).setBigUint64(0,t,!1),n+8}writeBigUInt64LE(t,n=0){return checkOffset(n,8,this.length),new DataView(this.buffer,this.byteOffset+n,8).setBigUint64(0,t,!0),n+8}readUint8(t=0){return this.readUInt8(t)}readUint16BE(t=0){return this.readUInt16BE(t)}readUint16LE(t=0){return this.readUInt16LE(t)}readUint32BE(t=0){return this.readUInt32BE(t)}readUint32LE(t=0){return this.readUInt32LE(t)}readUintBE(t,n){return this.readUIntBE(t,n)}readUintLE(t,n){return this.readUIntLE(t,n)}readBigUint64BE(t=0){return this.readBigUInt64BE(t)}readBigUint64LE(t=0){return this.readBigUInt64LE(t)}writeUint8(t,n=0){return this.writeUInt8(t,n)}writeUint16BE(t,n=0){return this.writeUInt16BE(t,n)}writeUint16LE(t,n=0){return this.writeUInt16LE(t,n)}writeUint32BE(t,n=0){return this.writeUInt32BE(t,n)}writeUint32LE(t,n=0){return this.writeUInt32LE(t,n)}writeBigUint64BE(t,n=0){return this.writeBigUInt64BE(t,n)}writeBigUint64LE(t,n=0){return this.writeBigUInt64LE(t,n)}swap16(){let t=this.length;if(t%2!=0)throw RangeError(`Buffer size must be a multiple of 16-bits`);for(let n=0;n<t;n+=2){let t=this[n];this[n]=this[n+1],this[n+1]=t}return this}swap32(){let t=this.length;if(t%4!=0)throw RangeError(`Buffer size must be a multiple of 32-bits`);for(let n=0;n<t;n+=4){let t=this[n],S=this[n+1];this[n]=this[n+3],this[n+1]=this[n+2],this[n+2]=S,this[n+3]=t}return this}swap64(){let t=this.length;if(t%8!=0)throw RangeError(`Buffer size must be a multiple of 64-bits`);for(let n=0;n<t;n+=8){let t=this[n],S=this[n+1],C=this[n+2],N=this[n+3];this[n]=this[n+7],this[n+1]=this[n+6],this[n+2]=this[n+5],this[n+3]=this[n+4],this[n+4]=N,this[n+5]=C,this[n+6]=S,this[n+7]=t}return this}},st=2**31-1,ct=2**28-16,lt={MAX_LENGTH:st,MAX_STRING_LENGTH:ct},SlowBuffer=class extends ot{constructor(t){super(t)}}}),dt=__exportAll$5({Blob:()=>te,Buffer:()=>ot,File:()=>ne,INSPECT_MAX_BYTES:()=>50,SlowBuffer:()=>SlowBuffer,atob:()=>ft,atobPolyfill:()=>atobPolyfill,base64Decode:()=>base64Decode$2,base64Encode:()=>base64Encode$1,btoa:()=>pt,btoaPolyfill:()=>btoaPolyfill,checkEncoding:()=>checkEncoding,constants:()=>lt,default:()=>mt,kMaxLength:()=>st,kStringMaxLength:()=>ct,normalizeEncoding:()=>normalizeEncoding}),ft,pt,mt,ht=__esmMin(()=>{Qe(),re(),et(),ut(),ft=globalThis.atob,pt=globalThis.btoa,mt={Buffer:ot,SlowBuffer,Blob:te,File:ne,atob:ft,btoa:pt,kMaxLength:st,kStringMaxLength:ct,constants:lt,INSPECT_MAX_BYTES:50}});ht(),`Buffer`in globalThis||Object.defineProperty(globalThis,"Buffer",{value:ot,enumerable:!1,writable:!0,configurable:!0});var gt,_t=__esmMin(()=>{gt=t}),vt,yt=__esmMin(()=>{_t(),vt=gt});yt(),typeof globalThis.btoa!=`function`&&Object.defineProperty(globalThis,"btoa",{value:function btoa(t){let n=new Uint8Array(t.length);for(let S=0;S<t.length;S++)n[S]=t.charCodeAt(S)&255;return vt.base64_encode(n)},enumerable:!0,writable:!0,configurable:!0}),typeof globalThis.atob!=`function`&&Object.defineProperty(globalThis,"atob",{value:function atob(t){let n=String(t).replace(/[\t\n\f\r ]/g,``);n.length%4!=0&&!n.includes(`=`)&&(n+=`=`.repeat(4-n.length%4));let S=vt.base64_decode(n),C=``;for(let t=0;t<S.length;t++)C+=String.fromCharCode(S[t]);return C},enumerable:!0,writable:!0,configurable:!0}),Ye(),typeof queueMicrotask!=`function`&&Object.defineProperty(globalThis,"queueMicrotask",{value:ve,enumerable:!0,writable:!0,configurable:!0});function getGjsGlobal(){return globalThis}function getGioNamespace(){let t=getGjsGlobal().imports?.gi;if(!t)return null;let n=null;try{n=t.GioUnix??null}catch{}if(!n)try{n=t.Gio??null}catch{}return n}var bt=__esmMin(()=>{});function getMonotonicTime(){try{let t=getGjsGlobal().imports?.gi?.GLib;if(t?.get_monotonic_time)return BigInt(t.get_monotonic_time())*1000n}catch{}return typeof performance?.now==`function`?BigInt(Math.round(performance.now()*1e6)):BigInt(Date.now())*1000000n}function hrtime(t){let n=getMonotonicTime()-xt,S=Number(n/1000000000n),C=Number(n%1000000000n);if(t){let n=S-t[0],N=C-t[1];return N<0&&(n--,N+=1e9),[n,N]}return[S,C]}function hrtimeBigint(){return getMonotonicTime()-xt}var xt,St=__esmMin(()=>{bt(),xt=getMonotonicTime()});function probeUname(){if(Ct!==void 0)return Ct;Ct=null;try{let t=getGjsGlobal().imports?.gi?.GLib;if(!t)return Ct;let n=t.spawn_sync,S=t.SpawnFlags?.SEARCH_PATH;if(!n||S===void 0)return Ct;let[C,N]=n(null,[`uname`,`-sm`],null,S,null);if(!C||!N)return Ct;let F=new TextDecoder().decode(N).trim().split(/\s+/);if(F.length<2)return Ct;let I=mapSysname(F[0]),H=mapMachine(F[F.length-1]);if(!I||!H)return Ct;Ct={platform:I,arch:H}}catch{}return Ct}var Ct,wt=__esmMin(()=>{bt(),Ye()});function detectGjsVersion(){try{let t=getGjsGlobal().imports?.system;if(t?.version!==void 0){let n=Number(t.version);return`${Math.floor(n/1e4)}.${Math.floor(n%1e4/100)}.${n%100}`}}catch{}}function detectNodeVersion(){if(typeof globalThis.process?.versions?.node==`string`)return globalThis.process.versions.node}function detectVersionInfo(){if(detectNodeVersion())return{version:globalThis.process.version,versions:{...globalThis.process.versions},title:globalThis.process?.title||`node`};let t=detectGjsVersion(),n={node:`20.0.0`};return t&&(n.gjs=t),{version:`v20.0.0`,versions:n,title:`gjs`}}function detectPpid(){let t=runtimeProcess();return t&&typeof t.ppid==`number`?t.ppid:hostPpid()??0}function runtimeProcess(){let t=globalThis.process;return typeof t?.release?.name==`string`?t:void 0}function onGjs(){try{return getGjsGlobal().imports?.gi!==void 0}catch{return!1}}function detectPlatform$1(){let t=runtimeProcess();if(t)return t.platform;if(onGjs()){let t=probeUname();if(t)return t.platform}return`linux`}function detectArch(){let t=runtimeProcess();if(t)return t.arch;if(onGjs()){let t=probeUname();if(t)return t.arch}return`x64`}function getPid$1(){let t=runtimeProcess();return t&&typeof t.pid==`number`?t.pid:hostPid()??0}var Tt=__esmMin(()=>{bt(),wt(),Ye(),__name$1(detectPlatform$1,`detectPlatform`),__name$1(getPid$1,`getPid`)});function getEnvProxy(){if(typeof globalThis.process?.env==`object`)return globalThis.process.env;try{let t=getGjsGlobal().imports?.gi?.GLib;if(t)return new Proxy({},{get(n,S){if(typeof S==`string`)return t.getenv(S)??void 0},set(n,S,C){return typeof S==`string`?(t.setenv(S,String(C),!0),!0):!1},deleteProperty(n,S){return typeof S==`string`?(t.unsetenv(S),!0):!1},has(n,S){return typeof S==`string`?t.getenv(S)!==null:!1},ownKeys(n){return t.listenv()},getOwnPropertyDescriptor(n,S){if(typeof S!=`string`)return;let C=t.getenv(S);if(C!==null)return{configurable:!0,enumerable:!0,writable:!0,value:C}}})}catch{}return{}}function getArgv(){if(globalThis.process?.argv!==void 0)return globalThis.process.argv;try{let t=getGjsGlobal().imports?.system;if(t?.programArgs)return[`gjs`,t.programInvocationName||``,...t.programArgs]}catch{}return[`gjs`]}function getExecPath(){let t=globalThis.process;return!isGjsHost()&&typeof t?.execPath==`string`?t.execPath:hostExecPath()??`/usr/bin/gjs`}function isGjsHost(){try{return getGjsGlobal().imports?.gi!==void 0}catch{return!1}}function getCwd(){try{let t=getGjsGlobal().imports?.gi?.GLib;if(t?.get_current_dir)return t.get_current_dir()}catch{}return`/`}function chdir(t){let n=getGjsGlobal().imports?.gi?.GLib;try{if(n?.chdir){if(!n.file_test(t,16)){let n=Error(`ENOENT: no such file or directory, chdir '${t}'`);throw n.code=`ENOENT`,n.syscall=`chdir`,n.path=t,n}n.chdir(t);return}}catch(t){if(t&&typeof t==`object`&&t.code===`ENOENT`)throw t}if(!n){let n=globalThis.process;if(n&&typeof n.chdir==`function`){n.chdir(t);return}}throw Error(`process.chdir() is not supported in this environment`)}function getExecArgv(){if(!isGjsHost()){let t=globalThis.process;return Array.isArray(t?.execArgv)?t.execArgv:[]}try{let t=getGjsGlobal().imports?.gi?.GLib;if(t?.file_get_contents){let[,n]=t.file_get_contents(`/proc/self/cmdline`);if(n){let t=n instanceof Uint8Array?n:new Uint8Array(n),S=new TextDecoder().decode(t).split(`\0`).filter(t=>t.length>0),C=[];for(let t=1;t<S.length&&S[t].startsWith(`-`);t++)C.push(S[t]);return C}}}catch{}return[]}var Et=__esmMin(()=>{bt(),Ye()});function exitProcess(t){let n=getGjsGlobal().imports,S=n?.gi?.GLib,C=n?.system,N=S?.idle_add,F=S?.SOURCE_REMOVE,I=S?.PRIORITY_DEFAULT,H=S?.MainContext;if(C?.exit&&N&&typeof I==`number`&&typeof F==`boolean`&&typeof H?.default==`function`){N(I,()=>(C.exit(t),F));let n=H.default();for(;;)n.iteration(!0)}try{C?.exit&&C.exit(t)}catch{}let W=globalThis.process;throw W&&typeof W.exit==`function`&&W.exit(t),Error(`process.exit(${t})`)}var Dt=__esmMin(()=>{bt()});function isGjs$1(){return getGjsGlobal().imports?.gi?.GLib!==void 0}function classifyKillFailure(t){if(/No such process/i.test(t))return`ESRCH`;if(/Operation not permitted/i.test(t))return`EPERM`}function killPid(t,n){let S=getGjsGlobal().imports?.gi?.GLib;if(S){let C=typeof n==`number`?String(n):n||`SIGTERM`,N=[`kill`,C.startsWith(`SIG`)?`-${C.slice(3)}`:`-${C}`,`--`,String(t)],F=S.environ_setenv(S.get_environ(),`LC_ALL`,`C`,!0),[,,I,H]=S.spawn_sync(null,N,F,4,null),W=!1;try{W=S.spawn_check_wait_status(H)}catch{W=!1}if(W)return!0;let q=I?new TextDecoder().decode(I).trim():``,Y=classifyKillFailure(q),X=Error(Y?`kill ${Y}`:`kill failed${q?`: ${q}`:``}`);throw Y&&(X.code=Y,X.errno=Y===`ESRCH`?-3:-1,X.syscall=`kill`),X}let C=globalThis.process;if(C&&typeof C.kill==`function`)return C.kill(t,n);throw Error(`process.kill() is not supported in this environment`)}function memoryUsage(){let t=readProcessMemory$4();if(t)return{rss:t.resident,heapTotal:t.resident,heapUsed:t.resident,external:0,arrayBuffers:0};if(!isGjs$1()){let t=globalThis.process;if(t&&typeof t.memoryUsage==`function`)return t.memoryUsage()}return{rss:0,heapTotal:0,heapUsed:0,external:0,arrayBuffers:0}}function cpuUsage(t){if(!isGjs$1()){let n=globalThis.process;if(n&&typeof n.cpuUsage==`function`)return n.cpuUsage(t)}return{user:0,system:0}}function readUmask(){try{let t=getGjsGlobal().imports?.gi?.GLib;if(t){let[n,S]=t.file_get_contents(`/proc/self/status`);if(n){let t=/^Umask:\s*([0-7]+)/m.exec(new TextDecoder().decode(S));if(t)return parseInt(t[1],8)}}}catch{}return 18}var Ot=__esmMin(()=>{bt(),Ye(),__name$1(isGjs$1,`isGjs`)});function resolveSignalAdd(){let t=getGjsGlobal().imports?.gi;if(!t)return null;for(let[n,S]of[[`GLibUnix`,`signal_add`],[`GLib`,`unix_signal_add`]])try{let C=t[n]?.[S];if(typeof C==`function`)return C}catch{}return null}function isDeliverableSignal(t){return typeof t==`string`&&t in kt}function armSignal(t,n){if(At.has(t))return;let S=kt[t],C=resolveSignalAdd(),N=getGjsGlobal().imports?.gi?.GLib;if(S===void 0||C===null||!N)return;let F=N.PRIORITY_DEFAULT,I=C(F,S,()=>(n(t),!0));At.set(t,I)}function disarmSignal(t){let n=At.get(t);if(n===void 0)return;At.delete(t);let S=getGjsGlobal().imports?.gi?.GLib;S&&typeof S.source_remove==`function`&&S.source_remove(n)}var kt,At,jt=__esmMin(()=>{bt(),kt={SIGHUP:1,SIGINT:2,SIGTERM:15},At=new Map});function claimRawMode(t,n){Pt.set(t,n)}function releaseRawMode(t){Pt.delete(t)}function noteRawMode(t,n,S){let C=S(n);return n?C&&claimRawMode(t,()=>{S(!1)}):releaseRawMode(t),C}function restoreClaimedRawModes(){let t=[...Pt.entries()];Pt.clear();let n=0,S;for(let[,C]of t)try{C(),n+=1}catch(t){S??=t}if(S!==void 0)throw S;return n}var Mt,Nt,Pt,Ft=__esmMin(()=>{Mt=Symbol.for(`@gjsify/terminal-native:raw-mode-claims`),Nt=globalThis,Pt=Nt[Mt]??=new Map});function callableModule(){if(!Lt)return null;try{return Lt.Terminal.is_tty(2),Lt}catch{return null}}function nativeIsTty(t){try{return callableModule()?.Terminal.is_tty(t)??null}catch{return null}}function nativeTerminalSize(t){try{let[n,S,C]=callableModule()?.Terminal.get_size(t)??[!1,0,0];return!n||C<=0?null:{rows:S,columns:C}}catch{return null}}function nativeSetRawMode(t,n){try{return callableModule()?.Terminal.set_raw_mode(t,n)??null}catch{return null}}var It,Lt,Rt,zt=__esmMin(()=>{Ft(),Ye(),It=loadOptionalNativeModule(`GjsifyTerminal`,[`Terminal`,`ResizeWatcher`]),Lt=It.module,Rt=Lt});function onceWrapper(){let{target:t,type:n,listener:S}=this;return this.wrapperFn&&t.removeListener(n,this.wrapperFn),S.apply(t,Array.from(arguments))}function _onceWrap(t,n,S){let C={target:t,type:n,listener:S,wrapperFn:void 0},N=onceWrapper.bind(C);return C.wrapperFn=N,N.listener=S,N}function arrayClone(t){switch(t.length){case 0:return[];case 1:return[t[0]];case 2:return[t[0],t[1]];case 3:return[t[0],t[1],t[2]];default:return t.slice()}}function checkListener(t){if(typeof t!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof t)}function validateNumber(t,n){if(typeof t!=`number`||t!==t)throw TypeError(`The "${n}" argument must be of type number. Received type ${typeof t}`)}function spliceOne(t,n){for(;n+1<t.length;n++)t[n]=t[n+1];t.pop()}function unwrapListeners(t){let n=Array.from({length:t.length});for(let S=0;S<n.length;++S)n[S]=t[S].listener??t[S];return n}function createAbortError$2(t){let n=Error(`The operation was aborted`);return n.name=`AbortError`,n.code=`ABORT_ERR`,t?.reason&&(n.cause=t.reason),n}var Bt,Vt,Ht,Ut=__esmMin(()=>{_e(),Bt=Symbol(`kCapture`),Vt=Symbol.for(`nodejs.rejection`),Ht=class EventEmitter{static defaultMaxListeners=10;static errorMonitor=Symbol(`events.errorMonitor`);static captureRejectionSymbol=Vt;static _captureRejections=!1;static get captureRejections(){return EventEmitter._captureRejections}static set captureRejections(t){if(typeof t!=`boolean`)throw TypeError(`The "captureRejections" argument must be of type boolean.`);EventEmitter._captureRejections=t}_events;_eventsCount;_maxListeners;[Bt];constructor(t){this._events=Object.create(null),this._eventsCount=0,this._maxListeners=void 0,this[Bt]=t?.captureRejections??EventEmitter._captureRejections}setMaxListeners(t){if(validateNumber(t,`n`),t<0)throw RangeError(`The value of "n" is out of range. It must be a non-negative number. Received `+t);return this._maxListeners=t,this}getMaxListeners(){return this._maxListeners??EventEmitter.defaultMaxListeners}emit(t,...n){let S=this._events,C=t===`error`;if(S!==void 0)C&&S[EventEmitter.errorMonitor]!==void 0&&this.emit(EventEmitter.errorMonitor,...n),C&&=S.error===void 0;else if(!C)return!1;if(C){let t;if(t=n.length>0?n[0]:Error(`Unhandled error.`),t instanceof Error)throw t;let S=Error(`Unhandled error. (`+t+`)`);throw S.context=t,S}let N=S[t];if(N===void 0)return!1;if(typeof N==`function`){let S=N.apply(this,n);S!=null&&this[Bt]&&this._addCatch(S,t,n)}else{let S=arrayClone(N),C=S.length;for(let N=0;N<C;++N){let C=S[N].apply(this,n);C!=null&&this[Bt]&&this._addCatch(C,t,n)}}return!0}_addCatch(t,n,S){typeof t?.then==`function`&&t.then(void 0,t=>{let C=this[Vt];if(typeof C==`function`)C.call(this,t,n,...S);else{let n=this[Bt];try{this[Bt]=!1,this.emit(`error`,t)}finally{this[Bt]=n}}})}addListener(t,n){return this._addListener(t,n,!1)}on(t,n){return this._addListener(t,n,!1)}prependListener(t,n){return this._addListener(t,n,!0)}_addListener(t,n,S){checkListener(n);let C=this._events;C===void 0?(C=this._events=Object.create(null),this._eventsCount=0):C.newListener!==void 0&&(this.emit(`newListener`,t,n.listener??n),C=this._events);let N=C[t];N===void 0?(C[t]=n,++this._eventsCount):typeof N==`function`?C[t]=S?[n,N]:[N,n]:S?N.unshift(n):N.push(n);let F=this.getMaxListeners();if(F>0){let n=typeof C[t]==`function`?1:C[t].length;if(n>F&&!C[t].warned){typeof C[t]!=`function`&&(C[t].warned=!0);let S=Error(`Possible EventEmitter memory leak detected. ${n} ${String(t)} listeners added to [${this.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);S.name=`MaxListenersExceededWarning`,ge.warn(S.message)}}return this}once(t,n){return checkListener(n),this.on(t,_onceWrap(this,t,n)),this}prependOnceListener(t,n){return checkListener(n),this.prependListener(t,_onceWrap(this,t,n)),this}removeListener(t,n){checkListener(n);let S=this._events;if(S===void 0)return this;let C=S[t];if(C===void 0)return this;if(C===n||C.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete S[t],S.removeListener&&this.emit(`removeListener`,t,C.listener??n));else if(typeof C!=`function`){let N=-1;for(let t=C.length-1;t>=0;t--)if(C[t]===n||C[t].listener===n){N=t;break}if(N<0)return this;N===0?C.shift():spliceOne(C,N),C.length===1&&(S[t]=C[0]),S.removeListener!==void 0&&this.emit(`removeListener`,t,n.listener??n)}return this}off(t,n){return this.removeListener(t,n)}removeAllListeners(t){let n=this._events;if(n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[t]),this;if(arguments.length===0){let t=Object.keys(n);for(let n=0;n<t.length;++n){let S=t[n];S!==`removeListener`&&this.removeAllListeners(S)}return this.removeAllListeners(`removeListener`),this._events=Object.create(null),this._eventsCount=0,this}let S=n[t];if(typeof S==`function`)this.removeListener(t,S);else if(S!==void 0)for(let n=S.length-1;n>=0;n--)this.removeListener(t,S[n]);return this}listeners(t){let n=this._events;if(n===void 0)return[];let S=n[t];return S===void 0?[]:typeof S==`function`?[S.listener??S]:unwrapListeners(S)}rawListeners(t){let n=this._events;if(n===void 0)return[];let S=n[t];return S===void 0?[]:typeof S==`function`?[S]:arrayClone(S)}listenerCount(t){let n=this._events;if(n===void 0)return 0;let S=n[t];return S===void 0?0:typeof S==`function`?1:S.length}eventNames(){return(this._eventsCount??0)>0?Reflect.ownKeys(this._events):[]}static once(t,n,S){return new Promise((C,N)=>{let F=S?.signal;if(F?.aborted){N(createAbortError$2(F));return}if(typeof t.addEventListener==`function`){let S=t,handler=(...t)=>{F&&F.removeEventListener(`abort`,abortHandler),C(t)},errorHandler=t=>{F&&F.removeEventListener(`abort`,abortHandler),S.removeEventListener(`error`,errorHandler),N(t)},abortHandler=()=>{S.removeEventListener(n,handler),S.removeEventListener(`error`,errorHandler),N(createAbortError$2(F))};S.addEventListener(n,handler,{once:!0}),n!==`error`&&S.addEventListener(`error`,errorHandler,{once:!0}),F&&F.addEventListener(`abort`,abortHandler,{once:!0});return}let I=t,eventHandler=(...t)=>{F&&F.removeEventListener(`abort`,abortHandler),errorHandler!==void 0&&I.removeListener(`error`,errorHandler),C(t)},errorHandler;n!==`error`&&(errorHandler=t=>{I.removeListener(n,eventHandler),F&&F.removeEventListener(`abort`,abortHandler),N(t)},I.once(`error`,errorHandler)),I.once(n,eventHandler);let abortHandler=()=>{I.removeListener(n,eventHandler),errorHandler&&I.removeListener(`error`,errorHandler),N(createAbortError$2(F))};F&&F.addEventListener(`abort`,abortHandler,{once:!0})})}static on(t,n,S){let C=S?.signal;if(C?.aborted)throw createAbortError$2(C);let N=S?.highWaterMark??2**53-1,F=S?.lowWaterMark??1;validateNumber(N,`highWaterMark`),validateNumber(F,`lowWaterMark`);let I=[],H=[],W=null,q=!1,Y=!1,eventHandler=(...n)=>{if(H.length>0){let{resolve:t}=H.shift();t({value:n,done:!1})}else I.push(n),I.length>=N&&!Y&&(Y=!0,typeof t.pause==`function`&&t.pause())},errorHandler=t=>{if(W=t,H.length>0){let{reject:n}=H.shift();n(t)}X.return()},abortHandler=()=>{errorHandler(createAbortError$2(C))};t.on(n,eventHandler),n!==`error`&&t.on(`error`,errorHandler),C&&C.addEventListener(`abort`,abortHandler,{once:!0});let cleanup=()=>{t.removeListener(n,eventHandler),t.removeListener(`error`,errorHandler),C&&C.removeEventListener(`abort`,abortHandler),q=!0;for(let{resolve:t}of H)t({value:void 0,done:!0});H.length=0,I.length=0},X={next(){if(I.length>0){let n=I.shift();return Y&&I.length<F&&(Y=!1,typeof t.resume==`function`&&t.resume()),Promise.resolve({value:n,done:!1})}if(W){let t=Promise.reject(W);return W=null,t}return q?Promise.resolve({value:void 0,done:!0}):new Promise((t,n)=>{H.push({resolve:t,reject:n})})},return(){return cleanup(),Promise.resolve({value:void 0,done:!0})},throw(t){return q||(W=t,cleanup()),Promise.reject(t)},[Symbol.asyncIterator](){return this}};return X}static listenerCount(t,n){return t.listenerCount(n)}static getEventListeners(t,n){return typeof t.listeners==`function`?t.listeners(n):[]}static setMaxListeners(t,...n){if(validateNumber(t,`n`),t<0)throw RangeError(`The value of "n" is out of range.`);if(n.length===0)EventEmitter.defaultMaxListeners=t;else for(let S of n)typeof S.setMaxListeners==`function`&&S.setMaxListeners(t)}static getMaxListeners(t){return typeof t.getMaxListeners==`function`?t.getMaxListeners():EventEmitter.defaultMaxListeners}static addAbortListener(t,n){t.aborted&&Promise.resolve().then(()=>n());let handler=()=>n();return t.addEventListener(`abort`,handler,{once:!0}),{[Symbol.dispose](){t.removeEventListener(`abort`,handler)}}}},Ht.EventEmitter=Ht;for(let t of[`setMaxListeners`,`getMaxListeners`,`emit`,`addListener`,`on`,`prependListener`,`once`,`prependOnceListener`,`removeListener`,`off`,`removeAllListeners`,`listeners`,`rawListeners`,`listenerCount`,`eventNames`]){let n=Ht.prototype[t];typeof n==`function`&&Object.defineProperty(Ht.prototype,t,{enumerable:!0,configurable:!0,writable:!0,value:n})}Object.defineProperty(Ht.prototype,"_events",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(Ht.prototype,"_eventsCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(Ht.prototype,"_maxListeners",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),__name$1(createAbortError$2,`createAbortError`)}),Wt=__exportAll$5({EventEmitter:()=>Gt,addAbortListener:()=>tn,captureRejectionSymbol:()=>Kt,default:()=>Gt,defaultMaxListeners:()=>Jt,errorMonitor:()=>qt,getEventListeners:()=>$t,getMaxListeners:()=>Xt,listenerCount:()=>en,"module.exports":()=>Gt,on:()=>Qt,once:()=>Zt,setMaxListeners:()=>Yt}),Gt,Kt,qt,Jt,Yt,Xt,Zt,Qt,$t,en,tn,nn=__esmMin(()=>{Ut(),Ye(),Gt=makeCallable(Ht),Gt.EventEmitter=Gt,Kt=Gt.captureRejectionSymbol,qt=Gt.errorMonitor,Jt=Gt.defaultMaxListeners,Yt=Gt.setMaxListeners,Xt=Gt.getMaxListeners,Zt=Gt.once,Qt=Gt.on,$t=Gt.getEventListeners,en=Gt.listenerCount,tn=Gt.addAbortListener}),rn=__exportAll$5({StringDecoder:()=>an,default:()=>on});function normalizeAndValidateEncoding(t){return t&&checkEncoding(t),normalizeEncoding(t)}function utf8DecodeMaximalSubpart(t,n,S){let C=``,N=n;for(;N<S;){let n=t[N];if(n<=127){C+=String.fromCharCode(n),N++;continue}if(n>=194&&n<=223){N+1<S&&t[N+1]>=128&&t[N+1]<=191?(C+=String.fromCharCode((n&31)<<6|t[N+1]&63),N+=2):(C+=`�`,N++);continue}if(n>=224&&n<=239){let F,I;if(n===224?(F=160,I=191):n===237?(F=128,I=159):(F=128,I=191),N+1>=S){C+=`�`,N++;continue}let H=t[N+1];if(H<F||H>I){C+=`�`,N++;continue}if(N+2>=S){C+=`�`,N+=2;continue}let W=t[N+2];if(W<128||W>191){C+=`�`,N+=2;continue}let q=(n&15)<<12|(H&63)<<6|W&63;C+=String.fromCharCode(q),N+=3;continue}if(n>=240&&n<=244){let F,I;if(n===240?(F=144,I=191):n===244?(F=128,I=143):(F=128,I=191),N+1>=S){C+=`�`,N++;continue}let H=t[N+1];if(H<F||H>I){C+=`�`,N++;continue}if(N+2>=S){C+=`�`,N+=2;continue}let W=t[N+2];if(W<128||W>191){C+=`�`,N+=2;continue}if(N+3>=S){C+=`�`,N+=3;continue}let q=t[N+3];if(q<128||q>191){C+=`�`,N+=3;continue}let Y=(n&7)<<18|(H&63)<<12|(W&63)<<6|q&63;C+=String.fromCharCode(55296+(Y-65536>>10),56320+(Y-65536&1023)),N+=4;continue}C+=`�`,N++}return C}function utf8CharLength(t){return t&128?t>=194&&t<=223?2:t>=224&&t<=239?3:t>=240&&t<=244?4:0:1}function isValidContinuation(t,n,S,C){if(S===1){if(n===3)return t===224?C>=160&&C<=191:t===237?C>=128&&C<=159:C>=128&&C<=191;if(n===4)return t===240?C>=144&&C<=191:t===244?C>=128&&C<=143:C>=128&&C<=191}return C>=128&&C<=191}function writeUtf8(t,n){let S=0,C=``;if(t._lastNeed>0){for(;S<n.length&&t._lastNeed>0;){let N=n[S],F=t._lastTotal-t._lastNeed;if(isValidContinuation(t._lastLeadByte,t._lastTotal,F,N))t._lastChar[F]=N,t._lastNeed--,S++;else{C+=`�`,t._lastNeed=0,t._lastTotal=0,t._lastLeadByte=0;break}}if(t._lastNeed===0&&t._lastTotal>0&&(C+=utf8DecodeMaximalSubpart(t._lastChar,0,t._lastTotal),t._lastTotal=0,t._lastLeadByte=0),t._lastNeed>0)return C}let N=n.length;for(let C=0;C<Math.min(4,n.length-S);C++){let F=n.length-1-C;if(F<S)break;let I=n[F];if((I&192)!=128){let S=utf8CharLength(I);if(S>0&&I>=128){let C=n.length-F;if(C<S){let H=!0;for(let t=1;t<C;t++)if(!isValidContinuation(I,S,t,n[F+t])){H=!1;break}if(H){N=F;for(let S=0;S<C;S++)t._lastChar[S]=n[F+S];t._lastNeed=S-C,t._lastTotal=S,t._lastLeadByte=I}}}break}}return N>S&&(C+=utf8DecodeMaximalSubpart(n,S,N)),C}function writeUtf16le(t,n){let S=``,C=0;if(t._lastNeed>0){let N=t._lastTotal-t._lastNeed,F=Math.min(t._lastNeed,n.length);for(let S=0;S<F;S++)t._lastChar[N+S]=n[S];if(t._lastNeed-=F,C=F,t._lastNeed>0)return``;let I=t._lastTotal,H=0;for(;H+1<I;){let N=t._lastChar[H]|t._lastChar[H+1]<<8;if(H+=2,N>=55296&&N<=56319){if(H+1<I){let n=t._lastChar[H]|t._lastChar[H+1]<<8;if(n>=56320&&n<=57343){S+=String.fromCharCode(N,n),H+=2;continue}}if(C+1<n.length){let t=n[C]|n[C+1]<<8;if(t>=56320&&t<=57343){S+=String.fromCharCode(N,t),C+=2;continue}}else if(C>=n.length)return t._lastChar[0]=t._lastChar[H-2],t._lastChar[1]=t._lastChar[H-1],t._lastNeed=2,t._lastTotal=4,S}S+=String.fromCharCode(N)}t._lastTotal=0}for(;C+1<n.length;){let N=n[C]|n[C+1]<<8;if(C+=2,N>=55296&&N<=56319)if(C+1<n.length){let t=n[C]|n[C+1]<<8;if(t>=56320&&t<=57343){S+=String.fromCharCode(N,t),C+=2;continue}}else if(C<n.length)return S+=String.fromCharCode(N),t._lastChar[0]=n[C],t._lastNeed=1,t._lastTotal=2,S;else return t._lastChar[0]=n[C-2],t._lastChar[1]=n[C-1],t._lastNeed=2,t._lastTotal=4,S;S+=String.fromCharCode(N)}return C<n.length&&(t._lastChar[0]=n[C],t._lastNeed=1,t._lastTotal=2),S}function writeBase64(t,n){let S=0;if(t._lastNeed>0){let C=Math.min(t._lastNeed,n.length);for(let S=0;S<C;S++)t._lastChar[t._lastTotal-t._lastNeed+S]=n[S],t._lastNeed--;if(S=C,t._lastNeed>0)return``}let C=n.length-S,N=C-C%3,F=``;t._lastTotal>0&&t._lastNeed===0&&(F+=base64Encode$1(t._lastChar.subarray(0,t._lastTotal)),t._lastTotal=0),N>0&&(F+=base64Encode$1(n.subarray(S,S+N)));let I=C-N;if(I>0){for(let C=0;C<I;C++)t._lastChar[C]=n[S+N+C];t._lastNeed=3-I,t._lastTotal=3}return F}function decodeAscii(t){let n=``;for(let S=0;S<t.length;S++)n+=String.fromCharCode(t[S]&127);return n}function decodeLatin1(t){let n=``;for(let S=0;S<t.length;S++)n+=String.fromCharCode(t[S]);return n}function decodeHex(t){let n=``;for(let S=0;S<t.length;S++)n+=t[S].toString(16).padStart(2,`0`);return n}var an,on,sn=__esmMin(()=>{ht(),an=function StringDecoder(t){this.encoding=normalizeAndValidateEncoding(t),this._lastNeed=0,this._lastTotal=0,this._lastLeadByte=0,this.encoding===`utf8`||this.encoding===`utf16le`?this._lastChar=new Uint8Array(4):this.encoding===`base64`?this._lastChar=new Uint8Array(3):this._lastChar=new Uint8Array},an.prototype.write=function write(t){if(t.length===0)return``;switch(this.encoding){case`utf8`:return writeUtf8(this,t);case`utf16le`:return writeUtf16le(this,t);case`base64`:return writeBase64(this,t);case`ascii`:return decodeAscii(t);case`latin1`:return decodeLatin1(t);case`hex`:return decodeHex(t);default:return decodeAscii(t)}},an.prototype.end=function end(t){let n=``;if(t&&t.length>0&&(n=this.write(t)),this.encoding===`utf8`&&this._lastNeed>0)n+=`�`,this._lastNeed=0,this._lastTotal=0;else if(this.encoding===`utf16le`&&this._lastNeed>0){let t=this._lastTotal-this._lastNeed;for(let S=0;S+1<t;S+=2)n+=String.fromCharCode(this._lastChar[S]|this._lastChar[S+1]<<8);this._lastNeed=0,this._lastTotal=0}else if(this.encoding===`base64`&&this._lastNeed>0){let t=this._lastChar.subarray(0,this._lastTotal-this._lastNeed);n+=base64Encode$1(t),this._lastNeed=0,this._lastTotal=0}return n},on={StringDecoder:an}}),cn,ProcessWriteStream,ProcessReadStream,ln=__esmMin(()=>{_e(),bt(),zt(),nn(),Ye(),sn(),cn=new TextEncoder,ProcessWriteStream=class extends Gt{fd;writable=!0;_outGio=null;constructor(t){super(),this.fd=t;let n=getGioNamespace();if(n){let t=n.UnixOutputStream??n.OutputStream;if(t)try{this._outGio=t.new(this.fd,!1)}catch{}}}write(t){if(this._outGio)try{let n=typeof t==`string`?cn.encode(t):t;return this._outGio.write_all(n,null),!0}catch{}return this.fd===2?ge.error(t):ge.log(t),!0}get isTTY(){let t=nativeIsTty(this.fd);if(t!==null)return t;try{let t=getGjsGlobal().imports?.gi?.GLib;if(t)return!!t.log_writer_supports_color(this.fd)}catch{}return!1}get columns(){let t=nativeTerminalSize(this.fd);if(t)return t.columns;try{let t=getGjsGlobal().imports?.gi?.GLib;if(t){let n=parseInt(t.getenv(`COLUMNS`)??`0`,10);if(n>0)return n}}catch{}return 80}end(){}destroy(){}get rows(){let t=nativeTerminalSize(this.fd);if(t)return t.rows;try{let t=getGjsGlobal().imports?.gi?.GLib;if(t){let n=parseInt(t.getenv(`LINES`)??`0`,10);if(n>0)return n}}catch{}return 24}},ProcessReadStream=class extends Gt{fd;isRaw=!1;_gio=null;_stdinGio=null;_reading=!1;_flowing=!1;_mainLoopHeld=!1;_pendingRead=!1;_decoder=null;constructor(t){super(),this.fd=t,this._gio=getGioNamespace()}get isTTY(){return nativeIsTty(this.fd)??!1}setRawMode(t){return noteRawMode(this.fd,t,t=>nativeSetRawMode(this.fd,t)===!0)?(this.isRaw=t,this):(noteRawMode(this.fd,t,t=>this._setRawModeViaStty(t)),this.isRaw=t,this)}_setRawModeViaStty(t){try{let n=globalThis.imports?.gi,S=n?.Gio??n?.Gio;if(!S)return!1;let C=S.SubprocessFlags?.STDIN_INHERIT??2,N=t?[`stty`,`-icanon`,`-echo`,`-icrnl`,`-isig`,`min`,`1`,`time`,`0`]:[`stty`,`icanon`,`echo`,`icrnl`,`isig`],F=new S.SubprocessLauncher({flags:C}).spawnv(N);return F.wait(null),F.get_successful()}catch{return!1}}setEncoding(t){return this._decoder=new an(t),this}_pushData(t){if(this._decoder){let n=this._decoder.write(t);n.length>0&&this.emit(`data`,n)}else this.emit(`data`,t)}on(t,n){let S=t===`data`&&this.listenerCount(`data`)===0;return super.on(t,n),S&&t===`data`&&this.resume(),this}addListener(t,n){return this.on(t,n)}once(t,n){return super.once(t,n),this}removeListener(t,n){return super.removeListener(t,n),t===`data`&&this.listenerCount(`data`)===0&&this.pause(),this}off(t,n){return this.removeListener(t,n)}removeAllListeners(t){let n=t===void 0||t===`data`?this.listenerCount(`data`)>0:!1;return super.removeAllListeners(t),n&&this.listenerCount(`data`)===0&&this.pause(),this}resume(){return this._flowing=!0,this._gio&&this.fd===0&&!this._reading&&this._startReading(),this}pause(){if(this._flowing=!1,this._reading=!1,this._mainLoopHeld){this._mainLoopHeld=!1;let t=globalThis.imports?.gi,n=t?.GLib??t?.GLib;n?.idle_add?n.idle_add(300,()=>(this._mainLoopHeld||quitMainLoop(),!1)):quitMainLoop()}return this}read(){return null}[Symbol.asyncIterator](){let t=[],n=!1,S=null,C=null,notify=()=>{let t=C;C=null,t?.()},onData=n=>{t.push(n),notify()},onEnd=()=>{n=!0,notify()},onError=t=>{S=t instanceof Error?t:Error(String(t)),notify()},stop=()=>{this.off(`data`,onData),this.off(`end`,onEnd),this.off(`error`,onError)};return this.on(`error`,onError),this.on(`end`,onEnd),this.on(`data`,onData),{next:async()=>{for(;;){if(t.length>0)return{value:t.shift(),done:!1};if(S)throw stop(),S;if(n)return stop(),{value:void 0,done:!0};await new Promise(t=>{C=t})}},return:async()=>(stop(),{value:void 0,done:!0}),[Symbol.asyncIterator](){return this}}}_startReading(){if(!this._gio||this._reading)return;if(this._pendingRead){this._reading=!0,this._mainLoopHeld||(this._mainLoopHeld=!0,ensureMainLoop());return}if(this._reading=!0,this._mainLoopHeld||(this._mainLoopHeld=!0,ensureMainLoop()),!this._stdinGio){let t=this._gio.UnixInputStream??this._gio.InputStream;if(!t){this._reading=!1;return}try{this._stdinGio=t.new(this.fd,!1)}catch{this._reading=!1;return}}let loop=()=>{if(!this._reading){this._pendingRead=!1;return}this._pendingRead=!0,this._stdinGio.read_bytes_async(4096,0,null,(t,n)=>{this._pendingRead=!1;try{let S=t.read_bytes_finish(n)?.get_data?.()??null;if(S&&S.byteLength>0)this._pushData(Buffer.from(S));else if(S!==null&&S.byteLength===0){if(this._reading=!1,this._decoder){let t=this._decoder.end();t.length>0&&this.emit(`data`,t)}this.emit(`end`);return}}catch{this._reading=!1;return}this._reading&&loop()})};loop()}}});function defineLazy(t,n,S){Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){let C=S();return Object.defineProperty(t,n,{value:C,configurable:!0,enumerable:!0,writable:!1}),C}})}var un,Process,dn=__esmMin(()=>{_e(),Tt(),Et(),Dt(),St(),Ot(),jt(),ln(),zt(),nn(),un=Date.now(),Process=class extends Gt{platform;arch;env;argv;argv0;execPath;pid;ppid;version;versions;title;execArgv;config;exitCode;constructor(){super(),this.on(`exit`,()=>{try{restoreClaimedRawModes()}catch(t){ge.error(`@gjsify/process: raw mode could not be restored:`,t)}}),defineLazy(this,`platform`,detectPlatform$1),defineLazy(this,`arch`,detectArch),this.env=getEnvProxy(),this.argv=getArgv(),this.argv0=this.argv[0]||`gjs`,this.execPath=getExecPath(),this.execArgv=getExecArgv(),this.config=globalThis.process?.config??{target_defaults:{},variables:{}},this.pid=getPid$1(),this.ppid=detectPpid();let t=detectVersionInfo();this.version=t.version,this.versions=t.versions,this.title=t.title,this.on(`newListener`,t=>{isDeliverableSignal(t)&&armSignal(t,t=>this.emit(t,t))}),this.on(`removeListener`,t=>{isDeliverableSignal(t)&&this.listenerCount(t)===0&&disarmSignal(t)})}cwd(){return getCwd()}chdir(t){chdir(t)}kill(t,n){return killPid(t,n)}exit(t){return this.exitCode=t??this.exitCode??0,this.emit(`exit`,this.exitCode),exitProcess(this.exitCode)}nextTick(t,...n){typeof queueMicrotask==`function`?queueMicrotask(()=>t(...n)):Promise.resolve().then(()=>t(...n))}hrtime(t){return hrtime(t)}uptime(){return(Date.now()-un)/1e3}memoryUsage(){return memoryUsage()}cpuUsage(t){return cpuUsage(t)}stdout=new ProcessWriteStream(1);stderr=new ProcessWriteStream(2);stdin=new ProcessReadStream(0);abort(){this.exit(1)}umask(t){let n=readUmask();return t!==void 0&&!this._umaskWarned&&(this._umaskWarned=!0,this.emitWarning(`process.umask(0${t.toString(8)}) cannot change the file-creation mask under GJS — there is no umask(2) binding, so the mask is UNCHANGED. Pass an explicit \`mode\` to open/mkdir/writeFile instead; the kernel applies it atomically at creation.`,`UnsupportedWarning`)),n}_umaskWarned=!1;emitWarning(t,n){ge.warn(typeof t==`string`?`(${n||`Warning`}): ${t}`:t.message)}},Process.prototype.hrtime.bigint=function(){return hrtimeBigint()}});function gi(){let t=globalThis.imports?.gi;if(!t?.Gio||!t.GLib)throw Error(`@gjsify/ipc-channel needs a GJS host (imports.gi)`);return{Gio:t.Gio,GLib:t.GLib}}var gio,glib,fn=__esmMin(()=>{gio=()=>gi().Gio,glib=()=>gi().GLib}),pn,LineChannel,mn=__esmMin(()=>{fn(),pn=new TextEncoder,LineChannel=class{_output;_input;constructor(t,n=null){this._output=t,this._input=n?gio().DataInputStream.new(n):null}get writable(){return this._output!==null}writeLine(t){if(!this._output)throw Error(`LineChannel: output is closed`);this._output.write_all(pn.encode(t),null)}send(t){this.writeLine(JSON.stringify(t)+`
11
11
  `)}startReading(t,n){let S=this._input;if(!S)throw Error(`LineChannel: no input stream`);let readNext=()=>{S.read_line_async(glib().PRIORITY_DEFAULT,null,(C,N)=>{let F;try{let[t]=S.read_line_finish_utf8(N);if(t===null){n?.();return}F=JSON.parse(t)}catch{n?.();return}try{t(F)}catch{}finally{readNext()}})};readNext()}closeOutput(){if(this._output){try{this._output.close(null)}catch{}this._output=null}}}});function codedError$1(t,n,S){let C=new t(S);return C.code=n,C}function isInternalMessage(t){if(typeof t!=`object`||!t)return!1;let n=t.cmd;return typeof n==`string`&&n.length>4&&n.startsWith(`NODE_`)}function setupNodeChannel(t,n){let S=gio().Socket.new_from_fd(n),C=S.connection_factory_create_connection(),N=new LineChannel(C.get_output_stream(),C.get_input_stream()),F=!0,I=!0,H=!1,updateHold=()=>{let n=F&&I&&t.listenerCount(`message`)+t.listenerCount(`disconnect`)>0;n!==H&&(H=n,n?acquireMainLoop():releaseMainLoop())};t.on(`newListener`,t=>{(t===`message`||t===`disconnect`)&&queueMicrotask(updateHold)}),t.on(`removeListener`,t=>{(t===`message`||t===`disconnect`)&&queueMicrotask(updateHold)});let W=!0,release=()=>{try{S.close()}catch{}},close=()=>{if(F){F=!1,t.connected=!1,t.channel=null;try{S.shutdown(!0,!0)}catch{}W||release(),queueMicrotask(()=>{t.emit(`disconnect`),updateHold()})}},send=(n,S,C,I)=>{typeof S==`function`?(I=S,S=void 0):typeof C==`function`&&(I=C);let H=typeof I==`function`?I:void 0;if(!F){let n=codedError$1(Error,`ERR_IPC_CHANNEL_CLOSED`,`Channel closed`);return queueMicrotask(H?()=>H(n):()=>t.emit(`error`,n)),!1}if(n===void 0)throw codedError$1(TypeError,`ERR_MISSING_ARGS`,`The "message" argument must be specified`);if(![`string`,`object`,`number`,`boolean`].includes(typeof n))throw codedError$1(TypeError,`ERR_INVALID_ARG_TYPE`,`The "message" argument must be one of type string, object, number, or boolean. Received type ${typeof n}`);if(S!=null)throw codedError$1(Error,`ERR_FEATURE_UNAVAILABLE_ON_PLATFORM`,`Sending a handle over the IPC channel is not supported under GJS`);try{N.send(n)}catch(n){let S=n instanceof Error?n:Error(String(n));return queueMicrotask(H?()=>H(S):()=>t.emit(`error`,S)),!1}return H&&queueMicrotask(()=>H(null)),!0},disconnect=()=>{if(!F){t.emit(`error`,codedError$1(Error,`ERR_IPC_DISCONNECTED`,`IPC channel is already disconnected`));return}close()},q={fd:n,ref(){I=!0,updateHold()},unref(){I=!1,updateHold()}};return Object.assign(t,{send,disconnect,channel:q,connected:!0}),N.startReading(n=>{F&&(isInternalMessage(n)?t.emit(`internalMessage`,n):t.emit(`message`,n,void 0))},()=>{W=!1,close(),release()}),H=!0,acquireMainLoop(),queueMicrotask(updateHold),q}var hn=__esmMin(()=>{fn(),mn(),Ue(),__name$1(codedError$1,`codedError`)});function connectParentChannel(t){if(!isGjsHost())return;let n=t.env.NODE_CHANNEL_FD;if(n===void 0)return;let S=t.env.NODE_CHANNEL_SERIALIZATION_MODE??`json`;delete t.env.NODE_CHANNEL_FD,delete t.env.NODE_CHANNEL_SERIALIZATION_MODE;let C=Number.parseInt(n,10);if(!(!Number.isInteger(C)||C<0)){if(S!==`json`){t.emitWarning(`IPC serialization '${S}' is not supported under GJS yet; no channel to the parent`,`ExperimentalWarning`);return}try{setupNodeChannel(t,C)}catch(n){t.emitWarning(`Could not open the IPC channel to the parent: ${n.message}`)}}}var gn=__esmMin(()=>{Et(),hn()}),_n,vn,yn,bn=__esmMin(()=>{if(St(),dn(),gn(),zt(),_n=new Process,connectParentChannel(_n),Rt)try{let t=new Rt.ResizeWatcher;t.connect(`resized`,(t,n,S)=>{_n.stdout.emit(`resize`),_n.stderr.emit(`resize`)}),t.start()}catch{}_n.platform,_n.arch,_n.env,_n.argv,_n.argv0,_n.execPath,_n.pid,_n.ppid,_n.version,_n.versions,_n.cwd.bind(_n),_n.chdir.bind(_n),_n.exit.bind(_n),_n.nextTick.bind(_n),Object.assign(_n.hrtime.bind(_n),{bigint:hrtimeBigint}),_n.uptime.bind(_n),_n.memoryUsage.bind(_n),_n.cpuUsage.bind(_n),_n.kill.bind(_n),_n.abort.bind(_n),_n.umask.bind(_n),_n.emitWarning.bind(_n),_n.execArgv,_n.config,vn=_n.stdout,_n.stderr,yn=_n.stdin});Ye(),bn(),typeof Promise.withResolvers!=`function`&&(Promise.withResolvers=function(){let t,n;return{promise:new Promise((S,C)=>{t=S,n=C}),resolve:t,reject:n}}),initErrorV8Methods(Error),`global`in globalThis||Object.defineProperty(globalThis,"global",{value:globalThis,writable:!1,enumerable:!1,configurable:!0}),Object.defineProperty(globalThis,"process",{value:_n,enumerable:!1,writable:!0,configurable:!0}),Ye(),typeof globalThis.structuredClone!=`function`&&Object.defineProperty(globalThis,"structuredClone",{value:structuredClone$1,enumerable:!0,writable:!0,configurable:!0}),Ue();function getGLib(){return globalThis.imports?.gi?.GLib}const xn=getGLib()!==void 0;function reportTimerThrow(t,n){try{t.log_default_handler(`gjsify-timers`,t.LogLevelFlags.LEVEL_WARNING,`Uncaught exception in a timer callback: ${String(n)}\n${n?.stack??``}`,null)}catch{}}var GjsifyTimeout=class{_id=null;_refed=!0;_tracked=!1;_callback;_delay;_args;_repeat;constructor(t,n,S,C){this._callback=t,this._delay=n,this._args=S,this._repeat=C,this._schedule()}_schedule(){let t=getGLib();if(!t)return;let n=t.timeout_add.bind(t);this._track(),this._id=n(t.PRIORITY_DEFAULT,this._delay,()=>{try{this._callback.apply(globalThis,this._args)}catch(n){reportTimerThrow(t,n),globalThis.__gjsify_worker_context?.crash(n)}return this._repeat?t.SOURCE_CONTINUE:(this._id=null,this._untrack(),t.SOURCE_REMOVE)})}unref(){return this._refed=!1,this._untrack(),this}ref(){return this._refed=!0,this._id!==null&&this._track(),this}_track(){this._tracked||!this._refed||(this._tracked=!0,trackTimer())}_untrack(){this._tracked&&(this._tracked=!1,untrackTimer())}hasRef(){return this._refed}refresh(){return this._cancel(),this._schedule(),this}_cancel(){this._id!==null&&(getGLib()?.Source.remove(this._id),this._id=null,this._untrack())}close(){return this._cancel(),this}[Symbol.toPrimitive](){return this._id}[Symbol.dispose](){this._cancel()}};function removeById(t){t instanceof GjsifyTimeout||typeof t==`object`&&t&&`_cancel`in t?t._cancel():typeof t==`object`&&t&&typeof t.close==`function`?t.close():typeof t==`number`&&getGLib()?.Source.remove(t)}if(xn){let setT=(t,n=0,...S)=>new GjsifyTimeout(t,Math.max(0,n|0),S,!1),setI=(t,n=0,...S)=>new GjsifyTimeout(t,Math.max(0,n|0),S,!0),t=globalThis;t.setTimeout=setT,t.clearTimeout=removeById,t.setInterval=setI,t.clearInterval=removeById}function setImmediate$1(t,...n){return setTimeout(t,0,...n)}__name$1(setImmediate$1,`setImmediate`);function clearImmediate(t){clearTimeout(t)}`setImmediate`in globalThis||Object.defineProperty(globalThis,"setImmediate",{value:setImmediate$1,enumerable:!0,writable:!0,configurable:!0}),`clearImmediate`in globalThis||Object.defineProperty(globalThis,"clearImmediate",{value:clearImmediate,enumerable:!0,writable:!0,configurable:!0});var Sn,Cn,wn=__esmMin(()=>{Sn=Object.defineProperty,Cn=__name$1((t,n)=>{let S={};for(var C in t)Sn(S,C,{get:t[C],enumerable:!0});return n||Sn(S,Symbol.toStringTag,{value:`Module`}),S},`__exportAll`)});function assertPath(t){if(typeof t!=`string`)throw TypeError(`The "path" argument must be of type string. Received type `+typeof t)}function isPosixPathSeparator(t){return t===47}function isPathSeparator(t){return t===47||t===92}function isWindowsDeviceRoot(t){return t>=65&&t<=90||t>=97&&t<=122}function normalizeString$1(t,n,S,C){let N=``,F=0,I=-1,H=0,W;for(let q=0;q<=t.length;++q){if(q<t.length)W=t.charCodeAt(q);else if(C(W))break;else W=47;if(C(W)){if(!(I===q-1||H===1))if(I!==q-1&&H===2){if(N.length<2||F!==2||N.charCodeAt(N.length-1)!==46||N.charCodeAt(N.length-2)!==46){if(N.length>2){let t=N.lastIndexOf(S);t===-1?(N=``,F=0):(N=N.slice(0,t),F=N.length-1-N.lastIndexOf(S)),I=q,H=0;continue}else if(N.length===2||N.length===1){N=``,F=0,I=q,H=0;continue}}n&&(N.length>0?N+=`${S}..`:N=`..`,F=2)}else N.length>0?N+=S+t.slice(I+1,q):N=t.slice(I+1,q),F=q-I-1;I=q,H=0}else W===46&&H!==-1?++H:H=-1}return N}function _format(t,n){if(typeof n!=`object`||!n)throw TypeError(`The "pathObject" argument must be of type Object. Received type `+typeof n);let S=n,C=S.dir||S.root,N=S.base||(S.name||``)+formatExt(S.ext);return C?C===S.root?C+N:C+t+N:N}function formatExt(t){return t?`${t[0]===`.`?``:`.`}${t}`:``}var $=__esmMin(()=>{__name$1(normalizeString$1,`normalizeString`)});function posixCwd(){if(typeof globalThis.process?.cwd==`function`)return globalThis.process.cwd();try{let t=globalThis.imports?.gi?.GLib;if(t?.get_current_dir)return t.get_current_dir()}catch{}return`/`}function resolve$4(...t){let n=``,S=!1;for(let C=t.length-1;C>=-1&&!S;C--){let N;if(C>=0){if(N=t[C],assertPath(N),N.length===0)continue}else N=posixCwd();n=`${N}/${n}`,S=N.charCodeAt(0)===47}return n=normalizeString$1(n,!S,`/`,isPosixPathSeparator),S?n.length>0?`/${n}`:`/`:n.length>0?n:`.`}function normalize$2(t){if(assertPath(t),t.length===0)return`.`;let n=t.charCodeAt(0)===47,S=t.charCodeAt(t.length-1)===47,C=normalizeString$1(t,!n,`/`,isPosixPathSeparator);return C.length===0&&!n&&(C=`.`),C.length>0&&S&&(C+=`/`),n?`/${C}`:C}function isAbsolute$2(t){return assertPath(t),t.length>0&&t.charCodeAt(0)===47}function join$3(...t){if(t.length===0)return`.`;let n;for(let S=0;S<t.length;++S){let C=t[S];assertPath(C),C.length>0&&(n===void 0?n=C:n+=`/${C}`)}return n===void 0?`.`:normalize$2(n)}function relative$1(t,n){if(assertPath(t),assertPath(n),t===n||(t=resolve$4(t),n=resolve$4(n),t===n))return``;let S=t.length,C=S-1,N=1,F=n.length-N,I=C<F?C:F,H=-1,W=0;for(;W<=I;++W){if(W===I){if(F>I){if(n.charCodeAt(N+W)===47)return n.slice(N+W+1);if(W===0)return n.slice(N+W)}else C>I&&(t.charCodeAt(1+W)===47?H=W:W===0&&(H=0));break}let S=t.charCodeAt(1+W);if(S!==n.charCodeAt(N+W))break;S===47&&(H=W)}let q=``;for(W=1+H+1;W<=S;++W)(W===S||t.charCodeAt(W)===47)&&(q.length===0?q+=`..`:q+=`/..`);return q.length>0?q+n.slice(N+H):(N+=H,n.charCodeAt(N)===47&&++N,n.slice(N))}function toNamespacedPath$1(t){return t}function dirname$2(t){if(assertPath(t),t.length===0)return`.`;let n=t.charCodeAt(0)===47,S=-1,C=!0;for(let n=t.length-1;n>=1;--n)if(t.charCodeAt(n)===47){if(!C){S=n;break}}else C=!1;return S===-1?n?`/`:`.`:n&&S===1?`//`:t.slice(0,S)}function basename$2(t,n){n!==void 0&&assertPath(n),assertPath(t);let S=0,C=-1,N=!0;if(n!==void 0&&n.length>0&&n.length<=t.length){if(n.length===t.length&&n===t)return``;let F=n.length-1,I=-1;for(let H=t.length-1;H>=0;--H){let W=t.charCodeAt(H);if(W===47){if(!N){S=H+1;break}}else I===-1&&(N=!1,I=H+1),F>=0&&(W===n.charCodeAt(F)?--F===-1&&(C=H):(F=-1,C=I))}return S===C?C=I:C===-1&&(C=t.length),t.slice(S,C)}else{for(let n=t.length-1;n>=0;--n)if(t.charCodeAt(n)===47){if(!N){S=n+1;break}}else C===-1&&(N=!1,C=n+1);return C===-1?``:t.slice(S,C)}}function extname$2(t){assertPath(t);let n=-1,S=0,C=-1,N=!0,F=0;for(let I=t.length-1;I>=0;--I){let H=t.charCodeAt(I);if(H===47){if(!N){S=I+1;break}continue}C===-1&&(N=!1,C=I+1),H===46?n===-1?n=I:F!==1&&(F=1):n!==-1&&(F=-1)}return n===-1||C===-1||F===0||F===1&&n===C-1&&n===S+1?``:t.slice(n,C)}function format$3(t){if(typeof t!=`object`||!t)throw TypeError(`The "pathObject" argument must be of type Object. Received type `+typeof t);return _format(`/`,t)}function parse$6(t){assertPath(t);let n={root:``,dir:``,base:``,ext:``,name:``};if(t.length===0)return n;let S=t.charCodeAt(0)===47,C;S?(n.root=`/`,C=1):C=0;let N=-1,F=0,I=-1,H=!0,W=t.length-1,q=0;for(;W>=C;--W){let n=t.charCodeAt(W);if(n===47){if(!H){F=W+1;break}continue}I===-1&&(H=!1,I=W+1),n===46?N===-1?N=W:q!==1&&(q=1):N!==-1&&(q=-1)}return N===-1||I===-1||q===0||q===1&&N===I-1&&N===F+1?I!==-1&&(F===0&&S?n.base=n.name=t.slice(1,I):n.base=n.name=t.slice(F,I)):(F===0&&S?(n.name=t.slice(1,N),n.base=t.slice(1,I)):(n.name=t.slice(F,N),n.base=t.slice(F,I)),n.ext=t.slice(N,I)),F>0?n.dir=t.slice(0,F-1):S&&(n.dir=`/`),n}var Tn,En=__esmMin(()=>{wn(),$(),Tn=Cn({basename:()=>basename$2,delimiter:()=>`:`,dirname:()=>dirname$2,extname:()=>extname$2,format:()=>format$3,isAbsolute:()=>isAbsolute$2,join:()=>join$3,normalize:()=>normalize$2,parse:()=>parse$6,relative:()=>relative$1,resolve:()=>resolve$4,sep:()=>`/`,toNamespacedPath:()=>toNamespacedPath$1}),__name$1(resolve$4,`resolve`),__name$1(normalize$2,`normalize`),__name$1(isAbsolute$2,`isAbsolute`),__name$1(join$3,`join`),__name$1(relative$1,`relative`),__name$1(toNamespacedPath$1,`toNamespacedPath`),__name$1(dirname$2,`dirname`),__name$1(basename$2,`basename`),__name$1(extname$2,`extname`),__name$1(format$3,`format`),__name$1(parse$6,`parse`)});function cwd$1(){return typeof globalThis.process?.cwd==`function`?globalThis.process.cwd():`/`}function resolve$3(...t){let n=``,S=``,C=!1;for(let N=t.length-1;N>=-1;N--){let F;if(N>=0){if(F=t[N],assertPath(F),F.length===0)continue}else n.length===0?F=cwd$1():(F=globalThis.process?.env?.[`=${n}`]||cwd$1(),F.slice(0,2).toLowerCase()!==n.toLowerCase()&&F.charCodeAt(2)===92&&(F=`${n}\\`));let I=F.length,H=0,W=``,q=!1,Y=F.charCodeAt(0);if(I===1)isPathSeparator(Y)&&(H=1,q=!0);else if(isPathSeparator(Y))if(q=!0,isPathSeparator(F.charCodeAt(1))){let t=matchUncRoot(F);t&&(W=t.device,H=t.rootEnd)}else H=1;else isWindowsDeviceRoot(Y)&&F.charCodeAt(1)===58&&(W=F.slice(0,2),H=2,I>2&&isPathSeparator(F.charCodeAt(2))&&(q=!0,H=3));if(W.length>0)if(n.length>0){if(W.toLowerCase()!==n.toLowerCase())continue}else n=W;if(C){if(n.length>0)break}else if(S=`${F.slice(H)}\\${S}`,C=q,q&&n.length>0)break}return S=normalizeString$1(S,!C,`\\`,isPathSeparator),C?`${n}\\${S}`:`${n}${S}`||`.`}function matchUncRoot(t){let n=t.length,S=2,C=S;for(;S<n&&!isPathSeparator(t.charCodeAt(S));)S++;if(S>=n||S===C)return;let N=t.slice(C,S);for(C=S;S<n&&isPathSeparator(t.charCodeAt(S));)S++;if(!(S>=n||S===C)){for(C=S;S<n&&!isPathSeparator(t.charCodeAt(S));)S++;return N===`.`||N===`?`?{device:`\\\\${N}`,rootEnd:4,shareOnly:!1}:{device:`\\\\${N}\\${t.slice(C,S)}`,rootEnd:S,shareOnly:S===n}}}function normalize$1(t){assertPath(t);let n=t.length;if(n===0)return`.`;let S=t.charCodeAt(0);if(n===1)return isPosixPathSeparator(S)?`\\`:t;let C=0,N,F=!1;if(isPathSeparator(S))if(F=!0,isPathSeparator(t.charCodeAt(1))){let n=matchUncRoot(t);if(n?.shareOnly)return`${n.device}\\`;if(n&&(N=n.device,C=n.rootEnd,N.length===3)){let n=t.slice(4,t.indexOf(`:`)+1);isWindowsReservedName(n,n.length-1)&&(N=`\\\\?\\${n}`,C=4+n.length)}}else C=1;else{let I=t.indexOf(`:`);I>0&&(isWindowsDeviceRoot(S)&&I===1?(N=t.slice(0,2),C=2,n>2&&isPathSeparator(t.charCodeAt(2))&&(F=!0,C=3)):isWindowsReservedName(t,I)&&(N=t.slice(0,I+1),C=I+1))}let I=C<n?normalizeString$1(t.slice(C),!F,`\\`,isPathSeparator):``;if(I.length===0&&!F&&(I=`.`),I.length>0&&isPathSeparator(t.charCodeAt(n-1))&&(I+=`\\`),!F&&N===void 0&&t.includes(`:`)){if(I.length>=2&&isWindowsDeviceRoot(I.charCodeAt(0))&&I.charCodeAt(1)===58)return`.\\${I}`;let S=t.indexOf(`:`);do if(S===n-1||isPathSeparator(t.charCodeAt(S+1)))return`.\\${I}`;while((S=t.indexOf(`:`,S+1))!==-1)}return isWindowsReservedName(t,t.indexOf(`:`))?`.\\${N??``}${I}`:N===void 0?F?`\\${I}`:I:F?`${N}\\${I}`:`${N}${I}`}function isWindowsReservedName(t,n){return On.has(t.slice(0,n).toUpperCase())}function isAbsolute$1(t){assertPath(t);let n=t.length;if(n===0)return!1;let S=t.charCodeAt(0);return!!(isPathSeparator(S)||isWindowsDeviceRoot(S)&&n>2&&t.charCodeAt(1)===58&&isPathSeparator(t.charCodeAt(2)))}function join$2(...t){if(t.length===0)return`.`;let n,S;for(let C=0;C<t.length;++C){let N=t[C];assertPath(N),N.length>0&&(n===void 0?n=S=N:n+=`\\${N}`)}if(n===void 0)return`.`;let C=!0,N=0;if(isPathSeparator(S.charCodeAt(0))){++N;let t=S.length;t>1&&isPathSeparator(S.charCodeAt(1))&&(++N,t>2&&(isPathSeparator(S.charCodeAt(2))?++N:C=!1))}if(C){for(;N<n.length&&isPathSeparator(n.charCodeAt(N));++N);N>=2&&(n=`\\${n.slice(N)}`)}return n.split(/\\+/).some(t=>{let n=t.indexOf(`:`);return n!==-1&&isWindowsReservedName(t,n)})?n.replace(/\//g,`\\`):normalize$1(n)}function relative(t,n){if(assertPath(t),assertPath(n),t===n)return``;let S=resolve$3(t),C=resolve$3(n);if(S===C||(t=S.toLowerCase(),n=C.toLowerCase(),t===n))return``;let N=0;for(;N<t.length&&t.charCodeAt(N)===92;++N);let F=t.length;for(;F-1>N&&t.charCodeAt(F-1)===92;--F);let I=F-N,H=0;for(;H<n.length&&n.charCodeAt(H)===92;++H);let W=n.length;for(;W-1>H&&n.charCodeAt(W-1)===92;--W);let q=W-H,Y=I<q?I:q,X=-1,Z=0;for(;Z<=Y;++Z){if(Z===Y){if(q>Y){if(n.charCodeAt(H+Z)===92)return C.slice(H+Z+1);if(Z===2)return C.slice(H+Z)}I>Y&&(t.charCodeAt(N+Z)===92?X=Z:Z===2&&(X=3));break}let S=t.charCodeAt(N+Z);if(S!==n.charCodeAt(H+Z))break;S===92&&(X=Z)}if(Z!==Y&&X===-1)return C;let te=``;for(X===-1&&(X=0),Z=N+X+1;Z<=F;++Z)(Z===F||t.charCodeAt(Z)===92)&&(te.length===0?te+=`..`:te+=`\\..`);return te.length>0?te+C.slice(H+X,W):(H+=X,C.charCodeAt(H)===92&&++H,C.slice(H,W))}function toNamespacedPath(t){if(typeof t!=`string`||t.length===0)return t;let n=resolve$3(t);if(n.length<=2)return t;if(n.charCodeAt(0)===92){if(n.charCodeAt(1)===92){let t=n.charCodeAt(2);if(t!==63&&t!==46)return`\\\\?\\UNC\\${n.slice(2)}`}}else if(isWindowsDeviceRoot(n.charCodeAt(0))&&n.charCodeAt(1)===58&&n.charCodeAt(2)===92)return`\\\\?\\${n}`;return n}function dirname$1(t){assertPath(t);let n=t.length;if(n===0)return`.`;let S=-1,C=-1,N=!0,F=0,I=t.charCodeAt(0);if(n>1)if(isPathSeparator(I)){if(S=F=1,isPathSeparator(t.charCodeAt(1))){let C=2,N=C;for(;C<n&&!isPathSeparator(t.charCodeAt(C));++C);if(C<n&&C!==N){for(N=C;C<n&&isPathSeparator(t.charCodeAt(C));++C);if(C<n&&C!==N){for(N=C;C<n&&!isPathSeparator(t.charCodeAt(C));++C);if(C===n)return t;C!==N&&(S=F=C+1)}}}}else isWindowsDeviceRoot(I)&&t.charCodeAt(1)===58&&(S=F=2,n>2&&isPathSeparator(t.charCodeAt(2))&&(S=F=3));else if(isPathSeparator(I))return t;for(let S=n-1;S>=F;--S)if(isPathSeparator(t.charCodeAt(S))){if(!N){C=S;break}}else N=!1;if(C===-1){if(S===-1)return`.`;C=S}return t.slice(0,C)}function basename$1(t,n){n!==void 0&&assertPath(n),assertPath(t);let S=0,C=-1,N=!0;if(t.length>=2&&isWindowsDeviceRoot(t.charCodeAt(0))&&t.charCodeAt(1)===58&&(S=2),n!==void 0&&n.length>0&&n.length<=t.length){if(n.length===t.length&&n===t)return``;let F=n.length-1,I=-1;for(let H=t.length-1;H>=S;--H){let W=t.charCodeAt(H);if(isPathSeparator(W)){if(!N){S=H+1;break}}else I===-1&&(N=!1,I=H+1),F>=0&&(W===n.charCodeAt(F)?--F===-1&&(C=H):(F=-1,C=I))}return S===C?C=I:C===-1&&(C=t.length),t.slice(S,C)}else{for(let n=t.length-1;n>=S;--n)if(isPathSeparator(t.charCodeAt(n))){if(!N){S=n+1;break}}else C===-1&&(N=!1,C=n+1);return C===-1?``:t.slice(S,C)}}function extname$1(t){assertPath(t);let n=0,S=-1,C=0,N=-1,F=!0,I=0;t.length>=2&&t.charCodeAt(1)===58&&isWindowsDeviceRoot(t.charCodeAt(0))&&(n=C=2);for(let H=t.length-1;H>=n;--H){let n=t.charCodeAt(H);if(isPathSeparator(n)){if(!F){C=H+1;break}continue}N===-1&&(F=!1,N=H+1),n===46?S===-1?S=H:I!==1&&(I=1):S!==-1&&(I=-1)}return S===-1||N===-1||I===0||I===1&&S===N-1&&S===C+1?``:t.slice(S,N)}function format$2(t){if(typeof t!=`object`||!t)throw TypeError(`The "pathObject" argument must be of type Object. Received type `+typeof t);return _format(`\\`,t)}function parse$5(t){assertPath(t);let n={root:``,dir:``,base:``,ext:``,name:``};if(t.length===0)return n;let S=t.length,C=0,N=t.charCodeAt(0);if(S>1)if(isPathSeparator(N)){if(C=1,isPathSeparator(t.charCodeAt(1))){let n=2,N=n;for(;n<S&&!isPathSeparator(t.charCodeAt(n));++n);if(n<S&&n!==N){for(N=n;n<S&&isPathSeparator(t.charCodeAt(n));++n);if(n<S&&n!==N){for(N=n;n<S&&!isPathSeparator(t.charCodeAt(n));++n);n===S?C=n:n!==N&&(C=n+1)}}}}else isWindowsDeviceRoot(N)&&t.charCodeAt(1)===58&&(C=2,S>2&&isPathSeparator(t.charCodeAt(2))&&(C=3));else if(isPathSeparator(N))return n.root=n.dir=t,n;C>0&&(n.root=t.slice(0,C));let F=-1,I=C,H=-1,W=!0,q=t.length-1,Y=0;for(;q>=C;--q){if(N=t.charCodeAt(q),isPathSeparator(N)){if(!W){I=q+1;break}continue}H===-1&&(W=!1,H=q+1),N===46?F===-1?F=q:Y!==1&&(Y=1):F!==-1&&(Y=-1)}return F===-1||H===-1||Y===0||Y===1&&F===H-1&&F===I+1?H!==-1&&(n.base=n.name=t.slice(I,H)):(n.name=t.slice(I,F),n.base=t.slice(I,H),n.ext=t.slice(F,H)),I>0&&I!==C?n.dir=t.slice(0,I-1):n.dir=n.root,n}var Dn,On,kn=__esmMin(()=>{wn(),$(),Dn=Cn({basename:()=>basename$1,delimiter:()=>`;`,dirname:()=>dirname$1,extname:()=>extname$1,format:()=>format$2,isAbsolute:()=>isAbsolute$1,join:()=>join$2,normalize:()=>normalize$1,parse:()=>parse$5,relative:()=>relative,resolve:()=>resolve$3,sep:()=>`\\`,toNamespacedPath:()=>toNamespacedPath}),__name$1(cwd$1,`cwd`),__name$1(resolve$3,`resolve`),__name$1(normalize$1,`normalize`),On=new Set([`CON`,`PRN`,`AUX`,`NUL`,...[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`,`¹`,`²`,`³`].flatMap(t=>[`COM${t}`,`LPT${t}`])]),__name$1(isAbsolute$1,`isAbsolute`),__name$1(join$2,`join`),__name$1(dirname$1,`dirname`),__name$1(basename$1,`basename`),__name$1(extname$1,`extname`),__name$1(format$2,`format`),__name$1(parse$5,`parse`)});function selectFlavour(t){return t===`win32`?Dn:Tn}var An=__esmMin(()=>{En(),kn()}),jn=__exportAll$5({basename:()=>Bn,default:()=>Kn,delimiter:()=>Gn,dirname:()=>zn,extname:()=>Vn,format:()=>Hn,isAbsolute:()=>Fn,join:()=>In,normalize:()=>Pn,parse:()=>Un,posix:()=>Tn,relative:()=>Ln,resolve:()=>Nn,sep:()=>Wn,toNamespacedPath:()=>Rn,win32:()=>Dn}),Mn,Nn,Pn,Fn,In,Ln,Rn,zn,Bn,Vn,Hn,Un,Wn,Gn,Kn,qn=__esmMin(()=>{En(),kn(),An(),Ye(),Mn=selectFlavour(hostOs()),{resolve:Nn,normalize:Pn,isAbsolute:Fn,join:In,relative:Ln,toNamespacedPath:Rn,dirname:zn,basename:Bn,extname:Vn,format:Hn,parse:Un,sep:Wn,delimiter:Gn}=Mn,Kn={resolve:Mn.resolve,normalize:Mn.normalize,isAbsolute:Mn.isAbsolute,join:Mn.join,relative:Mn.relative,toNamespacedPath:Mn.toNamespacedPath,dirname:Mn.dirname,basename:Mn.basename,extname:Mn.extname,format:Mn.format,parse:Mn.parse,sep:Mn.sep,delimiter:Mn.delimiter,posix:Tn,win32:Dn}}),Jn=__exportAll$5({URL:()=>nr,URLSearchParams:()=>Zn,default:()=>rr,domainToASCII:()=>domainToASCII,domainToUnicode:()=>domainToUnicode,fileURLToPath:()=>fileURLToPath,format:()=>format$1,parse:()=>parse$4,pathToFileURL:()=>pathToFileURL,resolve:()=>resolve$2});function platformOrShapeIsWindows(t){return hostOs()===void 0?isWindowsPath(t):isWin32()}function parseFormUrlencoded(t){let n=[];if(!t)return n;for(let S of t.split(`&`)){if(S===``)continue;let t=S.indexOf(`=`);t===-1?n.push([decodeComponent(S),``]):n.push([decodeComponent(S.slice(0,t)),decodeComponent(S.slice(t+1))])}return n}function decodeComponent(t){try{return decodeURIComponent(t.replace(/\+/g,` `))}catch{return t}}function percentEncodeUtf8(t){let n=``;for(let S of new TextEncoder().encode(t))n+=`%${S.toString(16).toUpperCase().padStart(2,`0`)}`;return n}function encodeComponent(t){let n=``;for(let S of t)S===` `?n+=`+`:/^[A-Za-z0-9*\-._]$/.test(S)?n+=S:n+=percentEncodeUtf8(S);return n}function isSpecialScheme(t){return Qn.has(t)}function defaultPort(t){return Qn.get(t)??null}function percentEncode(t,n){let S=``;for(let C of t){let t=C.codePointAt(0);S+=t<=32||t>126||n.includes(C)?percentEncodeUtf8(C):C}return S}function encodeQuery(t,n){return percentEncode(t,n?`"#<>'`:`"#<>`)}function isSchemeChar(t){return t>=`a`&&t<=`z`||t>=`A`&&t<=`Z`||t>=`0`&&t<=`9`||t===`+`||t===`-`||t===`.`}function isAsciiDigit(t){return t!==void 0&&t>=`0`&&t<=`9`}function isHexDigit$1(t){return t!==void 0&&/^[0-9A-Fa-f]$/.test(t)}function digitPrefix(t){let n=``;for(let S of t){if(!isAsciiDigit(S))break;n+=S}return n}function hasForbiddenDomainCodePoint(t){for(let n of t){let t=n.codePointAt(0);if(t<=31||t===127||n===`%`||tr.has(n))return!0}return!1}function parseIPv6(t){let n=[0,0,0,0,0,0,0,0],S=0,C=null,N=0,at=()=>t[N];if(at()===`:`){if(t[N+1]!==`:`)return;N+=2,S++,C=S}for(;N<t.length;){if(S===8)return;if(at()===`:`){if(C!==null)return;N++,S++,C=S;continue}let F=0,I=0;for(;I<4&&isHexDigit$1(at());)F=F*16+Number.parseInt(at(),16),N++,I++;if(at()===`.`){if(I===0||(N-=I,S>6))return;let C=0;for(;N<t.length;){let t=null;if(C>0)if(at()===`.`&&C<4)N++;else return;if(!isAsciiDigit(at()))return;for(;isAsciiDigit(at());){let n=Number(at());if(t===null)t=n;else if(t===0)return;else t=t*10+n;if(t>255)return;N++}n[S]=n[S]*256+t,C++,(C===2||C===4)&&S++}if(C!==4)return;break}if(at()===`:`){if(N++,N>=t.length)return}else if(N<t.length)return;n[S]=F,S++}if(C!==null){let t=S-C;for(S=7;S!==0&&t>0;){let N=n[C+t-1];n[C+t-1]=n[S],n[S]=N,S--,t--}}else if(S!==8)return;return serializeIPv6(n)}function serializeIPv6(t){let n=null,S=1,C=-1,N=0;for(let F=0;F<8;F++){if(t[F]!==0){C=-1,N=0;continue}C===-1&&(C=F),N++,N>S&&(S=N,n=C)}let F=``,I=!1;for(let S=0;S<8;S++)if(!(I&&t[S]===0)){if(I=!1,n===S){F+=S===0?`::`:`:`,I=!0;continue}F+=t[S].toString(16),S!==7&&(F+=`:`)}return F}function parseHost(t,n){if(t.startsWith(`[`)){if(!t.endsWith(`]`))return;let n=parseIPv6(t.slice(1,-1));return n===void 0?void 0:`[${n}]`}if(n){for(let n of t)if(tr.has(n))return;return percentEncode(t,``)}if(!hasForbiddenDomainCodePoint(t))return t.toLowerCase()}function parseHostSetterValue(t,n,S,C,N){let F=t.replace(er,``),I=isSpecialScheme(n);if(n===`file`){let t=F.length;for(let n=0;n<F.length;n++){let S=F[n];if(S===`/`||S===`\\`||S===`?`||S===`#`){t=n;break}}let n=F.slice(0,t);if(n===``)return{host:``};let S=parseHost(n,!1);return S===void 0?void 0:{host:S===`localhost`?``:S}}let H=!1,W=``;for(let t=0;t<F.length;t++){let S=F[t];if(S===`:`&&!H){if(W===``||N)return;let S=parseHost(W,!I);if(S===void 0)return;let C=digitPrefix(F.slice(t+1));if(C===``)return{host:S};let H=Number(C);return H>65535?{host:S}:{host:S,port:H===defaultPort(n)?null:H}}if(S===`/`||S===`?`||S===`#`||I&&S===`\\`)break;S===`[`?H=!0:S===`]`&&(H=!1),W+=S}if(W===``&&(I||S||C))return;let q=parseHost(W,!I);return q===void 0?void 0:{host:q}}function isDoubleDotSegment(t){let n=t.toLowerCase();return n===`..`||n===`.%2e`||n===`%2e.`||n===`%2e%2e`}function isSingleDotSegment(t){let n=t.toLowerCase();return n===`.`||n===`%2e`}function parsePathSetterValue(t,n,S){let C=t.replace(er,``);if(n&&(C=C.replace(/\\/g,`/`)),C===``)return n||S?`/`:``;let N=[],F=(C.startsWith(`/`)?C.slice(1):C).split(`/`);for(let t=0;t<F.length;t++){let n=F[t],S=t===F.length-1;isDoubleDotSegment(n)?(N.pop(),S&&N.push(``)):isSingleDotSegment(n)?S&&N.push(``):N.push(percentEncode(n,'"#<>?^`{}'))}return`/`+N.join(`/`)}function bracketIPv6Host(t){return t.includes(`:`)&&!t.startsWith(`[`)?`[${t}]`:t}function parse$4(t,n,S){if(typeof t!=`string`)throw TypeError(`The "url" argument must be of type string. Received type `+typeof t);let C={protocol:null,slashes:null,auth:null,host:null,port:null,hostname:null,hash:null,search:null,query:null,pathname:null,path:null,href:t},N=t.trim(),F=N.indexOf(`#`);F!==-1&&(C.hash=N.slice(F),N=N.slice(0,F));let I=N.indexOf(`?`);I!==-1&&(C.search=N.slice(I),C.query=n?Object.fromEntries(new Zn(N.slice(I+1))):N.slice(I+1),N=N.slice(0,I));let H=/^([a-z][a-z0-9.+-]*:)/i.exec(N);if(H&&(C.protocol=H[1].toLowerCase(),N=N.slice(C.protocol.length)),(S||C.protocol)&&N.startsWith(`//`)&&(C.slashes=!0,N=N.slice(2)),C.slashes||C.protocol&&![`javascript:`,`data:`,`mailto:`].includes(C.protocol)){let t=-1;for(let n=0;n<N.length;n++){let S=N[n];if(S===`/`||S===`\\`){t=n;break}}let n=t===-1?N:N.slice(0,t);N=t===-1?``:N.slice(t);let S=n.lastIndexOf(`@`);S===-1?parseHostPort(n,C):(C.auth=decodeURIComponent(n.slice(0,S)),parseHostPort(n.slice(S+1),C))}return C.pathname=N||(C.slashes?`/`:null),(C.pathname!==null||C.search!==null)&&(C.path=(C.pathname||``)+(C.search||``)),C.href=format$1(C),C}function parseHostPort(t,n){if(!t)return;let S=t.indexOf(`[`);if(S!==-1){let C=t.indexOf(`]`,S);if(C!==-1){let N=t.slice(C+1);N.startsWith(`:`)&&(n.port=N.slice(1)),n.hostname=t.slice(S,C+1),n.host=n.hostname+(n.port?`:`+n.port:``);return}}let C=t.lastIndexOf(`:`);if(C!==-1){let S=t.slice(C+1);/^\d*$/.test(S)?(n.port=S||null,n.hostname=t.slice(0,C).toLowerCase()):n.hostname=t.toLowerCase()}else n.hostname=t.toLowerCase();n.host=n.hostname+(n.port?`:`+n.port:``)}function format$1(t){if(typeof t==`string`)return t;if(t instanceof nr)return t.href;let n=t,S=``;if(n.protocol&&(S+=n.protocol),(n.slashes||n.protocol&&![`javascript:`,`data:`,`mailto:`].includes(n.protocol||``))&&(S+=`//`),n.auth&&(S+=encodeURIComponent(n.auth)+`@`),n.host?S+=n.host:(n.hostname&&(S+=n.hostname),n.port&&(S+=`:`+n.port)),n.pathname&&(S+=n.pathname),n.search)S+=n.search;else if(n.query&&typeof n.query==`object`){let t=new Zn(n.query).toString();t&&(S+=`?`+t)}return n.hash&&(S+=n.hash),S}function resolve$2(t,n){return new nr(n,new nr(t,`resolve://`)).href.replace(/^resolve:\/\//,``)}function fileURLToPath(t,n){if(typeof t==`string`&&(t=new nr(t)),!(t instanceof nr))throw TypeError(`The "url" argument must be of type string or URL. Received type `+typeof t);if(t.protocol!==`file:`)throw TypeError(`The URL must be of scheme file`);let S=t.pathname,C=n?.windows??platformOrShapeIsWindows(S.slice(1));for(let t=0;t<S.length;t++){if(S[t]!==`%`)continue;let n=S.codePointAt(t+2)|32,N=S[t+1]===`2`&&n===102,F=S[t+1]===`5`&&n===99;if(C&&(N||F))throw TypeError(`File URL path must not include encoded \\ or / characters`);if(N)throw TypeError(`File URL path must not include encoded / characters`)}if(t.hostname!==``&&t.hostname!==`localhost`){if(!C)throw TypeError(`File URL host must be "localhost" or empty on ${hostOs()??`this platform`}`);return`\\\\${t.hostname}${decodeURIComponent(S).replace(/\//g,`\\`)}`}if(C){let t=decodeURIComponent(S);return/^\/[A-Za-z]:/.test(t)?t.slice(1).replace(/\//g,`\\`):t.replace(/\//g,`\\`)}return decodeURIComponent(S)}function pathToFileURL(t,n){let S=n?.windows??platformOrShapeIsWindows(t),C=S&&t.startsWith(`\\\\`)?t:(S?Dn:Tn).resolve(currentDir(),t);if(S&&C.startsWith(`\\\\`))return uncPathToFileURL(C);let N=t.charCodeAt(t.length-1);return(N===47||S&&N===92)&&C[C.length-1]!==Wn&&(C+=`/`),new nr(pathToFileUrlHref(C,{windows:S}))}function currentDir(){return typeof globalThis.process?.cwd==`function`?globalThis.process.cwd():vt.get_current_dir()}function uncPathToFileURL(t){let n=t.startsWith(`\\\\?\\UNC\\`)?8:2,S=t.indexOf(`\\`,n);if(S===-1)throw invalidPathValue(t,`Missing UNC resource path`);if(S===2)throw invalidPathValue(t,`Empty UNC servername`);let C=t.slice(n,S);return new nr(`file://${C===`?`?``:C}${encodePathForFileUrl(t.slice(S).replace(/\\/g,`/`))}`)}function invalidPathValue(t,n){let S=TypeError(`The argument 'path' ${n}. Received '${t}'`);return S.code=`ERR_INVALID_ARG_VALUE`,S}function domainToASCII(t){try{return new nr(`http://${t}`).hostname}catch{return``}}function domainToUnicode(t){try{return new nr(`http://${t}`).hostname}catch{return``}}var Yn,Xn,Zn,Qn,$n,er,tr,nr,rr,ir=__esmMin(()=>{yt(),Ye(),qn(),Yn=vt.UriFlags.HAS_PASSWORD|vt.UriFlags.ENCODED|vt.UriFlags.SCHEME_NORMALIZE,Xn=new WeakMap,Zn=class URLSearchParams{_entries=[];constructor(t){if(t)if(typeof t==`string`)this._entries=parseFormUrlencoded(t.startsWith(`?`)?t.slice(1):t);else if(Array.isArray(t))for(let[n,S]of t)this._entries.push([String(n),String(S)]);else if(t instanceof URLSearchParams)this._entries=t._entries.map(([t,n])=>[t,n]);else for(let n of Object.keys(t))this._entries.push([n,String(t[n])])}get(t){for(let[n,S]of this._entries)if(n===t)return S;return null}getAll(t){return this._entries.filter(([n])=>n===t).map(([,t])=>t)}set(t,n){let S=!1;if(this._entries=this._entries.filter(([n])=>n===t?S?!1:(S=!0,!0):!0),S){for(let S=0;S<this._entries.length;S++)if(this._entries[S][0]===t){this._entries[S][1]=n;break}}else this._entries.push([t,n]);Xn.get(this)?.()}has(t,n){return n===void 0?this._entries.some(([n])=>n===t):this._entries.some(([S,C])=>S===t&&C===n)}delete(t,n){this._entries=n===void 0?this._entries.filter(([n])=>n!==t):this._entries.filter(([S,C])=>!(S===t&&C===n)),Xn.get(this)?.()}append(t,n){this._entries.push([t,n]),Xn.get(this)?.()}sort(){this._entries.sort((t,n)=>t[0]<n[0]?-1:+(t[0]>n[0])),Xn.get(this)?.()}toString(){return this._entries.map(([t,n])=>encodeComponent(t)+`=`+encodeComponent(n)).join(`&`)}forEach(t){for(let[n,S]of this._entries)t(S,n,this)}*entries(){yield*this._entries}*keys(){for(let[t]of this._entries)yield t}*values(){for(let[,t]of this._entries)yield t}[Symbol.iterator](){return this.entries()}get size(){return this._entries.length}},Qn=new Map([[`ftp`,21],[`file`,null],[`http`,80],[`https`,443],[`ws`,80],[`wss`,443]]),$n='"#/:;<=>?@[\\]^`{|}',er=/[\t\n\r]/g,__name$1(isHexDigit$1,`isHexDigit`),tr=new Set([`\0`,` `,`
12
12
  `,`\r`,` `,`#`,`/`,`:`,`<`,`>`,`?`,`@`,`[`,`\\`,`]`,`^`,`|`]),nr=class URL{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;constructor(t,n){let S=t instanceof URL?t.href:String(t),C;try{if(n!==void 0){let t=n instanceof URL?n.href:String(n);C=vt.Uri.parse(t,Yn).parse_relative(S,Yn)}else C=vt.Uri.parse(S,Yn)}catch{throw TypeError(`Invalid URL: ${S}`)}if(!C)throw TypeError(`Invalid URL: ${S}`);this.#e=C.get_scheme();let N=isSpecialScheme(this.#e);this.#t=C.get_user()??``,this.#n=C.get_password()??``;let F=C.get_host(),I=F===null?null:bracketIPv6Host(F.toLowerCase());this.#r=I===null?N?``:null:this.#e===`file`&&I===`localhost`?``:I;let H=C.get_port();this.#i=H===-1||H===defaultPort(this.#e)?null:H,this.#a=C.get_path()??``,N&&this.#a===``&&(this.#a=`/`),this.#o=this.#r===null&&!this.#a.startsWith(`/`),this.#r===null&&!this.#o&&this.#a.startsWith(`/.//`)&&(this.#a=this.#a.slice(2)),this.#s=C.get_fragment()??null,this.#l=C.get_query()??null,this.#c=new Zn,this.#c._entries=parseFormUrlencoded(this.#l??``),Xn.set(this.#c,()=>{let t=this.#c.toString();this.#l=t===``?null:t})}get protocol(){return this.#e+`:`}set protocol(t){let n=String(t).replace(er,``)+`:`;if(!/^[A-Za-z]/.test(n))return;let S=``;for(let t of n){if(t===`:`)break;if(!isSchemeChar(t))return;S+=t.toLowerCase()}isSpecialScheme(this.#e)===isSpecialScheme(S)&&(S===`file`&&(this.#t!==``||this.#n!==``||this.#i!==null)||this.#e===`file`&&(this.#r===null||this.#r===``)||(this.#e=S,this.#i!==null&&this.#i===defaultPort(S)&&(this.#i=null)))}get hostname(){return this.#r??``}set hostname(t){if(this.#o)return;let n=parseHostSetterValue(String(t),this.#e,this.#t!==``||this.#n!==``,this.#i!==null,!0);n!==void 0&&(this.#r=n.host)}get port(){return this.#i===null?``:String(this.#i)}set port(t){if(this.#u())return;let n=String(t);if(n===``){this.#i=null;return}let S=digitPrefix(n.replace(er,``));if(S===``)return;let C=Number(S);C>65535||(this.#i=C===defaultPort(this.#e)?null:C)}get host(){let t=this.hostname,n=this.port;return n?`${t}:${n}`:t}set host(t){if(this.#o)return;let n=parseHostSetterValue(String(t),this.#e,this.#t!==``||this.#n!==``,this.#i!==null,!1);n!==void 0&&(this.#r=n.host,n.port!==void 0&&(this.#i=n.port))}get pathname(){return this.#a}set pathname(t){this.#o||(this.#a=parsePathSetterValue(String(t),isSpecialScheme(this.#e),this.#r===null))}get search(){return this.#l?`?`+this.#l:``}set search(t){let n=String(t);if(n===``){this.#l=null,this.#c._entries=[];return}let S=(n.startsWith(`?`)?n.slice(1):n).replace(er,``);this.#l=encodeQuery(S,isSpecialScheme(this.#e)),this.#c._entries=parseFormUrlencoded(S)}get hash(){return this.#s?`#`+this.#s:``}set hash(t){let n=String(t);if(n===``){this.#s=null;return}let S=(n.startsWith(`#`)?n.slice(1):n).replace(er,``);this.#s=percentEncode(S,'"<>`')}get origin(){return isSpecialScheme(this.#e)&&this.#e!==`file`?`${this.protocol}//${this.host}`:`null`}get username(){return this.#t}set username(t){this.#u()||(this.#t=percentEncode(String(t),$n))}get password(){return this.#n}set password(t){this.#u()||(this.#n=percentEncode(String(t),$n))}#u(){return this.#r===null||this.#r===``||this.#e===`file`}get href(){let t=this.#e+`:`;return this.#r===null?!this.#o&&this.#a.startsWith(`//`)&&(t+=`/.`):(t+=`//`,(this.#t!==``||this.#n!==``)&&(t+=this.#t,this.#n!==``&&(t+=`:`+this.#n),t+=`@`),t+=this.#r,this.#i!==null&&(t+=`:`+this.#i)),t+=this.#a,t+=this.#l===null?``:`?${this.#l}`,t+=this.#s===null?``:`#${this.#s}`,t}set href(t){let n=new URL(String(t));this.#e=n.#e,this.#t=n.#t,this.#n=n.#n,this.#r=n.#r,this.#i=n.#i,this.#a=n.#a,this.#o=n.#o,this.#l=n.#l,this.#s=n.#s,this.#c._entries=parseFormUrlencoded(this.#l??``)}get searchParams(){return this.#c}toString(){return this.href}toJSON(){return this.href}static _objectURLPaths=new Map;static _objectURLCounter=0;static createObjectURL(t){let n=t?._tmpPath;if(typeof n==`string`&&n.length>0){let t=`file://${n}`;return URL._objectURLPaths.set(t,n),t}return`file:///dev/null`}static revokeObjectURL(t){let n=URL._objectURLPaths.get(t);n&&(vt.unlink(n),URL._objectURLPaths.delete(t))}},__name$1(parse$4,`parse`),__name$1(format$1,`format`),__name$1(resolve$2,`resolve`),rr={URL:nr,URLSearchParams:Zn,parse:parse$4,format:format$1,resolve:resolve$2,fileURLToPath,pathToFileURL,domainToASCII,domainToUnicode}});ir(),typeof globalThis.URL!=`function`&&Object.defineProperty(globalThis,"URL",{value:nr,enumerable:!1,writable:!0,configurable:!0}),typeof globalThis.URLSearchParams!=`function`&&Object.defineProperty(globalThis,"URLSearchParams",{value:Zn,enumerable:!1,writable:!0,configurable:!0});var ar=__exportAll$5({PerformanceEntry:()=>ur,PerformanceMark:()=>fr,PerformanceMeasure:()=>pr,PerformanceObserver:()=>lr,PerformanceObserverEntryList:()=>dr,default:()=>mr,eventLoopUtilization:()=>eventLoopUtilization,monitorEventLoopDelay:()=>monitorEventLoopDelay,performance:()=>sr,timerify:()=>timerify});function eventLoopUtilization(t,n){return{idle:0,active:0,utilization:0}}function timerify(t){let wrapped=function(...n){let S=sr.now(),C=t.apply(this,n);return sr.now()-S,C};return Object.defineProperty(wrapped,"name",{value:t.name}),wrapped}function monitorEventLoopDelay(t){let n=new Map;return{enable(){},disable(){},reset(){},percentile(t){return 0},get min(){return 0},get max(){return 0},get mean(){return 0},get stddev(){return 0},get percentiles(){return n}}}var sr,PerformanceObserverStub,PerformanceEntryStub,PerformanceObserverEntryListStub,cr,lr,ur,dr,fr,pr,mr,hr=__esmMin(()=>{if(globalThis.performance)sr=globalThis.performance;else{let t,_now;try{let n=globalThis.imports?.gi?.GLib;if(!n)throw Error(`GJS imports.gi.GLib not available`);t=n.get_monotonic_time(),_now=()=>(n.get_monotonic_time()-t)/1e3}catch{let n=Date.now();t=0,_now=()=>Date.now()-n}let n=[],S=Date.now()-_now();sr={timeOrigin:S,now:_now,mark(t){let S={name:t,entryType:`mark`,startTime:_now(),duration:0};return n.push(S),S},measure(t,S,C){let N=0,F=_now();if(S){let t=n.find(t=>t.entryType===`mark`&&t.name===S);t&&(N=t.startTime)}if(C){let t=n.find(t=>t.entryType===`mark`&&t.name===C);t&&(F=t.startTime)}let I={name:t,entryType:`measure`,startTime:N,duration:F-N};return n.push(I),I},getEntries(){return[...n]},getEntriesByName(t){return n.filter(n=>n.name===t)},getEntriesByType(t){return n.filter(n=>n.entryType===t)},clearMarks(t){for(let S=n.length-1;S>=0;S--)n[S].entryType===`mark`&&(!t||n[S].name===t)&&n.splice(S,1)},clearMeasures(t){for(let S=n.length-1;S>=0;S--)n[S].entryType===`measure`&&(!t||n[S].name===t)&&n.splice(S,1)},clearResourceTimings(){},setResourceTimingBufferSize(){},toJSON(){return{timeOrigin:S}}}}PerformanceObserverStub=class{_callback;constructor(t){this._callback=t}observe(t){}disconnect(){}takeRecords(){return[]}},PerformanceEntryStub=class{name=``;entryType=``;startTime=0;duration=0;toJSON(){return{name:this.name,entryType:this.entryType,startTime:this.startTime,duration:this.duration}}},PerformanceObserverEntryListStub=class{getEntries(){return[]}getEntriesByName(t){return[]}getEntriesByType(t){return[]}},cr=globalThis,lr=cr.PerformanceObserver||PerformanceObserverStub,ur=cr.PerformanceEntry||PerformanceEntryStub,dr=cr.PerformanceObserverEntryList||PerformanceObserverEntryListStub,fr=cr.PerformanceMark||class PerformanceMark extends PerformanceEntryStub{},pr=cr.PerformanceMeasure||class PerformanceMeasure extends PerformanceEntryStub{},mr={performance:sr,PerformanceObserver:lr,PerformanceEntry:ur,PerformanceObserverEntryList:dr,PerformanceMark:fr,PerformanceMeasure:pr,eventLoopUtilization,timerify,monitorEventLoopDelay}});hr();const gr=globalThis;globalThis.performance===void 0&&(gr.performance=sr),typeof gr.PerformanceObserver!=`function`&&(gr.PerformanceObserver=lr);const _r={IndexSizeError:1,HierarchyRequestError:3,WrongDocumentError:4,InvalidCharacterError:5,NoModificationAllowedError:7,NotFoundError:8,NotSupportedError:9,InUseAttributeError:10,InvalidStateError:11,SyntaxError:12,InvalidModificationError:13,NamespaceError:14,InvalidAccessError:15,TypeMismatchError:17,SecurityError:18,NetworkError:19,AbortError:20,URLMismatchError:21,QuotaExceededError:22,TimeoutError:23,InvalidNodeTypeError:24,DataCloneError:25};var _DOMExceptionPolyfill=class extends Error{code;constructor(t,n){super(t),this.name=n||`Error`,this.code=Object.hasOwn(_r,this.name)?_r[this.name]:0}};const vr=globalThis.DOMException??_DOMExceptionPolyfill;_e();const yr=Symbol(`type`),br=Symbol(`bubbles`),Sr=Symbol(`cancelable`),Cr=Symbol(`composed`),wr=Symbol(`target`),Tr=Symbol(`currentTarget`),Er=Symbol(`eventPhase`),Dr=Symbol(`defaultPrevented`),Or=Symbol(`isTrusted`),kr=Symbol(`timeStamp`),Ar=Symbol(`stop`),jr=Symbol(`immediateStop`),Mr=Symbol(`dispatching`),Nr=Symbol(`inPassiveListener`);var Event=class{[yr];[br];[Sr];[Cr];[wr]=null;[Tr]=null;[Er]=0;[Dr]=!1;[Or]=!1;[kr];[Ar]=!1;[jr]=!1;[Mr]=!1;[Nr]=!1;get type(){return this[yr]}get bubbles(){return this[br]}get cancelable(){return this[Sr]}get composed(){return this[Cr]}get target(){return this[wr]}get currentTarget(){return this[Tr]}get eventPhase(){return this[Er]}get defaultPrevented(){return this[Dr]}get timeStamp(){return this[kr]}get cancelBubble(){return this[Ar]}set cancelBubble(t){t&&this.stopPropagation()}get returnValue(){return!this[Dr]}set returnValue(t){t||this.preventDefault()}get srcElement(){return this[wr]}static NONE=0;static CAPTURING_PHASE=1;static AT_TARGET=2;static BUBBLING_PHASE=3;get[Symbol.toStringTag](){return`Event`}constructor(t,n){this[yr]=t,this[br]=n?.bubbles??!1,this[Sr]=n?.cancelable??!1,this[Cr]=n?.composed??!1,this[kr]=Date.now(),Object.defineProperty(this,"isTrusted",{get:()=>this[Or],enumerable:!0,configurable:!1})}composedPath(){return this[Tr]?[this[Tr]]:[]}preventDefault(){this[Sr]&&!this[Nr]&&(this[Dr]=!0)}stopPropagation(){this[Ar]=!0}stopImmediatePropagation(){this[Ar]=!0,this[jr]=!0}},EventTarget=class{#e=new Map;get[Symbol.toStringTag](){return`EventTarget`}addEventListener(t,n,S){if(n===null)return;let C=typeof S==`boolean`?S:S?.capture??!1,N=typeof S==`object`?S?.once??!1:!1,F=typeof S==`object`?S?.passive??!1:!1,I=this.#e.get(t);I||(I=[],this.#e.set(t,I));for(let t of I)if(t.listener===n&&t.capture===C)return;let H={listener:n,capture:C,once:N,passive:F,removed:!1};I.push(H),typeof S==`object`&&S?.signal&&S.signal.addEventListener(`abort`,()=>{this.removeEventListener(t,n,{capture:C})},{once:!0})}removeEventListener(t,n,S){if(n===null)return;let C=typeof S==`boolean`?S:S?.capture??!1,N=this.#e.get(t);if(!N)return;let F=N.findIndex(t=>t.listener===n&&t.capture===C);F!==-1&&(N[F].removed=!0,N.splice(F,1),N.length===0&&this.#e.delete(t))}dispatchEvent(t){let n=t;if(n[Mr])throw new vr(`The event is already being dispatched.`,`InvalidStateError`);n[Mr]=!0,n[wr]=this,n[Tr]=this,n[Er]=Event.AT_TARGET;try{let S=this.#e.get(t.type);if(S){let C=[...S];for(let S of C)if(!S.removed){if(n[jr]||n[Ar])break;S.once&&this.removeEventListener(t.type,S.listener,{capture:S.capture});try{S.passive&&(n[Nr]=!0),typeof S.listener==`function`?S.listener.call(this,t):typeof S.listener.handleEvent==`function`&&S.listener.handleEvent.call(S.listener,t)}catch(t){reportListenerException(t)}finally{n[Nr]=!1}}}}finally{n[Er]=Event.NONE,n[Tr]=null,n[Mr]=!1}return!t.defaultPrevented}};function reportListenerException(t){try{let n=globalThis;if(typeof n.reportError==`function`)n.reportError(t);else if(t instanceof Error){let n=`${t.name}: ${t.message}`;ge.error(t.stack?`${n}\n${t.stack}`:n)}else ge.error(String(t))}catch{}}for(let[t,n]of[[`NONE`,0],[`CAPTURING_PHASE`,1],[`AT_TARGET`,2],[`BUBBLING_PHASE`,3]])Object.defineProperty(Event.prototype,t,{value:n,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(Event,t,{value:n,writable:!1,enumerable:!0,configurable:!1});const Pr=Symbol(`abort`),Fr=Symbol(`internal`);var Ir=class AbortSignal extends EventTarget{#e=!1;#t=void 0;onabort=null;constructor(t){if(super(),t!==Fr)throw TypeError(`Illegal constructor.`)}get aborted(){if(!(this instanceof AbortSignal))throw TypeError(`'get aborted' called on an object that is not a valid instance of AbortSignal.`);return this.#e}get reason(){return this.#t}get[Symbol.toStringTag](){return`AbortSignal`}throwIfAborted(){if(this.#e)throw this.#t}[Pr](t){if(this.#e)return;this.#e=!0,this.#t=t??new vr(`The operation was aborted.`,`AbortError`);let n=new Event(`abort`);typeof this.onabort==`function`&&this.onabort.call(this,n),this.dispatchEvent(n)}static abort(t){let n=new AbortSignal(Fr);return n[Pr](t),n}static timeout(t){let n=new AbortSignal(Fr);return setTimeout(()=>{n[Pr](new vr(`The operation timed out.`,`TimeoutError`))},t),n}static any(t){let n=new AbortSignal(Fr);for(let S of t)if(S.aborted)return n[Pr](S.reason),n;let onAbort=()=>{if(!n.aborted){let S=t.find(t=>t.aborted);n[Pr](S?.reason)}};for(let n of t)n.addEventListener(`abort`,onAbort,{once:!0});return n}},Lr=class AbortController{signal;constructor(){this.signal=new Ir(Fr)}get[Symbol.toStringTag](){return`AbortController`}abort(t){if(!(this instanceof AbortController))throw TypeError(`'abort' called on an object that is not a valid instance of AbortController.`);this.signal[Pr](t)}};const Rr=globalThis;globalThis.AbortController===void 0&&(Rr.AbortController=Lr),globalThis.AbortSignal===void 0&&(Rr.AbortSignal=Ir);const zr=Symbol(`kState`),Br=Symbol(`kType`);function isBrandCheck(t){return n=>typeof n==`object`&&!!n&&n[zr]!==void 0&&n[Br]===t}function dequeueValue(t){let n=t[zr].queue.shift();if(n===void 0)throw Error(`dequeueValue called on an empty queue`);let{value:S,size:C}=n;return t[zr].queueTotalSize=Math.max(0,t[zr].queueTotalSize-C),S}function resetQueue(t){t[zr].queue=[],t[zr].queueTotalSize=0}function peekQueueValue(t){return t[zr].queue[0].value}function enqueueValueWithSize(t,n,S){if(S=+S,typeof S!=`number`||S<0||Number.isNaN(S)||S===1/0)throw RangeError(`Invalid size: ${S}`);t[zr].queue.push({value:n,size:S}),t[zr].queueTotalSize+=S}function extractHighWaterMark(t,n){if(t===void 0)return n;if(t=+t,typeof t!=`number`||Number.isNaN(t)||t<0)throw RangeError(`Invalid highWaterMark: ${t}`);return t}function extractSizeAlgorithm(t){if(t===void 0)return()=>1;if(typeof t!=`function`)throw TypeError(`strategy.size must be a function`);return t}function transferArrayBuffer(t){return typeof ArrayBuffer.prototype.transfer==`function`?t.transfer():t.slice(0)}function isDetachedBuffer(t){if(typeof SharedArrayBuffer<`u`&&t instanceof SharedArrayBuffer||t.byteLength!==0)return!1;try{return t.slice(0,0),!1}catch{return!0}}function typedArrayConstructorByTag(t){switch(t){case`Int8Array`:return Int8Array;case`Uint8Array`:return Uint8Array;case`Uint8ClampedArray`:return Uint8ClampedArray;case`Int16Array`:return Int16Array;case`Uint16Array`:return Uint16Array;case`Int32Array`:return Int32Array;case`Uint32Array`:return Uint32Array;case`Float32Array`:return Float32Array;case`Float64Array`:return Float64Array;case`BigInt64Array`:return typeof BigInt64Array<`u`?BigInt64Array:void 0;case`BigUint64Array`:return typeof BigUint64Array<`u`?BigUint64Array:void 0;default:return}}function elementSizeByTag(t){switch(t){case`Int8Array`:case`Uint8Array`:case`Uint8ClampedArray`:return 1;case`Int16Array`:case`Uint16Array`:return 2;case`Int32Array`:case`Uint32Array`:case`Float32Array`:return 4;case`Float64Array`:case`BigInt64Array`:case`BigUint64Array`:return 8;default:return 1}}function setPromiseHandled(t){t.then(()=>{},()=>{})}function createPromiseCallback(t,n,S){if(typeof n!=`function`)throw TypeError(`${t} must be a function`);return async(...t)=>n.call(S,...t)}async function nonOpFlush(){}function nonOpStart(){}async function nonOpPull(){}async function nonOpCancel(){}async function nonOpWrite(){}const Vr={__proto__:Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),next:void 0,return:void 0};function createAsyncFromSyncIterator(t){let n={[Symbol.iterator]:()=>t.iterator},S=(async function*(){return yield*n})();return{iterator:S,nextMethod:S.next,done:!1}}function getIterator(t,n=`sync`,S){if(S===void 0)if(n===`async`){if(S=t[Symbol.asyncIterator],S==null){let n=t[Symbol.iterator];if(n===void 0)throw TypeError(`Object is not iterable`);return createAsyncFromSyncIterator(getIterator(t,`sync`,n))}}else S=t[Symbol.iterator];if(S===void 0)throw TypeError(`Object is not iterable`);let C=S.call(t);if(typeof C!=`object`||!C)throw TypeError(`The iterator method must return an object`);return{iterator:C,nextMethod:C.next,done:!1}}function iteratorNext(t,n){let S;if(S=n===void 0?t.nextMethod.call(t.iterator):t.nextMethod.call(t.iterator,n),typeof S!=`object`||!S)throw TypeError(`The iterator.next() method must return an object`);return S}const Hr=typeof globalThis.AbortController==`function`?globalThis.AbortController:class AbortControllerShim{signal={aborted:!1,reason:void 0,addEventListener(){},removeEventListener(){}};abort(t){this.signal.aborted=!0,this.signal.reason=t}},Ur=Symbol(`kAbort`),Wr=Symbol(`kCloseSentinel`),Gr=Symbol(`kError`),Kr=Symbol(`kSkipThrow`);var WritableStream=class{[Br]=`WritableStream`;[zr];constructor(t={},n={}){if(t!=null&&typeof t!=`object`)throw TypeError(`sink must be an object`);if(n!=null&&typeof n!=`object`)throw TypeError(`strategy must be an object`);let S=t?.type;if(S!==void 0)throw RangeError(`Invalid type: ${S}`);this[zr]=createWritableStreamState();let C=extractSizeAlgorithm(n?.size),N=extractHighWaterMark(n?.highWaterMark,1);setupWritableStreamDefaultControllerFromSink(this,t,N,C)}get locked(){if(!qr(this))throw TypeError(`Invalid this`);return isWritableStreamLocked(this)}abort(t){return qr(this)?isWritableStreamLocked(this)?Promise.reject(TypeError(`WritableStream is locked`)):writableStreamAbort(this,t):Promise.reject(TypeError(`Invalid this`))}close(){return qr(this)?isWritableStreamLocked(this)?Promise.reject(TypeError(`WritableStream is locked`)):writableStreamCloseQueuedOrInFlight(this)?Promise.reject(TypeError(`Failure closing WritableStream`)):writableStreamClose(this):Promise.reject(TypeError(`Invalid this`))}getWriter(){if(!qr(this))throw TypeError(`Invalid this`);return new WritableStreamDefaultWriter(this)}get[Symbol.toStringTag](){return`WritableStream`}},WritableStreamDefaultWriter=class{[Br]=`WritableStreamDefaultWriter`;[zr];constructor(t){if(!qr(t))throw TypeError(`Expected a WritableStream`);this[zr]={stream:void 0,close:{promise:void 0,resolve:void 0,reject:void 0},ready:{promise:void 0,resolve:void 0,reject:void 0}},setupWritableStreamDefaultWriter(this,t)}get closed(){return Jr(this)?this[zr].close.promise:Promise.reject(TypeError(`Invalid this`))}get desiredSize(){if(!Jr(this))throw TypeError(`Invalid this`);if(this[zr].stream===void 0)throw TypeError(`Writer is not bound to a WritableStream`);return writableStreamDefaultWriterGetDesiredSize(this)}get ready(){return Jr(this)?this[zr].ready.promise:Promise.reject(TypeError(`Invalid this`))}abort(t){return Jr(this)?this[zr].stream===void 0?Promise.reject(TypeError(`Writer is not bound to a WritableStream`)):writableStreamDefaultWriterAbort(this,t):Promise.reject(TypeError(`Invalid this`))}close(){if(!Jr(this))return Promise.reject(TypeError(`Invalid this`));let{stream:t}=this[zr];return t===void 0?Promise.reject(TypeError(`Writer is not bound to a WritableStream`)):writableStreamCloseQueuedOrInFlight(t)?Promise.reject(TypeError(`Failure to close WritableStream`)):writableStreamDefaultWriterClose(this)}releaseLock(){if(!Jr(this))throw TypeError(`Invalid this`);let{stream:t}=this[zr];t!==void 0&&writableStreamDefaultWriterRelease(this)}write(t){return Jr(this)?this[zr].stream===void 0?Promise.reject(TypeError(`Writer is not bound to a WritableStream`)):writableStreamDefaultWriterWrite(this,t):Promise.reject(TypeError(`Invalid this`))}get[Symbol.toStringTag](){return`WritableStreamDefaultWriter`}},WritableStreamDefaultController=class{[Br]=`WritableStreamDefaultController`;[zr];constructor(t){if(t!==Kr)throw TypeError(`Illegal constructor`)}[Ur](t){let n=this[zr].abortAlgorithm(t);return writableStreamDefaultControllerClearAlgorithms(this),n}[Gr](){resetQueue(this)}get signal(){if(!Yr(this))throw TypeError(`Invalid this`);return this[zr].abortController.signal}error(t){if(!Yr(this))throw TypeError(`Invalid this`);this[zr].stream[zr].state===`writable`&&writableStreamDefaultControllerError(this,t)}get[Symbol.toStringTag](){return`WritableStreamDefaultController`}};const qr=isBrandCheck(`WritableStream`),Jr=isBrandCheck(`WritableStreamDefaultWriter`),Yr=isBrandCheck(`WritableStreamDefaultController`);function createEmptyPromiseRecord(){return{promise:void 0,resolve:void 0,reject:void 0}}function createWritableStreamState(){return{close:Promise.withResolvers(),closeRequest:createEmptyPromiseRecord(),inFlightWriteRequest:createEmptyPromiseRecord(),inFlightCloseRequest:createEmptyPromiseRecord(),pendingAbortRequest:{abort:createEmptyPromiseRecord(),reason:void 0,wasAlreadyErroring:!1},backpressure:!1,controller:void 0,state:`writable`,storedError:void 0,writeRequests:[],writer:void 0}}function isWritableStreamLocked(t){return t[zr].writer!==void 0}function setupWritableStreamDefaultWriter(t,n){if(isWritableStreamLocked(n))throw TypeError(`WritableStream is locked`);switch(t[zr].stream=n,n[zr].writer=t,n[zr].state){case`writable`:!writableStreamCloseQueuedOrInFlight(n)&&n[zr].backpressure?t[zr].ready=Promise.withResolvers():t[zr].ready={promise:Promise.resolve(),resolve:void 0,reject:void 0},t[zr].close=Promise.withResolvers();break;case`erroring`:t[zr].ready={promise:Promise.reject(n[zr].storedError),resolve:void 0,reject:void 0},setPromiseHandled(t[zr].ready.promise),t[zr].close=Promise.withResolvers();break;case`closed`:t[zr].ready={promise:Promise.resolve(),resolve:void 0,reject:void 0},t[zr].close={promise:Promise.resolve(),resolve:void 0,reject:void 0};break;default:t[zr].ready={promise:Promise.reject(n[zr].storedError),resolve:void 0,reject:void 0},t[zr].close={promise:Promise.reject(n[zr].storedError),resolve:void 0,reject:void 0},setPromiseHandled(t[zr].ready.promise),setPromiseHandled(t[zr].close.promise)}}function writableStreamAbort(t,n){let{state:S,controller:C}=t[zr];if(S===`closed`||S===`errored`)return Promise.resolve();if(C[zr].abortController.abort(n),t[zr].pendingAbortRequest.abort.promise!==void 0)return t[zr].pendingAbortRequest.abort.promise;let N=!1;S===`erroring`&&(N=!0,n=void 0);let F=Promise.withResolvers();return t[zr].pendingAbortRequest={abort:F,reason:n,wasAlreadyErroring:N},N||writableStreamStartErroring(t,n),F.promise}function writableStreamClose(t){let{state:n,writer:S,backpressure:C,controller:N}=t[zr];if(n===`closed`||n===`errored`)return Promise.reject(TypeError(`WritableStream is closed`));t[zr].closeRequest=Promise.withResolvers();let{promise:F}=t[zr].closeRequest;return S!==void 0&&C&&n===`writable`&&S[zr].ready.resolve?.(),writableStreamDefaultControllerClose(N),F}function writableStreamUpdateBackpressure(t,n){let{writer:S}=t[zr];S!==void 0&&t[zr].backpressure!==n&&(n?S[zr].ready=Promise.withResolvers():S[zr].ready.resolve?.()),t[zr].backpressure=n}function writableStreamStartErroring(t,n){let{controller:S,writer:C}=t[zr];t[zr].state=`erroring`,t[zr].storedError=n,C!==void 0&&writableStreamDefaultWriterEnsureReadyPromiseRejected(C,n),!writableStreamHasOperationMarkedInFlight(t)&&S[zr].started&&writableStreamFinishErroring(t)}function writableStreamRejectCloseAndClosedPromiseIfNeeded(t){t[zr].closeRequest.promise!==void 0&&(t[zr].closeRequest.reject?.(t[zr].storedError),t[zr].closeRequest={promise:void 0,resolve:void 0,reject:void 0}),setPromiseHandled(t[zr].close.promise),t[zr].close.reject?.(t[zr].storedError);let{writer:n}=t[zr];n!==void 0&&(setPromiseHandled(n[zr].close.promise),n[zr].close.reject?.(t[zr].storedError))}function writableStreamMarkFirstWriteRequestInFlight(t){let n=t[zr].writeRequests.shift();t[zr].inFlightWriteRequest=n}function writableStreamMarkCloseRequestInFlight(t){t[zr].inFlightCloseRequest=t[zr].closeRequest,t[zr].closeRequest={promise:void 0,resolve:void 0,reject:void 0}}function writableStreamHasOperationMarkedInFlight(t){return t[zr].inFlightWriteRequest.promise!==void 0||t[zr].inFlightCloseRequest.promise!==void 0}function writableStreamFinishInFlightWriteWithError(t,n){t[zr].inFlightWriteRequest.reject?.(n),t[zr].inFlightWriteRequest={promise:void 0,resolve:void 0,reject:void 0},writableStreamDealWithRejection(t,n)}function writableStreamFinishInFlightWrite(t){t[zr].inFlightWriteRequest.resolve?.(),t[zr].inFlightWriteRequest={promise:void 0,resolve:void 0,reject:void 0}}function writableStreamFinishInFlightCloseWithError(t,n){t[zr].inFlightCloseRequest.reject?.(n),t[zr].inFlightCloseRequest={promise:void 0,resolve:void 0,reject:void 0},t[zr].pendingAbortRequest.abort.promise!==void 0&&(t[zr].pendingAbortRequest.abort.reject?.(n),t[zr].pendingAbortRequest={abort:{promise:void 0,resolve:void 0,reject:void 0},reason:void 0,wasAlreadyErroring:!1}),writableStreamDealWithRejection(t,n)}function writableStreamFinishInFlightClose(t){t[zr].inFlightCloseRequest.resolve?.(),t[zr].inFlightCloseRequest={promise:void 0,resolve:void 0,reject:void 0},t[zr].state===`erroring`&&(t[zr].storedError=void 0,t[zr].pendingAbortRequest.abort.promise!==void 0&&(t[zr].pendingAbortRequest.abort.resolve?.(),t[zr].pendingAbortRequest={abort:{promise:void 0,resolve:void 0,reject:void 0},reason:void 0,wasAlreadyErroring:!1})),t[zr].state=`closed`,t[zr].writer!==void 0&&t[zr].writer[zr].close.resolve?.(),t[zr].close.resolve?.()}function writableStreamFinishErroring(t){t[zr].state=`errored`,t[zr].controller[Gr]();let n=t[zr].storedError;for(let S of t[zr].writeRequests)S.reject?.(n);if(t[zr].writeRequests=[],t[zr].pendingAbortRequest.abort.promise===void 0){writableStreamRejectCloseAndClosedPromiseIfNeeded(t);return}let S=t[zr].pendingAbortRequest;if(t[zr].pendingAbortRequest={abort:{promise:void 0,resolve:void 0,reject:void 0},reason:void 0,wasAlreadyErroring:!1},S.wasAlreadyErroring){S.abort.reject?.(n),writableStreamRejectCloseAndClosedPromiseIfNeeded(t);return}t[zr].controller[Ur](S.reason).then(()=>{S.abort.resolve?.(),writableStreamRejectCloseAndClosedPromiseIfNeeded(t)},n=>{S.abort.reject?.(n),writableStreamRejectCloseAndClosedPromiseIfNeeded(t)})}function writableStreamDealWithRejection(t,n){if(t[zr].state===`writable`){writableStreamStartErroring(t,n);return}writableStreamFinishErroring(t)}function writableStreamCloseQueuedOrInFlight(t){return t[zr].closeRequest.promise!==void 0||t[zr].inFlightCloseRequest.promise!==void 0}function writableStreamAddWriteRequest(t){let{promise:n,resolve:S,reject:C}=Promise.withResolvers();return t[zr].writeRequests.push({promise:n,resolve:S,reject:C}),n}function writableStreamDefaultWriterWrite(t,n){let{stream:S}=t[zr],{controller:C}=S[zr],N=writableStreamDefaultControllerGetChunkSize(C,n);if(S!==t[zr].stream)return Promise.reject(TypeError(`Mismatched WritableStreams`));let{state:F}=S[zr];if(F===`errored`)return Promise.reject(S[zr].storedError);if(writableStreamCloseQueuedOrInFlight(S)||F===`closed`)return Promise.reject(TypeError(`WritableStream is closed`));if(F===`erroring`)return Promise.reject(S[zr].storedError);let I=writableStreamAddWriteRequest(S);return writableStreamDefaultControllerWrite(C,n,N),I}function writableStreamDefaultWriterRelease(t){let{stream:n}=t[zr],S=TypeError(`Writer has been released`);writableStreamDefaultWriterEnsureReadyPromiseRejected(t,S),writableStreamDefaultWriterEnsureClosedPromiseRejected(t,S),n[zr].writer=void 0,t[zr].stream=void 0}function writableStreamDefaultWriterGetDesiredSize(t){let{stream:n}=t[zr];switch(n[zr].state){case`errored`:case`erroring`:return null;case`closed`:return 0}return writableStreamDefaultControllerGetDesiredSize(n[zr].controller)}function writableStreamDefaultWriterEnsureReadyPromiseRejected(t,n){t[zr].ready.reject?(t[zr].ready.reject(n),t[zr].ready.resolve=void 0,t[zr].ready.reject=void 0):t[zr].ready={promise:Promise.reject(n),resolve:void 0,reject:void 0},setPromiseHandled(t[zr].ready.promise)}function writableStreamDefaultWriterEnsureClosedPromiseRejected(t,n){t[zr].close.reject?(t[zr].close.reject(n),t[zr].close.resolve=void 0,t[zr].close.reject=void 0):t[zr].close={promise:Promise.reject(n),resolve:void 0,reject:void 0},setPromiseHandled(t[zr].close.promise)}function writableStreamDefaultWriterCloseWithErrorPropagation(t){let{stream:n}=t[zr],{state:S}=n[zr];return writableStreamCloseQueuedOrInFlight(n)||S===`closed`?Promise.resolve():S===`errored`?Promise.reject(n[zr].storedError):writableStreamDefaultWriterClose(t)}function writableStreamDefaultWriterClose(t){return writableStreamClose(t[zr].stream)}function writableStreamDefaultWriterAbort(t,n){return writableStreamAbort(t[zr].stream,n)}function writableStreamDefaultControllerWrite(t,n,S){try{enqueueValueWithSize(t,n,S)}catch(n){writableStreamDefaultControllerErrorIfNeeded(t,n);return}let{stream:C}=t[zr];!writableStreamCloseQueuedOrInFlight(C)&&C[zr].state===`writable`&&writableStreamUpdateBackpressure(C,writableStreamDefaultControllerGetBackpressure(t)),writableStreamDefaultControllerAdvanceQueueIfNeeded(t)}function writableStreamDefaultControllerProcessWrite(t,n){let{stream:S,writeAlgorithm:C}=t[zr];writableStreamMarkFirstWriteRequestInFlight(S),C(n,t).then(()=>{writableStreamFinishInFlightWrite(S);let{state:n}=S[zr];dequeueValue(t),!writableStreamCloseQueuedOrInFlight(S)&&n===`writable`&&writableStreamUpdateBackpressure(S,writableStreamDefaultControllerGetBackpressure(t)),writableStreamDefaultControllerAdvanceQueueIfNeeded(t)},n=>{S[zr].state===`writable`&&writableStreamDefaultControllerClearAlgorithms(t),writableStreamFinishInFlightWriteWithError(S,n)})}function writableStreamDefaultControllerProcessClose(t){let{closeAlgorithm:n,stream:S}=t[zr];writableStreamMarkCloseRequestInFlight(S),dequeueValue(t);let C=n();writableStreamDefaultControllerClearAlgorithms(t),C.then(()=>writableStreamFinishInFlightClose(S),t=>writableStreamFinishInFlightCloseWithError(S,t))}function writableStreamDefaultControllerGetDesiredSize(t){return t[zr].highWaterMark-t[zr].queueTotalSize}function writableStreamDefaultControllerGetChunkSize(t,n){let{sizeAlgorithm:S}=t[zr];if(S===void 0)return 1;try{return S(n)}catch(n){return writableStreamDefaultControllerErrorIfNeeded(t,n),1}}function writableStreamDefaultControllerErrorIfNeeded(t,n){t[zr].stream[zr].state===`writable`&&writableStreamDefaultControllerError(t,n)}function writableStreamDefaultControllerError(t,n){writableStreamDefaultControllerClearAlgorithms(t),writableStreamStartErroring(t[zr].stream,n)}function writableStreamDefaultControllerClose(t){enqueueValueWithSize(t,Wr,0),writableStreamDefaultControllerAdvanceQueueIfNeeded(t)}function writableStreamDefaultControllerClearAlgorithms(t){t[zr].writeAlgorithm=void 0,t[zr].closeAlgorithm=void 0,t[zr].abortAlgorithm=void 0,t[zr].sizeAlgorithm=void 0}function writableStreamDefaultControllerGetBackpressure(t){return writableStreamDefaultControllerGetDesiredSize(t)<=0}function writableStreamDefaultControllerAdvanceQueueIfNeeded(t){let{queue:n,started:S,stream:C}=t[zr];if(!S||C[zr].inFlightWriteRequest.promise!==void 0)return;if(C[zr].state===`erroring`){writableStreamFinishErroring(C);return}if(!n.length)return;let N=peekQueueValue(t);N===Wr?writableStreamDefaultControllerProcessClose(t):writableStreamDefaultControllerProcessWrite(t,N)}function setupWritableStreamDefaultControllerFromSink(t,n,S,C){let N=new WritableStreamDefaultController(Kr),F=n?.start,I=n?.write,H=n?.close,W=n?.abort;setupWritableStreamDefaultController(t,N,F?F.bind(n,N):nonOpStart,I?createPromiseCallback(`sink.write`,I,n):nonOpWrite,H?createPromiseCallback(`sink.close`,H,n):nonOpCancel,W?createPromiseCallback(`sink.abort`,W,n):nonOpCancel,S,C)}function setupWritableStreamDefaultController(t,n,S,C,N,F,I,H){n[zr]={abortAlgorithm:F,closeAlgorithm:N,highWaterMark:I,queue:[],queueTotalSize:0,abortController:new Hr,sizeAlgorithm:H,started:!1,stream:t,writeAlgorithm:C},t[zr].controller=n,writableStreamUpdateBackpressure(t,writableStreamDefaultControllerGetBackpressure(n));let W=S();new Promise(t=>t(W)).then(()=>{n[zr].started=!0,writableStreamDefaultControllerAdvanceQueueIfNeeded(n)},S=>{n[zr].started=!0,writableStreamDealWithRejection(t,S)})}function createWritableStream(t,n,S,C,N=1,F=()=>1){let I=Object.create(WritableStream.prototype);return I[Br]=`WritableStream`,I[zr]=createWritableStreamState(),setupWritableStreamDefaultController(I,new WritableStreamDefaultController(Kr),t,n,S,C,N,F),I}Ye();const Xr=Symbol(`kCancel`),Zr=Symbol(`kClose`),Qr=Symbol(`kChunk`),$r=Symbol(`kError`),ei=Symbol(`kPull`),ti=Symbol(`kRelease`),ni=Symbol(`kSkipThrow`);let ri,ii;function lazyReadableReleasedError(){return ri||(ri=TypeError(`Reader released`),ri)}function lazyReadableReleasingError(){return ii||(ii=TypeError(`Releasing reader`),ii)}function createAbortError$1(){if(typeof globalThis.DOMException==`function`)return new DOMException(`The operation was aborted`,`AbortError`);let t=Error(`The operation was aborted`);return t.name=`AbortError`,t}__name$1(createAbortError$1,`createAbortError`);function createReadableStreamState(){return{disturbed:!1,reader:void 0,state:`readable`,storedError:void 0,controller:void 0,closedPromise:Promise.withResolvers()}}var ReadableStream$1=class{static{__name$1(this,`ReadableStream`)}[Br]=`ReadableStream`;[zr];constructor(t={},n={}){if(t!=null&&typeof t!=`object`)throw TypeError(`source must be an object`);if(n!=null&&typeof n!=`object`)throw TypeError(`strategy must be an object`);this[zr]=createReadableStreamState();let S=n?.size,C=n?.highWaterMark,N=t?.type;if(N!==void 0){if(`${N}`==`bytes`){if(S!==void 0)throw RangeError(`strategy.size must not be set for a byte stream`);setupReadableByteStreamControllerFromSource(this,t,extractHighWaterMark(C,0));return}throw RangeError(`Invalid type: ${N}`)}setupReadableStreamDefaultControllerFromSource(this,t,extractHighWaterMark(C,1),extractSizeAlgorithm(S))}get locked(){if(!ai(this))throw TypeError(`Invalid this`);return isReadableStreamLocked(this)}static from(t){return readableStreamFromIterable(t)}cancel(t=void 0){return ai(this)?isReadableStreamLocked(this)?Promise.reject(TypeError(`ReadableStream is locked`)):readableStreamCancel(this,t):Promise.reject(TypeError(`Invalid this`))}getReader(t={}){if(!ai(this))throw TypeError(`Invalid this`);if(t!=null&&typeof t!=`object`)throw TypeError(`options must be an object`);let n=t?.mode;if(n===void 0)return new ReadableStreamDefaultReader(this);if(`${n}`==`byob`)return new ReadableStreamBYOBReader(this);throw RangeError(`Invalid mode: ${n}`)}pipeThrough(t,n={}){if(!ai(this))throw TypeError(`Invalid this`);let S=t?.readable;if(!ai(S))throw TypeError(`transform.readable must be a ReadableStream`);let C=t?.writable;if(!qr(C))throw TypeError(`transform.writable must be a WritableStream`);if(n!=null&&typeof n!=`object`)throw TypeError(`options must be an object`);let N=n?.preventAbort,F=n?.preventCancel,I=n?.preventClose,H=n?.signal;if(H!==void 0&&!(H instanceof Object&&`aborted`in H))throw TypeError(`options.signal must be an AbortSignal`);if(isReadableStreamLocked(this))throw TypeError(`The ReadableStream is locked`);if(isWritableStreamLocked(C))throw TypeError(`The WritableStream is locked`);return setPromiseHandled(readableStreamPipeTo(this,C,!!I,!!N,!!F,H)),S}pipeTo(t,n={}){try{if(!ai(this))throw TypeError(`Invalid this`);if(!qr(t))throw TypeError(`destination must be a WritableStream`);if(n!=null&&typeof n!=`object`)throw TypeError(`options must be an object`);let S=n?.preventAbort,C=n?.preventCancel,N=n?.preventClose,F=n?.signal;if(F!==void 0&&!(F instanceof Object&&`aborted`in F))throw TypeError(`options.signal must be an AbortSignal`);if(isReadableStreamLocked(this))throw TypeError(`The ReadableStream is locked`);if(isWritableStreamLocked(t))throw TypeError(`The WritableStream is locked`);return readableStreamPipeTo(this,t,!!N,!!S,!!C,F)}catch(t){return Promise.reject(t)}}tee(){if(!ai(this))throw TypeError(`Invalid this`);let t=this[zr].controller;return ci(t)?readableByteStreamTee(this):readableStreamDefaultTee(this,!1)}values(t={}){if(!ai(this))throw TypeError(`Invalid this`);if(t!=null&&typeof t!=`object`)throw TypeError(`options must be an object`);let n=!!t?.preventCancel,S=new ReadableStreamDefaultReader(this),C={done:!1,current:void 0},N=!1;function nextSteps(){if(C.done)return Promise.resolve({done:!0,value:void 0});if(S[zr].stream===void 0)return Promise.reject(TypeError(`The reader is not bound to a ReadableStream`));let{promise:t,resolve:n,reject:N}=Promise.withResolvers();return readableStreamDefaultReaderRead(S,{[Qr](t){C.current=void 0,n({value:t,done:!1})},[Zr](){C.current=void 0,C.done=!0,readableStreamReaderGenericRelease(S),n({done:!0,value:void 0})},[$r](t){C.current=void 0,C.done=!0,readableStreamReaderGenericRelease(S),N(t)}}),t}async function returnSteps(t){if(C.done)return{done:!0,value:t};if(C.done=!0,S[zr].stream===void 0)throw TypeError(`The reader is not bound to a ReadableStream`);if(!n){let n=readableStreamReaderGenericCancel(S,t);return readableStreamReaderGenericRelease(S),await n,{done:!0,value:t}}return readableStreamReaderGenericRelease(S),{done:!0,value:t}}return Object.setPrototypeOf({next(){return N||=(C.current=Promise.resolve(),!0),C.current=C.current===void 0?nextSteps():C.current.then(nextSteps,nextSteps),C.current},return(t){return N=!0,C.current=C.current===void 0?returnSteps(t):C.current.then(()=>returnSteps(t),()=>returnSteps(t)),C.current},[Symbol.asyncIterator](){return this}},Vr)}[Symbol.asyncIterator](){return this.values()}get[Symbol.toStringTag](){return`ReadableStream`}},DefaultReadRequest=class{[zr];constructor(){this[zr]=Promise.withResolvers()}[Qr](t){this[zr].resolve?.({value:t,done:!1})}[Zr](){this[zr].resolve?.({value:void 0,done:!0})}[$r](t){this[zr].reject?.(t)}get promise(){return this[zr].promise}},ReadableStreamDefaultReader=class{[Br]=`ReadableStreamDefaultReader`;[zr];constructor(t){if(!ai(t))throw TypeError(`Expected a ReadableStream`);this[zr]={readRequests:[],readIntoRequests:[],stream:void 0,close:{promise:void 0,resolve:void 0,reject:void 0}},setupReadableStreamDefaultReader(this,t)}read(){if(!si(this))return Promise.reject(TypeError(`Invalid this`));if(this[zr].stream===void 0)return Promise.reject(TypeError(`The reader is not attached to a stream`));let t=this[zr].stream,n=t[zr].controller;if(t[zr].state===`readable`&&oi(n)&&n[zr].queue.length>0){t[zr].disturbed=!0;let S=dequeueValue(n);return n[zr].closeRequested&&!n[zr].queue.length?(readableStreamDefaultControllerClearAlgorithms(n),readableStreamClose(t)):readableStreamDefaultControllerCallPullIfNeeded(n),Promise.resolve({value:S,done:!1})}let S=new DefaultReadRequest;return readableStreamDefaultReaderRead(this,S),S.promise}releaseLock(){if(!si(this))throw TypeError(`Invalid this`);this[zr].stream!==void 0&&readableStreamDefaultReaderRelease(this)}get closed(){return si(this)?this[zr].close.promise:Promise.reject(TypeError(`Invalid this`))}cancel(t=void 0){return si(this)?this[zr].stream===void 0?Promise.reject(TypeError(`The reader is not attached to a stream`)):readableStreamReaderGenericCancel(this,t):Promise.reject(TypeError(`Invalid this`))}get[Symbol.toStringTag](){return`ReadableStreamDefaultReader`}},ReadableStreamDefaultController=class{[Br]=`ReadableStreamDefaultController`;[zr];constructor(t){if(t!==ni)throw TypeError(`Illegal constructor`)}get desiredSize(){return readableStreamDefaultControllerGetDesiredSize(this)}close(){if(!readableStreamDefaultControllerCanCloseOrEnqueue(this))throw TypeError(`Controller is already closed`);readableStreamDefaultControllerClose(this)}enqueue(t=void 0){if(!readableStreamDefaultControllerCanCloseOrEnqueue(this))throw TypeError(`Controller is already closed`);readableStreamDefaultControllerEnqueue(this,t)}error(t=void 0){readableStreamDefaultControllerError(this,t)}[Xr](t){return readableStreamDefaultControllerCancelSteps(this,t)}[ei](t){readableStreamDefaultControllerPullSteps(this,t)}[ti](){}get[Symbol.toStringTag](){return`ReadableStreamDefaultController`}};const ai=isBrandCheck(`ReadableStream`),oi=isBrandCheck(`ReadableStreamDefaultController`),si=isBrandCheck(`ReadableStreamDefaultReader`);function isReadableStreamLocked(t){return t[zr].reader!==void 0}function readableStreamCancel(t,n){switch(t[zr].disturbed=!0,t[zr].state){case`closed`:return Promise.resolve();case`errored`:return Promise.reject(t[zr].storedError)}readableStreamClose(t);let S=t[zr].reader;if(S!==void 0&&readableStreamHasBYOBReader(t)){let t=S[zr].readIntoRequests;S[zr].readIntoRequests=[];for(let n=0;n<t.length;n++)t[n][Zr](void 0)}return t[zr].controller[Xr](n).then(()=>{})}function readableStreamClose(t){t[zr].state=`closed`,t[zr].closedPromise.resolve();let{reader:n}=t[zr];if(n!==void 0&&(n[zr].close.resolve?.(),readableStreamHasDefaultReader(t))){for(let t=0;t<n[zr].readRequests.length;t++)n[zr].readRequests[t][Zr]();n[zr].readRequests=[]}}function readableStreamError(t,n){t[zr].state=`errored`,t[zr].storedError=n,setPromiseHandled(t[zr].closedPromise.promise),t[zr].closedPromise.reject(n);let{reader:S}=t[zr];if(S!==void 0){if(setPromiseHandled(S[zr].close.promise),S[zr].close.reject?.(n),readableStreamHasDefaultReader(t)){for(let t=0;t<S[zr].readRequests.length;t++)S[zr].readRequests[t][$r](n);S[zr].readRequests=[]}else if(readableStreamHasBYOBReader(t)){for(let t=0;t<S[zr].readIntoRequests.length;t++)S[zr].readIntoRequests[t][$r](n);S[zr].readIntoRequests=[]}}}function readableStreamHasDefaultReader(t){let{reader:n}=t[zr];return n===void 0?!1:n[zr]!==void 0&&n[Br]===`ReadableStreamDefaultReader`}function readableStreamGetNumReadRequests(t){return t[zr].reader[zr].readRequests.length}function readableStreamFulfillReadRequest(t,n,S){let{reader:C}=t[zr],N=C[zr].readRequests.shift();S?N[Zr]():N[Qr](n)}function readableStreamAddReadRequest(t,n){t[zr].reader[zr].readRequests.push(n)}function readableStreamReaderGenericCancel(t,n){let{stream:S}=t[zr];return readableStreamCancel(S,n)}function readableStreamReaderGenericInitialize(t,n){switch(t[zr].stream=n,n[zr].reader=t,n[zr].state){case`readable`:t[zr].close=Promise.withResolvers();break;case`closed`:t[zr].close={promise:Promise.resolve(),resolve:void 0,reject:void 0};break;case`errored`:t[zr].close={promise:Promise.reject(n[zr].storedError),resolve:void 0,reject:void 0},setPromiseHandled(t[zr].close.promise);break}}function readableStreamReaderGenericRelease(t){let{stream:n}=t[zr],S=lazyReadableReleasedError();n[zr].state===`readable`?t[zr].close.reject?.(S):t[zr].close={promise:Promise.reject(S),resolve:void 0,reject:void 0},setPromiseHandled(t[zr].close.promise),n[zr].controller[ti](),n[zr].reader=void 0,t[zr].stream=void 0}function readableStreamDefaultReaderRelease(t){readableStreamReaderGenericRelease(t),readableStreamDefaultReaderErrorReadRequests(t,lazyReadableReleasingError())}function readableStreamDefaultReaderErrorReadRequests(t,n){for(let S=0;S<t[zr].readRequests.length;++S)t[zr].readRequests[S][$r](n);t[zr].readRequests=[]}function readableStreamDefaultReaderRead(t,n){let{stream:S}=t[zr];switch(S[zr].disturbed=!0,S[zr].state){case`closed`:n[Zr]();break;case`errored`:n[$r](S[zr].storedError);break;case`readable`:S[zr].controller[ei](n);break}}function setupReadableStreamDefaultReader(t,n){if(isReadableStreamLocked(n))throw TypeError(`ReadableStream is locked`);readableStreamReaderGenericInitialize(t,n),t[zr].readRequests=[]}function readableStreamDefaultControllerClose(t){readableStreamDefaultControllerCanCloseOrEnqueue(t)&&(t[zr].closeRequested=!0,t[zr].queue.length||(readableStreamDefaultControllerClearAlgorithms(t),readableStreamClose(t[zr].stream)))}function readableStreamDefaultControllerEnqueue(t,n){if(!readableStreamDefaultControllerCanCloseOrEnqueue(t))return;let{stream:S}=t[zr];if(isReadableStreamLocked(S)&&readableStreamGetNumReadRequests(S))readableStreamFulfillReadRequest(S,n,!1);else try{enqueueValueWithSize(t,n,t[zr].sizeAlgorithm(n))}catch(n){throw readableStreamDefaultControllerError(t,n),n}readableStreamDefaultControllerCallPullIfNeeded(t)}function readableStreamDefaultControllerCanCloseOrEnqueue(t){let{stream:n}=t[zr];return!t[zr].closeRequested&&n[zr].state===`readable`}function readableStreamDefaultControllerGetDesiredSize(t){let{stream:n,highWaterMark:S,queueTotalSize:C}=t[zr];switch(n[zr].state){case`errored`:return null;case`closed`:return 0;default:return S-C}}function readableStreamDefaultControllerHasBackpressure(t){return!readableStreamDefaultControllerShouldCallPull(t)}function readableStreamDefaultControllerShouldCallPull(t){let{stream:n}=t[zr];if(!readableStreamDefaultControllerCanCloseOrEnqueue(t)||!t[zr].started)return!1;if(isReadableStreamLocked(n)&&readableStreamGetNumReadRequests(n))return!0;let S=readableStreamDefaultControllerGetDesiredSize(t);return S!==null&&S>0}function readableStreamDefaultControllerCallPullIfNeeded(t){if(readableStreamDefaultControllerShouldCallPull(t)){if(t[zr].pulling){t[zr].pullAgain=!0;return}t[zr].pulling=!0,t[zr].pullAlgorithm(t).then(()=>{t[zr].pulling=!1,t[zr].pullAgain&&(t[zr].pullAgain=!1,readableStreamDefaultControllerCallPullIfNeeded(t))},n=>readableStreamDefaultControllerError(t,n))}}function readableStreamDefaultControllerClearAlgorithms(t){t[zr].pullAlgorithm=void 0,t[zr].cancelAlgorithm=void 0,t[zr].sizeAlgorithm=void 0}function readableStreamDefaultControllerError(t,n){let{stream:S}=t[zr];S[zr].state===`readable`&&(resetQueue(t),readableStreamDefaultControllerClearAlgorithms(t),readableStreamError(S,n))}function readableStreamDefaultControllerCancelSteps(t,n){resetQueue(t);let S=t[zr].cancelAlgorithm?.(n)??Promise.resolve();return readableStreamDefaultControllerClearAlgorithms(t),S}function readableStreamDefaultControllerPullSteps(t,n){let{stream:S,queue:C}=t[zr];if(C.length){let N=dequeueValue(t);t[zr].closeRequested&&!C.length?(readableStreamDefaultControllerClearAlgorithms(t),readableStreamClose(S)):readableStreamDefaultControllerCallPullIfNeeded(t),n[Qr](N);return}readableStreamAddReadRequest(S,n),readableStreamDefaultControllerCallPullIfNeeded(t)}function setupReadableStreamDefaultController(t,n,S,C,N,F,I){n[zr]={cancelAlgorithm:N,closeRequested:!1,highWaterMark:F,pullAgain:!1,pullAlgorithm:C,pulling:!1,queue:[],queueTotalSize:0,started:!1,sizeAlgorithm:I,stream:t},t[zr].controller=n;let H=S();new Promise(t=>t(H)).then(()=>{n[zr].started=!0,readableStreamDefaultControllerCallPullIfNeeded(n)},t=>readableStreamDefaultControllerError(n,t))}function setupReadableStreamDefaultControllerFromSource(t,n,S,C){let N=new ReadableStreamDefaultController(ni),F=n?.start,I=n?.pull,H=n?.cancel;setupReadableStreamDefaultController(t,N,F?F.bind(n,N):nonOpStart,I?createPromiseCallback(`source.pull`,I,n):nonOpPull,H?createPromiseCallback(`source.cancel`,H,n):nonOpCancel,S,C)}function createReadableStream(t,n,S,C=1,N=()=>1){let F=Object.create(ReadableStream$1.prototype);return F[Br]=`ReadableStream`,F[zr]=createReadableStreamState(),setupReadableStreamDefaultController(F,new ReadableStreamDefaultController(ni),t,n,S,C,N),F}function readableStreamFromIterable(t){let n,S=getIterator(t,`async`),C=nonOpStart;async function pullAlgorithm(){let t=iteratorNext(S);return Promise.resolve(t).then(t=>{if(typeof t!=`object`||!t)throw TypeError(`The promise returned by the iterator.next() method must fulfill with an object`);t.done?readableStreamDefaultControllerClose(n[zr].controller):readableStreamDefaultControllerEnqueue(n[zr].controller,t.value)})}async function cancelAlgorithm(t){let n=S.iterator,C=n.return;if(C===void 0)return Promise.resolve();let N=C.call(n,t);return Promise.resolve(N).then(t=>{if(typeof t!=`object`||!t)throw TypeError(`The promise returned by the iterator.return() method must fulfill with an object`)})}return n=createReadableStream(C,pullAlgorithm,cancelAlgorithm,0),n}function readableStreamPipeTo(t,n,S,C,N,F){let I,H;try{I=new ReadableStreamDefaultReader(t),H=new WritableStreamDefaultWriter(n)}catch(t){return Promise.reject(t)}t[zr].disturbed=!0;let W=!1,{promise:q,resolve:Y,reject:X}=Promise.withResolvers(),Z={currentWrite:Promise.resolve()},te;function finalize(t,n){writableStreamDefaultWriterRelease(H),readableStreamReaderGenericRelease(I),F!==void 0&&te&&(F.removeEventListener(`abort`,te),te=void 0),t?X(n):Y()}async function waitForCurrentWrite(){let t=Z.currentWrite;await t,t!==Z.currentWrite&&await waitForCurrentWrite()}function shutdownWithAnAction(t,S,C){if(W)return;if(W=!0,n[zr].state===`writable`&&!writableStreamCloseQueuedOrInFlight(n)){waitForCurrentWrite().then(complete,t=>finalize(!0,t));return}complete();function complete(){t().then(()=>finalize(!!S,C),t=>finalize(!0,t))}}function shutdown(t,S){if(!W){if(W=!0,n[zr].state===`writable`&&!writableStreamCloseQueuedOrInFlight(n)){waitForCurrentWrite().then(()=>finalize(!!t,S),t=>finalize(!0,t));return}finalize(!!t,S)}}function abortAlgorithm(){let S;S=F.reason&&F.reason.name===`AbortError`?createAbortError$1():F.reason;let I=[];C||I.push(()=>n[zr].state===`writable`?writableStreamAbort(n,S):Promise.resolve()),N||I.push(()=>t[zr].state===`readable`?readableStreamCancel(t,S):Promise.resolve()),shutdownWithAnAction(()=>Promise.all(I.map(t=>t())).then(()=>void 0),!0,S)}function watchErrored(t,n,S){t[zr].state===`errored`?S(t[zr].storedError):n.then(void 0,S)}function watchClosed(t,n,S){t[zr].state===`closed`?S():n.then(S,()=>{})}class PipeToReadRequest{[Qr](t){ve(()=>{Z.currentWrite=writableStreamDefaultWriterWrite(H,t),setPromiseHandled(Z.currentWrite),ne.resolve(!1)})}[Zr](){ne.resolve(!0)}[$r](t){ne.reject(t)}}let ne={resolve:null,reject:null};async function step(){if(W||n[zr].backpressure&&(await H[zr].ready.promise,W))return!0;let S=t[zr].controller;if(t[zr].state===`readable`&&oi(S)&&S[zr].queue.length>0){for(;S[zr].queue.length>0;){if(W)return!0;let C=dequeueValue(S);if(S[zr].closeRequested&&!S[zr].queue.length&&(readableStreamDefaultControllerClearAlgorithms(S),readableStreamClose(t)),Z.currentWrite=writableStreamDefaultWriterWrite(H,C),setPromiseHandled(Z.currentWrite),n[zr].backpressure||n[zr].state!==`writable`||writableStreamCloseQueuedOrInFlight(n))break}return readableStreamDefaultControllerCallPullIfNeeded(S),t[zr].state===`closed`}let{promise:C,resolve:N,reject:F}=Promise.withResolvers();return ne={resolve:N,reject:F},readableStreamDefaultReaderRead(I,new PipeToReadRequest),C}async function run(){for(;!await step(););}if(F!==void 0){if(F.aborted)return abortAlgorithm(),q;te=abortAlgorithm,F.addEventListener(`abort`,te,{once:!0})}if(setPromiseHandled(run()),watchErrored(t,I[zr].close.promise,t=>{if(!C)return shutdownWithAnAction(()=>writableStreamAbort(n,t),!0,t);shutdown(!0,t)}),watchErrored(n,H[zr].close.promise,n=>{if(!N)return shutdownWithAnAction(()=>readableStreamCancel(t,n),!0,n);shutdown(!0,n)}),watchClosed(t,I[zr].close.promise,()=>{if(!S)return shutdownWithAnAction(()=>writableStreamDefaultWriterCloseWithErrorPropagation(H));shutdown()}),writableStreamCloseQueuedOrInFlight(n)||n[zr].state===`closed`){let n=TypeError(`Destination WritableStream is closed`);N?shutdown(!0,n):shutdownWithAnAction(()=>readableStreamCancel(t,n),!0,n)}return q}function readableStreamDefaultTee(t,n){let S=new ReadableStreamDefaultReader(t),C=!1,N=!1,F=!1,I,H,W,q,Y=Promise.withResolvers();async function pullAlgorithm(){C||(C=!0,readableStreamDefaultReaderRead(S,{[Qr](t){ve(()=>{C=!1;let S=t,I=t;if(!F&&n)try{I=structuredClone(I)}catch{}N||readableStreamDefaultControllerEnqueue(W[zr].controller,S),F||readableStreamDefaultControllerEnqueue(q[zr].controller,I)})},[Zr](){ve(()=>{C=!1,N||readableStreamDefaultControllerClose(W[zr].controller),F||readableStreamDefaultControllerClose(q[zr].controller),(!N||!F)&&Y.resolve(void 0)})},[$r](){C=!1}}))}function cancel1Algorithm(n){if(N=!0,I=n,F){let n=[I,H];Y.resolve(readableStreamCancel(t,n))}return Y.promise}function cancel2Algorithm(n){if(F=!0,H=n,N){let n=[I,H];Y.resolve(readableStreamCancel(t,n))}return Y.promise}return W=createReadableStream(nonOpStart,pullAlgorithm,cancel1Algorithm),q=createReadableStream(nonOpStart,pullAlgorithm,cancel2Algorithm),S[zr].close.promise.then(void 0,t=>{readableStreamDefaultControllerError(W[zr].controller,t),readableStreamDefaultControllerError(q[zr].controller,t),(!N||!F)&&Y.resolve(void 0)}),[W,q]}var BYOBReadIntoRequest=class{[zr];constructor(){this[zr]=Promise.withResolvers()}[Qr](t){this[zr].resolve?.({value:t,done:!1})}[Zr](t){this[zr].resolve?.({value:t,done:!0})}[$r](t){this[zr].reject?.(t)}get promise(){return this[zr].promise}},ReadableStreamBYOBReader=class{[Br]=`ReadableStreamBYOBReader`;[zr];constructor(t){if(!ai(t))throw TypeError(`Expected a ReadableStream`);this[zr]={readRequests:[],readIntoRequests:[],stream:void 0,close:{promise:void 0,resolve:void 0,reject:void 0}},setupReadableStreamBYOBReader(this,t)}read(t,n={}){if(!li(this))return Promise.reject(TypeError(`Invalid this`));if(typeof t!=`object`||!t||!ArrayBuffer.isView(t))return Promise.reject(TypeError(`view must be an ArrayBufferView`));let S=t.buffer,C=t.byteLength;if(C===0)return Promise.reject(TypeError(`view must have non-zero byteLength`));if(S.byteLength===0)return isDetachedBuffer(S)?Promise.reject(TypeError(`view's buffer has been detached`)):Promise.reject(TypeError(`view's buffer must have non-zero byteLength`));let N=n?.min??1;if(typeof N!=`number`||N<1||!Number.isInteger(N)||Number.isNaN(N))return Promise.reject(TypeError(`options.min must be a positive integer`));let F=t[Symbol.toStringTag];if(F!==void 0&&F!==`DataView`){if(N>t.length)return Promise.reject(RangeError(`options.min must be smaller or equal to view size`))}else if(N>C)return Promise.reject(RangeError(`options.min must be smaller or equal to view size`));if(this[zr].stream===void 0)return Promise.reject(TypeError(`Reader has no associated stream`));let I=new BYOBReadIntoRequest;return readableStreamBYOBReaderRead(this,t,N,I),I.promise}releaseLock(){if(!li(this))throw TypeError(`Invalid this`);this[zr].stream!==void 0&&readableStreamBYOBReaderRelease(this)}get closed(){return li(this)?this[zr].close.promise:Promise.reject(TypeError(`Invalid this`))}cancel(t=void 0){return li(this)?this[zr].stream===void 0?Promise.reject(TypeError(`Reader has no associated stream`)):readableStreamReaderGenericCancel(this,t):Promise.reject(TypeError(`Invalid this`))}get[Symbol.toStringTag](){return`ReadableStreamBYOBReader`}},ReadableStreamBYOBRequest=class{[Br]=`ReadableStreamBYOBRequest`;[zr];constructor(t){if(t!==ni)throw TypeError(`Illegal constructor`)}get view(){if(!di(this))throw TypeError(`Invalid this`);return this[zr].view}respond(t){if(!di(this))throw TypeError(`Invalid this`);if(this[zr].controller===void 0)throw TypeError(`BYOB request has been invalidated`);if(t=+t,!Number.isInteger(t)||t<0||!Number.isFinite(t))throw RangeError(`bytesWritten must be a non-negative integer`);let n=this[zr].view;if(isDetachedBuffer(n.buffer))throw TypeError(`The BYOB request's buffer has been detached`);readableByteStreamControllerRespond(this[zr].controller,t)}respondWithNewView(t){if(!di(this))throw TypeError(`Invalid this`);if(this[zr].controller===void 0)throw TypeError(`BYOB request has been invalidated`);if(typeof t!=`object`||!t||!ArrayBuffer.isView(t))throw TypeError(`view must be an ArrayBufferView`);if(isDetachedBuffer(t.buffer))throw TypeError(`The given view's buffer has been detached`);readableByteStreamControllerRespondWithNewView(this[zr].controller,t)}get[Symbol.toStringTag](){return`ReadableStreamBYOBRequest`}},ReadableByteStreamController=class{[Br]=`ReadableByteStreamController`;[zr];constructor(t){if(t!==ni)throw TypeError(`Illegal constructor`)}get byobRequest(){if(!ci(this))throw TypeError(`Invalid this`);return readableByteStreamControllerGetBYOBRequest(this)}get desiredSize(){if(!ci(this))throw TypeError(`Invalid this`);return readableByteStreamControllerGetDesiredSize(this)}close(){if(!ci(this))throw TypeError(`Invalid this`);if(this[zr].closeRequested)throw TypeError(`Close already requested`);if(this[zr].stream[zr].state!==`readable`)throw TypeError(`Stream is not in a readable state`);readableByteStreamControllerClose(this)}enqueue(t){if(!ci(this))throw TypeError(`Invalid this`);if(typeof t!=`object`||!t||!ArrayBuffer.isView(t))throw TypeError(`chunk must be an ArrayBufferView`);if(t.byteLength===0)throw TypeError(`chunk length must be non-zero`);if(t.buffer.byteLength===0)throw TypeError(`chunk's buffer length must be non-zero`);if(this[zr].closeRequested)throw TypeError(`Cannot enqueue after close has been requested`);if(this[zr].stream[zr].state!==`readable`)throw TypeError(`Stream is not in a readable state`);readableByteStreamControllerEnqueue(this,t)}error(t=void 0){if(!ci(this))throw TypeError(`Invalid this`);readableByteStreamControllerError(this,t)}[Xr](t){return readableByteStreamControllerCancelSteps(this,t)}[ei](t){readableByteStreamControllerPullSteps(this,t)}[ti](){if(this[zr].pendingPullIntos.length>0){let t=this[zr].pendingPullIntos[0];t.readerType=`none`,this[zr].pendingPullIntos=[t]}}get[Symbol.toStringTag](){return`ReadableByteStreamController`}};const ci=isBrandCheck(`ReadableByteStreamController`),li=isBrandCheck(`ReadableStreamBYOBReader`),di=isBrandCheck(`ReadableStreamBYOBRequest`);function readableStreamHasBYOBReader(t){let{reader:n}=t[zr];return n===void 0?!1:n[zr]!==void 0&&n[Br]===`ReadableStreamBYOBReader`}function readableStreamGetNumReadIntoRequests(t){return t[zr].reader[zr].readIntoRequests.length}function readableStreamAddReadIntoRequest(t,n){t[zr].reader[zr].readIntoRequests.push(n)}function readableStreamFulfillReadIntoRequest(t,n,S){let{reader:C}=t[zr],N=C[zr].readIntoRequests.shift();S?N[Zr](n):N[Qr](n)}function setupReadableStreamBYOBReader(t,n){if(isReadableStreamLocked(n))throw TypeError(`ReadableStream is locked`);if(!ci(n[zr].controller))throw TypeError(`Cannot use a BYOB reader with a non-byte stream`);readableStreamReaderGenericInitialize(t,n),t[zr].readIntoRequests=[]}function readableStreamBYOBReaderRead(t,n,S,C){let{stream:N}=t[zr];N[zr].disturbed=!0,N[zr].state===`errored`?C[$r](N[zr].storedError):readableByteStreamControllerPullInto(N[zr].controller,n,S,C)}function readableStreamBYOBReaderRelease(t){readableStreamReaderGenericRelease(t);let n=TypeError(`Reader was released`);for(let S=0;S<t[zr].readIntoRequests.length;S++)t[zr].readIntoRequests[S][$r](n);t[zr].readIntoRequests=[]}function readableByteStreamControllerClearAlgorithms(t){t[zr].pullAlgorithm=void 0,t[zr].cancelAlgorithm=void 0}function readableByteStreamControllerClearPendingPullIntos(t){readableByteStreamControllerInvalidateBYOBRequest(t),t[zr].pendingPullIntos=[]}function readableByteStreamControllerInvalidateBYOBRequest(t){let n=t[zr].byobRequest;n!=null&&(n[zr].controller=void 0,n[zr].view=null,t[zr].byobRequest=null)}function readableByteStreamControllerError(t,n){let{stream:S}=t[zr];S[zr].state===`readable`&&(readableByteStreamControllerClearPendingPullIntos(t),resetQueue(t),readableByteStreamControllerClearAlgorithms(t),readableStreamError(S,n))}function readableByteStreamControllerGetDesiredSize(t){let n=t[zr].stream[zr].state;return n===`errored`?null:n===`closed`?0:t[zr].highWaterMark-t[zr].queueTotalSize}function readableByteStreamControllerShouldCallPull(t){let{stream:n}=t[zr];if(n[zr].state!==`readable`||t[zr].closeRequested||!t[zr].started)return!1;if(readableStreamHasDefaultReader(n)&&readableStreamGetNumReadRequests(n)>0||readableStreamHasBYOBReader(n)&&readableStreamGetNumReadIntoRequests(n)>0)return!0;let S=readableByteStreamControllerGetDesiredSize(t);return S!==null&&S>0}function readableByteStreamControllerCallPullIfNeeded(t){if(readableByteStreamControllerShouldCallPull(t)){if(t[zr].pulling){t[zr].pullAgain=!0;return}t[zr].pulling=!0,t[zr].pullAlgorithm(t).then(()=>{t[zr].pulling=!1,t[zr].pullAgain&&(t[zr].pullAgain=!1,readableByteStreamControllerCallPullIfNeeded(t))},n=>readableByteStreamControllerError(t,n))}}function readableByteStreamControllerHandleQueueDrain(t){t[zr].queueTotalSize===0&&t[zr].closeRequested?(readableByteStreamControllerClearAlgorithms(t),readableStreamClose(t[zr].stream)):readableByteStreamControllerCallPullIfNeeded(t)}function readableByteStreamControllerEnqueueChunkToQueue(t,n,S,C){t[zr].queue.push({buffer:n,byteOffset:S,byteLength:C}),t[zr].queueTotalSize+=C}function readableByteStreamControllerEnqueueClonedChunkToQueue(t,n,S,C){let N;try{N=n.slice(S,S+C)}catch(n){readableByteStreamControllerError(t,n);return}readableByteStreamControllerEnqueueChunkToQueue(t,N,0,C)}function readableByteStreamControllerEnqueueDetachedPullIntoToQueue(t,n){n.bytesFilled>0&&readableByteStreamControllerEnqueueClonedChunkToQueue(t,n.buffer,n.byteOffset,n.bytesFilled),readableByteStreamControllerShiftPendingPullInto(t)}function readableByteStreamControllerShiftPendingPullInto(t){return t[zr].pendingPullIntos.shift()}function readableByteStreamControllerFillHeadPullIntoDescriptor(t,n,S){S.bytesFilled+=n}function readableByteStreamControllerConvertPullIntoDescriptor(t){let n=t.bytesFilled,S=t.elementSize,C=transferArrayBuffer(t.buffer);return t.buffer=C,new t.viewConstructor(C,t.byteOffset,n/S)}function readableByteStreamControllerCommitPullIntoDescriptor(t,n){let S=!1;t[zr].state===`closed`&&(S=!0);let C=readableByteStreamControllerConvertPullIntoDescriptor(n);n.readerType==="default"?readableStreamFulfillReadRequest(t,C,S):readableStreamFulfillReadIntoRequest(t,C,S)}function readableByteStreamControllerFillPullIntoDescriptorFromQueue(t,n){let S=Math.min(t[zr].queueTotalSize,n.byteLength-n.bytesFilled),C=n.bytesFilled+S,N=S,F=!1,I=C-C%n.elementSize;I>=n.minimumFill&&(N=I-n.bytesFilled,F=!0);let H=t[zr].queue;for(;N>0;){let S=H[0],C=Math.min(N,S.byteLength),F=n.byteOffset+n.bytesFilled,I=new Uint8Array(n.buffer,F,C),W=new Uint8Array(S.buffer,S.byteOffset,C);I.set(W),S.byteLength===C?H.shift():(S.byteOffset+=C,S.byteLength-=C),t[zr].queueTotalSize-=C,readableByteStreamControllerFillHeadPullIntoDescriptor(t,C,n),N-=C}return F}function readableByteStreamControllerFillReadRequestFromQueue(t,n){let S=t[zr].queue.shift();t[zr].queueTotalSize-=S.byteLength,readableByteStreamControllerHandleQueueDrain(t);let C=new Uint8Array(S.buffer,S.byteOffset,S.byteLength);n[Qr](C)}function readableByteStreamControllerProcessReadRequestsUsingQueue(t){let n=t[zr].stream[zr].reader;for(;n[zr].readRequests.length!==0;){if(t[zr].queueTotalSize===0)return;readableByteStreamControllerFillReadRequestFromQueue(t,n[zr].readRequests.shift())}}function readableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(t){for(;t[zr].pendingPullIntos.length!==0;){if(t[zr].queueTotalSize===0)return;let n=t[zr].pendingPullIntos[0];readableByteStreamControllerFillPullIntoDescriptorFromQueue(t,n)&&(readableByteStreamControllerShiftPendingPullInto(t),readableByteStreamControllerCommitPullIntoDescriptor(t[zr].stream,n))}}function readableByteStreamControllerGetBYOBRequest(t){if(t[zr].byobRequest===null&&t[zr].pendingPullIntos.length!==0){let n=t[zr].pendingPullIntos[0],S=new Uint8Array(n.buffer,n.byteOffset+n.bytesFilled,n.byteLength-n.bytesFilled),C=new ReadableStreamBYOBRequest(ni);C[zr]={controller:t,view:S},t[zr].byobRequest=C}return t[zr].byobRequest}function readableByteStreamControllerEnqueue(t,n){let{stream:S}=t[zr];if(t[zr].closeRequested||S[zr].state!==`readable`)return;let C=n.buffer,N=n.byteLength,F=n.byteOffset;if(isDetachedBuffer(C))throw TypeError(`chunk's buffer is detached`);let I=transferArrayBuffer(C);if(t[zr].pendingPullIntos.length!==0){let n=t[zr].pendingPullIntos[0];if(isDetachedBuffer(n.buffer))throw TypeError(`BYOB request's buffer has been detached`);readableByteStreamControllerInvalidateBYOBRequest(t),n.buffer=transferArrayBuffer(n.buffer),n.readerType===`none`&&readableByteStreamControllerEnqueueDetachedPullIntoToQueue(t,n)}readableStreamHasDefaultReader(S)?(readableByteStreamControllerProcessReadRequestsUsingQueue(t),readableStreamGetNumReadRequests(S)===0?readableByteStreamControllerEnqueueChunkToQueue(t,I,F,N):(t[zr].pendingPullIntos.length!==0&&readableByteStreamControllerShiftPendingPullInto(t),readableStreamFulfillReadRequest(S,new Uint8Array(I,F,N),!1))):readableStreamHasBYOBReader(S)?(readableByteStreamControllerEnqueueChunkToQueue(t,I,F,N),readableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(t)):readableByteStreamControllerEnqueueChunkToQueue(t,I,F,N),readableByteStreamControllerCallPullIfNeeded(t)}function readableByteStreamControllerClose(t){let{stream:n}=t[zr];if(!(t[zr].closeRequested||n[zr].state!==`readable`)){if(t[zr].queueTotalSize>0){t[zr].closeRequested=!0;return}if(t[zr].pendingPullIntos.length!==0){let n=t[zr].pendingPullIntos[0];if(n.bytesFilled%n.elementSize!==0){let n=TypeError(`Insufficient bytes to fill elements in the given buffer`);throw readableByteStreamControllerError(t,n),n}}readableByteStreamControllerClearAlgorithms(t),readableStreamClose(n)}}function readableByteStreamControllerPullInto(t,n,S,C){let N=t[zr].stream,F=n[Symbol.toStringTag],I,H;if(F===void 0||F===`DataView`)I=DataView,H=1;else{let t=typedArrayConstructorByTag(F);if(!t){C[$r](TypeError(`Unsupported typed array: ${F}`));return}I=t,H=elementSizeByTag(F)}let W=n.buffer,q=n.byteLength,Y=n.byteOffset,X=S*H,Z;try{Z=transferArrayBuffer(W)}catch(t){C[$r](t);return}let te={buffer:Z,bufferByteLength:Z.byteLength,byteOffset:Y,byteLength:q,bytesFilled:0,minimumFill:X,elementSize:H,viewConstructor:I,readerType:`byob`};if(t[zr].pendingPullIntos.length!==0){t[zr].pendingPullIntos.push(te),readableStreamAddReadIntoRequest(N,C);return}if(N[zr].state===`closed`){let t=new I(te.buffer,te.byteOffset,0);C[Zr](t);return}if(t[zr].queueTotalSize>0){if(readableByteStreamControllerFillPullIntoDescriptorFromQueue(t,te)){let n=readableByteStreamControllerConvertPullIntoDescriptor(te);readableByteStreamControllerHandleQueueDrain(t),C[Qr](n);return}if(t[zr].closeRequested){let n=TypeError(`Insufficient bytes to fill elements in the given buffer`);readableByteStreamControllerError(t,n),C[$r](n);return}}t[zr].pendingPullIntos.push(te),readableStreamAddReadIntoRequest(N,C),readableByteStreamControllerCallPullIfNeeded(t)}function readableByteStreamControllerRespond(t,n){let S=t[zr].pendingPullIntos[0];if(t[zr].stream[zr].state===`closed`){if(n!==0)throw TypeError(`bytesWritten must be 0 when calling respond() on a closed stream`)}else{if(n===0)throw TypeError(`bytesWritten must be greater than 0 when calling respond() on a readable stream`);if(S.bytesFilled+n>S.byteLength)throw RangeError(`bytesWritten out of range`)}S.buffer=transferArrayBuffer(S.buffer),readableByteStreamControllerRespondInternal(t,n)}function readableByteStreamControllerRespondWithNewView(t,n){let S=t[zr].pendingPullIntos[0],C=t[zr].stream[zr].state,N=n.byteLength,F=n.byteOffset,I=n.buffer;if(C===`closed`){if(N!==0)throw TypeError(`view's length must be 0 when calling respondWithNewView() on a closed stream`)}else if(N===0)throw TypeError(`view's length must be greater than 0 when calling respondWithNewView() on a readable stream`);if(S.byteOffset+S.bytesFilled!==F)throw RangeError(`The region specified by view does not match byobRequest`);if(S.bufferByteLength!==I.byteLength)throw RangeError(`The buffer of view has different capacity than byobRequest`);if(S.bytesFilled+N>S.byteLength)throw RangeError(`The region specified by view is larger than byobRequest`);S.buffer=transferArrayBuffer(I),readableByteStreamControllerRespondInternal(t,N)}function readableByteStreamControllerRespondInternal(t,n){let S=t[zr].pendingPullIntos[0];readableByteStreamControllerInvalidateBYOBRequest(t),t[zr].stream[zr].state===`closed`?readableByteStreamControllerRespondInClosedState(t,S):readableByteStreamControllerRespondInReadableState(t,n,S),readableByteStreamControllerCallPullIfNeeded(t)}function readableByteStreamControllerRespondInClosedState(t,n){n.readerType===`none`&&readableByteStreamControllerShiftPendingPullInto(t);let S=t[zr].stream;if(readableStreamHasBYOBReader(S))for(;readableStreamGetNumReadIntoRequests(S)>0;)readableByteStreamControllerCommitPullIntoDescriptor(S,readableByteStreamControllerShiftPendingPullInto(t))}function readableByteStreamControllerRespondInReadableState(t,n,S){if(readableByteStreamControllerFillHeadPullIntoDescriptor(t,n,S),S.readerType===`none`){readableByteStreamControllerEnqueueDetachedPullIntoToQueue(t,S),readableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(t);return}if(S.bytesFilled<S.minimumFill)return;readableByteStreamControllerShiftPendingPullInto(t);let C=S.bytesFilled%S.elementSize;if(C>0){let n=S.byteOffset+S.bytesFilled;readableByteStreamControllerEnqueueClonedChunkToQueue(t,S.buffer,n-C,C)}S.bytesFilled-=C,readableByteStreamControllerCommitPullIntoDescriptor(t[zr].stream,S),readableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(t)}function readableByteStreamControllerCancelSteps(t,n){readableByteStreamControllerClearPendingPullIntos(t),resetQueue(t);let S=t[zr].cancelAlgorithm?.(n)??Promise.resolve();return readableByteStreamControllerClearAlgorithms(t),S}function readableByteStreamControllerPullSteps(t,n){let S=t[zr].stream;if(t[zr].queueTotalSize>0){readableByteStreamControllerFillReadRequestFromQueue(t,n);return}let C=t[zr].autoAllocateChunkSize;if(C!==void 0){let S;try{S=new ArrayBuffer(C)}catch(t){n[$r](t);return}let N={buffer:S,bufferByteLength:C,byteOffset:0,byteLength:C,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:`default`};t[zr].pendingPullIntos.push(N)}readableStreamAddReadRequest(S,n),readableByteStreamControllerCallPullIfNeeded(t)}function setupReadableByteStreamController(t,n,S,C,N,F,I){n[zr]={cancelAlgorithm:N,closeRequested:!1,highWaterMark:F,pullAgain:!1,pullAlgorithm:C,pulling:!1,queue:[],queueTotalSize:0,started:!1,stream:t,byobRequest:null,pendingPullIntos:[],autoAllocateChunkSize:I},t[zr].controller=n;let H=S();new Promise(t=>t(H)).then(()=>{n[zr].started=!0,readableByteStreamControllerCallPullIfNeeded(n)},t=>readableByteStreamControllerError(n,t))}function setupReadableByteStreamControllerFromSource(t,n,S){let C=new ReadableByteStreamController(ni),N=n?.start,F=n?.pull,I=n?.cancel,H=n?.autoAllocateChunkSize;if(H!==void 0&&(H===0||!Number.isInteger(H)||H<0))throw TypeError(`autoAllocateChunkSize must be a positive integer`);setupReadableByteStreamController(t,C,N?N.bind(n,C):nonOpStart,F?createPromiseCallback(`source.pull`,F,n):nonOpPull,I?createPromiseCallback(`source.cancel`,I,n):nonOpCancel,S,H)}function readableByteStreamTee(t){let n=new ReadableStreamDefaultReader(t),S=!1,C=!1,N=!1,F,I,H=Promise.withResolvers(),W,q,Y,X;function pullAlgorithm(){return S?Promise.resolve():(S=!0,n.read().then(t=>{if(S=!1,t.done){C||Y.close(),N||X.close();return}let n=t.value,F=new Uint8Array(n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength));C||Y.enqueue(F),N||X.enqueue(new Uint8Array(F))},()=>{}),Promise.resolve())}return W=new ReadableStream$1({type:`bytes`,pull:pullAlgorithm,cancel(n){if(C=!0,F=n,N){let n=readableStreamCancel(t,[F,I]);return H.resolve(),n}return H.promise}}),q=new ReadableStream$1({type:`bytes`,pull:pullAlgorithm,cancel(n){if(N=!0,I=n,C){let n=readableStreamCancel(t,[F,I]);return H.resolve(),n}return H.promise}}),Y=W[zr].controller,X=q[zr].controller,n.closed.catch(t=>{Y.error(t),X.error(t),(!C||!N)&&H.resolve()}),[W,q]}const fi=Symbol(`kSkipThrow`);var TransformStream=class{[Br]=`TransformStream`;[zr];constructor(t={},n={},S={}){if(t!=null&&typeof t!=`object`)throw TypeError(`transformer must be an object`);if(n!=null&&typeof n!=`object`)throw TypeError(`writableStrategy must be an object`);if(S!=null&&typeof S!=`object`)throw TypeError(`readableStrategy must be an object`);let C=t?.readableType,N=t?.writableType,F=t?.start;if(C!==void 0)throw RangeError(`Invalid readableType: ${C}`);if(N!==void 0)throw RangeError(`Invalid writableType: ${N}`);let I=extractHighWaterMark(S?.highWaterMark,0),H=extractSizeAlgorithm(S?.size),W=extractHighWaterMark(n?.highWaterMark,1),q=extractSizeAlgorithm(n?.size),Y=Promise.withResolvers();initializeTransformStream(this,Y,W,q,I,H),setupTransformStreamDefaultControllerFromTransformer(this,t),F===void 0?Y.resolve():Y.resolve(F.call(t,this[zr].controller))}get readable(){if(!pi(this))throw TypeError(`Invalid this`);return this[zr].readable}get writable(){if(!pi(this))throw TypeError(`Invalid this`);return this[zr].writable}get[Symbol.toStringTag](){return`TransformStream`}},TransformStreamDefaultController=class{[Br]=`TransformStreamDefaultController`;[zr];constructor(t){if(t!==fi)throw TypeError(`Illegal constructor`)}get desiredSize(){if(!mi(this))throw TypeError(`Invalid this`);let{stream:t}=this[zr],{readable:n}=t[zr],S=n[zr].controller;return readableStreamDefaultControllerGetDesiredSize(S)}enqueue(t){if(!mi(this))throw TypeError(`Invalid this`);transformStreamDefaultControllerEnqueue(this,t)}error(t){if(!mi(this))throw TypeError(`Invalid this`);transformStreamDefaultControllerError(this,t)}terminate(){if(!mi(this))throw TypeError(`Invalid this`);transformStreamDefaultControllerTerminate(this)}get[Symbol.toStringTag](){return`TransformStreamDefaultController`}};const pi=isBrandCheck(`TransformStream`),mi=isBrandCheck(`TransformStreamDefaultController`);async function defaultTransformAlgorithm(t,n){transformStreamDefaultControllerEnqueue(n,t)}function initializeTransformStream(t,n,S,C,N,F){let startAlgorithm=()=>n.promise,I=createWritableStream(startAlgorithm,n=>transformStreamDefaultSinkWriteAlgorithm(t,n),()=>transformStreamDefaultSinkCloseAlgorithm(t),n=>transformStreamDefaultSinkAbortAlgorithm(t,n),S,C);t[zr]={readable:createReadableStream(startAlgorithm,()=>transformStreamDefaultSourcePullAlgorithm(t),n=>transformStreamDefaultSourceCancelAlgorithm(t,n),N,F),writable:I,controller:void 0,backpressure:void 0,backpressureChange:{promise:void 0,resolve:void 0,reject:void 0}},transformStreamSetBackpressure(t,!0)}function transformStreamError(t,n){let{readable:S}=t[zr];readableStreamDefaultControllerError(S[zr].controller,n),transformStreamErrorWritableAndUnblockWrite(t,n)}function transformStreamErrorWritableAndUnblockWrite(t,n){let{controller:S,writable:C}=t[zr];transformStreamDefaultControllerClearAlgorithms(S),writableStreamDefaultControllerErrorIfNeeded(C[zr].controller,n),transformStreamUnblockWrite(t)}function transformStreamUnblockWrite(t){t[zr].backpressure&&transformStreamSetBackpressure(t,!1)}function transformStreamSetBackpressure(t,n){t[zr].backpressureChange.promise!==void 0&&t[zr].backpressureChange.resolve?.(),t[zr].backpressureChange=Promise.withResolvers(),t[zr].backpressure=n}function setupTransformStreamDefaultController(t,n,S,C,N){n[zr]={stream:t,transformAlgorithm:S,flushAlgorithm:C,cancelAlgorithm:N,finishPromise:void 0},t[zr].controller=n}function setupTransformStreamDefaultControllerFromTransformer(t,n){let S=new TransformStreamDefaultController(fi),C=n?.transform,N=n?.flush,F=n?.cancel;setupTransformStreamDefaultController(t,S,C?createPromiseCallback(`transformer.transform`,C,n):defaultTransformAlgorithm,N?createPromiseCallback(`transformer.flush`,N,n):nonOpFlush,F?createPromiseCallback(`transformer.cancel`,F,n):nonOpCancel)}function transformStreamDefaultControllerClearAlgorithms(t){t[zr].transformAlgorithm=void 0,t[zr].flushAlgorithm=void 0,t[zr].cancelAlgorithm=void 0}function transformStreamDefaultControllerEnqueue(t,n){let{stream:S}=t[zr],{readable:C}=S[zr],N=C[zr].controller;if(!readableStreamDefaultControllerCanCloseOrEnqueue(N))throw TypeError(`Unable to enqueue`);try{readableStreamDefaultControllerEnqueue(N,n)}catch(t){throw transformStreamErrorWritableAndUnblockWrite(S,t),C[zr].storedError}readableStreamDefaultControllerHasBackpressure(N)!==S[zr].backpressure&&transformStreamSetBackpressure(S,!0)}function transformStreamDefaultControllerError(t,n){transformStreamError(t[zr].stream,n)}async function transformStreamDefaultControllerPerformTransform(t,n){try{let S=t[zr].transformAlgorithm;if(S===void 0)return;await S(n,t)}catch(n){throw transformStreamError(t[zr].stream,n),n}}function transformStreamDefaultControllerTerminate(t){let{stream:n}=t[zr],{readable:S}=n[zr];readableStreamDefaultControllerClose(S[zr].controller),transformStreamErrorWritableAndUnblockWrite(n,TypeError(`TransformStream has been terminated`))}function transformStreamDefaultSinkWriteAlgorithm(t,n){let{controller:S}=t[zr];return t[zr].backpressure?t[zr].backpressureChange.promise.then(()=>{let{writable:C}=t[zr];if(C[zr].state===`erroring`)throw C[zr].storedError;return transformStreamDefaultControllerPerformTransform(S,n)}):transformStreamDefaultControllerPerformTransform(S,n)}async function transformStreamDefaultSinkAbortAlgorithm(t,n){let{controller:S,readable:C}=t[zr];if(S[zr].finishPromise!==void 0)return S[zr].finishPromise;let{promise:N,resolve:F,reject:I}=Promise.withResolvers();S[zr].finishPromise=N;let H=S[zr].cancelAlgorithm(n);return transformStreamDefaultControllerClearAlgorithms(S),H.then(()=>{C[zr].state===`errored`?I(C[zr].storedError):(readableStreamDefaultControllerError(C[zr].controller,n),F())},t=>{readableStreamDefaultControllerError(C[zr].controller,t),I(t)}),S[zr].finishPromise}function transformStreamDefaultSinkCloseAlgorithm(t){let{readable:n,controller:S}=t[zr];if(S[zr].finishPromise!==void 0)return S[zr].finishPromise;let{promise:C,resolve:N,reject:F}=Promise.withResolvers();S[zr].finishPromise=C;let I=S[zr].flushAlgorithm(S);return transformStreamDefaultControllerClearAlgorithms(S),I.then(()=>{n[zr].state===`errored`?F(n[zr].storedError):(readableStreamDefaultControllerClose(n[zr].controller),N())},t=>{readableStreamDefaultControllerError(n[zr].controller,t),F(t)}),S[zr].finishPromise}function transformStreamDefaultSourcePullAlgorithm(t){return transformStreamSetBackpressure(t,!1),t[zr].backpressureChange.promise}function transformStreamDefaultSourceCancelAlgorithm(t,n){let{controller:S,writable:C}=t[zr];if(S[zr].finishPromise!==void 0)return S[zr].finishPromise;let{promise:N,resolve:F,reject:I}=Promise.withResolvers();S[zr].finishPromise=N;let H=S[zr].cancelAlgorithm(n);return transformStreamDefaultControllerClearAlgorithms(S),H.then(()=>{C[zr].state===`errored`?I(C[zr].storedError):(writableStreamDefaultControllerErrorIfNeeded(C[zr].controller,n),transformStreamUnblockWrite(t),F())},n=>{writableStreamDefaultControllerErrorIfNeeded(C[zr].controller,n),transformStreamUnblockWrite(t),I(n)}),S[zr].finishPromise}const hi=Object.defineProperty(t=>t.byteLength,"name",{value:`size`}),_i=Object.defineProperty(()=>1,"name",{value:`size`});var ByteLengthQueuingStrategy=class{#e;constructor(t){if(typeof t!=`object`||!t)throw TypeError(`init must be an object`);if(t.highWaterMark===void 0)throw TypeError(`init.highWaterMark is required`);this.#e=+t.highWaterMark}get highWaterMark(){return this.#e}get size(){return hi}get[Symbol.toStringTag](){return`ByteLengthQueuingStrategy`}},CountQueuingStrategy=class{#e;constructor(t){if(typeof t!=`object`||!t)throw TypeError(`init must be an object`);if(t.highWaterMark===void 0)throw TypeError(`init.highWaterMark is required`);this.#e=+t.highWaterMark}get highWaterMark(){return this.#e}get size(){return _i}get[Symbol.toStringTag](){return`CountQueuingStrategy`}},TextEncoderStream=class{#e=null;#t=new TextEncoder;#n;constructor(){this.#n=new TransformStream({transform:(t,n)=>{if(t=String(t),t===``)return;this.#e!==null&&(t=this.#e+t);let S=t.charCodeAt(t.length-1);55296<=S&&S<=56319?(this.#e=t.slice(-1),t=t.slice(0,-1)):this.#e=null,t&&n.enqueue(this.#t.encode(t))},flush:t=>{this.#e!==null&&t.enqueue(new Uint8Array([239,191,189]))}})}get encoding(){return`utf-8`}get readable(){return this.#n.readable}get writable(){return this.#n.writable}};function hasStreamingSupport(){try{return new TextDecoder().decode(new Uint8Array([195]),{stream:!0}),!0}catch{return!1}}const vi=hasStreamingSupport();function incompleteUtf8Tail$1(t){let n=t.length;if(n===0)return 0;for(let S=1;S<=Math.min(3,n);S++){let C=t[n-S];if(!(C&128))return 0;if((C&192)!=128){let t;if((C&224)==192)t=2;else if((C&240)==224)t=3;else if((C&248)==240)t=4;else return 0;return S<t?S:0}}return 0}__name$1(incompleteUtf8Tail$1,`incompleteUtf8Tail`);var TextDecoderStream=class{#e;#t;constructor(t,n){if(this.#e=new TextDecoder(t,n),vi)this.#t=new TransformStream({transform:(t,n)=>{let S=toUint8Array$3(t),C=this.#e.decode(S,{stream:!0});C&&n.enqueue(C)},flush:t=>{let n=this.#e.decode();n&&t.enqueue(n)},cancel:()=>{this.#e.decode()}});else{let t=new Uint8Array;this.#t=new TransformStream({transform:(n,S)=>{let C=toUint8Array$3(n),N;t.length>0?(N=new Uint8Array(t.length+C.length),N.set(t,0),N.set(C,t.length)):N=C;let F=incompleteUtf8Tail$1(N),I;if(F>0?(I=N.slice(0,N.length-F),t=N.slice(N.length-F)):(I=N,t=new Uint8Array),I.length>0){let t=this.#e.decode(I);t&&S.enqueue(t)}},flush:n=>{if(t.length>0){let S=this.#e.decode(t);S&&n.enqueue(S),t=new Uint8Array}},cancel:()=>{t=new Uint8Array}})}}get encoding(){return this.#e.encoding}get fatal(){return this.#e.fatal}get ignoreBOM(){return this.#e.ignoreBOM}get readable(){return this.#t.readable}get writable(){return this.#t.writable}};function toUint8Array$3(t){if(t instanceof Uint8Array)return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw TypeError(`chunk must be a BufferSource`)}__name$1(toUint8Array$3,`toUint8Array`);function isNativeStreamUsable$3(t,n){try{return typeof t==`function`?typeof t.prototype?.[n]==`function`:!1}catch{return!1}}__name$1(isNativeStreamUsable$3,`isNativeStreamUsable`);const yi=isNativeStreamUsable$3(globalThis.ReadableStream,`getReader`)?globalThis.ReadableStream:ReadableStream$1,bi=isNativeStreamUsable$3(globalThis.WritableStream,`getWriter`)?globalThis.WritableStream:WritableStream,xi=isNativeStreamUsable$3(globalThis.TransformStream,`readable`)?globalThis.TransformStream:TransformStream,Si=typeof globalThis.ByteLengthQueuingStrategy==`function`?globalThis.ByteLengthQueuingStrategy:ByteLengthQueuingStrategy,Ci=typeof globalThis.CountQueuingStrategy==`function`?globalThis.CountQueuingStrategy:CountQueuingStrategy,wi=typeof globalThis.TextEncoderStream==`function`?globalThis.TextEncoderStream:TextEncoderStream,Ti=typeof globalThis.TextDecoderStream==`function`?globalThis.TextDecoderStream:TextDecoderStream;function withCode(t,n){return Object.assign(t,{code:n})}function addNumericalSeparator(t){let n=``,S=t.length,C=+(t[0]===`-`);for(;S>=C+4;S-=3)n=`_${t.slice(S-3,S)}${n}`;return`${t.slice(0,S)}${n}`}function formatReceivedNumber(t){return Number.isInteger(t)&&Math.abs(t)>2**32?addNumericalSeparator(String(t)):Object.is(t,-0)?`-0`:String(t)}function describeType(t){if(t===null)return`null`;switch(typeof t){case`bigint`:return`type bigint (${t}n)`;case`boolean`:return`type boolean (${t})`;case`symbol`:return`type symbol (${String(t)})`;case`function`:return`function ${t.name}`;case`string`:{let n=t.length>28?`${t.slice(0,25)}...`:t;return n.includes(`'`)?`type string (${JSON.stringify(n)})`:`type string ('${n}')`}default:{let n=t.constructor;return n?.name?`an instance of ${n.name}`:`type ${typeof t}`}}}function outOfRange(t,n){return withCode(RangeError(`The value of "${Di}" is out of range. It must be ${t}. Received ${formatReceivedNumber(n)}`),`ERR_OUT_OF_RANGE`)}function resolveMaxOutputLength(t){let n=t?.maxOutputLength;if(n===void 0)return Ei;if(typeof n!=`number`)throw withCode(TypeError(`The "${Di}" property must be of type number. Received ${describeType(n)}`),`ERR_INVALID_ARG_TYPE`);if(Number.isNaN(n))return Ei;if(!Number.isFinite(n))throw outOfRange(`a finite number`,n);if(n<1||n>Ei)throw outOfRange(`>= 1 and <= ${Ei}`,n);return n}function bufferTooLargeError(t){return withCode(RangeError(`Cannot create a Buffer larger than ${t} bytes`),`ERR_BUFFER_TOO_LARGE`)}function isBufferTooLargeError(t){return t instanceof RangeError&&t.code===`ERR_BUFFER_TOO_LARGE`}function remainingReadBudget(t,n){return Math.floor(t-n)+1}var Ei,Di,Oi=__esmMin(()=>{Ei=2**53-1,Di=`options.maxOutputLength`}),ki,Ai=__esmMin(()=>{ki=n}),ji,Mi=__esmMin(()=>{Ai(),ji=ki});function getGioFormat(t){switch(t){case`gzip`:return ji.ZlibCompressorFormat.GZIP;case`deflate`:return ji.ZlibCompressorFormat.ZLIB;case`deflate-raw`:return ji.ZlibCompressorFormat.RAW}}function hasGzipMagic(t,n=0){return t.length-n>=2&&t[n]===31&&t[n+1]===139}function concat$2(t){let n=t.reduce((t,n)=>t+n.length,0),S=new Uint8Array(n),C=0;for(let n of t)S.set(n,C),C+=n.length;return S}function assertLevel(t){if(!(t>=-1&&t<=9))throw RangeError(`The value of "level" is out of range. It must be >= -1 and <= 9. Received ${t}`)}function compressWithGio(t,n,S=-1){assertLevel(S);let C=new ji.ZlibCompressor({format:getGioFormat(n),level:Math.trunc(S)}),N=new ji.ConverterOutputStream({base_stream:ji.MemoryOutputStream.new_resizable(),converter:C});N.write_bytes(new vt.Bytes(t),null),N.close(null);let F=N.get_base_stream().steal_as_bytes();return new Uint8Array(F.get_data()??[])}function decompressStreamWithGio(t,n,S=Ei,C=0){let N=new ji.ZlibDecompressor({format:getGioFormat(n)}),F=ji.MemoryInputStream.new_from_bytes(new vt.Bytes(t)),I=new ji.ConverterInputStream({base_stream:F,converter:N}),H=[],W=C;try{for(;;){let t=Math.min(Pi,remainingReadBudget(S,W)),n=I.read_bytes(t,null),C=n.get_size();if(C===0)break;if(W+=C,W>S)throw bufferTooLargeError(S);H.push(new Uint8Array(n.get_data()))}}finally{I.close(null)}return concat$2(H)}function findGzipMemberEnd(t,n=1/0){let S=new ji.ZlibDecompressor({format:ji.ZlibCompressorFormat.GZIP}),C=new Uint8Array(262144),N=0,F=0;for(;;){let I=t.subarray(N,N+Ni);try{let[t,H,W]=S.convert(I,C,ji.ConverterFlags.NONE);if(N+=H,F+=W,t===ji.ConverterResult.FINISHED||F>n||H===0&&W===0)return N}catch{return N}}}function gunzipWithGio(t,n=Ei){let S=[],C=0,N=0;for(;hasGzipMagic(t,C);){let F=t.subarray(C),I=findGzipMemberEnd(F,n-N);if(I<=0)break;let H=decompressStreamWithGio(F.subarray(0,I),`gzip`,n,N);S.push(H),N+=H.length,C+=I}return S.length===0?decompressStreamWithGio(t,`gzip`,n):concat$2(S)}var Ni,Pi,Fi=__esmMin(()=>{Oi(),Mi(),yt(),Ni=256*1024,Pi=1024*1024,__name$1(concat$2,`concat`)}),Ii=__esmMin(()=>{Ye()}),Li,Ri,zi=__esmMin(()=>{Li=Object.defineProperty,Ri=__name$1((t,n)=>{let S={};for(var C in t)Li(S,C,{get:t[C],enumerable:!0});return n||Li(S,Symbol.toStringTag,{value:`Module`}),S},`__exportAll`)});function _setPipeImpl(t){Bi=t}var Bi,Stream_,Vi=__esmMin(()=>{nn(),Stream_=class extends Gt{constructor(t){super(t)}pipe(t,n){return Bi(this,t,n)}}});function finished$1(t,n,S){let C;C=typeof n==`function`?n:S;let N=!1;function done(t){N||(N=!0,C(t))}let onFinish=()=>done(),onEnd=()=>done(),onError=t=>done(t),onClose=()=>{let n=t,S=t;!n.writableFinished&&!S.readableEnded&&done(Error(`premature close`))};t.on(`finish`,onFinish),t.on(`end`,onEnd),t.on(`error`,onError),t.on(`close`,onClose);let F=t,I=typeof t.write==`function`,H=typeof t.read==`function`,W=F.writableFinished===!0,q=F.readableEnded===!0;if(F.destroyed===!0){let t=F._err;ve(t?()=>done(t):I&&W||H&&q?()=>done():()=>done(Error(`premature close`)))}else(I&&!H&&W||!I&&H&&q||I&&H&&W&&q)&&ve(()=>done());return function cleanup(){t.removeListener(`finish`,onFinish),t.removeListener(`end`,onEnd),t.removeListener(`error`,onError),t.removeListener(`close`,onClose)}}function addAbortSignal(t,n){if(!(t instanceof AbortSignal))throw TypeError(`The first argument must be an AbortSignal`);if(!(n instanceof Stream_))throw TypeError(`The second argument must be a Stream`);let S=n;if(t.aborted)S.destroy(Error(`The operation was aborted`));else{let onAbort=()=>{S.destroy(Error(`The operation was aborted`))};t.addEventListener(`abort`,onAbort,{once:!0}),n.once(`close`,()=>{t.removeEventListener(`abort`,onAbort)})}return n}function isReadable(t){if(t==null)return!1;let n=t;return typeof n.readable!=`boolean`||typeof n.read!=`function`||n.destroyed===!0||n.readableEnded===!0?!1:n.readable===!0}function isWritable(t){if(t==null)return!1;let n=t;return typeof n.writable!=`boolean`||typeof n.write!=`function`||n.destroyed===!0||n.writableEnded===!0?!1:n.writable===!0}function isDestroyed(t){return t==null?!1:t.destroyed===!0}function isDisturbed(t){if(t==null)return!1;let n=t;return n.readableDidRead===!0||n.readableFlowing!==null&&n.readableFlowing!==void 0}function isErrored(t){if(t==null)return!1;let n=t;return n.destroyed===!0&&typeof n.readable==`boolean`&&n.readable===!1||n.destroyed===!0&&typeof n.writable==`boolean`&&n.writable===!1}var Hi=__esmMin(()=>{Vi(),Ye(),__name$1(finished$1,`finished`)});function getDefaultHighWaterMark(t){return t?Wi:Ui}function setDefaultHighWaterMark(t,n){if(typeof n!=`number`||n<0||Number.isNaN(n))throw TypeError(`Invalid highWaterMark: ${n}`);t?Wi=n:Ui=n}function validateHighWaterMark(t,n){if(n!==void 0&&(typeof n!=`number`||Number.isNaN(n))){let S=TypeError(`The value of "${t}" is invalid. Received ${n}`);throw S.code=`ERR_INVALID_ARG_VALUE`,S}}var Ui,Wi,Gi=__esmMin(()=>{Ui=16384,Wi=16});function createAbortError(){let t=Error(`The operation was aborted`);return t.name=`AbortError`,t.code=`ABORT_ERR`,t}async function streamAsyncDispose(t,n){let S;t.destroyed||(S=n?void 0:createAbortError(),t.destroy(S)),await new Promise((n,C)=>{finished$1(t,t=>{t&&t!==S?C(t):n()})})}var Ki,qi=__esmMin(()=>{Hi(),Ki=Symbol.asyncDispose??Symbol.for(`Symbol.asyncDispose`)});function chunkLength(t){if(t==null)return 1;let n=t.length;return typeof n==`number`?n:1}function sliceChunk(t,n,S){if(typeof t==`string`)return S===void 0?t.slice(n):t.slice(n,S);let C=t.slice;return typeof C==`function`?C.call(t,n,S):t}var Ji,Yi,Xi,Zi=__esmMin(()=>{Vi(),qi(),Gi(),Ye(),Ji=class Readable_ extends Stream_{readable=!0;readableFlowing=null;readableLength=0;readableHighWaterMark;readableEncoding;readableObjectMode;readableEnded=!1;readableAborted=!1;destroyed=!1;_pipeDests=[];_buffer=[];_readableState={ended:!1,endEmitted:!1,reading:!1,constructed:!0,highWaterMark:0,objectMode:!1,pipes:[]};_err;_readablePending=!1;_readImpl;_constructImpl;constructor(t){super(t),this.readableHighWaterMark=t?.highWaterMark??getDefaultHighWaterMark(t?.objectMode??!1),this.readableEncoding=t?.encoding??null,this.readableObjectMode=t?.objectMode??!1,this._readableState.highWaterMark=this.readableHighWaterMark,this._readableState.objectMode=this.readableObjectMode,t?.read&&(this._readImpl=t.read),t?.destroy&&(this._destroy=t.destroy),t?.construct&&(this._constructImpl=t.construct),(this._constructImpl||this._construct!==Readable_.prototype._construct)&&(this._readableState.constructed=!1,nextTick(()=>{this._construct(t=>{this._readableState.constructed=!0,t?this.destroy(t):this.readableFlowing===!0&&this._flow()})}))}_construct(t){this._constructImpl?this._constructImpl.call(this,t):t()}_read(t){this._readImpl&&this._readImpl.call(this,t)}read(t){if(!this._readableState.constructed)return null;if(this._buffer.length===0){if(this._readableState.ended)return null;this._readableState.reading=!0,this._read(t??this.readableHighWaterMark),this._readableState.reading=!1}if(this._buffer.length===0||t===0)return null;if(this.readableObjectMode){if(t===void 0){let t=this._buffer.shift();return--this.readableLength,this._readableState.ended&&this._buffer.length===0&&!this._readableState.endEmitted&&this._emitEnd(),t}if(t>this.readableLength)return null;let n=this._buffer.shift();return--this.readableLength,n}if(t!=null)return t>this.readableLength?null:this._readBytes(t);let n=this._buffer.splice(0);if(this.readableLength=0,this._readableState.ended&&this._buffer.length===0&&!this._readableState.endEmitted&&this._emitEnd(),n.length===1)return n[0];if(n.length===0)return null;if(typeof n[0]==`string`)return n.join(``);let S=globalThis.Buffer;return S?.concat?S.concat(n):n}_readBytes(t){let n=0,S=[];for(;n<t&&this._buffer.length>0;){let C=this._buffer[0],N=chunkLength(C);if(n+N<=t)S.push(this._buffer.shift()),n+=N,this.readableLength-=N;else{let N=t-n;S.push(sliceChunk(C,0,N)),this._buffer[0]=sliceChunk(C,N),this.readableLength-=N,n+=N}}if(S.length===1)return S[0];let C=globalThis.Buffer;return C?.concat?C.concat(S):S}push(t,n){if(t===null)return this._readableState.ended=!0,this.readableEnded=!0,this._buffer.length===0&&!this._readableState.endEmitted&&nextTick(()=>this._emitEnd()),this._scheduleReadable(),!1;if(!this.readableObjectMode&&!(typeof t==`string`||ArrayBuffer.isView(t))){let n=Object.assign(TypeError(`Invalid non-string/buffer chunk type: ${typeof t}`),{code:`ERR_INVALID_ARG_TYPE`});return nextTick(()=>this.emit(`error`,n)),!1}return this._buffer.push(t),this.readableLength+=this.readableObjectMode?1:chunkLength(t),this.readableFlowing&&!this._flowing&&nextTick(()=>this._flow()),this.readableFlowing!==!0&&this._scheduleReadable(),this.readableLength<this.readableHighWaterMark}_emitEnd(){this._readableState.endEmitted||(this._readableState.endEmitted=!0,this.emit(`end`),nextTick(()=>this._autoClose()))}_autoClose(){this.emit(`close`)}_scheduleReadable(){this._readablePending||this.listenerCount(`readable`)===0||(this._readablePending=!0,nextTick(()=>{this._readablePending=!1,this.destroyed||this.emit(`readable`)}))}on(t,n){return super.on(t,n),t===`data`&&this.readableFlowing!==!1&&this.listenerCount(`readable`)===0&&this.resume(),t===`readable`&&(this.readableFlowing=!1,this._buffer.length>0||this._readableState.ended?this._scheduleReadable():this._readableState.reading||nextTick(()=>{this.destroyed||this.read(0)})),this}removeListener(t,n){let S=super.removeListener(t,n);return t===`readable`&&nextTick(()=>this._updateReadableListening()),S}removeAllListeners(t){let n=t===void 0?super.removeAllListeners():super.removeAllListeners(t);return(t===`readable`||t===void 0)&&nextTick(()=>this._updateReadableListening()),n}_updateReadableListening(){this.listenerCount(`readable`)>0||(this.listenerCount(`data`)>0?this.resume():this.readableFlowing=null)}unshift(t){this._buffer.unshift(t),this.readableLength+=this.readableObjectMode?1:chunkLength(t)}setEncoding(t){return this.readableEncoding=t,this}pause(){return this.readableFlowing=!1,this.emit(`pause`),this}resume(){return this.readableFlowing!==!0&&(this.readableFlowing=!0,this.emit(`resume`),this._readableState.constructed&&this._flow()),this}_flowing=!1;_flow(){if(!(this.readableFlowing!==!0||this._flowing||this.destroyed)&&this._readableState.constructed){this._flowing=!0;try{for(;this._buffer.length>0&&this.readableFlowing&&!this.destroyed;){let t=this._buffer.shift();if(this.readableLength-=this.readableObjectMode?1:chunkLength(t),this.readableEncoding&&typeof t!=`string`){let n=globalThis.Buffer;n?.isBuffer&&n.isBuffer(t)?t=t.toString(this.readableEncoding):t instanceof Uint8Array&&(t=new TextDecoder(this.readableEncoding).decode(t))}this.emit(`data`,t)}if(this.destroyed)return;if(this._readableState.ended&&this._buffer.length===0&&!this._readableState.endEmitted){nextTick(()=>this._emitEnd());return}!this._readableState.ended&&!this._readableState.reading&&!this.destroyed&&(this._readableState.reading=!0,this._read(this.readableHighWaterMark),this._readableState.reading=!1)}finally{this._flowing=!1}this._buffer.length>0&&this.readableFlowing&&!this.destroyed&&nextTick(()=>this._flow())}}isPaused(){return this.readableFlowing===!1}unpipe(t){if(t){let n=this._pipeDests.findIndex(n=>n.dest===t);if(n!==-1){this._pipeDests[n].cleanup(),this._pipeDests.splice(n,1);let S=this._readableState.pipes.indexOf(t);S!==-1&&this._readableState.pipes.splice(S,1),t.emit(`unpipe`,this),this._pipeDests.length===0&&(this.readableFlowing=!1)}}else{for(let t of this._pipeDests)t.cleanup(),t.dest.emit(`unpipe`,this);this._pipeDests=[],this._readableState.pipes=[],this.readableFlowing=!1}return this}_destroy(t,n){n(t??void 0)}destroy(t){if(this.destroyed)return this;this.destroyed=!0,this.readable=!1,this.readableAborted=!this.readableEnded,t&&(this._err=t);let n=!1,cb=t=>{n||(n=!0,t&&nextTick(()=>this.emit(`error`,t)),nextTick(()=>this.emit(`close`)))};try{this._destroy(t??null,cb)}catch(t){cb(t)}return this}static toWeb(t){return new ReadableStream({start(n){t.on(`data`,t=>{typeof t==`string`?n.enqueue(new TextEncoder().encode(t)):t instanceof Uint8Array?n.enqueue(t):t&&typeof t.length==`number`&&n.enqueue(new Uint8Array(t))}),t.on(`end`,()=>{n.close()}),t.on(`error`,t=>{n.error(t)})},cancel(){t.destroy()}})}static fromWeb(t,n){let S=t.getReader();return new Readable_({...n,read(){S.read().then(({done:t,value:n})=>{t?this.push(null):this.push(n)},t=>{this.destroy(t)})},destroy(t,n){S.cancel(t?.message).then(()=>n(null),n)}})}[Symbol.asyncIterator](){let t=this,n=[],S=!1,C=null,N=null,F=null;return t.on(`data`,t=>{if(N){let n=N;N=null,F=null,n({value:t,done:!1})}else n.push(t)}),t.on(`end`,()=>{if(S=!0,N){let t=N;N=null,F=null,t({value:void 0,done:!0})}}),t.on(`error`,t=>{if(C=t,S=!0,F){let n=F;N=null,F=null,n(t)}}),{next(){return C?Promise.reject(C):n.length>0?Promise.resolve({value:n.shift(),done:!1}):S?Promise.resolve({value:void 0,done:!0}):new Promise((t,n)=>{N=t,F=n})},return(){return t.destroy(),Promise.resolve({value:void 0,done:!0})},[Symbol.asyncIterator](){return this}}}static from(t,n){let S=new Readable_({objectMode:!0,...n,read(){}});return typeof t==`string`||ArrayBuffer.isView(t)?(S.push(t),S.push(null),S):((async()=>{try{for await(let n of t)S.push(n)||await new Promise(t=>S.once(`drain`,t));S.push(null)}catch(t){S.destroy(t)}})(),S)}},Ji.prototype[Ki]=function(){return streamAsyncDispose(this,this.readableEnded)},Yi=Object.getOwnPropertyDescriptor(Ji.prototype,`on`),Xi=Object.getOwnPropertyDescriptor(Ji.prototype,`removeListener`),Object.defineProperty(Ji.prototype,"addListener",{...Yi}),Object.defineProperty(Ji.prototype,"off",{...Xi})});function writeAfterEndError(){let t=Error(`write after end`);return t.code=`ERR_STREAM_WRITE_AFTER_END`,t}var Qi=__esmMin(()=>{});function chunkLen$1(t){if(t==null)return 1;let n=t.length;return typeof n==`number`?n:1}var Duplex_,$i=__esmMin(()=>{Qi(),Gi(),Zi(),Ye(),Duplex_=class extends Ji{writable=!0;writableHighWaterMark;writableLength=0;writableObjectMode;writableEnded=!1;writableFinished=!1;writableCorked=0;writableNeedDrain=!1;allowHalfOpen;_decodeStrings;_writableState={highWaterMark:0,objectMode:!1};_duplexCorkedBuffer=[];_duplexWriting=!1;_duplexWriteQueue=[];_writeImpl;_finalImpl;_defaultEncoding=`utf8`;_pendingWrites=0;_pendingEndCb=null;_autoClosed=!1;constructor(t){super(t),validateHighWaterMark(`writableHighWaterMark`,t?.writableHighWaterMark),validateHighWaterMark(`readableHighWaterMark`,t?.readableHighWaterMark),this.writableObjectMode=t?.writableObjectMode??t?.objectMode??!1,this.writableHighWaterMark=t?.highWaterMark??t?.writableHighWaterMark??getDefaultHighWaterMark(this.writableObjectMode),this._writableState.highWaterMark=this.writableHighWaterMark,this._writableState.objectMode=this.writableObjectMode,t?.highWaterMark===void 0&&t?.readableHighWaterMark!==void 0&&(this.readableHighWaterMark=t.readableHighWaterMark,this._readableState.highWaterMark=t.readableHighWaterMark),t?.readableObjectMode!==void 0&&(this.readableObjectMode=t.readableObjectMode,this._readableState.objectMode=t.readableObjectMode,t?.readableHighWaterMark===void 0&&t?.highWaterMark===void 0&&(this.readableHighWaterMark=getDefaultHighWaterMark(t.readableObjectMode),this._readableState.highWaterMark=this.readableHighWaterMark)),this.allowHalfOpen=t?.allowHalfOpen!==!1,this._decodeStrings=t?.decodeStrings!==!1,t?.write&&(this._writeImpl=t.write),t?.final&&(this._finalImpl=t.final),this.allowHalfOpen||this.once(`end`,()=>{this.writableEnded||nextTick(()=>this.end())})}_write(t,n,S){this._writeImpl?this._writeImpl.call(this,t,n,S):S()}_final(t){this._finalImpl?this._finalImpl.call(this,t):t()}destroy(t){return this.destroyed?this:(this.writable=!1,super.destroy(t))}write(t,n,S){let C,N;if(typeof n==`function`?(C=n,N=this._defaultEncoding):(N=n??this._defaultEncoding,C=S??(()=>{})),this._decodeStrings&&!this.writableObjectMode&&typeof t==`string`){let n=globalThis.Buffer;n&&(t=n.from(t,N),N=`buffer`)}if(typeof t!=`string`&&!this.writableObjectMode){let n=globalThis.Buffer;(n&&n.isBuffer(t)||t instanceof Uint8Array)&&(N=`buffer`)}if(this.writableEnded){let t=writeAfterEndError();return nextTick(()=>{C(t),this.emit(`error`,t),this.destroy()}),!1}if(this.writableLength+=this.writableObjectMode?1:chunkLen$1(t),this.writableCorked>0)return this._duplexCorkedBuffer.push({chunk:t,encoding:N,callback:C}),this.writableLength<this.writableHighWaterMark;let F=this.writableLength<this.writableHighWaterMark;return F||(this.writableNeedDrain=!0),this._duplexDoWrite(t,N,C),F}_duplexDoWrite(t,n,S){if(this._duplexWriting){this._duplexWriteQueue.push({chunk:t,encoding:n,callback:S});return}this._duplexWriting=!0,this._duplexStartWrite(t,n,S)}_duplexStartWrite(t,n,S){this._pendingWrites++,this._write(t,n,n=>{this._pendingWrites--,this.writableLength-=this.writableObjectMode?1:chunkLen$1(t),nextTick(n?()=>{if(S(n),this._duplexWriting=!1,this.destroyed||this.emit(`error`,n),this._duplexWriteQueue.length>0){let t=this._duplexWriteQueue.shift();this._duplexWriting=!0,this._duplexStartWrite(t.chunk,t.encoding,t.callback)}}:()=>{if(S(),this._duplexWriteQueue.length>0){let t=this._duplexWriteQueue.shift();this._duplexStartWrite(t.chunk,t.encoding,t.callback);return}if(this._duplexWriting=!1,this.writableNeedDrain&&this.writableLength<=this.writableHighWaterMark&&(this.writableNeedDrain=!1,this.emit(`drain`)),this._pendingWrites===0&&this._pendingEndCb){let t=this._pendingEndCb;this._pendingEndCb=null,t()}})})}end(t,n,S){typeof t==`function`&&(S=t,t=void 0),typeof n==`function`&&(S=n,n=void 0),t!=null&&this.write(t,n),this.writableEnded=!0;let doFinal=()=>{this._final(t=>{this.writableFinished=!0,this._doPrefinishHooks(()=>{nextTick(()=>{t&&this.emit(`error`,t),this.emit(`finish`),nextTick(()=>this._closeAfterFinish()),S&&S()})})})};return this._pendingWrites>0||this._duplexWriting||this._duplexWriteQueue.length>0?this._pendingEndCb=doFinal:doFinal(),this}_closeAfterFinish(){this._autoClosed||!this.destroyed&&!this._readableState.endEmitted&&this.readable||(this._autoClosed=!0,this.emit(`close`))}_autoClose(){this._autoClosed||(this._autoClosed=!0,this.emit(`close`))}_doPrefinishHooks(t){t()}cork(){this.writableCorked++}uncork(){if(this.writableCorked>0&&(this.writableCorked--,this.writableCorked===0&&this._duplexCorkedBuffer.length>0)){let t=this._duplexCorkedBuffer.splice(0);for(let{chunk:n,encoding:S,callback:C}of t)this._write(n,S,t=>{this.writableLength-=this.writableObjectMode?1:chunkLen$1(n),t?(C(t),this.destroyed||this.emit(`error`,t)):C()});this.writableNeedDrain&&this.writableLength<=this.writableHighWaterMark&&(this.writableNeedDrain=!1,nextTick(()=>this.emit(`drain`)))}}setDefaultEncoding(t){return this._defaultEncoding=t,this}},__name$1(chunkLen$1,`chunkLen`)});function pipe(t,n,S){let C=t,N=S?.end!==!1,F=!1,ondrain=()=>{F=!1,n.removeListener(`drain`,ondrain);let t=C;typeof t.resume==`function`&&t.resume()},ondata=t=>{if(n.writable){let S=C;n.write(t)===!1&&typeof S.pause==`function`&&(S.pause(),F||(F=!0,n.on(`drain`,ondrain)))}};C.on(`data`,ondata);let I=!1,onend=()=>{I||(I=!0,N&&n.end())},onclose=()=>{if(!I&&(I=!0,N&&!(C instanceof Ji))){let t=n;typeof t.destroy==`function`&&t.destroy()}};N&&(C.on(`end`,onend),C.on(`close`,onclose));let cleanup=()=>{C.removeListener(`data`,ondata),F&&n.removeListener(`drain`,ondrain),C.removeListener(`end`,onend),C.removeListener(`close`,onclose),C.removeListener(`end`,cleanup),C.removeListener(`close`,cleanup),n.removeListener(`close`,cleanup)};return C.on(`end`,cleanup),C.on(`close`,cleanup),n.on(`close`,cleanup),C instanceof Ji&&(C._pipeDests.push({dest:n,cleanup}),C._readableState.pipes.push(n)),n.emit(`pipe`,C),n}var ea=__esmMin(()=>{Vi(),Zi(),_setPipeImpl(pipe)});function chunkLen(t){if(t==null)return 1;let n=t.length;return typeof n==`number`?n:1}var ta,na=__esmMin(()=>{Qi(),Vi(),qi(),Gi(),Ye(),ta=class Writable_ extends Stream_{static[Symbol.hasInstance](t){let n=this;return n.prototype!==void 0&&Object.prototype.isPrototypeOf.call(n.prototype,t)?!0:n.prototype!==Writable_.prototype||t==null?!1:typeof t.writableHighWaterMark==`number`}writable=!0;writableHighWaterMark;writableLength=0;writableObjectMode;writableEnded=!1;writableFinished=!1;writableCorked=0;writableNeedDrain=!1;destroyed=!1;_err;_writableState={ended:!1,finished:!1,constructed:!0,writing:!1};_corkedBuffer=[];_writeBuffer=[];_pendingConstruct=[];_ending=!1;_endCallback;_pendingEnd=null;_writeImpl;_writev;_finalImpl;_constructImpl;_decodeStrings;_defaultEncoding=`utf8`;_autoDestroy;constructor(t){super(t),this.writableHighWaterMark=t?.highWaterMark??getDefaultHighWaterMark(t?.objectMode??!1),this.writableObjectMode=t?.objectMode??!1,this._decodeStrings=t?.decodeStrings!==!1,this._autoDestroy=t?.autoDestroy!==!1,t?.write&&(this._writeImpl=t.write),t?.writev&&(this._writev=t.writev),t?.final&&(this._finalImpl=t.final),t?.destroy&&(this._destroy=t.destroy),t?.construct&&(this._constructImpl=t.construct),(this._constructImpl||this._construct!==Writable_.prototype._construct)&&(this._writableState.constructed=!1,nextTick(()=>{this._construct(t=>{this._writableState.constructed=!0,t?this.destroy(t):this._maybeFlush()})}))}_construct(t){this._constructImpl?this._constructImpl.call(this,t):t()}_write(t,n,S){this._writeImpl?this._writeImpl.call(this,t,n,S):S()}_final(t){this._finalImpl?this._finalImpl.call(this,t):t()}_destroy(t,n){n(t)}_maybeFlush(){let t=this._pendingConstruct.splice(0);if(t.length>0){let[n,...S]=t;this._writeBuffer.push(...S),this._doWrite(n.chunk,n.encoding,n.callback)}if(this._pendingEnd){let{chunk:t,encoding:n,callback:S}=this._pendingEnd;this._pendingEnd=null,this._doEnd(t,n,S)}}_doWrite(t,n,S){this._writableState.writing=!0;let C=!0;this._write(t,n,n=>{if(this.writableLength-=this.writableObjectMode?1:chunkLen(t),C){nextTick(()=>{if(n){S(n),this.emit(`error`,n);return}S(),this.writableNeedDrain&&this.writableLength<=this.writableHighWaterMark&&(this.writableNeedDrain=!1,this.emit(`drain`))}),n||this._drainWriteBuffer();return}nextTick(n?()=>{S(n),this.emit(`error`,n),this._drainWriteBuffer()}:()=>{S(),this.writableNeedDrain&&this.writableLength<=this.writableHighWaterMark&&(this.writableNeedDrain=!1,this.emit(`drain`)),this._drainWriteBuffer()})}),C=!1}_drainWriteBuffer(){if(this._writeBuffer.length>0){let t=this._writeBuffer.shift();this._doWrite(t.chunk,t.encoding,t.callback)}else this._writableState.writing=!1,this._maybeFinish()}_maybeFinish(){!this._ending||this._writableState.finished||this._writableState.writing||this._writeBuffer.length>0||(this._ending=!1,this._final(t=>{this.writableFinished=!0,this._writableState.finished=!0,nextTick(()=>{t&&this.emit(`error`,t),this.emit(`finish`),this._autoDestroy?this.destroy():nextTick(()=>this.emit(`close`)),this._endCallback&&this._endCallback()})}))}write(t,n,S){let C,N;if(typeof n==`function`?(C=n,N=this._defaultEncoding):(N=n??this._defaultEncoding,C=S??(()=>{})),this._decodeStrings&&!this.writableObjectMode&&typeof t==`string`){let n=globalThis.Buffer;n&&(t=n.from(t,N),N=`buffer`)}if(typeof t!=`string`&&!this.writableObjectMode){let n=globalThis.Buffer;(n&&n.isBuffer(t)||t instanceof Uint8Array)&&(N=`buffer`)}if(this.writableEnded){let t=writeAfterEndError();return nextTick(()=>{C(t),this.emit(`error`,t)}),!1}if(this.writableLength+=this.writableObjectMode?1:chunkLen(t),this.writableCorked>0)return this._corkedBuffer.push({chunk:t,encoding:N,callback:C}),this.writableLength<this.writableHighWaterMark;if(!this._writableState.constructed)return this._pendingConstruct.push({chunk:t,encoding:N,callback:C}),this.writableLength<this.writableHighWaterMark;let F=this.writableLength<this.writableHighWaterMark;return F||(this.writableNeedDrain=!0),this._writableState.writing?this._writeBuffer.push({chunk:t,encoding:N,callback:C}):this._doWrite(t,N,C),F}_doEnd(t,n,S){t!=null&&this.write(t,n),this.writableEnded=!0,this._writableState.ended=!0,this._ending=!0,this._endCallback=S,this._maybeFinish()}end(t,n,S){return typeof t==`function`&&(S=t,t=void 0),typeof n==`function`&&(S=n,n=void 0),this.writableEnded?(S&&nextTick(S),this):this._writableState.constructed?(this._doEnd(t,n,S),this):(this._pendingEnd={chunk:t,encoding:n,callback:S},this)}cork(){this.writableCorked++}uncork(){this.writableCorked>0&&(this.writableCorked--,this.writableCorked===0&&this._corkedBuffer.length>0&&this._flushCorkedBuffer())}_flushCorkedBuffer(){if(this._writev&&this._corkedBuffer.length>1){let t=this._corkedBuffer.splice(0),n=t.map(t=>({chunk:t.chunk,encoding:t.encoding}));this._writev.call(this,n,n=>{for(let n of t)this.writableLength-=this.writableObjectMode?1:chunkLen(n.chunk);if(n){for(let S of t)S.callback(n);this.emit(`error`,n)}else{for(let n of t)n.callback();this.writableNeedDrain&&this.writableLength<=this.writableHighWaterMark&&(this.writableNeedDrain=!1,this.emit(`drain`))}})}else{let t=this._corkedBuffer.splice(0);if(t.length>0){let[n,...S]=t;this._writeBuffer.push(...S),this._doWrite(n.chunk,n.encoding,n.callback)}}}setDefaultEncoding(t){return this._defaultEncoding=t,this}destroy(t){if(this.destroyed)return this;this.destroyed=!0,this.writable=!1,t&&(this._err=t);let n=!1,cb=t=>{n||(n=!0,t&&nextTick(()=>this.emit(`error`,t)),nextTick(()=>this.emit(`close`)))};try{this._destroy(t??null,cb)}catch(t){cb(t)}return this}},ta.prototype[Ki]=function(){return streamAsyncDispose(this,this.writableFinished)}}),ra,ia=__esmMin(()=>{$i(),Ye(),ra=class Transform_ extends Duplex_{constructor(t){super({...t,write:void 0,final:void 0});let n=this;t?.transform&&(n._transform=t.transform),t?.flush&&(n._flush=t.flush),t?.final&&(n._final=t.final)}_transform(t,n,S){throw Object.assign(Error(`The _transform() method is not implemented`),{code:`ERR_METHOD_NOT_IMPLEMENTED`})}_flush(t){t()}_write(t,n,S){let C=!1;try{this._transform(t,n,(t,n)=>{if(C){let t=Object.assign(Error(`Callback called multiple times`),{code:`ERR_MULTIPLE_CALLBACK`});nextTick(()=>this.emit(`error`,t));return}if(C=!0,t){S(t);return}n!=null&&this.push(n),S()})}catch(t){if(t?.code===`ERR_METHOD_NOT_IMPLEMENTED`)throw t;S(t)}}_final(t){this._flush((n,S)=>{if(n){t(n);return}S!=null&&this.push(S),this.push(null),t()})}_doPrefinishHooks(t){let n=Transform_.prototype._final;this._final===n?t():n.call(this,t)}}}),PassThrough_,aa=__esmMin(()=>{ia(),PassThrough_=class extends ra{constructor(t){super({...t,transform(t,n,S){S(null,t)}})}}});function pipeline$1(...t){let n=t,S=typeof n[n.length-1]==`function`?n.pop():void 0,C=n;if(C.length<2)throw Error(`pipeline requires at least 2 streams`);let N=null;function onError(t){if(!N){N=t;for(let t of C)typeof t.destroy==`function`&&t.destroy();S&&S(t)}}let F=C[0];for(let t=1;t<C.length;t++){let n=C[t];F.pipe(n),F.on(`error`,onError),F=n}let I=C[C.length-1];return I.on(`error`,onError),I.on(`finish`,()=>{S&&!N&&S(null)}),I}var oa=__esmMin(()=>{__name$1(pipeline$1,`pipeline`)});function pipeline(...t){return new Promise((n,S)=>{let cb=t=>{t?S(t):n()};pipeline$1(...t,cb)})}function finished(t,n){return new Promise((S,C)=>{n&&typeof n!=`function`?finished$1(t,n,t=>{t?C(t):S()}):finished$1(t,t=>{t?C(t):S()})})}var sa,ca,la=__esmMin(()=>{zi(),Hi(),oa(),sa=Ri({default:()=>ca,finished:()=>finished,pipeline:()=>pipeline}),ca={pipeline,finished}}),ua=__exportAll$5({Duplex:()=>ma,PassThrough:()=>ga,Readable:()=>fa,Stream:()=>da,Transform:()=>ha,Writable:()=>pa,addAbortSignal:()=>addAbortSignal,default:()=>_a,finished:()=>finished$1,getDefaultHighWaterMark:()=>getDefaultHighWaterMark,isDestroyed:()=>isDestroyed,isDisturbed:()=>isDisturbed,isErrored:()=>isErrored,isReadable:()=>isReadable,isWritable:()=>isWritable,"module.exports":()=>_a,pipeline:()=>pipeline$1,promises:()=>sa,setDefaultHighWaterMark:()=>setDefaultHighWaterMark}),da,fa,pa,ma,ha,ga,_a,va=__esmMin(()=>{Ii(),Vi(),Hi(),Gi(),Zi(),$i(),ea(),na(),ia(),aa(),oa(),la(),da=makeCallable(Stream_),fa=makeCallable(Ji),pa=makeCallable(ta),ma=makeCallable(Duplex_),ha=makeCallable(ra),ga=makeCallable(PassThrough_),_a=Object.assign(da,{Stream:da,Readable:fa,Writable:pa,Duplex:ma,Transform:ha,PassThrough:ga,pipeline:pipeline$1,finished:finished$1,addAbortSignal,isReadable,isWritable,isDestroyed,isDisturbed,isErrored,getDefaultHighWaterMark,setDefaultHighWaterMark,promises:sa})});function toUint8Array$2(t){return typeof t==`string`?new TextEncoder().encode(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}function concat$1(t){let n=t.reduce((t,n)=>t+n.length,0),S=new Uint8Array(n),C=0;for(let n of t)S.set(n,C),C+=n.length;return S}function createGzip(t){return new Gzip(t)}function createGunzip(t){return new Gunzip(t)}function createDeflate(t){return new Deflate(t)}function createInflate(t){return new Inflate(t)}function createDeflateRaw(t){return new DeflateRaw(t)}function createInflateRaw(t){return new InflateRaw(t)}function createUnzip(t){return new Unzip(t)}function createBrotliCompress(t){throw Error(`createBrotliCompress is not supported on GJS (no Brotli in GLib)`)}function createBrotliDecompress(t){throw Error(`createBrotliDecompress is not supported on GJS (no Brotli in GLib)`)}function createZstdCompress(t){let n=Error(`createZstdCompress is not supported on GJS (no Zstd in GLib)`);throw n.code=`ERR_UNSUPPORTED_OPERATION`,n}function createZstdDecompress(t){let n=Error(`createZstdDecompress is not supported on GJS (no Zstd in GLib)`);throw n.code=`ERR_UNSUPPORTED_OPERATION`,n}var ZlibBase,Gzip,Gunzip,Deflate,Inflate,DeflateRaw,InflateRaw,Unzip,BrotliCompress,BrotliDecompress,ZstdCompress,ZstdDecompress,ya=__esmMin(()=>{Oi(),Fi(),va(),__name$1(toUint8Array$2,`toUint8Array`),__name$1(concat$1,`concat`),ZlibBase=class extends ha{_mode;_chunks=[];constructor(t,n){resolveMaxOutputLength(n),super(n),this._mode=t}_transform(t,n,S){this._chunks.push(toUint8Array$2(t)),S()}_flush(t){let n=concat$1(this._chunks);this._chunks=[];try{this.push(Buffer.from(this._run(n))),t()}catch(n){t(n instanceof Error?n:Error(String(n)))}}_run(t){let n=this._mode;switch(n.kind){case`compress`:return compressWithGio(t,n.format);case`decompress`:return decompressStreamWithGio(t,n.format);case`gunzip`:return gunzipWithGio(t);case`unzip`:return hasGzipMagic(t)?gunzipWithGio(t):decompressStreamWithGio(t,`deflate`)}}},Gzip=class extends ZlibBase{constructor(t){super({kind:`compress`,format:`gzip`},t)}},Gunzip=class extends ZlibBase{constructor(t){super({kind:`gunzip`},t)}},Deflate=class extends ZlibBase{constructor(t){super({kind:`compress`,format:`deflate`},t)}},Inflate=class extends ZlibBase{constructor(t){super({kind:`decompress`,format:`deflate`},t)}},DeflateRaw=class extends ZlibBase{constructor(t){super({kind:`compress`,format:`deflate-raw`},t)}},InflateRaw=class extends ZlibBase{constructor(t){super({kind:`decompress`,format:`deflate-raw`},t)}},Unzip=class extends ZlibBase{constructor(t){super({kind:`unzip`},t)}},BrotliCompress=class extends ha{constructor(){throw super(),Error(`BrotliCompress is not supported on GJS (no Brotli in GLib)`)}},BrotliDecompress=class extends ha{constructor(){throw super(),Error(`BrotliDecompress is not supported on GJS (no Brotli in GLib)`)}},ZstdCompress=class extends ha{constructor(){super();let t=Error(`ZstdCompress is not supported on GJS (no Zstd in GLib)`);throw t.code=`ERR_UNSUPPORTED_OPERATION`,t}},ZstdDecompress=class extends ha{constructor(){super();let t=Error(`ZstdDecompress is not supported on GJS (no Zstd in GLib)`);throw t.code=`ERR_UNSUPPORTED_OPERATION`,t}}}),ba=__exportAll$5({BrotliCompress:()=>BrotliCompress,BrotliDecompress:()=>BrotliDecompress,Deflate:()=>Deflate,DeflateRaw:()=>DeflateRaw,Gunzip:()=>Gunzip,Gzip:()=>Gzip,Inflate:()=>Inflate,InflateRaw:()=>InflateRaw,Unzip:()=>Unzip,ZlibTransform:()=>ZlibBase,ZstdCompress:()=>ZstdCompress,ZstdDecompress:()=>ZstdDecompress,brotliCompress:()=>brotliCompress,brotliCompressSync:()=>brotliCompressSync,brotliDecompress:()=>brotliDecompress,brotliDecompressSync:()=>brotliDecompressSync,constants:()=>Sa,createBrotliCompress:()=>createBrotliCompress,createBrotliDecompress:()=>createBrotliDecompress,createDeflate:()=>createDeflate,createDeflateRaw:()=>createDeflateRaw,createGunzip:()=>createGunzip,createGzip:()=>createGzip,createInflate:()=>createInflate,createInflateRaw:()=>createInflateRaw,createUnzip:()=>createUnzip,createZstdCompress:()=>createZstdCompress,createZstdDecompress:()=>createZstdDecompress,default:()=>Ca,deflate:()=>deflate,deflateRaw:()=>deflateRaw,deflateRawSync:()=>deflateRawSync,deflateSync:()=>deflateSync,gunzip:()=>gunzip$1,gunzipSync:()=>gunzipSync,gzip:()=>gzip$1,gzipSync:()=>gzipSync,inflate:()=>inflate,inflateRaw:()=>inflateRaw,inflateRawSync:()=>inflateRawSync,inflateSync:()=>inflateSync,unzip:()=>unzip,unzipSync:()=>unzipSync,zstdCompress:()=>zstdCompress,zstdCompressSync:()=>zstdCompressSync,zstdDecompress:()=>zstdDecompress,zstdDecompressSync:()=>zstdDecompressSync});function decompressWithGio(t,n,S){return n===`gzip`?gunzipWithGio(t,S):decompressStreamWithGio(t,n,S)}function unzipFormat(t){return hasGzipMagic(t)?`gzip`:`deflate`}function assertWithinLimit(t,n){if(t.length>n)throw bufferTooLargeError(n);return t}async function runWebTransform(t,n,S=1/0){let C=new ReadableStream({start(n){n.enqueue(new Uint8Array(t.buffer,t.byteOffset,t.byteLength)),n.close()}}),N=[],F=0,I=C.pipeThrough(n).getReader();for(;;){let{done:t,value:n}=await I.read();if(t)break;if(F+=n.length,F>S)throw await I.cancel(),bufferTooLargeError(S);N.push(n)}let H=N.reduce((t,n)=>t+n.length,0),W=new Uint8Array(H),q=0;for(let t of N)W.set(t,q),q+=t.length;return W}async function compressWithWeb(t,n){return runWebTransform(t,new CompressionStream(n))}async function decompressWithWeb(t,n,S){return runWebTransform(t,new DecompressionStream(n),S)}function requestedLevel(t){let n=t?.level;if(!(n===void 0||n===-1))return assertLevel(n),n}async function compress(t,n,S,C){return S===void 0&&hasWebCompression()?assertWithinLimit(await compressWithWeb(t,n),C):assertWithinLimit(compressWithGio(t,n,S),C)}async function decompress(t,n,S){if(hasWebCompression()&&S>=Ei)try{return await decompressWithWeb(t,n,S)}catch(C){if(n!==`gzip`||isBufferTooLargeError(C))throw C;return decompressWithGio(t,n,S)}return decompressWithGio(t,n,S)}function toUint8Array$1(t){return typeof t==`string`?new TextEncoder().encode(t):t instanceof ArrayBuffer?new Uint8Array(t):t}function runAsync(t,n,S,C){let N=typeof n==`function`?n:S,F=typeof n==`function`?void 0:n,I=resolveMaxOutputLength(F);C(toUint8Array$1(t),F,I).then(t=>N(null,t),t=>N(t instanceof Error?t:Error(String(t)),new Uint8Array))}function compressAsync(t){return(n,S,C)=>compress(n,t,requestedLevel(S),C)}function decompressAsync(t){return(n,S,C)=>decompress(n,t,C)}function gzip$1(t,n,S){runAsync(t,n,S,compressAsync(`gzip`))}function gunzip$1(t,n,S){runAsync(t,n,S,decompressAsync(`gzip`))}function deflate(t,n,S){runAsync(t,n,S,compressAsync(`deflate`))}function inflate(t,n,S){runAsync(t,n,S,decompressAsync(`deflate`))}function deflateRaw(t,n,S){runAsync(t,n,S,compressAsync(`deflate-raw`))}function inflateRaw(t,n,S){runAsync(t,n,S,decompressAsync(`deflate-raw`))}function unzip(t,n,S){runAsync(t,n,S,(t,n,S)=>decompress(t,unzipFormat(t),S))}function compressSync(t,n,S){let C=resolveMaxOutputLength(S);return assertWithinLimit(compressWithGio(toUint8Array$1(t),n,S?.level??-1),C)}function gzipSync(t,n){return compressSync(t,`gzip`,n)}function gunzipSync(t,n){return decompressWithGio(toUint8Array$1(t),`gzip`,resolveMaxOutputLength(n))}function deflateSync(t,n){return compressSync(t,`deflate`,n)}function inflateSync(t,n){return decompressWithGio(toUint8Array$1(t),`deflate`,resolveMaxOutputLength(n))}function deflateRawSync(t,n){return compressSync(t,`deflate-raw`,n)}function inflateRawSync(t,n){return decompressWithGio(toUint8Array$1(t),`deflate-raw`,resolveMaxOutputLength(n))}function unzipSync(t,n){let S=toUint8Array$1(t);return decompressWithGio(S,unzipFormat(S),resolveMaxOutputLength(n))}function brotliCompress(t,n,S){(typeof n==`function`?n:S)(Error(`brotliCompress: Brotli is not supported in this environment`),xa)}function brotliDecompress(t,n,S){(typeof n==`function`?n:S)(Error(`brotliDecompress: Brotli is not supported in this environment`),xa)}function brotliCompressSync(t,n){throw Error(`brotliCompressSync: Brotli is not supported in this environment`)}function brotliDecompressSync(t,n){throw Error(`brotliDecompressSync: Brotli is not supported in this environment`)}function zstdCompress(t,n,S){let C=typeof n==`function`?n:S,N=Error(`zstdCompress: Zstd is not supported in this environment`);N.code=`ERR_UNSUPPORTED_OPERATION`,C(N,xa)}function zstdDecompress(t,n,S){let C=typeof n==`function`?n:S,N=Error(`zstdDecompress: Zstd is not supported in this environment`);N.code=`ERR_UNSUPPORTED_OPERATION`,C(N,xa)}function zstdCompressSync(t,n){let S=Error(`zstdCompressSync: Zstd is not supported in this environment`);throw S.code=`ERR_UNSUPPORTED_OPERATION`,S}function zstdDecompressSync(t,n){let S=Error(`zstdDecompressSync: Zstd is not supported in this environment`);throw S.code=`ERR_UNSUPPORTED_OPERATION`,S}var hasWebCompression,xa,Sa,Ca,wa=__esmMin(()=>{Oi(),Fi(),ya(),hasWebCompression=()=>globalThis.CompressionStream!==void 0,__name$1(toUint8Array$1,`toUint8Array`),__name$1(gzip$1,`gzip`),__name$1(gunzip$1,`gunzip`),xa=new Uint8Array,Sa={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_DEFLATED:8},Ca={gzip:gzip$1,gunzip:gunzip$1,deflate,inflate,deflateRaw,inflateRaw,unzip,gzipSync,gunzipSync,deflateSync,inflateSync,deflateRawSync,inflateRawSync,unzipSync,brotliCompress,brotliDecompress,brotliCompressSync,brotliDecompressSync,zstdCompress,zstdDecompress,zstdCompressSync,zstdDecompressSync,Gzip,Gunzip,Deflate,Inflate,DeflateRaw,InflateRaw,Unzip,BrotliCompress,BrotliDecompress,ZstdCompress,ZstdDecompress,createGzip,createGunzip,createDeflate,createInflate,createDeflateRaw,createInflateRaw,createUnzip,createBrotliCompress,createBrotliDecompress,createZstdCompress,createZstdDecompress,constants:Sa}});const Ta=new Set([`gzip`,`deflate`,`deflate-raw`]);function validateFormat(t){if(!Ta.has(t))throw TypeError(`Unsupported compression format: '${t}'. Supported formats: 'gzip', 'deflate', 'deflate-raw'.`);return t}const Ea=typeof globalThis.CompressionStream==`function`&&typeof globalThis.DecompressionStream==`function`;let Da=!1,Oa,ka,Aa,ja,Ma,Na;async function loadZlib(){if(Da)return;let t=await Promise.resolve().then(()=>(wa(),ba));Oa=t.gzipSync,ka=t.gunzipSync,Aa=t.deflateSync,ja=t.inflateSync,Ma=t.deflateRawSync,Na=t.inflateRawSync,Da=!0}function getCompressFn(t){switch(t){case`gzip`:return t=>Oa(t);case`deflate`:return t=>Aa(t);case`deflate-raw`:return t=>Ma(t)}}function getDecompressFn(t){switch(t){case`gzip`:return t=>ka(t);case`deflate`:return t=>ja(t);case`deflate-raw`:return t=>Na(t)}}function concatChunks$1(t){if(t.length===1)return t[0];let n=0;for(let S of t)n+=S.length;let S=new Uint8Array(n),C=0;for(let n of t)S.set(n,C),C+=n.length;return S}__name$1(concatChunks$1,`concatChunks`);let Pa,Fa;if(Ea)Pa=globalThis.CompressionStream,Fa=globalThis.DecompressionStream;else{let t=loadZlib();Pa=class CompressionStream{readable;writable;constructor(n){let S=validateFormat(n),C=[],N=new xi({transform(t){C.push(t)},async flush(n){try{await t;let N=getCompressFn(S)(concatChunks$1(C));N.length>0&&n.enqueue(N)}catch(t){n.error(t)}}});this.readable=N.readable,this.writable=N.writable}},Fa=class DecompressionStream{readable;writable;constructor(n){let S=validateFormat(n),C=[],N=new xi({transform(t){C.push(t)},async flush(n){try{await t;let N=getDecompressFn(S)(concatChunks$1(C));N.length>0&&n.enqueue(N)}catch(t){n.error(t)}}});this.readable=N.readable,this.writable=N.writable}}}const Ia=globalThis;globalThis.CompressionStream===void 0&&(Ia.CompressionStream=Pa),globalThis.DecompressionStream===void 0&&(Ia.DecompressionStream=Fa);const La=globalThis;globalThis.DOMException===void 0&&(La.DOMException=vr);var Ra,__name,za=__esmMin(()=>{Ra=Object.defineProperty,__name=(t,n)=>Ra(t,`name`,{value:n,configurable:!0})});function validateHeaderName(t){if(typeof t!=`string`||!/^[\^`\-\w!#$%&'*+.|~]+$/.test(t)){let n=TypeError(`Header name must be a valid HTTP token ["${t}"]`);throw Object.defineProperty(n,"code",{value:`ERR_INVALID_HTTP_TOKEN`}),n}}function validateHeaderValue(t,n){if(n===void 0){let n=TypeError(`Header "${t}" value must not be undefined`);throw Object.defineProperty(n,"code",{value:`ERR_HTTP_INVALID_HEADER_VALUE`}),n}if(typeof n==`string`&&/[^\t -~€-ÿ]/.test(n)){let n=TypeError(`Invalid character in header content ["${t}"]`);throw Object.defineProperty(n,"code",{value:`ERR_INVALID_CHAR`}),n}}const Ba=Symbol(`Headers.headers`);function isBoxedPrimitive$2(t){return t instanceof String||t instanceof Number||t instanceof Boolean||typeof Symbol<`u`&&t instanceof Symbol||typeof BigInt<`u`&&t instanceof BigInt}__name$1(isBoxedPrimitive$2,`isBoxedPrimitive`);var Va=class Headers{[Ba];constructor(t){if(this[Ba]=new Map,t!=null){if(t instanceof Headers){for(let[n,S]of t[Ba])this[Ba].set(n,[...S]);return}if(typeof t==`object`&&!isBoxedPrimitive$2(t)){let n=t[Symbol.iterator];if(n==null)for(let[n,S]of Object.entries(t))validateHeaderName(n),validateHeaderValue(n,String(S)),this.append(n,String(S));else{if(typeof n!=`function`)throw TypeError(`Header pairs must be iterable`);for(let n of t){if(typeof n!=`object`||isBoxedPrimitive$2(n))throw TypeError(`Each header pair must be an iterable object`);let t=[...n];if(t.length!==2)throw TypeError(`Each header pair must be a name/value tuple`);validateHeaderName(t[0]),validateHeaderValue(t[0],String(t[1])),this.append(t[0],String(t[1]))}}}else throw TypeError(`Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)'`)}}append(t,n){validateHeaderName(t),validateHeaderValue(t,n);let S=String(t).toLowerCase(),C=String(n),N=this[Ba].get(S);N?N.push(C):this[Ba].set(S,[C])}set(t,n){validateHeaderName(t),validateHeaderValue(t,n);let S=String(t).toLowerCase();this[Ba].set(S,[String(n)])}delete(t){this[Ba].delete(String(t).toLowerCase())}has(t){return this[Ba].has(String(t).toLowerCase())}get(t){let n=this[Ba].get(String(t).toLowerCase());if(!n||n.length===0)return null;let S=n.join(`, `);return/^content-encoding$/i.test(t)&&(S=S.toLowerCase()),S}getAll(t){return this[Ba].get(String(t).toLowerCase())??[]}getSetCookie(){return this[Ba].get(`set-cookie`)??[]}forEach(t,n){for(let S of this.keys())Reflect.apply(t,n,[this.get(S),S,this])}*keys(){let t=[...this[Ba].keys()].sort(),n=new Set;for(let S of t)n.has(S)||(n.add(S),yield S)}*values(){for(let t of this.keys())yield this.get(t)}*entries(){for(let t of this.keys())yield[t,this.get(t)]}[Symbol.iterator](){return this.entries()}get[Symbol.toStringTag](){return`Headers`}toString(){return Object.prototype.toString.call(this)}raw(){let t={};for(let n of this.keys())t[n]=this.getAll(n);return t}_appendToSoupMessage(t,n,S=t.MessageHeadersType.REQUEST){let C=n?n.get_request_headers():new t.MessageHeaders(S);for(let[t,n]of this.entries())C.append(t,n);return C}static _newFromSoupMessage(t,n,S=t.MessageHeadersType.RESPONSE){let C=new Headers,N;return N=S===t.MessageHeadersType.RESPONSE?n.get_response_headers():n.get_request_headers(),N.foreach((t,n)=>{C.append(t,n)}),C}[Symbol.for(`nodejs.util.inspect.custom`)](){let t={};for(let n of this.keys()){let S=this.getAll(n);n===`host`?t[n]=S[0]:t[n]=S.length>1?S:S[0]}return t}};Object.defineProperties(Va.prototype,[`get`,`entries`,`forEach`,`values`].reduce((t,n)=>(t[n]={enumerable:!0},t),{}));var Ha=__esmMin(()=>{ht()});Ha();var FetchBaseError=class extends Error{type;constructor(t,n){super(t),typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,this.constructor),this.type=n}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}},FetchError=class extends FetchBaseError{code;errno;erroredSysCall;constructor(t,n,S){super(t,n),S&&(this.code=this.errno=S.code,this.erroredSysCall=S.syscall)}};ir();const Ua=Symbol.toStringTag,isURLSearchParameters=t=>typeof t==`object`&&typeof t.append==`function`&&typeof t.delete==`function`&&typeof t.get==`function`&&typeof t.getAll==`function`&&typeof t.has==`function`&&typeof t.set==`function`&&typeof t.sort==`function`&&t[Ua]===`URLSearchParams`,isBlob=t=>{if(!t||typeof t!=`object`)return!1;let n=t;return typeof n.arrayBuffer==`function`&&typeof n.type==`string`&&typeof n.stream==`function`&&typeof n.constructor==`function`&&/^(Blob|File)$/.test(n[Ua])},isAbortSignal=t=>{if(typeof t!=`object`||!t)return!1;let n=t;return n[Ua]===`AbortSignal`||n[Ua]===`EventTarget`},isDomainOrSubdomain=(t,n)=>{let S=new nr(n).hostname,C=new nr(t).hostname;return S===C||S.endsWith(`.${C}`)},isSameProtocol=(t,n)=>new nr(n).protocol===new nr(t).protocol;var Wa,Ga,File,Ka=__esmMin(()=>{Wa=Symbol(`File.name`),Ga=Symbol(`File.lastModified`),File=class extends Blob{[Wa];[Ga];webkitRelativePath=``;constructor(t,n,S){super(t,S),this[Wa]=String(n),this[Ga]=S?.lastModified??Date.now()}get name(){return this[Wa]}get lastModified(){return this[Ga]}get[Symbol.toStringTag](){return`File`}}});function generateBoundary(){let t=`----formdata-`;for(let n=0;n<24;n++)t+=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`.charAt(Math.floor(Math.random()*62));return t}function escape(t){return t.replace(/\n/g,`%0A`).replace(/\r/g,`%0D`).replace(/"/g,`%22`)}function formDataToBlob(t,n){n??=generateBoundary();let S=[],C=`--${n}\r\nContent-Disposition: form-data; name="`;for(let[n,N]of t.entries())if(typeof N==`string`)S.push(`${C}${escape(n)}"\r\n\r\n${N.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
13
13
  `)}\r\n`);else{let t=N instanceof File?N:new File([N],`blob`,{type:N.type});S.push(`${C}${escape(n)}"; filename="${escape(t.name)}"\r\nContent-Type: ${t.type||`application/octet-stream`}\r\n\r\n`),S.push(t),S.push(`\r
@@ -146,7 +146,7 @@ fi
146
146
  `)}`:``;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=>{!Ip.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=>{Ip.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 Ip,Lp=__esmMin(()=>{Cp(),yp(),Fp(),Op(),Ip=[`$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,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,Fm,Im,Lm,Rm,zm,Bm,Vm,Hm,Um,Wm,Gm,Km,qm,Jm,Ym,Xm,Zm,Qm,$m,eh,th,nh,YargsInstance,rh=__esmMin(()=>{_e(),Dp(),yp(),Ll(),Ap(),Cp(),Pp(),Lp(),Op(),Bl(),wp(),bp(),Tp(),kp(),__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)},bm=Symbol(`copyDoubleDash`),xm=Symbol(`copyDoubleDash`),Sm=Symbol(`deleteFromParserHintObject`),Cm=Symbol(`emitWarning`),wm=Symbol(`freeze`),Tm=Symbol(`getDollarZero`),Em=Symbol(`getParserConfiguration`),Dm=Symbol(`getUsageConfiguration`),Om=Symbol(`guessLocale`),km=Symbol(`guessVersion`),Am=Symbol(`parsePositionalNumbers`),jm=Symbol(`pkgUp`),Mm=Symbol(`populateParserHintArray`),Nm=Symbol(`populateParserHintSingleValueDictionary`),Pm=Symbol(`populateParserHintArrayDictionary`),Fm=Symbol(`populateParserHintDictionary`),Im=Symbol(`sanitizeKey`),Lm=Symbol(`setKey`),Rm=Symbol(`unfreeze`),zm=Symbol(`validateAsync`),Bm=Symbol(`getCommandInstance`),Vm=Symbol(`getContext`),Hm=Symbol(`getHasOutput`),Um=Symbol(`getLoggerInstance`),Wm=Symbol(`getParseContext`),Gm=Symbol(`getUsageInstance`),Km=Symbol(`getValidationInstance`),qm=Symbol(`hasParseCallback`),Jm=Symbol(`isGlobalContext`),Ym=Symbol(`postProcess`),Xm=Symbol(`rebase`),Zm=Symbol(`reset`),Qm=Symbol(`runYargsParserAndExecuteCommands`),$m=Symbol(`runValidation`),eh=Symbol(`setHasOutput`),th=Symbol(`kTrackManuallySetKeys`),nh=`en_US`,YargsInstance=class{constructor(t=[],n,S,C){this.customScriptName=!1,this.parsed=!1,Rp.set(this,void 0),zp.set(this,void 0),Bp.set(this,{commands:[],fullCommands:[]}),Vp.set(this,null),Hp.set(this,null),Up.set(this,`show-hidden`),Wp.set(this,null),Gp.set(this,!0),Kp.set(this,{}),qp.set(this,!0),Jp.set(this,[]),Yp.set(this,void 0),Xp.set(this,{}),Zp.set(this,!1),Qp.set(this,null),$p.set(this,!0),em.set(this,void 0),tm.set(this,``),nm.set(this,void 0),im.set(this,void 0),am.set(this,{}),om.set(this,null),sm.set(this,null),cm.set(this,{}),lm.set(this,{}),um.set(this,void 0),dm.set(this,!1),fm.set(this,void 0),pm.set(this,!1),mm.set(this,!1),hm.set(this,!1),gm.set(this,void 0),_m.set(this,{}),vm.set(this,null),ym.set(this,void 0),__classPrivateFieldSet(this,fm,C,`f`),__classPrivateFieldSet(this,um,t,`f`),__classPrivateFieldSet(this,zp,n,`f`),__classPrivateFieldSet(this,im,S,`f`),__classPrivateFieldSet(this,Yp,new GlobalMiddleware(this),`f`),this.$0=this[Tm](),this[Zm](),__classPrivateFieldSet(this,Rp,__classPrivateFieldGet(this,Rp,`f`),`f`),__classPrivateFieldSet(this,gm,__classPrivateFieldGet(this,gm,`f`),`f`),__classPrivateFieldSet(this,ym,__classPrivateFieldGet(this,ym,`f`),`f`),__classPrivateFieldSet(this,nm,__classPrivateFieldGet(this,nm,`f`),`f`),__classPrivateFieldGet(this,nm,`f`).showHiddenOpt=__classPrivateFieldGet(this,Up,`f`),__classPrivateFieldSet(this,em,this[xm](),`f`),__classPrivateFieldGet(this,fm,`f`).y18n.setLocale(nh)}addHelpOpt(t,n){return argsert(`[string|boolean] [string]`,[t,n],arguments.length),__classPrivateFieldGet(this,Qp,`f`)&&(this[Sm](__classPrivateFieldGet(this,Qp,`f`)),__classPrivateFieldSet(this,Qp,null,`f`)),t===!1&&n===void 0?this:(__classPrivateFieldSet(this,Qp,typeof t==`string`?t:`help`,`f`),this.boolean(__classPrivateFieldGet(this,Qp,`f`)),this.describe(__classPrivateFieldGet(this,Qp,`f`),n||__classPrivateFieldGet(this,gm,`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,Up,`f`);return this.boolean(S),this.describe(S,n||__classPrivateFieldGet(this,gm,`f`).deferY18nLookup(`Show hidden options`)),__classPrivateFieldGet(this,nm,`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[Pm](this.alias.bind(this),`alias`,t,n),this}array(t){return argsert(`<array|string>`,[t],arguments.length),this[Mm](`array`,t),this[th](t),this}boolean(t){return argsert(`<array|string>`,[t],arguments.length),this[Mm](`boolean`,t),this[th](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,gm,`f`).fail(S.toString(),S):__classPrivateFieldGet(this,gm,`f`).fail(__classPrivateFieldGet(this,fm,`f`).y18n.__(`Argument check failed: %s`,t.toString())),n),t=>(__classPrivateFieldGet(this,gm,`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[Pm](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 Il(`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 Il(`coerce callback must be provided`);let S=t;return __classPrivateFieldGet(this,nm,`f`).key[S]=!0,__classPrivateFieldGet(this,Yp,`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 Il(t.message)})},S),this}conflicts(t,n){return argsert(`<string|object> [string|array]`,[t,n],arguments.length),__classPrivateFieldGet(this,ym,`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,zp,`f`),this[Em]()[`deep-merge-config`]||!1,__classPrivateFieldGet(this,fm,`f`)),__classPrivateFieldGet(this,nm,`f`).configObjects=(__classPrivateFieldGet(this,nm,`f`).configObjects||[]).concat(t),this):(typeof n==`function`&&(S=n,n=void 0),this.describe(t,n||__classPrivateFieldGet(this,gm,`f`).deferY18nLookup(`Path to JSON config file`)),(Array.isArray(t)?t:[t]).forEach(t=>{__classPrivateFieldGet(this,nm,`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,Hp,t||__classPrivateFieldGet(this,Hp,`f`)||`completion`,`f`),!n&&n!==!1&&(n=`generate completion script`),this.command(__classPrivateFieldGet(this,Hp,`f`),n),S&&__classPrivateFieldGet(this,Vp,`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,Rp,`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,im,`f`)||__classPrivateFieldGet(this,fm,`f`).require;return __classPrivateFieldGet(this,Rp,`f`).addDirectory(t,S,__classPrivateFieldGet(this,fm,`f`).getCallerFile(),n),this}count(t){return argsert(`<array|string>`,[t],arguments.length),this[Mm](`count`,t),this[th](t),this}default(t,n,S){return argsert(`<object|string|array> [*] [string]`,[t,n,S],arguments.length),S&&(assertSingleKey(t,__classPrivateFieldGet(this,fm,`f`)),__classPrivateFieldGet(this,nm,`f`).defaultDescription[t]=S),typeof n==`function`&&(assertSingleKey(t,__classPrivateFieldGet(this,fm,`f`)),__classPrivateFieldGet(this,nm,`f`).defaultDescription[t]||(__classPrivateFieldGet(this,nm,`f`).defaultDescription[t]=__classPrivateFieldGet(this,gm,`f`).functionDescription(n)),n=n.call()),this[Nm](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,nm,`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,fm,`f`)),this.demandOption(t,S)}),n=1/0):typeof n!=`number`&&(S=n,n=1/0),typeof t==`number`?(assertNotStrictEqual(S,!0,__classPrivateFieldGet(this,fm,`f`)),this.demandCommand(t,n,S,S)):Array.isArray(t)?t.forEach(t=>{assertNotStrictEqual(S,!0,__classPrivateFieldGet(this,fm,`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[Nm](this.demandOption.bind(this),`demandedOptions`,t,n),this}deprecateOption(t,n){return argsert(`<string> [string|boolean]`,[t,n],arguments.length),__classPrivateFieldGet(this,nm,`f`).deprecatedOptions[t]=n,this}describe(t,n){return argsert(`<object|string|array> [string]`,[t,n],arguments.length),this[Lm](t,!0),__classPrivateFieldGet(this,gm,`f`).describe(t,n),this}detectLocale(t){return argsert(`<boolean>`,[t],arguments.length),__classPrivateFieldSet(this,Gp,t,`f`),this}env(t){return argsert(`[string|boolean]`,[t],arguments.length),t===!1?delete __classPrivateFieldGet(this,nm,`f`).envPrefix:__classPrivateFieldGet(this,nm,`f`).envPrefix=t||``,this}epilogue(t){return argsert(`<string>`,[t],arguments.length),__classPrivateFieldGet(this,gm,`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,gm,`f`).example(t,n),this}exit(t,n){__classPrivateFieldSet(this,Zp,!0,`f`),__classPrivateFieldSet(this,Wp,n,`f`),__classPrivateFieldGet(this,qp,`f`)&&__classPrivateFieldGet(this,fm,`f`).process.exit(t)}exitProcess(t=!0){return argsert(`[boolean]`,[t],arguments.length),__classPrivateFieldSet(this,qp,t,`f`),this}fail(t){if(argsert(`<function|boolean>`,[t],arguments.length),typeof t==`boolean`&&t!==!1)throw new Il(`Invalid first argument. Expected function or boolean 'false'`);return __classPrivateFieldGet(this,gm,`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,Vp,`f`).getCompletion(t,n):new Promise((n,S)=>{__classPrivateFieldGet(this,Vp,`f`).getCompletion(t,(t,C)=>{t?S(t):n(C)})})}getDemandedOptions(){return argsert([],0),__classPrivateFieldGet(this,nm,`f`).demandedOptions}getDemandedCommands(){return argsert([],0),__classPrivateFieldGet(this,nm,`f`).demandedCommands}getDeprecatedOptions(){return argsert([],0),__classPrivateFieldGet(this,nm,`f`).deprecatedOptions}getDetectLocale(){return __classPrivateFieldGet(this,Gp,`f`)}getExitProcess(){return __classPrivateFieldGet(this,qp,`f`)}getGroups(){return Object.assign({},__classPrivateFieldGet(this,Xp,`f`),__classPrivateFieldGet(this,lm,`f`))}getHelp(){if(__classPrivateFieldSet(this,Zp,!0,`f`),!__classPrivateFieldGet(this,gm,`f`).hasCachedHelpMessage()){if(!this.parsed){let t=this[Qm](__classPrivateFieldGet(this,um,`f`),void 0,void 0,0,!0);if(isPromise(t))return t.then(()=>__classPrivateFieldGet(this,gm,`f`).help())}let t=__classPrivateFieldGet(this,Rp,`f`).runDefaultBuilderOn(this);if(isPromise(t))return t.then(()=>__classPrivateFieldGet(this,gm,`f`).help())}return Promise.resolve(__classPrivateFieldGet(this,gm,`f`).help())}getOptions(){return __classPrivateFieldGet(this,nm,`f`)}getStrict(){return __classPrivateFieldGet(this,pm,`f`)}getStrictCommands(){return __classPrivateFieldGet(this,mm,`f`)}getStrictOptions(){return __classPrivateFieldGet(this,hm,`f`)}global(t,n){return argsert(`<string|array> [boolean]`,[t,n],arguments.length),t=[].concat(t),n===!1?t.forEach(t=>{__classPrivateFieldGet(this,nm,`f`).local.includes(t)||__classPrivateFieldGet(this,nm,`f`).local.push(t)}):__classPrivateFieldGet(this,nm,`f`).local=__classPrivateFieldGet(this,nm,`f`).local.filter(n=>t.indexOf(n)===-1),this}group(t,n){argsert(`<string|array> <string>`,[t,n],arguments.length);let S=__classPrivateFieldGet(this,lm,`f`)[n]||__classPrivateFieldGet(this,Xp,`f`)[n];__classPrivateFieldGet(this,lm,`f`)[n]&&delete __classPrivateFieldGet(this,lm,`f`)[n];let C={};return __classPrivateFieldGet(this,Xp,`f`)[n]=(S||[]).concat(t).filter(t=>C[t]?!1:C[t]=!0),this}hide(t){return argsert(`<string>`,[t],arguments.length),__classPrivateFieldGet(this,nm,`f`).hiddenOptions.push(t),this}implies(t,n){return argsert(`<string|object> [number|string|array]`,[t,n],arguments.length),__classPrivateFieldGet(this,ym,`f`).implies(t,n),this}locale(t){return argsert(`[string]`,[t],arguments.length),t===void 0?(this[Om](),__classPrivateFieldGet(this,fm,`f`).y18n.getLocale()):(__classPrivateFieldSet(this,Gp,!1,`f`),__classPrivateFieldGet(this,fm,`f`).y18n.setLocale(t),this)}middleware(t,n,S){return __classPrivateFieldGet(this,Yp,`f`).addMiddleware(t,!!n,S)}nargs(t,n){return argsert(`<string|object|array> [number]`,[t,n],arguments.length),this[Nm](this.nargs.bind(this),`narg`,t,n),this}normalize(t){return argsert(`<array|string>`,[t],arguments.length),this[Mm](`normalize`,t),this}number(t){return argsert(`<array|string>`,[t],arguments.length),this[Mm](`number`,t),this[th](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[th](t),__classPrivateFieldGet(this,vm,`f`)&&(t===`version`||n?.alias===`version`)&&this[Cm]([`"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(`
147
147
  `),void 0,`versionWarning`),__classPrivateFieldGet(this,nm,`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,nm,`f`).defaultDescription[t]=n.defaultDescription),n.skipValidation&&this.skipValidation(t);let N=n.describe||n.description||n.desc,F=__classPrivateFieldGet(this,gm,`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[wm](),t===void 0&&(t=__classPrivateFieldGet(this,um,`f`)),typeof n==`object`&&(__classPrivateFieldSet(this,sm,n,`f`),n=S),typeof n==`function`&&(__classPrivateFieldSet(this,om,n,`f`),n=!1),n||__classPrivateFieldSet(this,um,t,`f`),__classPrivateFieldGet(this,om,`f`)&&__classPrivateFieldSet(this,qp,!1,`f`);let C=this[Qm](t,!!n),N=this.parsed;return __classPrivateFieldGet(this,Vp,`f`).setParsed(this.parsed),isPromise(C)?C.then(t=>(__classPrivateFieldGet(this,om,`f`)&&__classPrivateFieldGet(this,om,`f`).call(this,__classPrivateFieldGet(this,Wp,`f`),t,__classPrivateFieldGet(this,tm,`f`)),t)).catch(t=>{throw __classPrivateFieldGet(this,om,`f`)&&__classPrivateFieldGet(this,om,`f`)(t,this.parsed.argv,__classPrivateFieldGet(this,tm,`f`)),t}).finally(()=>{this[Rm](),this.parsed=N}):(__classPrivateFieldGet(this,om,`f`)&&__classPrivateFieldGet(this,om,`f`).call(this,__classPrivateFieldGet(this,Wp,`f`),C,__classPrivateFieldGet(this,tm,`f`)),this[Rm](),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 Il(`.parseSync() must not be used with asynchronous builders, handlers, or middleware`);return C}parserConfiguration(t){return argsert(`<object>`,[t],arguments.length),__classPrivateFieldSet(this,am,t,`f`),this}pkgConf(t,n){argsert(`<string> [string]`,[t,n],arguments.length);let S=null,C=this[jm](n||__classPrivateFieldGet(this,zp,`f`));return C[t]&&typeof C[t]==`object`&&(S=applyExtends(C[t],n||__classPrivateFieldGet(this,zp,`f`),this[Em]()[`deep-merge-config`]||!1,__classPrivateFieldGet(this,fm,`f`)),__classPrivateFieldGet(this,nm,`f`).configObjects=(__classPrivateFieldGet(this,nm,`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,Bp,`f`).fullCommands[__classPrivateFieldGet(this,Bp,`f`).fullCommands.length-1],N=C?__classPrivateFieldGet(this,Rp,`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,gm,`f`).getPositionalGroupName()),this.option(t,n)}recommendCommands(t=!0){return argsert(`[boolean]`,[t],arguments.length),__classPrivateFieldSet(this,dm,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,nm,`f`).narg[t]||this[Nm](this.requiresArg.bind(this),`narg`,t,NaN),this}showCompletionScript(t,n){return argsert(`[string] [string]`,[t,n],arguments.length),t||=this.$0,__classPrivateFieldGet(this,em,`f`).log(__classPrivateFieldGet(this,Vp,`f`).generateCompletionScript(t,n||__classPrivateFieldGet(this,Hp,`f`)||`completion`)),this}showHelp(t){if(argsert(`[string|function]`,[t],arguments.length),__classPrivateFieldSet(this,Zp,!0,`f`),!__classPrivateFieldGet(this,gm,`f`).hasCachedHelpMessage()){if(!this.parsed){let n=this[Qm](__classPrivateFieldGet(this,um,`f`),void 0,void 0,0,!0);if(isPromise(n))return n.then(()=>{__classPrivateFieldGet(this,gm,`f`).showHelp(t)}),this}let n=__classPrivateFieldGet(this,Rp,`f`).runDefaultBuilderOn(this);if(isPromise(n))return n.then(()=>{__classPrivateFieldGet(this,gm,`f`).showHelp(t)}),this}return __classPrivateFieldGet(this,gm,`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,gm,`f`).showHelpOnFail(t,n),this}showVersion(t){return argsert(`[string|function]`,[t],arguments.length),__classPrivateFieldGet(this,gm,`f`).showVersion(t),this}skipValidation(t){return argsert(`<array|string>`,[t],arguments.length),this[Mm](`skipValidation`,t),this}strict(t){return argsert(`[boolean]`,[t],arguments.length),__classPrivateFieldSet(this,pm,t!==!1,`f`),this}strictCommands(t){return argsert(`[boolean]`,[t],arguments.length),__classPrivateFieldSet(this,mm,t!==!1,`f`),this}strictOptions(t){return argsert(`[boolean]`,[t],arguments.length),__classPrivateFieldSet(this,hm,t!==!1,`f`),this}string(t){return argsert(`<array|string>`,[t],arguments.length),this[Mm](`string`,t),this[th](t),this}terminalWidth(){return argsert([],0),__classPrivateFieldGet(this,fm,`f`).process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return argsert(`<object>`,[t],arguments.length),__classPrivateFieldSet(this,Gp,!1,`f`),__classPrivateFieldGet(this,fm,`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,fm,`f`)),(t||``).match(/^\$0( |$)/))return this.command(t,n,S,C);throw new Il(`.usage() description must start with $0 if being used as alias for .command()`)}else return __classPrivateFieldGet(this,gm,`f`).usage(t),this}usageConfiguration(t){return argsert(`<object>`,[t],arguments.length),__classPrivateFieldSet(this,_m,t,`f`),this}version(t,n,S){let C=`version`;if(argsert(`[boolean|string] [string] [string]`,[t,n,S],arguments.length),__classPrivateFieldGet(this,vm,`f`)&&(this[Sm](__classPrivateFieldGet(this,vm,`f`)),__classPrivateFieldGet(this,gm,`f`).version(void 0),__classPrivateFieldSet(this,vm,null,`f`)),arguments.length===0)S=this[km](),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,vm,typeof t==`string`?t:C,`f`),n||=__classPrivateFieldGet(this,gm,`f`).deferY18nLookup(`Show version number`),__classPrivateFieldGet(this,gm,`f`).version(S||void 0),this.boolean(__classPrivateFieldGet(this,vm,`f`)),this.describe(__classPrivateFieldGet(this,vm,`f`),n),this}wrap(t){return argsert(`<number|null|undefined>`,[t],arguments.length),__classPrivateFieldGet(this,gm,`f`).wrap(t),this}[(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=new WeakMap,Qp=new WeakMap,$p=new WeakMap,em=new WeakMap,tm=new WeakMap,nm=new WeakMap,im=new WeakMap,am=new WeakMap,om=new WeakMap,sm=new WeakMap,cm=new WeakMap,lm=new WeakMap,um=new WeakMap,dm=new WeakMap,fm=new WeakMap,pm=new WeakMap,mm=new WeakMap,hm=new WeakMap,gm=new WeakMap,_m=new WeakMap,vm=new WeakMap,ym=new WeakMap,bm)](t){if(!t._||!t[`--`])return t;t._.push.apply(t._,t[`--`]);try{delete t[`--`]}catch{}return t}[xm](){return{log:(...t)=>{this[qm]()||ge.log(...t),__classPrivateFieldSet(this,Zp,!0,`f`),__classPrivateFieldGet(this,tm,`f`).length&&__classPrivateFieldSet(this,tm,__classPrivateFieldGet(this,tm,`f`)+`
148
148
  `,`f`),__classPrivateFieldSet(this,tm,__classPrivateFieldGet(this,tm,`f`)+t.join(` `),`f`)},error:(...t)=>{this[qm]()||ge.error(...t),__classPrivateFieldSet(this,Zp,!0,`f`),__classPrivateFieldGet(this,tm,`f`).length&&__classPrivateFieldSet(this,tm,__classPrivateFieldGet(this,tm,`f`)+`
149
- `,`f`),__classPrivateFieldSet(this,tm,__classPrivateFieldGet(this,tm,`f`)+t.join(` `),`f`)}}}[Sm](t){objectKeys(__classPrivateFieldGet(this,nm,`f`)).forEach(n=>{if((t=>t===`configObjects`)(n))return;let S=__classPrivateFieldGet(this,nm,`f`)[n];Array.isArray(S)?S.includes(t)&&S.splice(S.indexOf(t),1):typeof S==`object`&&delete S[t]}),delete __classPrivateFieldGet(this,gm,`f`).getDescriptions()[t]}[Cm](t,n,S){__classPrivateFieldGet(this,Kp,`f`)[S]||(__classPrivateFieldGet(this,fm,`f`).process.emitWarning(t,n),__classPrivateFieldGet(this,Kp,`f`)[S]=!0)}[wm](){__classPrivateFieldGet(this,Jp,`f`).push({options:__classPrivateFieldGet(this,nm,`f`),configObjects:__classPrivateFieldGet(this,nm,`f`).configObjects.slice(0),exitProcess:__classPrivateFieldGet(this,qp,`f`),groups:__classPrivateFieldGet(this,Xp,`f`),strict:__classPrivateFieldGet(this,pm,`f`),strictCommands:__classPrivateFieldGet(this,mm,`f`),strictOptions:__classPrivateFieldGet(this,hm,`f`),completionCommand:__classPrivateFieldGet(this,Hp,`f`),output:__classPrivateFieldGet(this,tm,`f`),exitError:__classPrivateFieldGet(this,Wp,`f`),hasOutput:__classPrivateFieldGet(this,Zp,`f`),parsed:this.parsed,parseFn:__classPrivateFieldGet(this,om,`f`),parseContext:__classPrivateFieldGet(this,sm,`f`)}),__classPrivateFieldGet(this,gm,`f`).freeze(),__classPrivateFieldGet(this,ym,`f`).freeze(),__classPrivateFieldGet(this,Rp,`f`).freeze(),__classPrivateFieldGet(this,Yp,`f`).freeze()}[Tm](){let t=``,n;return n=/\b(node|iojs|electron)(\.exe)?$/.test(__classPrivateFieldGet(this,fm,`f`).process.argv()[0])?__classPrivateFieldGet(this,fm,`f`).process.argv().slice(1,2):__classPrivateFieldGet(this,fm,`f`).process.argv().slice(0,1),t=n.map(t=>{let n=this[Xm](__classPrivateFieldGet(this,zp,`f`),t);return t.match(/^(\/|([a-zA-Z]:)?\\)/)&&n.length<t.length?n:t}).join(` `).trim(),__classPrivateFieldGet(this,fm,`f`).getEnv(`_`)&&__classPrivateFieldGet(this,fm,`f`).getProcessArgvBin()===__classPrivateFieldGet(this,fm,`f`).getEnv(`_`)&&(t=__classPrivateFieldGet(this,fm,`f`).getEnv(`_`).replace(`${__classPrivateFieldGet(this,fm,`f`).path.dirname(__classPrivateFieldGet(this,fm,`f`).process.execPath())}/`,``)),t}[Em](){return __classPrivateFieldGet(this,am,`f`)}[Dm](){return __classPrivateFieldGet(this,_m,`f`)}[Om](){if(!__classPrivateFieldGet(this,Gp,`f`))return;let t=__classPrivateFieldGet(this,fm,`f`).getEnv(`LC_ALL`)||__classPrivateFieldGet(this,fm,`f`).getEnv(`LC_MESSAGES`)||__classPrivateFieldGet(this,fm,`f`).getEnv(`LANG`)||__classPrivateFieldGet(this,fm,`f`).getEnv(`LANGUAGE`)||`en_US`;this.locale(t.replace(/[.:].*/,``))}[km](){return this[jm]().version||`unknown`}[Am](t){let n=t[`--`]?t[`--`]:t._;for(let t=0,S;(S=n[t])!==void 0;t++)__classPrivateFieldGet(this,fm,`f`).Parser.looksLikeNumber(S)&&Number.isSafeInteger(Math.floor(parseFloat(`${S}`)))&&(n[t]=Number(S));return t}[jm](t){let n=t||`*`;if(__classPrivateFieldGet(this,cm,`f`)[n])return __classPrivateFieldGet(this,cm,`f`)[n];let S={};try{let n=t||__classPrivateFieldGet(this,fm,`f`).mainFilename;__classPrivateFieldGet(this,fm,`f`).path.extname(n)&&(n=__classPrivateFieldGet(this,fm,`f`).path.dirname(n));let C=__classPrivateFieldGet(this,fm,`f`).findUp(n,(t,n)=>{if(n.includes(`package.json`))return`package.json`});assertNotStrictEqual(C,void 0,__classPrivateFieldGet(this,fm,`f`)),S=JSON.parse(__classPrivateFieldGet(this,fm,`f`).readFileSync(C,`utf8`))}catch{}return __classPrivateFieldGet(this,cm,`f`)[n]=S||{},__classPrivateFieldGet(this,cm,`f`)[n]}[Mm](t,n){n=[].concat(n),n.forEach(n=>{n=this[Im](n),__classPrivateFieldGet(this,nm,`f`)[t].push(n)})}[Nm](t,n,S,C){this[Fm](t,n,S,C,(t,n,S)=>{__classPrivateFieldGet(this,nm,`f`)[t][n]=S})}[Pm](t,n,S,C){this[Fm](t,n,S,C,(t,n,S)=>{__classPrivateFieldGet(this,nm,`f`)[t][n]=(__classPrivateFieldGet(this,nm,`f`)[t][n]||[]).concat(S)})}[Fm](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[Im](S),C)}[Im](t){return t===`__proto__`?`___proto___`:t}[Lm](t,n){return this[Nm](this[Lm].bind(this),`key`,t,n),this}[Rm](){var t,n,S,C,N,F,I,H,W,q,Y,X;let Z=__classPrivateFieldGet(this,Jp,`f`).pop();assertNotStrictEqual(Z,void 0,__classPrivateFieldGet(this,fm,`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,nm,n,`f`)}}.value,configObjects:te,exitProcess:{set value(t){__classPrivateFieldSet(n,qp,t,`f`)}}.value,groups:{set value(t){__classPrivateFieldSet(S,Xp,t,`f`)}}.value,output:{set value(t){__classPrivateFieldSet(C,tm,t,`f`)}}.value,exitError:{set value(t){__classPrivateFieldSet(N,Wp,t,`f`)}}.value,hasOutput:{set value(t){__classPrivateFieldSet(F,Zp,t,`f`)}}.value,parsed:this.parsed,strict:{set value(t){__classPrivateFieldSet(I,pm,t,`f`)}}.value,strictCommands:{set value(t){__classPrivateFieldSet(H,mm,t,`f`)}}.value,strictOptions:{set value(t){__classPrivateFieldSet(W,hm,t,`f`)}}.value,completionCommand:{set value(t){__classPrivateFieldSet(q,Hp,t,`f`)}}.value,parseFn:{set value(t){__classPrivateFieldSet(Y,om,t,`f`)}}.value,parseContext:{set value(t){__classPrivateFieldSet(X,sm,t,`f`)}}.value}=Z,__classPrivateFieldGet(this,nm,`f`).configObjects=te,__classPrivateFieldGet(this,gm,`f`).unfreeze(),__classPrivateFieldGet(this,ym,`f`).unfreeze(),__classPrivateFieldGet(this,Rp,`f`).unfreeze(),__classPrivateFieldGet(this,Yp,`f`).unfreeze()}[zm](t,n){return maybeAsyncResult(n,n=>(t(n),n))}getInternalMethods(){return{getCommandInstance:this[Bm].bind(this),getContext:this[Vm].bind(this),getHasOutput:this[Hm].bind(this),getLoggerInstance:this[Um].bind(this),getParseContext:this[Wm].bind(this),getParserConfiguration:this[Em].bind(this),getUsageConfiguration:this[Dm].bind(this),getUsageInstance:this[Gm].bind(this),getValidationInstance:this[Km].bind(this),hasParseCallback:this[qm].bind(this),isGlobalContext:this[Jm].bind(this),postProcess:this[Ym].bind(this),reset:this[Zm].bind(this),runValidation:this[$m].bind(this),runYargsParserAndExecuteCommands:this[Qm].bind(this),setHasOutput:this[eh].bind(this)}}[Bm](){return __classPrivateFieldGet(this,Rp,`f`)}[Vm](){return __classPrivateFieldGet(this,Bp,`f`)}[Hm](){return __classPrivateFieldGet(this,Zp,`f`)}[Um](){return __classPrivateFieldGet(this,em,`f`)}[Wm](){return __classPrivateFieldGet(this,sm,`f`)||{}}[Gm](){return __classPrivateFieldGet(this,gm,`f`)}[Km](){return __classPrivateFieldGet(this,ym,`f`)}[qm](){return!!__classPrivateFieldGet(this,om,`f`)}[Jm](){return __classPrivateFieldGet(this,$p,`f`)}[Ym](t,n,S,C){return S||isPromise(t)?t:(n||(t=this[bm](t)),(this[Em]()[`parse-positional-numbers`]||this[Em]()[`parse-positional-numbers`]===void 0)&&(t=this[Am](t)),C&&(t=applyMiddleware(t,this,__classPrivateFieldGet(this,Yp,`f`).getMiddleware(),!1)),t)}[Zm](t={}){__classPrivateFieldSet(this,nm,__classPrivateFieldGet(this,nm,`f`)||{},`f`);let n={};n.local=__classPrivateFieldGet(this,nm,`f`).local||[],n.configObjects=__classPrivateFieldGet(this,nm,`f`).configObjects||[];let S={};return n.local.forEach(n=>{S[n]=!0,(t[n]||[]).forEach(t=>{S[t]=!0})}),Object.assign(__classPrivateFieldGet(this,lm,`f`),Object.keys(__classPrivateFieldGet(this,Xp,`f`)).reduce((t,n)=>{let C=__classPrivateFieldGet(this,Xp,`f`)[n].filter(t=>!(t in S));return C.length>0&&(t[n]=C),t},{})),__classPrivateFieldSet(this,Xp,{},`f`),[`array`,`boolean`,`string`,`skipValidation`,`count`,`normalize`,`number`,`hiddenOptions`].forEach(t=>{n[t]=(__classPrivateFieldGet(this,nm,`f`)[t]||[]).filter(t=>!S[t])}),[`narg`,`key`,`alias`,`default`,`defaultDescription`,`config`,`choices`,`demandedOptions`,`demandedCommands`,`deprecatedOptions`].forEach(t=>{n[t]=objFilter(__classPrivateFieldGet(this,nm,`f`)[t],t=>!S[t])}),n.envPrefix=__classPrivateFieldGet(this,nm,`f`).envPrefix,__classPrivateFieldSet(this,nm,n,`f`),__classPrivateFieldSet(this,gm,__classPrivateFieldGet(this,gm,`f`)?__classPrivateFieldGet(this,gm,`f`).reset(S):usage(this,__classPrivateFieldGet(this,fm,`f`)),`f`),__classPrivateFieldSet(this,ym,__classPrivateFieldGet(this,ym,`f`)?__classPrivateFieldGet(this,ym,`f`).reset(S):validation(this,__classPrivateFieldGet(this,gm,`f`),__classPrivateFieldGet(this,fm,`f`)),`f`),__classPrivateFieldSet(this,Rp,__classPrivateFieldGet(this,Rp,`f`)?__classPrivateFieldGet(this,Rp,`f`).reset():command(__classPrivateFieldGet(this,gm,`f`),__classPrivateFieldGet(this,ym,`f`),__classPrivateFieldGet(this,Yp,`f`),__classPrivateFieldGet(this,fm,`f`)),`f`),__classPrivateFieldGet(this,Vp,`f`)||__classPrivateFieldSet(this,Vp,completion(this,__classPrivateFieldGet(this,gm,`f`),__classPrivateFieldGet(this,Rp,`f`),__classPrivateFieldGet(this,fm,`f`)),`f`),__classPrivateFieldGet(this,Yp,`f`).reset(),__classPrivateFieldSet(this,Hp,null,`f`),__classPrivateFieldSet(this,tm,``,`f`),__classPrivateFieldSet(this,Wp,null,`f`),__classPrivateFieldSet(this,Zp,!1,`f`),this.parsed=!1,this}[Xm](t,n){return __classPrivateFieldGet(this,fm,`f`).path.relative(t,n)}[Qm](t,n,S,C=0,N=!1){let F=!!S||N;t||=__classPrivateFieldGet(this,um,`f`),__classPrivateFieldGet(this,nm,`f`).__=__classPrivateFieldGet(this,fm,`f`).y18n.__,__classPrivateFieldGet(this,nm,`f`).configuration=this[Em]();let I=!!__classPrivateFieldGet(this,nm,`f`).configuration[`populate--`],H=Object.assign({},__classPrivateFieldGet(this,nm,`f`).configuration,{"populate--":!0}),W=__classPrivateFieldGet(this,fm,`f`).Parser.detailed(t,Object.assign({},__classPrivateFieldGet(this,nm,`f`),{configuration:{"parse-positional-numbers":!1,...H}})),q=Object.assign(W.argv,__classPrivateFieldGet(this,sm,`f`)),Y,X=W.aliases,Z=!1,te=!1;Object.keys(q).forEach(t=>{t===__classPrivateFieldGet(this,Qp,`f`)&&q[t]?Z=!0:t===__classPrivateFieldGet(this,vm,`f`)&&q[t]&&(te=!0)}),q.$0=this.$0,this.parsed=W,C===0&&__classPrivateFieldGet(this,gm,`f`).clearCachedHelpMessage();try{if(this[Om](),n)return this[Ym](q,I,!!S,!1);__classPrivateFieldGet(this,Qp,`f`)&&[__classPrivateFieldGet(this,Qp,`f`)].concat(X[__classPrivateFieldGet(this,Qp,`f`)]||[]).filter(t=>t.length>1).includes(``+q._[q._.length-1])&&(q._.pop(),Z=!0),__classPrivateFieldSet(this,$p,!1,`f`);let H=__classPrivateFieldGet(this,Rp,`f`).getCommands(),ne=__classPrivateFieldGet(this,Vp,`f`)?.completionKey?[__classPrivateFieldGet(this,Vp,`f`)?.completionKey,...this.getAliases()[__classPrivateFieldGet(this,Vp,`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,Hp,`f`)){let t=__classPrivateFieldGet(this,Rp,`f`).runCommand(F,this,W,n+1,N,Z||te||N);return this[Ym](t,I,!!S,!1)}else if(!t&&F!==__classPrivateFieldGet(this,Hp,`f`)){t=F;break}!__classPrivateFieldGet(this,Rp,`f`).hasDefaultCommand()&&__classPrivateFieldGet(this,dm,`f`)&&t&&!re&&__classPrivateFieldGet(this,ym,`f`).recommendCommands(t,H)}__classPrivateFieldGet(this,Hp,`f`)&&q._.includes(__classPrivateFieldGet(this,Hp,`f`))&&!ne&&(__classPrivateFieldGet(this,qp,`f`)&&setBlocking(!0),this.showCompletionScript(),this.exit(0))}if(__classPrivateFieldGet(this,Rp,`f`).hasDefaultCommand()&&!re){let t=__classPrivateFieldGet(this,Rp,`f`).runCommand(null,this,W,0,N,Z||te||N);return this[Ym](t,I,!!S,!1)}if(ne){__classPrivateFieldGet(this,qp,`f`)&&setBlocking(!0),t=[].concat(t);let n=t.slice(t.indexOf(`--${__classPrivateFieldGet(this,Vp,`f`).completionKey}`)+1);return __classPrivateFieldGet(this,Vp,`f`).getCompletion(n,(t,n)=>{if(t)throw new Il(t.message);(n||[]).forEach(t=>{__classPrivateFieldGet(this,em,`f`).log(t)}),this.exit(0)}),this[Ym](q,!I,!!S,!1)}if(__classPrivateFieldGet(this,Zp,`f`)||(Z?(__classPrivateFieldGet(this,qp,`f`)&&setBlocking(!0),F=!0,this.showHelp(t=>{__classPrivateFieldGet(this,em,`f`).log(t),this.exit(0)})):te&&(__classPrivateFieldGet(this,qp,`f`)&&setBlocking(!0),F=!0,__classPrivateFieldGet(this,gm,`f`).showVersion(`log`),this.exit(0))),!F&&__classPrivateFieldGet(this,nm,`f`).skipValidation.length>0&&(F=Object.keys(q).some(t=>__classPrivateFieldGet(this,nm,`f`).skipValidation.indexOf(t)>=0&&q[t]===!0)),!F){if(W.error)throw new Il(W.error.message);if(!ne){let t=this[$m](X,{},W.error);S||(Y=applyMiddleware(q,this,__classPrivateFieldGet(this,Yp,`f`).getMiddleware(),!0)),Y=this[zm](t,Y??q),isPromise(Y)&&!S&&(Y=Y.then(()=>applyMiddleware(q,this,__classPrivateFieldGet(this,Yp,`f`).getMiddleware(),!1)))}}}catch(t){if(t instanceof Il)__classPrivateFieldGet(this,gm,`f`).fail(t.message,t);else throw t}return this[Ym](Y??q,I,!!S,!0)}[$m](t,n,S,C){let N={...this.getDemandedOptions()};return F=>{if(S)throw new Il(S.message);__classPrivateFieldGet(this,ym,`f`).nonOptionCount(F),__classPrivateFieldGet(this,ym,`f`).requiredArguments(F,N);let I=!1;__classPrivateFieldGet(this,mm,`f`)&&(I=__classPrivateFieldGet(this,ym,`f`).unknownCommands(F)),__classPrivateFieldGet(this,pm,`f`)&&!I?__classPrivateFieldGet(this,ym,`f`).unknownArguments(F,t,n,!!C):__classPrivateFieldGet(this,hm,`f`)&&__classPrivateFieldGet(this,ym,`f`).unknownArguments(F,t,{},!1,!1),__classPrivateFieldGet(this,ym,`f`).limitedChoices(F),__classPrivateFieldGet(this,ym,`f`).implications(F),__classPrivateFieldGet(this,ym,`f`).conflicting(F)}}[eh](){__classPrivateFieldSet(this,Zp,!0,`f`)}[th](t){if(typeof t==`string`)__classPrivateFieldGet(this,nm,`f`).key[t]=!0;else for(let n of t)__classPrivateFieldGet(this,nm,`f`).key[n]=!0}}}),ih,ah=__esmMin(()=>{vp(),rh(),ih=YargsFactory(gp)});function classifyCliFailure(t,n){return typeof t==`string`&&t.length>0?{kind:`usage`,message:t}:{kind:`runtime`}}var oh=__esmMin(()=>{});function buildHeaders(t,n){let S={"user-agent":`gjsify-install/0.64.29`,"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 sh=__esmMin(()=>{}),PackageNotFoundError,IntegrityError,RegistryTimeoutError,RegistryUnreachableError,ch=__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):lh}function parseNpmrc(t){let n={registry:lh,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 lh,uh=__esmMin(()=>{lh=`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 dh=__esmMin(()=>{ch(),__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 fh=__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 ph=__esmMin(()=>{sh(),ch(),uh(),dh()});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 mh=__esmMin(()=>{sh(),ch(),dh(),fh()});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 hh=__esmMin(()=>{sh(),uh()}),gh=__esmMin(()=>{sh(),ch(),uh(),fh(),ph(),mh(),hh()});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 vh===void 0&&(vh=`0.64.29`),vh}function cliPackageDir(){let t=globalThis.process?.env?.GJSIFY_CLI_PACKAGE_JSON,n;try{n=zn(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=zn(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 vh,yh=__esmMin(()=>{ef(),qn(),ir(),gh()}),bh,xh=__esmMin(()=>{bh=`gjsify`});function parseDeclaredChannel(t,n){if(!(t===void 0||t===``)){if(Sh.includes(t))return t;throw Error(`${n}: "${String(t)}" is not a distribution channel. Known: ${Sh.join(`, `)}.`)}}function channelAllowsDonations(t){return t!==void 0&&Ch[t]===`external-link`}var Sh,Ch,wh,Th=__esmMin(()=>{Sh=[`flathub`,`web`,`microsoft-store`,`apple-app-store`],Ch={flathub:`external-link`,web:`external-link`,"microsoft-store":`none`,"apple-app-store":`store-purchase`},wh=`GJSIFY_CHANNEL`});function parseDeclaredPricing(t,n){if(!(t===void 0||t===``)){if(Eh.includes(t))return t;throw Error(`${n}: "${String(t)}" is not a pricing tier. Known: ${Eh.join(`, `)}.`)}}var Eh,Dh,Oh=__esmMin(()=>{Eh=[`free`,`paid`],Dh=`GJSIFY_PRICING`}),kh=__commonJSMin(((t,n)=>{let S=(qn(),__toCommonJS(jn)),C=(Xl(),__toCommonJS(Kl)),N=(ef(),__toCommonJS(Qd)),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)})),Ah=__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})),jh=__commonJSMin(((t,n)=>{let S=Ah();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}}}})),Mh=__commonJSMin(((t,n)=>{var{__gjsifyModuleDir:S,__gjsifyModuleFile:C}=(eu(),__toCommonJS(Zl)),N=S(`import-fresh/index.js`),F=C(`import-fresh/index.js`);let I=(qn(),__toCommonJS(jn)),H=kh(),W=jh();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)}})),Nh=__commonJSMin(((t,n)=>{n.exports=function isArrayish(t){return t?t instanceof Array||Array.isArray(t)||t.length>=0&&t.splice instanceof Function:!1}})),Ph=__commonJSMin(((t,n)=>{var S=(zu(),__toCommonJS(Fu)),C=Nh(),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
+ `,`f`),__classPrivateFieldSet(this,tm,__classPrivateFieldGet(this,tm,`f`)+t.join(` `),`f`)}}}[Sm](t){objectKeys(__classPrivateFieldGet(this,nm,`f`)).forEach(n=>{if((t=>t===`configObjects`)(n))return;let S=__classPrivateFieldGet(this,nm,`f`)[n];Array.isArray(S)?S.includes(t)&&S.splice(S.indexOf(t),1):typeof S==`object`&&delete S[t]}),delete __classPrivateFieldGet(this,gm,`f`).getDescriptions()[t]}[Cm](t,n,S){__classPrivateFieldGet(this,Kp,`f`)[S]||(__classPrivateFieldGet(this,fm,`f`).process.emitWarning(t,n),__classPrivateFieldGet(this,Kp,`f`)[S]=!0)}[wm](){__classPrivateFieldGet(this,Jp,`f`).push({options:__classPrivateFieldGet(this,nm,`f`),configObjects:__classPrivateFieldGet(this,nm,`f`).configObjects.slice(0),exitProcess:__classPrivateFieldGet(this,qp,`f`),groups:__classPrivateFieldGet(this,Xp,`f`),strict:__classPrivateFieldGet(this,pm,`f`),strictCommands:__classPrivateFieldGet(this,mm,`f`),strictOptions:__classPrivateFieldGet(this,hm,`f`),completionCommand:__classPrivateFieldGet(this,Hp,`f`),output:__classPrivateFieldGet(this,tm,`f`),exitError:__classPrivateFieldGet(this,Wp,`f`),hasOutput:__classPrivateFieldGet(this,Zp,`f`),parsed:this.parsed,parseFn:__classPrivateFieldGet(this,om,`f`),parseContext:__classPrivateFieldGet(this,sm,`f`)}),__classPrivateFieldGet(this,gm,`f`).freeze(),__classPrivateFieldGet(this,ym,`f`).freeze(),__classPrivateFieldGet(this,Rp,`f`).freeze(),__classPrivateFieldGet(this,Yp,`f`).freeze()}[Tm](){let t=``,n;return n=/\b(node|iojs|electron)(\.exe)?$/.test(__classPrivateFieldGet(this,fm,`f`).process.argv()[0])?__classPrivateFieldGet(this,fm,`f`).process.argv().slice(1,2):__classPrivateFieldGet(this,fm,`f`).process.argv().slice(0,1),t=n.map(t=>{let n=this[Xm](__classPrivateFieldGet(this,zp,`f`),t);return t.match(/^(\/|([a-zA-Z]:)?\\)/)&&n.length<t.length?n:t}).join(` `).trim(),__classPrivateFieldGet(this,fm,`f`).getEnv(`_`)&&__classPrivateFieldGet(this,fm,`f`).getProcessArgvBin()===__classPrivateFieldGet(this,fm,`f`).getEnv(`_`)&&(t=__classPrivateFieldGet(this,fm,`f`).getEnv(`_`).replace(`${__classPrivateFieldGet(this,fm,`f`).path.dirname(__classPrivateFieldGet(this,fm,`f`).process.execPath())}/`,``)),t}[Em](){return __classPrivateFieldGet(this,am,`f`)}[Dm](){return __classPrivateFieldGet(this,_m,`f`)}[Om](){if(!__classPrivateFieldGet(this,Gp,`f`))return;let t=__classPrivateFieldGet(this,fm,`f`).getEnv(`LC_ALL`)||__classPrivateFieldGet(this,fm,`f`).getEnv(`LC_MESSAGES`)||__classPrivateFieldGet(this,fm,`f`).getEnv(`LANG`)||__classPrivateFieldGet(this,fm,`f`).getEnv(`LANGUAGE`)||`en_US`;this.locale(t.replace(/[.:].*/,``))}[km](){return this[jm]().version||`unknown`}[Am](t){let n=t[`--`]?t[`--`]:t._;for(let t=0,S;(S=n[t])!==void 0;t++)__classPrivateFieldGet(this,fm,`f`).Parser.looksLikeNumber(S)&&Number.isSafeInteger(Math.floor(parseFloat(`${S}`)))&&(n[t]=Number(S));return t}[jm](t){let n=t||`*`;if(__classPrivateFieldGet(this,cm,`f`)[n])return __classPrivateFieldGet(this,cm,`f`)[n];let S={};try{let n=t||__classPrivateFieldGet(this,fm,`f`).mainFilename;__classPrivateFieldGet(this,fm,`f`).path.extname(n)&&(n=__classPrivateFieldGet(this,fm,`f`).path.dirname(n));let C=__classPrivateFieldGet(this,fm,`f`).findUp(n,(t,n)=>{if(n.includes(`package.json`))return`package.json`});assertNotStrictEqual(C,void 0,__classPrivateFieldGet(this,fm,`f`)),S=JSON.parse(__classPrivateFieldGet(this,fm,`f`).readFileSync(C,`utf8`))}catch{}return __classPrivateFieldGet(this,cm,`f`)[n]=S||{},__classPrivateFieldGet(this,cm,`f`)[n]}[Mm](t,n){n=[].concat(n),n.forEach(n=>{n=this[Im](n),__classPrivateFieldGet(this,nm,`f`)[t].push(n)})}[Nm](t,n,S,C){this[Fm](t,n,S,C,(t,n,S)=>{__classPrivateFieldGet(this,nm,`f`)[t][n]=S})}[Pm](t,n,S,C){this[Fm](t,n,S,C,(t,n,S)=>{__classPrivateFieldGet(this,nm,`f`)[t][n]=(__classPrivateFieldGet(this,nm,`f`)[t][n]||[]).concat(S)})}[Fm](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[Im](S),C)}[Im](t){return t===`__proto__`?`___proto___`:t}[Lm](t,n){return this[Nm](this[Lm].bind(this),`key`,t,n),this}[Rm](){var t,n,S,C,N,F,I,H,W,q,Y,X;let Z=__classPrivateFieldGet(this,Jp,`f`).pop();assertNotStrictEqual(Z,void 0,__classPrivateFieldGet(this,fm,`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,nm,n,`f`)}}.value,configObjects:te,exitProcess:{set value(t){__classPrivateFieldSet(n,qp,t,`f`)}}.value,groups:{set value(t){__classPrivateFieldSet(S,Xp,t,`f`)}}.value,output:{set value(t){__classPrivateFieldSet(C,tm,t,`f`)}}.value,exitError:{set value(t){__classPrivateFieldSet(N,Wp,t,`f`)}}.value,hasOutput:{set value(t){__classPrivateFieldSet(F,Zp,t,`f`)}}.value,parsed:this.parsed,strict:{set value(t){__classPrivateFieldSet(I,pm,t,`f`)}}.value,strictCommands:{set value(t){__classPrivateFieldSet(H,mm,t,`f`)}}.value,strictOptions:{set value(t){__classPrivateFieldSet(W,hm,t,`f`)}}.value,completionCommand:{set value(t){__classPrivateFieldSet(q,Hp,t,`f`)}}.value,parseFn:{set value(t){__classPrivateFieldSet(Y,om,t,`f`)}}.value,parseContext:{set value(t){__classPrivateFieldSet(X,sm,t,`f`)}}.value}=Z,__classPrivateFieldGet(this,nm,`f`).configObjects=te,__classPrivateFieldGet(this,gm,`f`).unfreeze(),__classPrivateFieldGet(this,ym,`f`).unfreeze(),__classPrivateFieldGet(this,Rp,`f`).unfreeze(),__classPrivateFieldGet(this,Yp,`f`).unfreeze()}[zm](t,n){return maybeAsyncResult(n,n=>(t(n),n))}getInternalMethods(){return{getCommandInstance:this[Bm].bind(this),getContext:this[Vm].bind(this),getHasOutput:this[Hm].bind(this),getLoggerInstance:this[Um].bind(this),getParseContext:this[Wm].bind(this),getParserConfiguration:this[Em].bind(this),getUsageConfiguration:this[Dm].bind(this),getUsageInstance:this[Gm].bind(this),getValidationInstance:this[Km].bind(this),hasParseCallback:this[qm].bind(this),isGlobalContext:this[Jm].bind(this),postProcess:this[Ym].bind(this),reset:this[Zm].bind(this),runValidation:this[$m].bind(this),runYargsParserAndExecuteCommands:this[Qm].bind(this),setHasOutput:this[eh].bind(this)}}[Bm](){return __classPrivateFieldGet(this,Rp,`f`)}[Vm](){return __classPrivateFieldGet(this,Bp,`f`)}[Hm](){return __classPrivateFieldGet(this,Zp,`f`)}[Um](){return __classPrivateFieldGet(this,em,`f`)}[Wm](){return __classPrivateFieldGet(this,sm,`f`)||{}}[Gm](){return __classPrivateFieldGet(this,gm,`f`)}[Km](){return __classPrivateFieldGet(this,ym,`f`)}[qm](){return!!__classPrivateFieldGet(this,om,`f`)}[Jm](){return __classPrivateFieldGet(this,$p,`f`)}[Ym](t,n,S,C){return S||isPromise(t)?t:(n||(t=this[bm](t)),(this[Em]()[`parse-positional-numbers`]||this[Em]()[`parse-positional-numbers`]===void 0)&&(t=this[Am](t)),C&&(t=applyMiddleware(t,this,__classPrivateFieldGet(this,Yp,`f`).getMiddleware(),!1)),t)}[Zm](t={}){__classPrivateFieldSet(this,nm,__classPrivateFieldGet(this,nm,`f`)||{},`f`);let n={};n.local=__classPrivateFieldGet(this,nm,`f`).local||[],n.configObjects=__classPrivateFieldGet(this,nm,`f`).configObjects||[];let S={};return n.local.forEach(n=>{S[n]=!0,(t[n]||[]).forEach(t=>{S[t]=!0})}),Object.assign(__classPrivateFieldGet(this,lm,`f`),Object.keys(__classPrivateFieldGet(this,Xp,`f`)).reduce((t,n)=>{let C=__classPrivateFieldGet(this,Xp,`f`)[n].filter(t=>!(t in S));return C.length>0&&(t[n]=C),t},{})),__classPrivateFieldSet(this,Xp,{},`f`),[`array`,`boolean`,`string`,`skipValidation`,`count`,`normalize`,`number`,`hiddenOptions`].forEach(t=>{n[t]=(__classPrivateFieldGet(this,nm,`f`)[t]||[]).filter(t=>!S[t])}),[`narg`,`key`,`alias`,`default`,`defaultDescription`,`config`,`choices`,`demandedOptions`,`demandedCommands`,`deprecatedOptions`].forEach(t=>{n[t]=objFilter(__classPrivateFieldGet(this,nm,`f`)[t],t=>!S[t])}),n.envPrefix=__classPrivateFieldGet(this,nm,`f`).envPrefix,__classPrivateFieldSet(this,nm,n,`f`),__classPrivateFieldSet(this,gm,__classPrivateFieldGet(this,gm,`f`)?__classPrivateFieldGet(this,gm,`f`).reset(S):usage(this,__classPrivateFieldGet(this,fm,`f`)),`f`),__classPrivateFieldSet(this,ym,__classPrivateFieldGet(this,ym,`f`)?__classPrivateFieldGet(this,ym,`f`).reset(S):validation(this,__classPrivateFieldGet(this,gm,`f`),__classPrivateFieldGet(this,fm,`f`)),`f`),__classPrivateFieldSet(this,Rp,__classPrivateFieldGet(this,Rp,`f`)?__classPrivateFieldGet(this,Rp,`f`).reset():command(__classPrivateFieldGet(this,gm,`f`),__classPrivateFieldGet(this,ym,`f`),__classPrivateFieldGet(this,Yp,`f`),__classPrivateFieldGet(this,fm,`f`)),`f`),__classPrivateFieldGet(this,Vp,`f`)||__classPrivateFieldSet(this,Vp,completion(this,__classPrivateFieldGet(this,gm,`f`),__classPrivateFieldGet(this,Rp,`f`),__classPrivateFieldGet(this,fm,`f`)),`f`),__classPrivateFieldGet(this,Yp,`f`).reset(),__classPrivateFieldSet(this,Hp,null,`f`),__classPrivateFieldSet(this,tm,``,`f`),__classPrivateFieldSet(this,Wp,null,`f`),__classPrivateFieldSet(this,Zp,!1,`f`),this.parsed=!1,this}[Xm](t,n){return __classPrivateFieldGet(this,fm,`f`).path.relative(t,n)}[Qm](t,n,S,C=0,N=!1){let F=!!S||N;t||=__classPrivateFieldGet(this,um,`f`),__classPrivateFieldGet(this,nm,`f`).__=__classPrivateFieldGet(this,fm,`f`).y18n.__,__classPrivateFieldGet(this,nm,`f`).configuration=this[Em]();let I=!!__classPrivateFieldGet(this,nm,`f`).configuration[`populate--`],H=Object.assign({},__classPrivateFieldGet(this,nm,`f`).configuration,{"populate--":!0}),W=__classPrivateFieldGet(this,fm,`f`).Parser.detailed(t,Object.assign({},__classPrivateFieldGet(this,nm,`f`),{configuration:{"parse-positional-numbers":!1,...H}})),q=Object.assign(W.argv,__classPrivateFieldGet(this,sm,`f`)),Y,X=W.aliases,Z=!1,te=!1;Object.keys(q).forEach(t=>{t===__classPrivateFieldGet(this,Qp,`f`)&&q[t]?Z=!0:t===__classPrivateFieldGet(this,vm,`f`)&&q[t]&&(te=!0)}),q.$0=this.$0,this.parsed=W,C===0&&__classPrivateFieldGet(this,gm,`f`).clearCachedHelpMessage();try{if(this[Om](),n)return this[Ym](q,I,!!S,!1);__classPrivateFieldGet(this,Qp,`f`)&&[__classPrivateFieldGet(this,Qp,`f`)].concat(X[__classPrivateFieldGet(this,Qp,`f`)]||[]).filter(t=>t.length>1).includes(``+q._[q._.length-1])&&(q._.pop(),Z=!0),__classPrivateFieldSet(this,$p,!1,`f`);let H=__classPrivateFieldGet(this,Rp,`f`).getCommands(),ne=__classPrivateFieldGet(this,Vp,`f`)?.completionKey?[__classPrivateFieldGet(this,Vp,`f`)?.completionKey,...this.getAliases()[__classPrivateFieldGet(this,Vp,`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,Hp,`f`)){let t=__classPrivateFieldGet(this,Rp,`f`).runCommand(F,this,W,n+1,N,Z||te||N);return this[Ym](t,I,!!S,!1)}else if(!t&&F!==__classPrivateFieldGet(this,Hp,`f`)){t=F;break}!__classPrivateFieldGet(this,Rp,`f`).hasDefaultCommand()&&__classPrivateFieldGet(this,dm,`f`)&&t&&!re&&__classPrivateFieldGet(this,ym,`f`).recommendCommands(t,H)}__classPrivateFieldGet(this,Hp,`f`)&&q._.includes(__classPrivateFieldGet(this,Hp,`f`))&&!ne&&(__classPrivateFieldGet(this,qp,`f`)&&setBlocking(!0),this.showCompletionScript(),this.exit(0))}if(__classPrivateFieldGet(this,Rp,`f`).hasDefaultCommand()&&!re){let t=__classPrivateFieldGet(this,Rp,`f`).runCommand(null,this,W,0,N,Z||te||N);return this[Ym](t,I,!!S,!1)}if(ne){__classPrivateFieldGet(this,qp,`f`)&&setBlocking(!0),t=[].concat(t);let n=t.slice(t.indexOf(`--${__classPrivateFieldGet(this,Vp,`f`).completionKey}`)+1);return __classPrivateFieldGet(this,Vp,`f`).getCompletion(n,(t,n)=>{if(t)throw new Il(t.message);(n||[]).forEach(t=>{__classPrivateFieldGet(this,em,`f`).log(t)}),this.exit(0)}),this[Ym](q,!I,!!S,!1)}if(__classPrivateFieldGet(this,Zp,`f`)||(Z?(__classPrivateFieldGet(this,qp,`f`)&&setBlocking(!0),F=!0,this.showHelp(t=>{__classPrivateFieldGet(this,em,`f`).log(t),this.exit(0)})):te&&(__classPrivateFieldGet(this,qp,`f`)&&setBlocking(!0),F=!0,__classPrivateFieldGet(this,gm,`f`).showVersion(`log`),this.exit(0))),!F&&__classPrivateFieldGet(this,nm,`f`).skipValidation.length>0&&(F=Object.keys(q).some(t=>__classPrivateFieldGet(this,nm,`f`).skipValidation.indexOf(t)>=0&&q[t]===!0)),!F){if(W.error)throw new Il(W.error.message);if(!ne){let t=this[$m](X,{},W.error);S||(Y=applyMiddleware(q,this,__classPrivateFieldGet(this,Yp,`f`).getMiddleware(),!0)),Y=this[zm](t,Y??q),isPromise(Y)&&!S&&(Y=Y.then(()=>applyMiddleware(q,this,__classPrivateFieldGet(this,Yp,`f`).getMiddleware(),!1)))}}}catch(t){if(t instanceof Il)__classPrivateFieldGet(this,gm,`f`).fail(t.message,t);else throw t}return this[Ym](Y??q,I,!!S,!0)}[$m](t,n,S,C){let N={...this.getDemandedOptions()};return F=>{if(S)throw new Il(S.message);__classPrivateFieldGet(this,ym,`f`).nonOptionCount(F),__classPrivateFieldGet(this,ym,`f`).requiredArguments(F,N);let I=!1;__classPrivateFieldGet(this,mm,`f`)&&(I=__classPrivateFieldGet(this,ym,`f`).unknownCommands(F)),__classPrivateFieldGet(this,pm,`f`)&&!I?__classPrivateFieldGet(this,ym,`f`).unknownArguments(F,t,n,!!C):__classPrivateFieldGet(this,hm,`f`)&&__classPrivateFieldGet(this,ym,`f`).unknownArguments(F,t,{},!1,!1),__classPrivateFieldGet(this,ym,`f`).limitedChoices(F),__classPrivateFieldGet(this,ym,`f`).implications(F),__classPrivateFieldGet(this,ym,`f`).conflicting(F)}}[eh](){__classPrivateFieldSet(this,Zp,!0,`f`)}[th](t){if(typeof t==`string`)__classPrivateFieldGet(this,nm,`f`).key[t]=!0;else for(let n of t)__classPrivateFieldGet(this,nm,`f`).key[n]=!0}}}),ih,ah=__esmMin(()=>{vp(),rh(),ih=YargsFactory(gp)});function classifyCliFailure(t,n){return typeof t==`string`&&t.length>0?{kind:`usage`,message:t}:{kind:`runtime`}}var oh=__esmMin(()=>{});function buildHeaders(t,n){let S={"user-agent":`gjsify-install/0.64.31`,"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 sh=__esmMin(()=>{}),PackageNotFoundError,IntegrityError,RegistryTimeoutError,RegistryUnreachableError,ch=__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):lh}function parseNpmrc(t){let n={registry:lh,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 lh,uh=__esmMin(()=>{lh=`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 dh=__esmMin(()=>{ch(),__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 fh=__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 ph=__esmMin(()=>{sh(),ch(),uh(),dh()});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 mh=__esmMin(()=>{sh(),ch(),dh(),fh()});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 hh=__esmMin(()=>{sh(),uh()}),gh=__esmMin(()=>{sh(),ch(),uh(),fh(),ph(),mh(),hh()});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 vh===void 0&&(vh=`0.64.31`),vh}function cliPackageDir(){let t=globalThis.process?.env?.GJSIFY_CLI_PACKAGE_JSON,n;try{n=zn(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=zn(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 vh,yh=__esmMin(()=>{ef(),qn(),ir(),gh()}),bh,xh=__esmMin(()=>{bh=`gjsify`});function parseDeclaredChannel(t,n){if(!(t===void 0||t===``)){if(Sh.includes(t))return t;throw Error(`${n}: "${String(t)}" is not a distribution channel. Known: ${Sh.join(`, `)}.`)}}function channelAllowsDonations(t){return t!==void 0&&Ch[t]===`external-link`}var Sh,Ch,wh,Th=__esmMin(()=>{Sh=[`flathub`,`web`,`microsoft-store`,`apple-app-store`],Ch={flathub:`external-link`,web:`external-link`,"microsoft-store":`none`,"apple-app-store":`store-purchase`},wh=`GJSIFY_CHANNEL`});function parseDeclaredPricing(t,n){if(!(t===void 0||t===``)){if(Eh.includes(t))return t;throw Error(`${n}: "${String(t)}" is not a pricing tier. Known: ${Eh.join(`, `)}.`)}}var Eh,Dh,Oh=__esmMin(()=>{Eh=[`free`,`paid`],Dh=`GJSIFY_PRICING`}),kh=__commonJSMin(((t,n)=>{let S=(qn(),__toCommonJS(jn)),C=(Xl(),__toCommonJS(Kl)),N=(ef(),__toCommonJS(Qd)),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)})),Ah=__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})),jh=__commonJSMin(((t,n)=>{let S=Ah();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}}}})),Mh=__commonJSMin(((t,n)=>{var{__gjsifyModuleDir:S,__gjsifyModuleFile:C}=(eu(),__toCommonJS(Zl)),N=S(`import-fresh/index.js`),F=C(`import-fresh/index.js`);let I=(qn(),__toCommonJS(jn)),H=kh(),W=jh();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)}})),Nh=__commonJSMin(((t,n)=>{n.exports=function isArrayish(t){return t?t instanceof Array||Array.isArray(t)||t.length>=0&&t.splice instanceof Function:!1}})),Ph=__commonJSMin(((t,n)=>{var S=(zu(),__toCommonJS(Fu)),C=Nh(),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(`
150
150
  `)},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(`
151
151
  `)},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})),Fh=__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=`
152
152
  `,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{}}})),Ih=__commonJSMin((t=>{t.__esModule=!0,t.LinesAndColumns=void 0;var n=`
@@ -697,7 +697,7 @@ Defaulting to 2020, but this will stop working in the future.`)),n.ecmaVersion=1
697
697
  `;break;default:t+=String.fromCharCode(S);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),n=this.pos}else++this.pos}},sS.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case`\\`:++this.pos;break;case`$`:if(this.input[this.pos+1]!==`{`)break;case"`":return this.finishToken(jb.invalidTemplate,this.input.slice(this.start,this.pos));case`\r`:this.input[this.pos+1]===`
698
698
  `&&++this.pos;case`
699
699
  `:case`\u2028`:case`\u2029`:++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,`Unterminated template`)},sS.readEscapedChar=function(t){var n=this.input.charCodeAt(++this.pos);switch(++this.pos,n){case 110:return`
700
- `;case 114:return`\r`;case 120:return String.fromCharCode(this.readHexChar(2));case 117:return codePointToString(this.readCodePoint());case 116:return` `;case 98:return`\b`;case 118:return`\v`;case 102:return`\f`;case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),``;case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,`Invalid escape sequence`),t){var S=this.pos-1;this.invalidStringToken(S,`Invalid escape sequence in template string`)}default:if(n>=48&&n<=55){var C=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],N=parseInt(C,8);return N>255&&(C=C.slice(0,-1),N=parseInt(C,8)),this.pos+=C.length-1,n=this.input.charCodeAt(this.pos),(C!==`0`||n===56||n===57)&&(this.strict||t)&&this.invalidStringToken(this.pos-1-C.length,t?`Octal literal in template string`:`Octal literal in strict mode`),String.fromCharCode(N)}return isNewLine(n)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),``):String.fromCharCode(n)}},sS.readHexChar=function(t){var n=this.pos,S=this.readInt(16,t);return S===null&&this.invalidStringToken(n,`Bad character escape sequence`),S},sS.readWord1=function(){this.containsEsc=!1;for(var t=``,n=!0,S=this.pos,C=this.options.ecmaVersion>=6;this.pos<this.input.length;){var N=this.fullCharCodeAtPos();if(isIdentifierChar(N,C))this.pos+=N<=65535?1:2;else if(N===92){this.containsEsc=!0,t+=this.input.slice(S,this.pos);var F=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,`Expecting Unicode escape sequence \\uXXXX`),++this.pos;var I=this.readCodePoint();(n?isIdentifierStart:isIdentifierChar)(I,C)||this.invalidStringToken(F,`Invalid Unicode escape`),t+=codePointToString(I),S=this.pos}else break;n=!1}return t+this.input.slice(S,this.pos)},sS.readWord=function(){var t=this.readWord1(),n=jb.name;return this.keywords.test(t)&&(n=Ab[t]),this.finishToken(n,t)},lS=`8.17.0`,dx.acorn={Parser:dx,version:lS,defaultOptions:Gb,Position:Ub,SourceLocation:Wb,getLineInfo,Node:Nx,TokenType:Db,tokTypes:jb,keywordTypes:Ab,TokContext:Tx,tokContexts:Ex,isIdentifierChar,isIdentifierStart,Token:oS,isNewLine,lineBreak:Mb,lineBreakG:Nb,nonASCIIwhitespace:Pb},__name$1(parse$3,`parse`)});function simple(t,n,S,C,N){S||=dS,(function c(t,C,N){var F=N||t.type;visitNode$1(S,F,t,C,c),n[F]&&n[F](t,C)})(t,C,N)}function ancestor(t,n,S,C,N){var F=[];S||=dS,(function c(t,C,N){var I=N||t.type,H=t!==F[F.length-1];H&&F.push(t),visitNode$1(S,I,t,C,c),n[I]&&n[I](t,C||F,F),H&&F.pop()})(t,C,N)}function full(t,n,S,C,N){S||=dS;var F;(function c(t,C,N){var I=N||t.type;visitNode$1(S,I,t,C,c),F!==t&&(n(t,C,I),F=t)})(t,C,N)}function skipThrough(t,n,S){S(t,n)}function ignore(t,n,S){}function visitNode$1(t,n,S,C,N){if(t[n]==null)throw Error(`No walker function defined for node type `+n);t[n](S,C,N)}var dS,fS=__esmMin(()=>{__name$1(visitNode$1,`visitNode`),dS={},dS.Program=dS.BlockStatement=dS.StaticBlock=function(t,n,S){for(var C=0,N=t.body;C<N.length;C+=1){var F=N[C];S(F,n,`Statement`)}},dS.Statement=skipThrough,dS.EmptyStatement=ignore,dS.ExpressionStatement=dS.ParenthesizedExpression=dS.ChainExpression=function(t,n,S){return S(t.expression,n,`Expression`)},dS.IfStatement=function(t,n,S){S(t.test,n,`Expression`),S(t.consequent,n,`Statement`),t.alternate&&S(t.alternate,n,`Statement`)},dS.LabeledStatement=function(t,n,S){return S(t.body,n,`Statement`)},dS.BreakStatement=dS.ContinueStatement=ignore,dS.WithStatement=function(t,n,S){S(t.object,n,`Expression`),S(t.body,n,`Statement`)},dS.SwitchStatement=function(t,n,S){S(t.discriminant,n,`Expression`);for(var C=0,N=t.cases;C<N.length;C+=1){var F=N[C];S(F,n)}},dS.SwitchCase=function(t,n,S){t.test&&S(t.test,n,`Expression`);for(var C=0,N=t.consequent;C<N.length;C+=1){var F=N[C];S(F,n,`Statement`)}},dS.ReturnStatement=dS.YieldExpression=dS.AwaitExpression=function(t,n,S){t.argument&&S(t.argument,n,`Expression`)},dS.ThrowStatement=dS.SpreadElement=function(t,n,S){return S(t.argument,n,`Expression`)},dS.TryStatement=function(t,n,S){S(t.block,n,`Statement`),t.handler&&S(t.handler,n),t.finalizer&&S(t.finalizer,n,`Statement`)},dS.CatchClause=function(t,n,S){t.param&&S(t.param,n,`Pattern`),S(t.body,n,`Statement`)},dS.WhileStatement=dS.DoWhileStatement=function(t,n,S){S(t.test,n,`Expression`),S(t.body,n,`Statement`)},dS.ForStatement=function(t,n,S){t.init&&S(t.init,n,`ForInit`),t.test&&S(t.test,n,`Expression`),t.update&&S(t.update,n,`Expression`),S(t.body,n,`Statement`)},dS.ForInStatement=dS.ForOfStatement=function(t,n,S){S(t.left,n,`ForInit`),S(t.right,n,`Expression`),S(t.body,n,`Statement`)},dS.ForInit=function(t,n,S){t.type===`VariableDeclaration`?S(t,n):S(t,n,`Expression`)},dS.DebuggerStatement=ignore,dS.FunctionDeclaration=function(t,n,S){return S(t,n,`Function`)},dS.VariableDeclaration=function(t,n,S){for(var C=0,N=t.declarations;C<N.length;C+=1){var F=N[C];S(F,n)}},dS.VariableDeclarator=function(t,n,S){S(t.id,n,`Pattern`),t.init&&S(t.init,n,`Expression`)},dS.Function=function(t,n,S){t.id&&S(t.id,n,`Pattern`);for(var C=0,N=t.params;C<N.length;C+=1){var F=N[C];S(F,n,`Pattern`)}S(t.body,n,t.expression?`Expression`:`Statement`)},dS.Pattern=function(t,n,S){t.type===`Identifier`?S(t,n,`VariablePattern`):t.type===`MemberExpression`?S(t,n,`MemberPattern`):S(t,n)},dS.VariablePattern=ignore,dS.MemberPattern=skipThrough,dS.RestElement=function(t,n,S){return S(t.argument,n,`Pattern`)},dS.ArrayPattern=function(t,n,S){for(var C=0,N=t.elements;C<N.length;C+=1){var F=N[C];F&&S(F,n,`Pattern`)}},dS.ObjectPattern=function(t,n,S){for(var C=0,N=t.properties;C<N.length;C+=1){var F=N[C];F.type===`Property`?(F.computed&&S(F.key,n,`Expression`),S(F.value,n,`Pattern`)):F.type===`RestElement`&&S(F.argument,n,`Pattern`)}},dS.Expression=skipThrough,dS.ThisExpression=dS.Super=dS.MetaProperty=ignore,dS.ArrayExpression=function(t,n,S){for(var C=0,N=t.elements;C<N.length;C+=1){var F=N[C];F&&S(F,n,`Expression`)}},dS.ObjectExpression=function(t,n,S){for(var C=0,N=t.properties;C<N.length;C+=1){var F=N[C];S(F,n)}},dS.FunctionExpression=dS.ArrowFunctionExpression=dS.FunctionDeclaration,dS.SequenceExpression=function(t,n,S){for(var C=0,N=t.expressions;C<N.length;C+=1){var F=N[C];S(F,n,`Expression`)}},dS.TemplateLiteral=function(t,n,S){for(var C=0,N=t.quasis;C<N.length;C+=1){var F=N[C];S(F,n)}for(var I=0,H=t.expressions;I<H.length;I+=1){var W=H[I];S(W,n,`Expression`)}},dS.TemplateElement=ignore,dS.UnaryExpression=dS.UpdateExpression=function(t,n,S){S(t.argument,n,`Expression`)},dS.BinaryExpression=dS.LogicalExpression=function(t,n,S){S(t.left,n,`Expression`),S(t.right,n,`Expression`)},dS.AssignmentExpression=dS.AssignmentPattern=function(t,n,S){S(t.left,n,`Pattern`),S(t.right,n,`Expression`)},dS.ConditionalExpression=function(t,n,S){S(t.test,n,`Expression`),S(t.consequent,n,`Expression`),S(t.alternate,n,`Expression`)},dS.NewExpression=dS.CallExpression=function(t,n,S){if(S(t.callee,n,`Expression`),t.arguments)for(var C=0,N=t.arguments;C<N.length;C+=1){var F=N[C];S(F,n,`Expression`)}},dS.MemberExpression=function(t,n,S){S(t.object,n,`Expression`),t.computed&&S(t.property,n,`Expression`)},dS.ExportNamedDeclaration=dS.ExportDefaultDeclaration=function(t,n,S){if(t.declaration&&S(t.declaration,n,t.type===`ExportNamedDeclaration`||t.declaration.id?`Statement`:`Expression`),t.source&&S(t.source,n,`Expression`),t.attributes)for(var C=0,N=t.attributes;C<N.length;C+=1){var F=N[C];S(F,n)}},dS.ExportAllDeclaration=function(t,n,S){if(t.exported&&S(t.exported,n),S(t.source,n,`Expression`),t.attributes)for(var C=0,N=t.attributes;C<N.length;C+=1){var F=N[C];S(F,n)}},dS.ImportAttribute=function(t,n,S){S(t.value,n,`Expression`)},dS.ImportDeclaration=function(t,n,S){for(var C=0,N=t.specifiers;C<N.length;C+=1){var F=N[C];S(F,n)}if(S(t.source,n,`Expression`),t.attributes)for(var I=0,H=t.attributes;I<H.length;I+=1){var W=H[I];S(W,n)}},dS.ImportExpression=function(t,n,S){S(t.source,n,`Expression`),t.options&&S(t.options,n,`Expression`)},dS.ImportSpecifier=dS.ImportDefaultSpecifier=dS.ImportNamespaceSpecifier=dS.Identifier=dS.PrivateIdentifier=dS.Literal=ignore,dS.TaggedTemplateExpression=function(t,n,S){S(t.tag,n,`Expression`),S(t.quasi,n,`Expression`)},dS.ClassDeclaration=dS.ClassExpression=function(t,n,S){return S(t,n,`Class`)},dS.Class=function(t,n,S){t.id&&S(t.id,n,`Pattern`),t.superClass&&S(t.superClass,n,`Expression`),S(t.body,n)},dS.ClassBody=function(t,n,S){for(var C=0,N=t.body;C<N.length;C+=1){var F=N[C];S(F,n)}},dS.MethodDefinition=dS.PropertyDefinition=dS.Property=function(t,n,S){t.computed&&S(t.key,n,`Expression`),t.value&&S(t.value,n,`Expression`)}}),pS,mS,hS,gS,_S=__esmMin(()=>{pS={node:[`Buffer`,`Blob`,`File`,`process`,`setImmediate`,`clearImmediate`,`queueMicrotask`,`structuredClone`,`btoa`,`atob`,`URL`,`URLSearchParams`,`navigator`],web:`self.fetch.Headers.Request.Response.FormData.ReadableStream.WritableStream.TransformStream.ReadableStreamBYOBReader.ReadableStreamBYOBRequest.ReadableByteStreamController.ReadableStreamDefaultController.ReadableStreamDefaultReader.TextEncoderStream.TextDecoderStream.ByteLengthQueuingStrategy.CountQueuingStrategy.CompressionStream.DecompressionStream.crypto.AbortController.AbortSignal.MessageChannel.MessagePort.Event.EventTarget.CustomEvent.MessageEvent.ErrorEvent.CloseEvent.ProgressEvent.UIEvent.MouseEvent.PointerEvent.KeyboardEvent.WheelEvent.FocusEvent.addEventListener.removeEventListener.dispatchEvent.EventSource.WebSocket.WebAssembly.DOMException.performance.PerformanceObserver.XMLHttpRequest.XMLHttpRequestUpload.DOMParser.AudioContext.webkitAudioContext.Audio.HTMLAudioElement.GamepadEvent.speechSynthesis.SpeechSynthesis.SpeechSynthesisUtterance.SpeechSynthesisVoice.SpeechSynthesisEvent.SpeechSynthesisErrorEvent.MediaDevices.RTCPeerConnection.RTCSessionDescription.RTCIceCandidate.RTCPeerConnectionIceEvent.RTCDataChannel.RTCDataChannelEvent.RTCError.RTCErrorEvent.MediaStream.MediaStreamTrack.RTCTrackEvent`.split(`.`),dom:[`document`,`Image`,`HTMLCanvasElement`,`HTMLImageElement`,`HTMLElement`,`MutationObserver`,`ResizeObserver`,`IntersectionObserver`,`FontFace`,`matchMedia`,`location`]},mS={Buffer:`@gjsify/node-globals/register/buffer`,process:`@gjsify/node-globals/register/process`,setTimeout:`@gjsify/node-globals/register/timers`,setInterval:`@gjsify/node-globals/register/timers`,clearTimeout:`@gjsify/node-globals/register/timers`,clearInterval:`@gjsify/node-globals/register/timers`,setImmediate:`@gjsify/node-globals/register/timers`,clearImmediate:`@gjsify/node-globals/register/timers`,queueMicrotask:`@gjsify/node-globals/register/microtask`,structuredClone:`@gjsify/node-globals/register/structured-clone`,btoa:`@gjsify/node-globals/register/encoding`,atob:`@gjsify/node-globals/register/encoding`,navigator:`@gjsify/node-globals/register/navigator`,Navigator:`@gjsify/node-globals/register/navigator`,URL:`@gjsify/node-globals/register/url`,URLSearchParams:`@gjsify/node-globals/register/url`,Blob:`@gjsify/buffer/register`,File:`@gjsify/buffer/register`,fetch:`fetch/register/fetch`,Headers:`fetch/register/fetch`,Request:`fetch/register/fetch`,Response:`fetch/register/fetch`,FormData:`@gjsify/web-globals/register/formdata`,self:`@gjsify/web-globals/register/self`,ReadableStream:`web-streams/register/readable`,ReadableStreamBYOBReader:`web-streams/register/readable`,ReadableStreamBYOBRequest:`web-streams/register/readable`,ReadableByteStreamController:`web-streams/register/readable`,ReadableStreamDefaultController:`web-streams/register/readable`,ReadableStreamDefaultReader:`web-streams/register/readable`,WritableStream:`web-streams/register/writable`,TransformStream:`web-streams/register/transform`,TextEncoderStream:`web-streams/register/text-streams`,TextDecoderStream:`web-streams/register/text-streams`,ByteLengthQueuingStrategy:`web-streams/register/queuing`,CountQueuingStrategy:`web-streams/register/queuing`,CompressionStream:`compression-streams/register`,DecompressionStream:`compression-streams/register`,crypto:`webcrypto/register`,AbortController:`abort-controller/register`,AbortSignal:`abort-controller/register`,MessageChannel:`message-channel/register`,MessagePort:`message-channel/register`,Worker:`web-worker/register`,Event:`dom-events/register/event-target`,EventTarget:`dom-events/register/event-target`,CustomEvent:`dom-events/register/custom-events`,MessageEvent:`dom-events/register/custom-events`,ErrorEvent:`dom-events/register/custom-events`,CloseEvent:`dom-events/register/custom-events`,ProgressEvent:`dom-events/register/custom-events`,UIEvent:`dom-events/register/ui-events`,MouseEvent:`dom-events/register/ui-events`,PointerEvent:`dom-events/register/ui-events`,KeyboardEvent:`dom-events/register/ui-events`,WheelEvent:`dom-events/register/ui-events`,FocusEvent:`dom-events/register/ui-events`,addEventListener:`dom-events/register/global-event-target`,removeEventListener:`dom-events/register/global-event-target`,dispatchEvent:`dom-events/register/global-event-target`,EventSource:`eventsource/register`,WebSocket:`websocket/register`,WebAssembly:`webassembly/register/promise`,performance:`@gjsify/web-globals/register/performance`,PerformanceObserver:`@gjsify/web-globals/register/performance`,DOMException:`dom-exception/register`,XMLHttpRequest:`fetch/register/xhr`,XMLHttpRequestUpload:`fetch/register/xhr`,DOMParser:`@gjsify/domparser/register`,AudioContext:`@gjsify/webaudio/register`,webkitAudioContext:`@gjsify/webaudio/register`,Audio:`@gjsify/webaudio/register`,HTMLAudioElement:`@gjsify/webaudio/register`,GamepadEvent:`@gjsify/gamepad/register`,speechSynthesis:`@gjsify/speech-synthesis/register`,SpeechSynthesis:`@gjsify/speech-synthesis/register`,SpeechSynthesisUtterance:`@gjsify/speech-synthesis/register`,SpeechSynthesisVoice:`@gjsify/speech-synthesis/register`,SpeechSynthesisEvent:`@gjsify/speech-synthesis/register`,SpeechSynthesisErrorEvent:`@gjsify/speech-synthesis/register`,MediaDevices:`@gjsify/webrtc/register/media-devices`,RTCPeerConnection:`@gjsify/webrtc/register/peer-connection`,RTCSessionDescription:`@gjsify/webrtc/register/peer-connection`,RTCIceCandidate:`@gjsify/webrtc/register/peer-connection`,RTCPeerConnectionIceEvent:`@gjsify/webrtc/register/peer-connection`,RTCDataChannel:`@gjsify/webrtc/register/data-channel`,RTCDataChannelEvent:`@gjsify/webrtc/register/data-channel`,RTCError:`@gjsify/webrtc/register/error`,RTCErrorEvent:`@gjsify/webrtc/register/error`,MediaStream:`@gjsify/webrtc/register/media`,MediaStreamTrack:`@gjsify/webrtc/register/media`,RTCTrackEvent:`@gjsify/webrtc/register/media`,document:`@gjsify/dom-elements/register/document`,Image:`@gjsify/dom-elements/register/image`,HTMLCanvasElement:`@gjsify/dom-elements/register/canvas`,HTMLImageElement:`@gjsify/dom-elements/register/image`,HTMLElement:`@gjsify/dom-elements/register/document`,MutationObserver:`@gjsify/dom-elements/register/observers`,ResizeObserver:`@gjsify/dom-elements/register/observers`,IntersectionObserver:`@gjsify/dom-elements/register/observers`,FontFace:`@gjsify/dom-elements/register/font-face`,matchMedia:`@gjsify/dom-elements/register/match-media`,location:`@gjsify/dom-elements/register/location`,ImageData:`@gjsify/canvas2d/register`,Path2D:`@gjsify/canvas2d/register`,HTMLIFrameElement:`@gjsify/iframe/register`,WebGLRenderingContext:`@gjsify/webgl/register`,WebGL2RenderingContext:`@gjsify/webgl/register`},hS=[`fetch`,`Headers`,`Request`,`Response`],gS={"@gjsify/dom-elements/register":[`Gdk`,`GdkPixbuf`,`Pango`,`PangoCairo`],"@gjsify/webaudio/register":[`Gst`,`GstApp`],"@gjsify/webrtc/register":[`Gst`,`GstWebRTC`,`GstSdp`],"@gjsify/gamepad/register":[`Manette`],"@gjsify/speech-synthesis/register":[`Spiel`],"@gjsify/canvas2d/register":[`Gdk`,`GdkPixbuf`,`Pango`,`PangoCairo`],"@gjsify/iframe/register":[`WebKit`],"@gjsify/webgl/register":[`GdkPixbuf`,`Gwebgl`]}});function excerptAt(t,n){let S=Math.max(0,n-yS),C=Math.min(t.length,n+yS),N=t.slice(S,C).replace(/[\r\n\t]+/g,` `);return`${S>0?`…`:``}${N}${C<t.length?`…`:``}`}function classifyJsxParseFailure(t,n){let S=n.pos,C=n.loc;return typeof S!=`number`||typeof C?.line!=`number`||typeof C.column!=`number`||t[S]!==`<`||!vS.test(t.slice(S+1,S+2))?null:{line:C.line,column:C.column,excerpt:excerptAt(t,S)}}function locateSurvivingJsx(t){try{return parse$3(t,{ecmaVersion:`latest`,sourceType:`module`,allowHashBang:!0}),null}catch(n){return classifyJsxParseFailure(t,n)}}function formatSurvivingJsx(t,n){return[`gjsify build: ${n} still contains raw JSX at ${t.line}:${t.column} — it is not valid JavaScript, so GJS aborts at load with "SyntaxError: expected expression, got '<'" before one line runs.`,` ${t.excerpt}`,``,'JSX reaches an artifact only when the transform was told to PRESERVE it (`jsx: "preserve"` in `gjsify.bundler.transform.jsx` or in tsconfig `compilerOptions.jsx`) and nothing compiled it afterwards. Either:'," - register the framework compiler that consumes preserved JSX (`babel-preset-solid` for Solid, the Vue SFC compiler) under `gjsify.bundler.plugins`, or",' - drop `preserve` and give the automatic runtime an import source that resolves AND runs: `bundler.transform.jsx: { "importSource": "<pkg exporting ./jsx-runtime>" }`, or tsconfig `"jsx": "react-jsx"` + `"jsxImportSource"`. Not `@gjsify/gtk-host` — its `/jsx-runtime` is a TYPE surface and throws when called.'].join(`
700
+ `;case 114:return`\r`;case 120:return String.fromCharCode(this.readHexChar(2));case 117:return codePointToString(this.readCodePoint());case 116:return` `;case 98:return`\b`;case 118:return`\v`;case 102:return`\f`;case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),``;case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,`Invalid escape sequence`),t){var S=this.pos-1;this.invalidStringToken(S,`Invalid escape sequence in template string`)}default:if(n>=48&&n<=55){var C=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],N=parseInt(C,8);return N>255&&(C=C.slice(0,-1),N=parseInt(C,8)),this.pos+=C.length-1,n=this.input.charCodeAt(this.pos),(C!==`0`||n===56||n===57)&&(this.strict||t)&&this.invalidStringToken(this.pos-1-C.length,t?`Octal literal in template string`:`Octal literal in strict mode`),String.fromCharCode(N)}return isNewLine(n)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),``):String.fromCharCode(n)}},sS.readHexChar=function(t){var n=this.pos,S=this.readInt(16,t);return S===null&&this.invalidStringToken(n,`Bad character escape sequence`),S},sS.readWord1=function(){this.containsEsc=!1;for(var t=``,n=!0,S=this.pos,C=this.options.ecmaVersion>=6;this.pos<this.input.length;){var N=this.fullCharCodeAtPos();if(isIdentifierChar(N,C))this.pos+=N<=65535?1:2;else if(N===92){this.containsEsc=!0,t+=this.input.slice(S,this.pos);var F=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,`Expecting Unicode escape sequence \\uXXXX`),++this.pos;var I=this.readCodePoint();(n?isIdentifierStart:isIdentifierChar)(I,C)||this.invalidStringToken(F,`Invalid Unicode escape`),t+=codePointToString(I),S=this.pos}else break;n=!1}return t+this.input.slice(S,this.pos)},sS.readWord=function(){var t=this.readWord1(),n=jb.name;return this.keywords.test(t)&&(n=Ab[t]),this.finishToken(n,t)},lS=`8.17.0`,dx.acorn={Parser:dx,version:lS,defaultOptions:Gb,Position:Ub,SourceLocation:Wb,getLineInfo,Node:Nx,TokenType:Db,tokTypes:jb,keywordTypes:Ab,TokContext:Tx,tokContexts:Ex,isIdentifierChar,isIdentifierStart,Token:oS,isNewLine,lineBreak:Mb,lineBreakG:Nb,nonASCIIwhitespace:Pb},__name$1(parse$3,`parse`)});function simple(t,n,S,C,N){S||=dS,(function c(t,C,N){var F=N||t.type;visitNode$1(S,F,t,C,c),n[F]&&n[F](t,C)})(t,C,N)}function ancestor(t,n,S,C,N){var F=[];S||=dS,(function c(t,C,N){var I=N||t.type,H=t!==F[F.length-1];H&&F.push(t),visitNode$1(S,I,t,C,c),n[I]&&n[I](t,C||F,F),H&&F.pop()})(t,C,N)}function full(t,n,S,C,N){S||=dS;var F;(function c(t,C,N){var I=N||t.type;visitNode$1(S,I,t,C,c),F!==t&&(n(t,C,I),F=t)})(t,C,N)}function skipThrough(t,n,S){S(t,n)}function ignore(t,n,S){}function visitNode$1(t,n,S,C,N){if(t[n]==null)throw Error(`No walker function defined for node type `+n);t[n](S,C,N)}var dS,fS=__esmMin(()=>{__name$1(visitNode$1,`visitNode`),dS={},dS.Program=dS.BlockStatement=dS.StaticBlock=function(t,n,S){for(var C=0,N=t.body;C<N.length;C+=1){var F=N[C];S(F,n,`Statement`)}},dS.Statement=skipThrough,dS.EmptyStatement=ignore,dS.ExpressionStatement=dS.ParenthesizedExpression=dS.ChainExpression=function(t,n,S){return S(t.expression,n,`Expression`)},dS.IfStatement=function(t,n,S){S(t.test,n,`Expression`),S(t.consequent,n,`Statement`),t.alternate&&S(t.alternate,n,`Statement`)},dS.LabeledStatement=function(t,n,S){return S(t.body,n,`Statement`)},dS.BreakStatement=dS.ContinueStatement=ignore,dS.WithStatement=function(t,n,S){S(t.object,n,`Expression`),S(t.body,n,`Statement`)},dS.SwitchStatement=function(t,n,S){S(t.discriminant,n,`Expression`);for(var C=0,N=t.cases;C<N.length;C+=1){var F=N[C];S(F,n)}},dS.SwitchCase=function(t,n,S){t.test&&S(t.test,n,`Expression`);for(var C=0,N=t.consequent;C<N.length;C+=1){var F=N[C];S(F,n,`Statement`)}},dS.ReturnStatement=dS.YieldExpression=dS.AwaitExpression=function(t,n,S){t.argument&&S(t.argument,n,`Expression`)},dS.ThrowStatement=dS.SpreadElement=function(t,n,S){return S(t.argument,n,`Expression`)},dS.TryStatement=function(t,n,S){S(t.block,n,`Statement`),t.handler&&S(t.handler,n),t.finalizer&&S(t.finalizer,n,`Statement`)},dS.CatchClause=function(t,n,S){t.param&&S(t.param,n,`Pattern`),S(t.body,n,`Statement`)},dS.WhileStatement=dS.DoWhileStatement=function(t,n,S){S(t.test,n,`Expression`),S(t.body,n,`Statement`)},dS.ForStatement=function(t,n,S){t.init&&S(t.init,n,`ForInit`),t.test&&S(t.test,n,`Expression`),t.update&&S(t.update,n,`Expression`),S(t.body,n,`Statement`)},dS.ForInStatement=dS.ForOfStatement=function(t,n,S){S(t.left,n,`ForInit`),S(t.right,n,`Expression`),S(t.body,n,`Statement`)},dS.ForInit=function(t,n,S){t.type===`VariableDeclaration`?S(t,n):S(t,n,`Expression`)},dS.DebuggerStatement=ignore,dS.FunctionDeclaration=function(t,n,S){return S(t,n,`Function`)},dS.VariableDeclaration=function(t,n,S){for(var C=0,N=t.declarations;C<N.length;C+=1){var F=N[C];S(F,n)}},dS.VariableDeclarator=function(t,n,S){S(t.id,n,`Pattern`),t.init&&S(t.init,n,`Expression`)},dS.Function=function(t,n,S){t.id&&S(t.id,n,`Pattern`);for(var C=0,N=t.params;C<N.length;C+=1){var F=N[C];S(F,n,`Pattern`)}S(t.body,n,t.expression?`Expression`:`Statement`)},dS.Pattern=function(t,n,S){t.type===`Identifier`?S(t,n,`VariablePattern`):t.type===`MemberExpression`?S(t,n,`MemberPattern`):S(t,n)},dS.VariablePattern=ignore,dS.MemberPattern=skipThrough,dS.RestElement=function(t,n,S){return S(t.argument,n,`Pattern`)},dS.ArrayPattern=function(t,n,S){for(var C=0,N=t.elements;C<N.length;C+=1){var F=N[C];F&&S(F,n,`Pattern`)}},dS.ObjectPattern=function(t,n,S){for(var C=0,N=t.properties;C<N.length;C+=1){var F=N[C];F.type===`Property`?(F.computed&&S(F.key,n,`Expression`),S(F.value,n,`Pattern`)):F.type===`RestElement`&&S(F.argument,n,`Pattern`)}},dS.Expression=skipThrough,dS.ThisExpression=dS.Super=dS.MetaProperty=ignore,dS.ArrayExpression=function(t,n,S){for(var C=0,N=t.elements;C<N.length;C+=1){var F=N[C];F&&S(F,n,`Expression`)}},dS.ObjectExpression=function(t,n,S){for(var C=0,N=t.properties;C<N.length;C+=1){var F=N[C];S(F,n)}},dS.FunctionExpression=dS.ArrowFunctionExpression=dS.FunctionDeclaration,dS.SequenceExpression=function(t,n,S){for(var C=0,N=t.expressions;C<N.length;C+=1){var F=N[C];S(F,n,`Expression`)}},dS.TemplateLiteral=function(t,n,S){for(var C=0,N=t.quasis;C<N.length;C+=1){var F=N[C];S(F,n)}for(var I=0,H=t.expressions;I<H.length;I+=1){var W=H[I];S(W,n,`Expression`)}},dS.TemplateElement=ignore,dS.UnaryExpression=dS.UpdateExpression=function(t,n,S){S(t.argument,n,`Expression`)},dS.BinaryExpression=dS.LogicalExpression=function(t,n,S){S(t.left,n,`Expression`),S(t.right,n,`Expression`)},dS.AssignmentExpression=dS.AssignmentPattern=function(t,n,S){S(t.left,n,`Pattern`),S(t.right,n,`Expression`)},dS.ConditionalExpression=function(t,n,S){S(t.test,n,`Expression`),S(t.consequent,n,`Expression`),S(t.alternate,n,`Expression`)},dS.NewExpression=dS.CallExpression=function(t,n,S){if(S(t.callee,n,`Expression`),t.arguments)for(var C=0,N=t.arguments;C<N.length;C+=1){var F=N[C];S(F,n,`Expression`)}},dS.MemberExpression=function(t,n,S){S(t.object,n,`Expression`),t.computed&&S(t.property,n,`Expression`)},dS.ExportNamedDeclaration=dS.ExportDefaultDeclaration=function(t,n,S){if(t.declaration&&S(t.declaration,n,t.type===`ExportNamedDeclaration`||t.declaration.id?`Statement`:`Expression`),t.source&&S(t.source,n,`Expression`),t.attributes)for(var C=0,N=t.attributes;C<N.length;C+=1){var F=N[C];S(F,n)}},dS.ExportAllDeclaration=function(t,n,S){if(t.exported&&S(t.exported,n),S(t.source,n,`Expression`),t.attributes)for(var C=0,N=t.attributes;C<N.length;C+=1){var F=N[C];S(F,n)}},dS.ImportAttribute=function(t,n,S){S(t.value,n,`Expression`)},dS.ImportDeclaration=function(t,n,S){for(var C=0,N=t.specifiers;C<N.length;C+=1){var F=N[C];S(F,n)}if(S(t.source,n,`Expression`),t.attributes)for(var I=0,H=t.attributes;I<H.length;I+=1){var W=H[I];S(W,n)}},dS.ImportExpression=function(t,n,S){S(t.source,n,`Expression`),t.options&&S(t.options,n,`Expression`)},dS.ImportSpecifier=dS.ImportDefaultSpecifier=dS.ImportNamespaceSpecifier=dS.Identifier=dS.PrivateIdentifier=dS.Literal=ignore,dS.TaggedTemplateExpression=function(t,n,S){S(t.tag,n,`Expression`),S(t.quasi,n,`Expression`)},dS.ClassDeclaration=dS.ClassExpression=function(t,n,S){return S(t,n,`Class`)},dS.Class=function(t,n,S){t.id&&S(t.id,n,`Pattern`),t.superClass&&S(t.superClass,n,`Expression`),S(t.body,n)},dS.ClassBody=function(t,n,S){for(var C=0,N=t.body;C<N.length;C+=1){var F=N[C];S(F,n)}},dS.MethodDefinition=dS.PropertyDefinition=dS.Property=function(t,n,S){t.computed&&S(t.key,n,`Expression`),t.value&&S(t.value,n,`Expression`)}}),pS,mS,hS,gS,_S=__esmMin(()=>{pS={node:[`Buffer`,`Blob`,`File`,`process`,`setImmediate`,`clearImmediate`,`queueMicrotask`,`structuredClone`,`btoa`,`atob`,`URL`,`URLSearchParams`,`navigator`],web:`self.fetch.Headers.Request.Response.FormData.ReadableStream.WritableStream.TransformStream.ReadableStreamBYOBReader.ReadableStreamBYOBRequest.ReadableByteStreamController.ReadableStreamDefaultController.ReadableStreamDefaultReader.TextEncoderStream.TextDecoderStream.ByteLengthQueuingStrategy.CountQueuingStrategy.CompressionStream.DecompressionStream.crypto.AbortController.AbortSignal.MessageChannel.MessagePort.Event.EventTarget.CustomEvent.MessageEvent.ErrorEvent.CloseEvent.ProgressEvent.UIEvent.MouseEvent.PointerEvent.KeyboardEvent.WheelEvent.FocusEvent.addEventListener.removeEventListener.dispatchEvent.EventSource.WebSocket.WebAssembly.DOMException.performance.PerformanceObserver.XMLHttpRequest.XMLHttpRequestUpload.DOMParser.AudioContext.webkitAudioContext.Audio.HTMLAudioElement.GamepadEvent.speechSynthesis.SpeechSynthesis.SpeechSynthesisUtterance.SpeechSynthesisVoice.SpeechSynthesisEvent.SpeechSynthesisErrorEvent.SpeechRecognition.SpeechRecognitionEvent.SpeechRecognitionErrorEvent.SpeechRecognitionResultList.SpeechRecognitionResult.SpeechRecognitionAlternative.SpeechRecognitionPhrase.MediaDevices.RTCPeerConnection.RTCSessionDescription.RTCIceCandidate.RTCPeerConnectionIceEvent.RTCDataChannel.RTCDataChannelEvent.RTCError.RTCErrorEvent.MediaStream.MediaStreamTrack.RTCTrackEvent`.split(`.`),dom:[`document`,`Image`,`HTMLCanvasElement`,`HTMLImageElement`,`HTMLElement`,`MutationObserver`,`ResizeObserver`,`IntersectionObserver`,`FontFace`,`matchMedia`,`location`]},mS={Buffer:`@gjsify/node-globals/register/buffer`,process:`@gjsify/node-globals/register/process`,setTimeout:`@gjsify/node-globals/register/timers`,setInterval:`@gjsify/node-globals/register/timers`,clearTimeout:`@gjsify/node-globals/register/timers`,clearInterval:`@gjsify/node-globals/register/timers`,setImmediate:`@gjsify/node-globals/register/timers`,clearImmediate:`@gjsify/node-globals/register/timers`,queueMicrotask:`@gjsify/node-globals/register/microtask`,structuredClone:`@gjsify/node-globals/register/structured-clone`,btoa:`@gjsify/node-globals/register/encoding`,atob:`@gjsify/node-globals/register/encoding`,navigator:`@gjsify/node-globals/register/navigator`,Navigator:`@gjsify/node-globals/register/navigator`,URL:`@gjsify/node-globals/register/url`,URLSearchParams:`@gjsify/node-globals/register/url`,Blob:`@gjsify/buffer/register`,File:`@gjsify/buffer/register`,fetch:`fetch/register/fetch`,Headers:`fetch/register/fetch`,Request:`fetch/register/fetch`,Response:`fetch/register/fetch`,FormData:`@gjsify/web-globals/register/formdata`,self:`@gjsify/web-globals/register/self`,ReadableStream:`web-streams/register/readable`,ReadableStreamBYOBReader:`web-streams/register/readable`,ReadableStreamBYOBRequest:`web-streams/register/readable`,ReadableByteStreamController:`web-streams/register/readable`,ReadableStreamDefaultController:`web-streams/register/readable`,ReadableStreamDefaultReader:`web-streams/register/readable`,WritableStream:`web-streams/register/writable`,TransformStream:`web-streams/register/transform`,TextEncoderStream:`web-streams/register/text-streams`,TextDecoderStream:`web-streams/register/text-streams`,ByteLengthQueuingStrategy:`web-streams/register/queuing`,CountQueuingStrategy:`web-streams/register/queuing`,CompressionStream:`compression-streams/register`,DecompressionStream:`compression-streams/register`,crypto:`webcrypto/register`,AbortController:`abort-controller/register`,AbortSignal:`abort-controller/register`,MessageChannel:`message-channel/register`,MessagePort:`message-channel/register`,Worker:`web-worker/register`,Event:`dom-events/register/event-target`,EventTarget:`dom-events/register/event-target`,CustomEvent:`dom-events/register/custom-events`,MessageEvent:`dom-events/register/custom-events`,ErrorEvent:`dom-events/register/custom-events`,CloseEvent:`dom-events/register/custom-events`,ProgressEvent:`dom-events/register/custom-events`,UIEvent:`dom-events/register/ui-events`,MouseEvent:`dom-events/register/ui-events`,PointerEvent:`dom-events/register/ui-events`,KeyboardEvent:`dom-events/register/ui-events`,WheelEvent:`dom-events/register/ui-events`,FocusEvent:`dom-events/register/ui-events`,addEventListener:`dom-events/register/global-event-target`,removeEventListener:`dom-events/register/global-event-target`,dispatchEvent:`dom-events/register/global-event-target`,EventSource:`eventsource/register`,WebSocket:`websocket/register`,WebAssembly:`webassembly/register/promise`,performance:`@gjsify/web-globals/register/performance`,PerformanceObserver:`@gjsify/web-globals/register/performance`,DOMException:`dom-exception/register`,XMLHttpRequest:`fetch/register/xhr`,XMLHttpRequestUpload:`fetch/register/xhr`,DOMParser:`@gjsify/domparser/register`,AudioContext:`@gjsify/webaudio/register`,webkitAudioContext:`@gjsify/webaudio/register`,Audio:`@gjsify/webaudio/register`,HTMLAudioElement:`@gjsify/webaudio/register`,GamepadEvent:`@gjsify/gamepad/register`,speechSynthesis:`@gjsify/speech-synthesis/register`,SpeechSynthesis:`@gjsify/speech-synthesis/register`,SpeechSynthesisUtterance:`@gjsify/speech-synthesis/register`,SpeechSynthesisVoice:`@gjsify/speech-synthesis/register`,SpeechSynthesisEvent:`@gjsify/speech-synthesis/register`,SpeechSynthesisErrorEvent:`@gjsify/speech-synthesis/register`,SpeechRecognition:`@gjsify/speech-recognition/register`,SpeechRecognitionEvent:`@gjsify/speech-recognition/register`,SpeechRecognitionErrorEvent:`@gjsify/speech-recognition/register`,SpeechRecognitionResultList:`@gjsify/speech-recognition/register`,SpeechRecognitionResult:`@gjsify/speech-recognition/register`,SpeechRecognitionAlternative:`@gjsify/speech-recognition/register`,SpeechRecognitionPhrase:`@gjsify/speech-recognition/register`,MediaDevices:`@gjsify/webrtc/register/media-devices`,RTCPeerConnection:`@gjsify/webrtc/register/peer-connection`,RTCSessionDescription:`@gjsify/webrtc/register/peer-connection`,RTCIceCandidate:`@gjsify/webrtc/register/peer-connection`,RTCPeerConnectionIceEvent:`@gjsify/webrtc/register/peer-connection`,RTCDataChannel:`@gjsify/webrtc/register/data-channel`,RTCDataChannelEvent:`@gjsify/webrtc/register/data-channel`,RTCError:`@gjsify/webrtc/register/error`,RTCErrorEvent:`@gjsify/webrtc/register/error`,MediaStream:`@gjsify/webrtc/register/media`,MediaStreamTrack:`@gjsify/webrtc/register/media`,RTCTrackEvent:`@gjsify/webrtc/register/media`,document:`@gjsify/dom-elements/register/document`,Image:`@gjsify/dom-elements/register/image`,HTMLCanvasElement:`@gjsify/dom-elements/register/canvas`,HTMLImageElement:`@gjsify/dom-elements/register/image`,HTMLElement:`@gjsify/dom-elements/register/document`,MutationObserver:`@gjsify/dom-elements/register/observers`,ResizeObserver:`@gjsify/dom-elements/register/observers`,IntersectionObserver:`@gjsify/dom-elements/register/observers`,FontFace:`@gjsify/dom-elements/register/font-face`,matchMedia:`@gjsify/dom-elements/register/match-media`,location:`@gjsify/dom-elements/register/location`,ImageData:`@gjsify/canvas2d/register`,Path2D:`@gjsify/canvas2d/register`,HTMLIFrameElement:`@gjsify/iframe/register`,WebGLRenderingContext:`@gjsify/webgl/register`,WebGL2RenderingContext:`@gjsify/webgl/register`},hS=[`fetch`,`Headers`,`Request`,`Response`],gS={"@gjsify/dom-elements/register":[`Gdk`,`GdkPixbuf`,`Pango`,`PangoCairo`],"@gjsify/webaudio/register":[`Gst`,`GstApp`],"@gjsify/webrtc/register":[`Gst`,`GstWebRTC`,`GstSdp`],"@gjsify/gamepad/register":[`Manette`],"@gjsify/speech-synthesis/register":[`Spiel`],"@gjsify/canvas2d/register":[`Gdk`,`GdkPixbuf`,`Pango`,`PangoCairo`],"@gjsify/iframe/register":[`WebKit`],"@gjsify/webgl/register":[`GdkPixbuf`,`Gwebgl`]}});function excerptAt(t,n){let S=Math.max(0,n-yS),C=Math.min(t.length,n+yS),N=t.slice(S,C).replace(/[\r\n\t]+/g,` `);return`${S>0?`…`:``}${N}${C<t.length?`…`:``}`}function classifyJsxParseFailure(t,n){let S=n.pos,C=n.loc;return typeof S!=`number`||typeof C?.line!=`number`||typeof C.column!=`number`||t[S]!==`<`||!vS.test(t.slice(S+1,S+2))?null:{line:C.line,column:C.column,excerpt:excerptAt(t,S)}}function locateSurvivingJsx(t){try{return parse$3(t,{ecmaVersion:`latest`,sourceType:`module`,allowHashBang:!0}),null}catch(n){return classifyJsxParseFailure(t,n)}}function formatSurvivingJsx(t,n){return[`gjsify build: ${n} still contains raw JSX at ${t.line}:${t.column} — it is not valid JavaScript, so GJS aborts at load with "SyntaxError: expected expression, got '<'" before one line runs.`,` ${t.excerpt}`,``,'JSX reaches an artifact only when the transform was told to PRESERVE it (`jsx: "preserve"` in `gjsify.bundler.transform.jsx` or in tsconfig `compilerOptions.jsx`) and nothing compiled it afterwards. Either:'," - register the framework compiler that consumes preserved JSX (`babel-preset-solid` for Solid, the Vue SFC compiler) under `gjsify.bundler.plugins`, or",' - drop `preserve` and give the automatic runtime an import source that resolves AND runs: `bundler.transform.jsx: { "importSource": "<pkg exporting ./jsx-runtime>" }`, or tsconfig `"jsx": "react-jsx"` + `"jsxImportSource"`. Not `@gjsify/gtk-host` — its `/jsx-runtime` is a TYPE surface and throws when called.'].join(`
701
701
  `)}var vS,yS,bS=__esmMin(()=>{uS(),vS=/^[A-Za-z_$>/]/,yS=60});function wbgJsNameFor(t){return t.match(wS)?.[1]??null}function extractBindingNames(t){if(!t)return[];switch(t.type){case`Identifier`:return[t.name];case`ObjectPattern`:return t.properties.flatMap(t=>t.type===`RestElement`?extractBindingNames(t.argument):extractBindingNames(t.value));case`ArrayPattern`:return t.elements.flatMap(t=>t?t.type===`RestElement`?extractBindingNames(t.argument):extractBindingNames(t):[]);case`AssignmentPattern`:return extractBindingNames(t.left);case`RestElement`:return extractBindingNames(t.argument);default:return[]}}function parseAnalysisChunk(t){try{return parse$3(t,{ecmaVersion:`latest`,sourceType:`module`,allowHashBang:!0})}catch(n){let S=classifyJsxParseFailure(t,n);throw S===null?n:Error(formatSurvivingJsx(S,`the analysis bundle`),{cause:n})}}function scanFreeGlobals(t,n){let S=n.knownGlobals,C=n.methodMarkers??{},N=n.wasmMarkers??{},F=parseAnalysisChunk(t),I=new Set;simple(F,{VariableDeclarator(t){for(let n of extractBindingNames(t.id))I.add(n)},FunctionDeclaration(t){t.id&&I.add(t.id.name);for(let n of t.params)for(let t of extractBindingNames(n))I.add(t)},FunctionExpression(t){t.id&&I.add(t.id.name);for(let n of t.params)for(let t of extractBindingNames(n))I.add(t)},ArrowFunctionExpression(t){for(let n of t.params)for(let t of extractBindingNames(n))I.add(t)},ClassDeclaration(t){t.id&&I.add(t.id.name)},ImportSpecifier(t){I.add(t.local.name)},ImportDefaultSpecifier(t){I.add(t.local.name)},ImportNamespaceSpecifier(t){I.add(t.local.name)},CatchClause(t){if(t.param)for(let n of extractBindingNames(t.param))I.add(n)}});let H=new Set,W=new Set,q=new Set([`globalThis`,`global`,`window`,`self`,`globalObject`]);return ancestor(F,{MemberExpression(t){if(t.computed||t.object.type!==`Identifier`||t.property.type!==`Identifier`)return;let N=t.object.name,F=t.property.name;if(q.has(N)){if(n.ignoreHostMembers)return;S.has(F)&&H.add(F);return}let I=`${N}.${F}`,W=C[I];W&&S.has(W)&&H.add(W)},FunctionDeclaration(t){if(!t.id)return;let n=wbgJsNameFor(t.id.name);if(!n)return;let C=N[n];C&&S.has(C)&&H.add(C)},Identifier(t,n){let C=t.name;if(!S.has(C)||I.has(C))return;let N=n[n.length-2];if(!N){H.add(C);return}switch(N.type){case`MemberExpression`:{let n=N;if(n.property===t&&!n.computed)return;break}case`Property`:{let n=N;if(n.key===t&&!n.computed)return;break}case`MethodDefinition`:case`PropertyDefinition`:{let n=N;if(n.key===t&&!n.computed)return;break}case`LabeledStatement`:if(N.label===t)return;break;case`ExportSpecifier`:if(N.exported===t)return;break;case`FunctionDeclaration`:case`FunctionExpression`:case`ClassDeclaration`:case`ClassExpression`:if(N.id===t)return;break;case`VariableDeclarator`:if(N.id===t)return;break;case`ImportSpecifier`:case`ImportDefaultSpecifier`:case`ImportNamespaceSpecifier`:return;case`UnaryExpression`:if(N.operator===`typeof`){H.has(C)||W.add(C);return}break}W.delete(C),H.add(C)}}),H}function detectFreeGlobals(t){return scanFreeGlobals(t,{knownGlobals:xS,methodMarkers:SS,wasmMarkers:CS})}function detectGjsAmbientGlobals(t){return scanFreeGlobals(t,{knownGlobals:TS,ignoreHostMembers:!0})}function isNodeGiSpecifier(t){return typeof t==`string`?t===ES||t.startsWith(`${ES}/`)?!0:DS.has(t):!1}function detectNodeGiModuleImports(t){let n=parse$3(t,{ecmaVersion:`latest`,sourceType:`module`,allowHashBang:!0});for(let t of n.body)if(t.type===`ImportDeclaration`&&isNodeGiSpecifier(t.source.value)||(t.type===`ExportNamedDeclaration`||t.type===`ExportAllDeclaration`)&&t.source&&isNodeGiSpecifier(t.source.value))return!0;return!1}var xS,SS,CS,wS,TS,ES,DS,OS=__esmMin(()=>{uS(),fS(),_S(),bS(),Bv(),xS=new Set(Object.keys(mS)),SS={"navigator.getGamepads":`GamepadEvent`,"navigator.mediaDevices":`MediaDevices`,"WebAssembly.compile":`WebAssembly`,"WebAssembly.compileStreaming":`WebAssembly`,"WebAssembly.instantiate":`WebAssembly`,"WebAssembly.instantiateStreaming":`WebAssembly`,"WebAssembly.validate":`WebAssembly`},CS={crypto:`crypto`,getRandomValues:`crypto`,msCrypto:`crypto`},wS=/^__wbg_([A-Za-z][A-Za-z0-9]*)_[A-Za-z0-9]+$/,TS=new Set([`print`,`printerr`,`log`,`logError`,`ARGV`,`imports`]),ES=`@gjsify/node-gi`,DS=new Set(Object.keys(Rv))});function resolveGlobalsList(t){let n=new Set,S=t.trim();if(!S)return n;for(let t of S.split(`,`)){let S=t.trim();if(!S)continue;let C=AS[S];if(C)for(let t of C){let S=kS[t];S&&n.add(S)}else{let t=kS[S];t&&n.add(t)}}return n}function packageNameFromRegisterPath(t){return t.startsWith(`@`)?t.split(`/`).slice(0,2).join(`/`):t.split(`/`)[0]??t}function resolveRegisterAlias(t){if(MS[t])return MS[t];let n=packageNameFromRegisterPath(t),S=MS[n];return S&&!t.startsWith(`@`)?S+t.slice(n.length):t}function isRegisterPathResolvable(t,n){let S=packageNameFromRegisterPath(resolveRegisterAlias(t)).split(`/`);for(let t of typeof n==`string`?[n]:n){let n=t,C=n.slice(0,n.indexOf(`/`)+1)||`/`;for(;;){if(existsSync(In(n,`node_modules`,...S,`package.json`)))return!0;if(n===C)break;let t=In(n,`..`);if(t===n)break;n=t}}return!1}function filterResolvableRegisterPaths(t,n){let S=new Set;for(let C of t)isRegisterPathResolvable(C,n)?S.add(C):ge.warn(`[gjsify] --globals auto: skipping register import '${C}' — package '${packageNameFromRegisterPath(C)}' is not installed in this project. If you need this global, add the package as a dependency or use --exclude-globals to suppress this warning.`);return S}function nativeOverrideIdentsFor(t){let n=[];for(let S of jS){let C=kS[S];C&&t.has(C)&&n.push(S)}return n}async function writeRegisterInjectFile(t,n=process.cwd(),S={}){if(t.size===0)return null;let C=In(n,`node_modules`,`.cache`,`gjsify`);await mkdir$1(C,{recursive:!0});let N=[...t].sort(),F=[],I=S.reverseBridgeOverride?nativeOverrideIdentsFor(t):[];if(I.length>0){let t=`// gjsify --app node reverse-bridge: clear runtime-native web globals so the
702
702
  // injected @gjsify/* register bodies install their GJS-semantics versions.
703
703
  for (const __k of ${JSON.stringify(I.sort())}) { try { delete globalThis[__k]; } catch {} }\n`,n=`auto-globals-override-${createHash(`sha1`).update(t).digest(`hex`).slice(0,10)}.mjs`;await writeFile$1(In(C,n),t,`utf-8`),F.push(`import './${n}';`)}for(let t of N)F.push(`import '${t}';`);let H=F.join(`
@@ -811,7 +811,7 @@ var n=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005
811
811
  `)[0]??t)),process.platform===`win32`&&t.push(checkMsvcRuntime()),t}function checkGwebgl(t){return checkNpmPackage(`gwebgl`,`gwebgl (@gjsify/webgl)`,`@gjsify/webgl`,t,`optional`,[`@gjsify/webgl`])}function runRequiredChecks(t){let n=[];return n.push(checkBinary(`pkg-config`,`pkg-config`,`pkg-config`,[`--version`],`required`)),n.push(checkBinary(`meson`,`Meson`,`meson`,[`--version`],`required`)),n.push(checkGiLibrary(`gtk4`,`GTK4`,`Gtk`,`4.0`,`gtk4`,`required`)),n.push(checkGiLibrary(`libadwaita`,`libadwaita`,`Adw`,`1`,`libadwaita-1`,`required`)),n.push(checkGiLibrary(`libsoup3`,`libsoup3`,`Soup`,`3.0`,`libsoup-3.0`,`required`)),n.push(checkPkgConfig(`gobject-introspection`,`GObject Introspection`,`gobject-introspection-1.0`,`required`)),n}function runNativeBuildToolchainChecks(){let t=[`@gjsify/http-soup-bridge`,`@gjsify/http2-native`,`@gjsify/lightningcss-native`,`@gjsify/oxfmt-native`,`@gjsify/rolldown-native`,`@gjsify/sab-native`,`@gjsify/terminal-native`,`@gjsify/tls-native`,`@gjsify/webgl`,`@gjsify/webrtc-native`];return[checkBinary(`ninja`,`Ninja`,`ninja`,[`--version`],`optional`,void 0,t),checkBinary(`vala`,`Vala`,`valac`,[`--version`],`optional`,t=>t.replace(/^Vala\s+/i,``),t),checkBinary(`cargo`,`Cargo (Rust)`,`cargo`,[`--version`],`optional`,t=>t.replace(/^cargo\s+/i,``).split(` `)[0]??t,[`@gjsify/lightningcss-native`,`@gjsify/oxfmt-native`,`@gjsify/rolldown-native`])]}function runOptionalChecks(t,n){let S=[];for(let[n,C]of Object.entries(YI)){if(t!==null&&!t.has(n))continue;let N=Object.entries(XI).filter(([,t])=>t.includes(n)).map(([t])=>t);S.push(checkPkgConfig(C.id,C.name,C.pkgName,`optional`,N))}return(t===null||t.has(`gwebgl`))&&S.push(checkGwebgl(n)),S}function buildInstallCommand(t,n){if(t===`unknown`)return null;let S=ZI[t],C=[],N=[];for(let t of n){if(t.id===`gwebgl`){N.push(`@gjsify/webgl`);continue}let n=S[t.id];n&&C.push(n)}let F=[];return C.length>0&&F.push(`${QI[t]} ${[...new Set(C)].join(` `)}`),N.length>0&&F.push(`npm install ${N.join(` `)}`),F.length>0?F.join(`
812
812
  `):null}function readGirsLibraryVersion(t,n){for(let S of[pathToFileURL(In(t,`_girs_.js`)).href,import.meta.url]){let t;try{t=zn(createRequire(S).resolve(n))}catch{continue}for(let S=0;S<5;S++){let S=In(t,`package.json`);if(existsSync(S))try{let t=JSON.parse(readFileSync(S,`utf-8`));if(t.name===n)return t.libraryVersion??null}catch{return null}let C=zn(t);if(C===t)break;t=C}}return null}function majorMinor(t){let n=/^(\d+)\.(\d+)/.exec(t.trim());return n?[Number(n[1]),Number(n[2])]:null}function isDegenerate(t,n){let S=t.trim(),C=n.split(`.`);for(let t=C.length;t<=3;t++)if(S===[...C,...Array(t-C.length).fill(`0`)].join(`.`))return!0;return!1}function checkTypeSkew(t,n={}){let S=n.readDeclared??readGirsLibraryVersion,C=n.readInstalled??(t=>tryExecFile(`pkg-config`,[`--modversion`,t])),N=[];for(let n of $I){let F=S(t,n.typePackage);if(F===null||isDegenerate(F,n.namespaceVersion))continue;let I=C(n.pkgConfig);if(I===null)continue;let H=majorMinor(F),W=majorMinor(I.split(`
813
813
  `)[0]??I);!H||!W||H[0]===W[0]&&H[1]===W[1]||N.push({typePackage:n.typePackage,pkgConfig:n.pkgConfig,declared:F,installed:I.split(`
814
- `)[0]??I,relation:H[0]>W[0]||H[0]===W[0]&&H[1]>W[1]?`ahead`:`behind`})}return N}var YI,XI,ZI,QI,$I,eL=__esmMin(()=>{rv(),qn(),Xl(),ir(),ef(),A_(),JI(),uv(),cv(),__name$1(detectPackageManager$1,`detectPackageManager`),YI={manette:{id:`manette`,name:`libmanette`,pkgName:`manette-0.2`},spiel:{id:`spiel`,name:`libspiel`,pkgName:`spiel-1.0`},gstreamer:{id:`gstreamer`,name:`GStreamer`,pkgName:`gstreamer-1.0`},"gst-app":{id:`gst-app`,name:`GStreamer App`,pkgName:`gstreamer-app-1.0`},"gdk-pixbuf":{id:`gdk-pixbuf`,name:`GdkPixbuf`,pkgName:`gdk-pixbuf-2.0`},pango:{id:`pango`,name:`Pango`,pkgName:`pango`},pangocairo:{id:`pangocairo`,name:`PangoCairo`,pkgName:`pangocairo`},webkitgtk:{id:`webkitgtk`,name:`WebKitGTK`,pkgName:`webkitgtk-6.0`},cairo:{id:`cairo`,name:`Cairo`,pkgName:`cairo`},gnutls:{id:`gnutls`,name:`GnuTLS`,pkgName:`gnutls`},nghttp2:{id:`nghttp2`,name:`libnghttp2`,pkgName:`libnghttp2`},"json-glib":{id:`json-glib`,name:`JSON-GLib`,pkgName:`json-glib-1.0`},epoxy:{id:`epoxy`,name:`libepoxy`,pkgName:`epoxy`},"gst-webrtc":{id:`gst-webrtc`,name:`GStreamer WebRTC`,pkgName:`gstreamer-webrtc-1.0`}},XI={"@gjsify/gamepad":[`manette`],"@gjsify/speech-synthesis":[`spiel`],"@gjsify/webaudio":[`gstreamer`,`gst-app`],"@gjsify/media-capture":[`gstreamer`,`gst-app`],"@gjsify/iframe":[`webkitgtk`],"@gjsify/canvas2d":[`gdk-pixbuf`,`pango`,`pangocairo`,`cairo`],"@gjsify/canvas2d-core":[`gdk-pixbuf`,`pango`,`pangocairo`,`cairo`],"@gjsify/dom-elements":[`gdk-pixbuf`],"@gjsify/webgl":[`gwebgl`,`gdk-pixbuf`,`epoxy`],"@gjsify/tls-native":[`gnutls`],"@gjsify/http2-native":[`nghttp2`],"@gjsify/rolldown-native":[`json-glib`],"@gjsify/webrtc-native":[`gstreamer`,`gst-webrtc`]},ZI={apt:{nodejs:`nodejs`,gjs:`gjs`,"pkg-config":`pkg-config`,meson:`meson`,ninja:`ninja-build`,vala:`valac`,cargo:`cargo`,gtk4:`libgtk-4-dev`,libadwaita:`libadwaita-1-dev`,libsoup3:`libsoup-3.0-dev`,webkitgtk:`libwebkit2gtk-6.0-dev`,"gobject-introspection":`gobject-introspection libgirepository1.0-dev`,manette:`libmanette-0.2-0 gir1.2-manette-0.2`,gstreamer:`libgstreamer1.0-dev`,"gst-app":`libgstreamer-plugins-base1.0-dev gir1.2-gst-plugins-base-1.0`,"gdk-pixbuf":`libgdk-pixbuf-2.0-dev`,pango:`libpango1.0-dev`,pangocairo:`libpango1.0-dev`,cairo:`libcairo2-dev`,gnutls:`libgnutls28-dev`,nghttp2:`libnghttp2-dev`,"json-glib":`libjson-glib-dev`,epoxy:`libepoxy-dev`},dnf:{nodejs:`nodejs`,gjs:`gjs`,"pkg-config":`pkgconf-pkg-config`,meson:`meson`,ninja:`ninja-build`,vala:`vala`,cargo:`cargo`,gtk4:`gtk4-devel`,libadwaita:`libadwaita-devel`,libsoup3:`libsoup3-devel`,webkitgtk:`webkitgtk6.0-devel`,"gobject-introspection":`gobject-introspection-devel`,manette:`libmanette-devel`,gstreamer:`gstreamer1-devel`,"gst-app":`gstreamer1-plugins-base-devel`,"gdk-pixbuf":`gdk-pixbuf2-devel`,pango:`pango-devel`,pangocairo:`pango-devel`,cairo:`cairo-devel`,gnutls:`gnutls-devel`,nghttp2:`libnghttp2-devel`,"json-glib":`json-glib-devel`,epoxy:`libepoxy-devel`},pacman:{nodejs:`nodejs`,gjs:`gjs`,"pkg-config":`pkgconf`,meson:`meson`,ninja:`ninja`,vala:`vala`,cargo:`rust`,gtk4:`gtk4`,libadwaita:`libadwaita`,libsoup3:`libsoup3`,webkitgtk:`webkitgtk-6.0`,"gobject-introspection":`gobject-introspection`,manette:`libmanette`,gstreamer:`gstreamer`,"gst-app":`gst-plugins-base`,"gdk-pixbuf":`gdk-pixbuf2`,pango:`pango`,pangocairo:`pango`,cairo:`cairo`,gnutls:`gnutls`,nghttp2:`libnghttp2`,"json-glib":`json-glib`,epoxy:`libepoxy`},zypper:{nodejs:`nodejs`,gjs:`gjs`,"pkg-config":`pkg-config`,meson:`meson`,ninja:`ninja`,vala:`vala`,cargo:`cargo`,gtk4:`gtk4-devel`,libadwaita:`libadwaita-devel`,libsoup3:`libsoup-3_0-devel`,webkitgtk:`webkitgtk6_0-devel`,"gobject-introspection":`gobject-introspection-devel`,manette:`libmanette-0_2-0-devel`,gstreamer:`gstreamer-devel`,"gst-app":`gstreamer-plugins-base-devel`,"gdk-pixbuf":`gdk-pixbuf-devel`,pango:`pango-devel`,pangocairo:`pango-devel`,cairo:`cairo-devel`,gnutls:`libgnutls-devel`,nghttp2:`libnghttp2-devel`,"json-glib":`json-glib-devel`,epoxy:`libepoxy-devel`},apk:{nodejs:`nodejs`,gjs:`gjs`,"pkg-config":`pkgconf`,meson:`meson`,ninja:`ninja`,vala:`vala`,cargo:`cargo`,gtk4:`gtk4.0-dev`,libadwaita:`libadwaita-dev`,libsoup3:`libsoup3-dev`,webkitgtk:`webkit2gtk-6.0-dev`,"gobject-introspection":`gobject-introspection-dev`,manette:`libmanette-dev`,gstreamer:`gstreamer-dev`,"gst-app":`gst-plugins-base-dev`,"gdk-pixbuf":`gdk-pixbuf-dev`,pango:`pango-dev`,pangocairo:`pango-dev`,cairo:`cairo-dev`,gnutls:`gnutls-dev`,nghttp2:`nghttp2-dev`,"json-glib":`json-glib-dev`,epoxy:`libepoxy-dev`},brew:{nodejs:`node`,gjs:`gjs`,"pkg-config":`pkgconf`,meson:`meson`,ninja:`ninja`,vala:`vala`,cargo:`rust`,gtk4:`gtk4`,libadwaita:`libadwaita`,libsoup3:`libsoup`,"gobject-introspection":`gobject-introspection`,gstreamer:`gstreamer`,"gst-app":`gst-plugins-base`,"gdk-pixbuf":`gdk-pixbuf`,pango:`pango`,pangocairo:`pango`,cairo:`cairo`,gnutls:`gnutls`,nghttp2:`nghttp2`,"json-glib":`json-glib`,epoxy:`libepoxy`},winget:{"msvc-runtime":`Microsoft.VCRedist.2015+.x64`},unknown:{}},QI={apt:`sudo apt install`,dnf:`sudo dnf install`,pacman:`sudo pacman -S`,zypper:`sudo zypper install`,apk:`sudo apk add`,brew:`brew install`,winget:`winget install --id`,unknown:``},$I=[{pkgConfig:`gtk4`,typePackage:`@girs/gtk-4.0`,namespaceVersion:`4.0`},{pkgConfig:`libadwaita-1`,typePackage:`@girs/adw-1`,namespaceVersion:`1`},{pkgConfig:`libsoup-3.0`,typePackage:`@girs/soup-3.0`,namespaceVersion:`3.0`},{pkgConfig:`glib-2.0`,typePackage:`@girs/glib-2.0`,namespaceVersion:`2.0`},{pkgConfig:`gobject-2.0`,typePackage:`@girs/gobject-2.0`,namespaceVersion:`2.0`},{pkgConfig:`gio-2.0`,typePackage:`@girs/gio-2.0`,namespaceVersion:`2.0`},{pkgConfig:`gstreamer-1.0`,typePackage:`@girs/gst-1.0`,namespaceVersion:`1.0`},{pkgConfig:`webkitgtk-6.0`,typePackage:`@girs/webkit-6.0`,namespaceVersion:`6.0`},{pkgConfig:`manette-0.2`,typePackage:`@girs/manette-0.2`,namespaceVersion:`0.2`},{pkgConfig:`pango`,typePackage:`@girs/pango-1.0`,namespaceVersion:`1.0`},{pkgConfig:`harfbuzz`,typePackage:`@girs/harfbuzz-0.0`,namespaceVersion:`0.0`}]});function parsePlatformToken(t){let n=t.endsWith(rL),S=n?t.slice(0,-5):t,C=S.indexOf(`-`),N=C<0?S:S.slice(0,C);return{os:N,arch:C<0?``:S.slice(C+1),libc:n&&N===`linux`?`musl`:null}}function canonicalPlatformToken(t){let{os:n,arch:S,libc:C}=parsePlatformToken(t);if(!S)return t;let N=`${n}-${nL[S]??S}`;return C===`musl`||t.endsWith(rL)?`${N}${rL}`:N}function hostPlatformTokens(t,n,S){let C=`${t}-${n}`;return S===`musl`&&t===`linux`?[`${C}${rL}`,C]:[C]}function prebuildDirCandidates(t,n,S,C){let N=hostPlatformTokens(t,n,C),F=tL[n]??n,I=[],push=t=>{I.includes(t)||I.push(t)};for(let t of N){for(let n of S??[])typeof n==`string`&&canonicalPlatformToken(n)===t&&push(n);push(t)}return push(`${t}-${F}`),I}function resolvePrebuildDirName(t){let{platform:n,arch:S,declaredPlatforms:C,existingDirs:N,libc:F}=t;for(let t of prebuildDirCandidates(n,S,C,F))if(N.includes(t))return t;return null}function platformPackageName(t,n){return`${t}-${n}`}function scanNodeModules(t,n){let S=[],C=[];if(!existsSync(t))return{resolved:S,declared:C};let N;try{N=readdirSync(t)}catch{return{resolved:S,declared:C}}let take=t=>{t&&(t.kind===`resolved`?S.push(t.pkg):C.push(t.candidate))};for(let S of N)if(!S.startsWith(`.`))if(S.startsWith(`@`)){let C=In(t,S),N;try{N=readdirSync(C)}catch{continue}for(let t of N)take(checkPackage(In(C,t),`${S}/${t}`,n))}else take(checkPackage(In(t,S),S,n));return{resolved:S,declared:C}}function checkPackage(t,n,S){let C=readPackageJson$2(In(t,`package.json`));if(!C)return null;let N=C.gjsify;if(!N||typeof N!=`object`)return null;let F=N,I=F.prebuilds;if(typeof I!=`string`)return null;let H=F.platforms,W=Array.isArray(H)?H.filter(t=>typeof t==`string`):void 0,q=In(t,I),Y;try{Y=readdirSync(q,{withFileTypes:!0}).filter(t=>t.isDirectory()||t.isSymbolicLink()).map(t=>t.name)}catch{return{kind:`declared`,candidate:{name:n,pkgDir:t}}}let X=resolvePrebuildDirName({platform:S.platform,arch:S.arch,declaredPlatforms:W,existingDirs:Y,libc:S.libc});return X?{kind:`resolved`,pkg:{name:n,prebuildsDir:In(q,X)}}:{kind:`declared`,candidate:{name:n,pkgDir:t}}}function resolvePlatformSibling(t,n){let S=hostPlatformTokens(n.platform,n.arch,n.libc),C=Nn(t.pkgDir);for(;;){for(let N of S){let S=platformPackageName(t.name,N),F=checkPackage(In(C,`node_modules`,...S.split(`/`)),S,n);if(F?.kind===`resolved`)return F.pkg}let N=Nn(C,`..`);if(N===C)return null;C=N}}function detectNativePackages(t,n={}){let S={platform:n.platform??process.platform,arch:n.arch??process.arch,libc:n.libc===void 0?detectHostLibc(n.platform??process.platform):n.libc},C=[],N=new Set,F=[],I=Nn(t);for(;;){let t=In(I,`node_modules`);if(existsSync(t)){let n=scanNodeModules(t,S);for(let t of n.resolved)N.has(t.name)||(N.add(t.name),C.push(t));for(let t of n.declared)F.some(n=>n.name===t.name)||F.push(t)}let n=Nn(I,`..`);if(n===I)break;I=n}for(let t of F){if(N.has(t.name))continue;let n=resolvePlatformSibling(t,S);!n||N.has(n.name)||(N.add(n.name),C.push(n))}return C}function resolveHostLibc(t){return t.platform===`linux`?typeof t.glibcVersionRuntime==`string`&&t.glibcVersionRuntime.length>0?`glibc`:t.muslLoaderPresent?`musl`:`glibc`:null}function detectHostLibc(t){if(t!==`linux`)return null;let n=process.report?.getReport()?.header;return resolveHostLibc({platform:t,glibcVersionRuntime:typeof n?.glibcVersionRuntime==`string`?n.glibcVersionRuntime:void 0,muslLoaderPresent:existsSync(`/lib`)&&readdirSync(`/lib`).some(t=>t.startsWith(`ld-musl-`))})}function muslPrebuildFallbacks(t,n){return t===`musl`?n.filter(t=>parsePlatformToken(Bn(t.prebuildsDir)).libc!==`musl`).map(t=>t.name):[]}function libraryPathVar(t){return t===`darwin`?{name:`DYLD_LIBRARY_PATH`,separator:`:`}:t===`win32`?{name:`PATH`,separator:`;`}:{name:`LD_LIBRARY_PATH`,separator:`:`}}function buildNativeEnv(t,n={}){let S=n.platform??process.platform,C=n.env??process.env,N=t.map(t=>t.prebuildsDir),F=S===`win32`?`;`:`:`,{name:I,separator:H}=libraryPathVar(S),W=S===`win32`?Object.keys(C).find(t=>t.toLowerCase()===I.toLowerCase())??I:I,prepend=(t,n)=>[...N,...t?[t]:[]].join(n),q={GI_TYPELIB_PATH:prepend(C.GI_TYPELIB_PATH,F)};q[W]=prepend(C[W],H);let Y=(n.systemGiDirs??systemGiLibraryDirs)({platform:S,env:C});return Y.length>0&&(q[iL]=composeDyldFallback(Y,C)),q}var tL,nL,rL,iL,aL=__esmMin(()=>{ef(),qn(),PI(),GI(),tL={x64:`x86_64`,arm64:`aarch64`,arm:`armv7`,ia32:`i686`},nL={x86_64:`x64`,amd64:`x64`,aarch64:`arm64`},rL=`-musl`,iL=`DYLD_FALLBACK_LIBRARY_PATH`});function defaultRepository(){let t=(globalThis.imports?.gi)?.GIRepository?.Repository;return typeof t?.dup_default==`function`?t.dup_default():null}function activateNativePrebuilds(){if(oL)return oL;oL=[];try{let t=defaultRepository();if(!t)return oL;let n=detectNativePackages(process.cwd()),S=new Set(n.map(t=>t.name)),C=detectNativePackages(zn(fileURLToPath(import.meta.url))),N=[...n,...C.filter(t=>!S.has(t.name))];for(let n of N)t.prepend_search_path(n.prebuildsDir),t.prepend_library_path(n.prebuildsDir);oL=N}catch{}return oL}var oL,sL=__esmMin(()=>{qn(),ir(),aL(),oL=null});async function loadNpmRolldown(){if(isGjs())throw Error("gjsify build: no usable bundler engine under GJS — `@gjsify/rolldown-native` is not loadable, and the npm `rolldown` engine is a Rust napi crate that cannot run under GJS.\n"+diagnoseNativeEngine());return(await import(resolveImportTargetForGjs(`rolldown`))).rolldown}function diagnoseNativeEngine(){let t=null;try{let n=zn(fileURLToPath(import.meta.url));t=findRolldownNativeDir(process.cwd(),n)}catch{t=null}if(t===null)return`\`@gjsify/rolldown-native\` is NOT INSTALLED — no node_modules/@gjsify/rolldown-native was found walking up from ${process.cwd()} or from the CLI bundle's own directory.\nInstall it: \`gjsify install @gjsify/rolldown-native\` (in the gjsify repo: \`gjsify install\`). Running the build under Node also works — there the npm \`rolldown\` crate is used instead.`;let n=In(t,`lib`,`esm`,`index.js`);if(!existsSync(n))return`The engine's JS facade is NOT BUILT: ${n} does not exist.\nIt is a BUILD OUTPUT, so this is almost certainly a clone of the gjsify REPOSITORY rather than a consumer install: in a clone, node_modules/@gjsify/rolldown-native is a symlink to the workspace package, whose \`lib/\` no \`gjsify install\` produces. An installed package from npm is NOT affected — the published tarball does contain \`lib/esm/index.js\` (verified against 0.26.1), so a consumer that hit this message should report it.
814
+ `)[0]??I,relation:H[0]>W[0]||H[0]===W[0]&&H[1]>W[1]?`ahead`:`behind`})}return N}var YI,XI,ZI,QI,$I,eL=__esmMin(()=>{rv(),qn(),Xl(),ir(),ef(),A_(),JI(),uv(),cv(),__name$1(detectPackageManager$1,`detectPackageManager`),YI={manette:{id:`manette`,name:`libmanette`,pkgName:`manette-0.2`},spiel:{id:`spiel`,name:`libspiel`,pkgName:`spiel-1.0`},gstreamer:{id:`gstreamer`,name:`GStreamer`,pkgName:`gstreamer-1.0`},"gst-app":{id:`gst-app`,name:`GStreamer App`,pkgName:`gstreamer-app-1.0`},"gdk-pixbuf":{id:`gdk-pixbuf`,name:`GdkPixbuf`,pkgName:`gdk-pixbuf-2.0`},pango:{id:`pango`,name:`Pango`,pkgName:`pango`},pangocairo:{id:`pangocairo`,name:`PangoCairo`,pkgName:`pangocairo`},webkitgtk:{id:`webkitgtk`,name:`WebKitGTK`,pkgName:`webkitgtk-6.0`},cairo:{id:`cairo`,name:`Cairo`,pkgName:`cairo`},gnutls:{id:`gnutls`,name:`GnuTLS`,pkgName:`gnutls`},nghttp2:{id:`nghttp2`,name:`libnghttp2`,pkgName:`libnghttp2`},"json-glib":{id:`json-glib`,name:`JSON-GLib`,pkgName:`json-glib-1.0`},epoxy:{id:`epoxy`,name:`libepoxy`,pkgName:`epoxy`},"gst-webrtc":{id:`gst-webrtc`,name:`GStreamer WebRTC`,pkgName:`gstreamer-webrtc-1.0`}},XI={"@gjsify/gamepad":[`manette`],"@gjsify/speech-synthesis":[`spiel`],"@gjsify/webaudio":[`gstreamer`,`gst-app`],"@gjsify/media-capture":[`gstreamer`,`gst-app`],"@gjsify/speech-recognition":[`gstreamer`,`gst-app`],"@gjsify/iframe":[`webkitgtk`],"@gjsify/canvas2d":[`gdk-pixbuf`,`pango`,`pangocairo`,`cairo`],"@gjsify/canvas2d-core":[`gdk-pixbuf`,`pango`,`pangocairo`,`cairo`],"@gjsify/dom-elements":[`gdk-pixbuf`],"@gjsify/webgl":[`gwebgl`,`gdk-pixbuf`,`epoxy`],"@gjsify/tls-native":[`gnutls`],"@gjsify/http2-native":[`nghttp2`],"@gjsify/rolldown-native":[`json-glib`],"@gjsify/webrtc-native":[`gstreamer`,`gst-webrtc`]},ZI={apt:{nodejs:`nodejs`,gjs:`gjs`,"pkg-config":`pkg-config`,meson:`meson`,ninja:`ninja-build`,vala:`valac`,cargo:`cargo`,gtk4:`libgtk-4-dev`,libadwaita:`libadwaita-1-dev`,libsoup3:`libsoup-3.0-dev`,webkitgtk:`libwebkit2gtk-6.0-dev`,"gobject-introspection":`gobject-introspection libgirepository1.0-dev`,manette:`libmanette-0.2-0 gir1.2-manette-0.2`,gstreamer:`libgstreamer1.0-dev`,"gst-app":`libgstreamer-plugins-base1.0-dev gir1.2-gst-plugins-base-1.0`,"gdk-pixbuf":`libgdk-pixbuf-2.0-dev`,pango:`libpango1.0-dev`,pangocairo:`libpango1.0-dev`,cairo:`libcairo2-dev`,gnutls:`libgnutls28-dev`,nghttp2:`libnghttp2-dev`,"json-glib":`libjson-glib-dev`,epoxy:`libepoxy-dev`},dnf:{nodejs:`nodejs`,gjs:`gjs`,"pkg-config":`pkgconf-pkg-config`,meson:`meson`,ninja:`ninja-build`,vala:`vala`,cargo:`cargo`,gtk4:`gtk4-devel`,libadwaita:`libadwaita-devel`,libsoup3:`libsoup3-devel`,webkitgtk:`webkitgtk6.0-devel`,"gobject-introspection":`gobject-introspection-devel`,manette:`libmanette-devel`,gstreamer:`gstreamer1-devel`,"gst-app":`gstreamer1-plugins-base-devel`,"gdk-pixbuf":`gdk-pixbuf2-devel`,pango:`pango-devel`,pangocairo:`pango-devel`,cairo:`cairo-devel`,gnutls:`gnutls-devel`,nghttp2:`libnghttp2-devel`,"json-glib":`json-glib-devel`,epoxy:`libepoxy-devel`},pacman:{nodejs:`nodejs`,gjs:`gjs`,"pkg-config":`pkgconf`,meson:`meson`,ninja:`ninja`,vala:`vala`,cargo:`rust`,gtk4:`gtk4`,libadwaita:`libadwaita`,libsoup3:`libsoup3`,webkitgtk:`webkitgtk-6.0`,"gobject-introspection":`gobject-introspection`,manette:`libmanette`,gstreamer:`gstreamer`,"gst-app":`gst-plugins-base`,"gdk-pixbuf":`gdk-pixbuf2`,pango:`pango`,pangocairo:`pango`,cairo:`cairo`,gnutls:`gnutls`,nghttp2:`libnghttp2`,"json-glib":`json-glib`,epoxy:`libepoxy`},zypper:{nodejs:`nodejs`,gjs:`gjs`,"pkg-config":`pkg-config`,meson:`meson`,ninja:`ninja`,vala:`vala`,cargo:`cargo`,gtk4:`gtk4-devel`,libadwaita:`libadwaita-devel`,libsoup3:`libsoup-3_0-devel`,webkitgtk:`webkitgtk6_0-devel`,"gobject-introspection":`gobject-introspection-devel`,manette:`libmanette-0_2-0-devel`,gstreamer:`gstreamer-devel`,"gst-app":`gstreamer-plugins-base-devel`,"gdk-pixbuf":`gdk-pixbuf-devel`,pango:`pango-devel`,pangocairo:`pango-devel`,cairo:`cairo-devel`,gnutls:`libgnutls-devel`,nghttp2:`libnghttp2-devel`,"json-glib":`json-glib-devel`,epoxy:`libepoxy-devel`},apk:{nodejs:`nodejs`,gjs:`gjs`,"pkg-config":`pkgconf`,meson:`meson`,ninja:`ninja`,vala:`vala`,cargo:`cargo`,gtk4:`gtk4.0-dev`,libadwaita:`libadwaita-dev`,libsoup3:`libsoup3-dev`,webkitgtk:`webkit2gtk-6.0-dev`,"gobject-introspection":`gobject-introspection-dev`,manette:`libmanette-dev`,gstreamer:`gstreamer-dev`,"gst-app":`gst-plugins-base-dev`,"gdk-pixbuf":`gdk-pixbuf-dev`,pango:`pango-dev`,pangocairo:`pango-dev`,cairo:`cairo-dev`,gnutls:`gnutls-dev`,nghttp2:`nghttp2-dev`,"json-glib":`json-glib-dev`,epoxy:`libepoxy-dev`},brew:{nodejs:`node`,gjs:`gjs`,"pkg-config":`pkgconf`,meson:`meson`,ninja:`ninja`,vala:`vala`,cargo:`rust`,gtk4:`gtk4`,libadwaita:`libadwaita`,libsoup3:`libsoup`,"gobject-introspection":`gobject-introspection`,gstreamer:`gstreamer`,"gst-app":`gst-plugins-base`,"gdk-pixbuf":`gdk-pixbuf`,pango:`pango`,pangocairo:`pango`,cairo:`cairo`,gnutls:`gnutls`,nghttp2:`nghttp2`,"json-glib":`json-glib`,epoxy:`libepoxy`},winget:{"msvc-runtime":`Microsoft.VCRedist.2015+.x64`},unknown:{}},QI={apt:`sudo apt install`,dnf:`sudo dnf install`,pacman:`sudo pacman -S`,zypper:`sudo zypper install`,apk:`sudo apk add`,brew:`brew install`,winget:`winget install --id`,unknown:``},$I=[{pkgConfig:`gtk4`,typePackage:`@girs/gtk-4.0`,namespaceVersion:`4.0`},{pkgConfig:`libadwaita-1`,typePackage:`@girs/adw-1`,namespaceVersion:`1`},{pkgConfig:`libsoup-3.0`,typePackage:`@girs/soup-3.0`,namespaceVersion:`3.0`},{pkgConfig:`glib-2.0`,typePackage:`@girs/glib-2.0`,namespaceVersion:`2.0`},{pkgConfig:`gobject-2.0`,typePackage:`@girs/gobject-2.0`,namespaceVersion:`2.0`},{pkgConfig:`gio-2.0`,typePackage:`@girs/gio-2.0`,namespaceVersion:`2.0`},{pkgConfig:`gstreamer-1.0`,typePackage:`@girs/gst-1.0`,namespaceVersion:`1.0`},{pkgConfig:`webkitgtk-6.0`,typePackage:`@girs/webkit-6.0`,namespaceVersion:`6.0`},{pkgConfig:`manette-0.2`,typePackage:`@girs/manette-0.2`,namespaceVersion:`0.2`},{pkgConfig:`pango`,typePackage:`@girs/pango-1.0`,namespaceVersion:`1.0`},{pkgConfig:`harfbuzz`,typePackage:`@girs/harfbuzz-0.0`,namespaceVersion:`0.0`}]});function parsePlatformToken(t){let n=t.endsWith(rL),S=n?t.slice(0,-5):t,C=S.indexOf(`-`),N=C<0?S:S.slice(0,C);return{os:N,arch:C<0?``:S.slice(C+1),libc:n&&N===`linux`?`musl`:null}}function canonicalPlatformToken(t){let{os:n,arch:S,libc:C}=parsePlatformToken(t);if(!S)return t;let N=`${n}-${nL[S]??S}`;return C===`musl`||t.endsWith(rL)?`${N}${rL}`:N}function hostPlatformTokens(t,n,S){let C=`${t}-${n}`;return S===`musl`&&t===`linux`?[`${C}${rL}`,C]:[C]}function prebuildDirCandidates(t,n,S,C){let N=hostPlatformTokens(t,n,C),F=tL[n]??n,I=[],push=t=>{I.includes(t)||I.push(t)};for(let t of N){for(let n of S??[])typeof n==`string`&&canonicalPlatformToken(n)===t&&push(n);push(t)}return push(`${t}-${F}`),I}function resolvePrebuildDirName(t){let{platform:n,arch:S,declaredPlatforms:C,existingDirs:N,libc:F}=t;for(let t of prebuildDirCandidates(n,S,C,F))if(N.includes(t))return t;return null}function platformPackageName(t,n){return`${t}-${n}`}function scanNodeModules(t,n){let S=[],C=[];if(!existsSync(t))return{resolved:S,declared:C};let N;try{N=readdirSync(t)}catch{return{resolved:S,declared:C}}let take=t=>{t&&(t.kind===`resolved`?S.push(t.pkg):C.push(t.candidate))};for(let S of N)if(!S.startsWith(`.`))if(S.startsWith(`@`)){let C=In(t,S),N;try{N=readdirSync(C)}catch{continue}for(let t of N)take(checkPackage(In(C,t),`${S}/${t}`,n))}else take(checkPackage(In(t,S),S,n));return{resolved:S,declared:C}}function checkPackage(t,n,S){let C=readPackageJson$2(In(t,`package.json`));if(!C)return null;let N=C.gjsify;if(!N||typeof N!=`object`)return null;let F=N,I=F.prebuilds;if(typeof I!=`string`)return null;let H=F.platforms,W=Array.isArray(H)?H.filter(t=>typeof t==`string`):void 0,q=In(t,I),Y;try{Y=readdirSync(q,{withFileTypes:!0}).filter(t=>t.isDirectory()||t.isSymbolicLink()).map(t=>t.name)}catch{return{kind:`declared`,candidate:{name:n,pkgDir:t}}}let X=resolvePrebuildDirName({platform:S.platform,arch:S.arch,declaredPlatforms:W,existingDirs:Y,libc:S.libc});return X?{kind:`resolved`,pkg:{name:n,prebuildsDir:In(q,X)}}:{kind:`declared`,candidate:{name:n,pkgDir:t}}}function resolvePlatformSibling(t,n){let S=hostPlatformTokens(n.platform,n.arch,n.libc),C=Nn(t.pkgDir);for(;;){for(let N of S){let S=platformPackageName(t.name,N),F=checkPackage(In(C,`node_modules`,...S.split(`/`)),S,n);if(F?.kind===`resolved`)return F.pkg}let N=Nn(C,`..`);if(N===C)return null;C=N}}function detectNativePackages(t,n={}){let S={platform:n.platform??process.platform,arch:n.arch??process.arch,libc:n.libc===void 0?detectHostLibc(n.platform??process.platform):n.libc},C=[],N=new Set,F=[],I=Nn(t);for(;;){let t=In(I,`node_modules`);if(existsSync(t)){let n=scanNodeModules(t,S);for(let t of n.resolved)N.has(t.name)||(N.add(t.name),C.push(t));for(let t of n.declared)F.some(n=>n.name===t.name)||F.push(t)}let n=Nn(I,`..`);if(n===I)break;I=n}for(let t of F){if(N.has(t.name))continue;let n=resolvePlatformSibling(t,S);!n||N.has(n.name)||(N.add(n.name),C.push(n))}return C}function resolveHostLibc(t){return t.platform===`linux`?typeof t.glibcVersionRuntime==`string`&&t.glibcVersionRuntime.length>0?`glibc`:t.muslLoaderPresent?`musl`:`glibc`:null}function detectHostLibc(t){if(t!==`linux`)return null;let n=process.report?.getReport()?.header;return resolveHostLibc({platform:t,glibcVersionRuntime:typeof n?.glibcVersionRuntime==`string`?n.glibcVersionRuntime:void 0,muslLoaderPresent:existsSync(`/lib`)&&readdirSync(`/lib`).some(t=>t.startsWith(`ld-musl-`))})}function muslPrebuildFallbacks(t,n){return t===`musl`?n.filter(t=>parsePlatformToken(Bn(t.prebuildsDir)).libc!==`musl`).map(t=>t.name):[]}function libraryPathVar(t){return t===`darwin`?{name:`DYLD_LIBRARY_PATH`,separator:`:`}:t===`win32`?{name:`PATH`,separator:`;`}:{name:`LD_LIBRARY_PATH`,separator:`:`}}function buildNativeEnv(t,n={}){let S=n.platform??process.platform,C=n.env??process.env,N=t.map(t=>t.prebuildsDir),F=S===`win32`?`;`:`:`,{name:I,separator:H}=libraryPathVar(S),W=S===`win32`?Object.keys(C).find(t=>t.toLowerCase()===I.toLowerCase())??I:I,prepend=(t,n)=>[...N,...t?[t]:[]].join(n),q={GI_TYPELIB_PATH:prepend(C.GI_TYPELIB_PATH,F)};q[W]=prepend(C[W],H);let Y=(n.systemGiDirs??systemGiLibraryDirs)({platform:S,env:C});return Y.length>0&&(q[iL]=composeDyldFallback(Y,C)),q}var tL,nL,rL,iL,aL=__esmMin(()=>{ef(),qn(),PI(),GI(),tL={x64:`x86_64`,arm64:`aarch64`,arm:`armv7`,ia32:`i686`},nL={x86_64:`x64`,amd64:`x64`,aarch64:`arm64`},rL=`-musl`,iL=`DYLD_FALLBACK_LIBRARY_PATH`});function defaultRepository(){let t=(globalThis.imports?.gi)?.GIRepository?.Repository;return typeof t?.dup_default==`function`?t.dup_default():null}function activateNativePrebuilds(){if(oL)return oL;oL=[];try{let t=defaultRepository();if(!t)return oL;let n=detectNativePackages(process.cwd()),S=new Set(n.map(t=>t.name)),C=detectNativePackages(zn(fileURLToPath(import.meta.url))),N=[...n,...C.filter(t=>!S.has(t.name))];for(let n of N)t.prepend_search_path(n.prebuildsDir),t.prepend_library_path(n.prebuildsDir);oL=N}catch{}return oL}var oL,sL=__esmMin(()=>{qn(),ir(),aL(),oL=null});async function loadNpmRolldown(){if(isGjs())throw Error("gjsify build: no usable bundler engine under GJS — `@gjsify/rolldown-native` is not loadable, and the npm `rolldown` engine is a Rust napi crate that cannot run under GJS.\n"+diagnoseNativeEngine());return(await import(resolveImportTargetForGjs(`rolldown`))).rolldown}function diagnoseNativeEngine(){let t=null;try{let n=zn(fileURLToPath(import.meta.url));t=findRolldownNativeDir(process.cwd(),n)}catch{t=null}if(t===null)return`\`@gjsify/rolldown-native\` is NOT INSTALLED — no node_modules/@gjsify/rolldown-native was found walking up from ${process.cwd()} or from the CLI bundle's own directory.\nInstall it: \`gjsify install @gjsify/rolldown-native\` (in the gjsify repo: \`gjsify install\`). Running the build under Node also works — there the npm \`rolldown\` crate is used instead.`;let n=In(t,`lib`,`esm`,`index.js`);if(!existsSync(n))return`The engine's JS facade is NOT BUILT: ${n} does not exist.\nIt is a BUILD OUTPUT, so this is almost certainly a clone of the gjsify REPOSITORY rather than a consumer install: in a clone, node_modules/@gjsify/rolldown-native is a symlink to the workspace package, whose \`lib/\` no \`gjsify install\` produces. An installed package from npm is NOT affected — the published tarball does contain \`lib/esm/index.js\` (verified against 0.26.1), so a consumer that hit this message should report it.
815
815
  Build it from the gjsify repo root — both are idempotent and skip already-built facades in seconds, and NEITHER requires Node any more:
816
816
  gjsify run build:infra # the full cold-tree chain
817
817
  gjsify run --node-script scripts/bootstrap-native-facades.mjs # just the facades
@@ -282,6 +282,7 @@ export const PACKAGE_DEPS = {
282
282
  '@gjsify/speech-synthesis': ['spiel'],
283
283
  '@gjsify/webaudio': ['gstreamer', 'gst-app'],
284
284
  '@gjsify/media-capture': ['gstreamer', 'gst-app'],
285
+ '@gjsify/speech-recognition': ['gstreamer', 'gst-app'],
285
286
  '@gjsify/iframe': ['webkitgtk'],
286
287
  '@gjsify/canvas2d': ['gdk-pixbuf', 'pango', 'pangocairo', 'cairo'],
287
288
  '@gjsify/canvas2d-core': ['gdk-pixbuf', 'pango', 'pangocairo', 'cairo'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/cli",
3
- "version": "0.64.29",
3
+ "version": "0.64.31",
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.64.29",
146
- "@gjsify/buffer": "^0.64.29",
147
- "@gjsify/create-app": "^0.64.29",
148
- "@gjsify/node-globals": "^0.64.29",
149
- "@gjsify/node-polyfills": "^0.64.29",
150
- "@gjsify/npm-registry": "^0.64.29",
151
- "@gjsify/resolve-npm": "^0.64.29",
152
- "@gjsify/rolldown-plugin-gjsify": "^0.64.29",
153
- "@gjsify/vite-plugin-blueprint": "^0.64.29",
154
- "@gjsify/rolldown-plugin-pnp": "^0.64.29",
155
- "@gjsify/semver": "^0.64.29",
156
- "@gjsify/tar": "^0.64.29",
157
- "@gjsify/tsc": "^0.64.29",
158
- "@gjsify/utils": "^0.64.29",
159
- "@gjsify/web-polyfills": "^0.64.29",
160
- "@gjsify/workspace": "^0.64.29",
145
+ "@gjsify/blueprint": "^0.64.31",
146
+ "@gjsify/buffer": "^0.64.31",
147
+ "@gjsify/create-app": "^0.64.31",
148
+ "@gjsify/node-globals": "^0.64.31",
149
+ "@gjsify/node-polyfills": "^0.64.31",
150
+ "@gjsify/npm-registry": "^0.64.31",
151
+ "@gjsify/resolve-npm": "^0.64.31",
152
+ "@gjsify/rolldown-plugin-gjsify": "^0.64.31",
153
+ "@gjsify/vite-plugin-blueprint": "^0.64.31",
154
+ "@gjsify/rolldown-plugin-pnp": "^0.64.31",
155
+ "@gjsify/semver": "^0.64.31",
156
+ "@gjsify/tar": "^0.64.31",
157
+ "@gjsify/tsc": "^0.64.31",
158
+ "@gjsify/utils": "^0.64.31",
159
+ "@gjsify/web-polyfills": "^0.64.31",
160
+ "@gjsify/workspace": "^0.64.31",
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.64.29",
169
+ "@gjsify/unit": "^0.64.31",
170
170
  "@types/yargs": "^17.0.35",
171
171
  "typescript": "^6.0.3"
172
172
  },
173
173
  "peerDependencies": {
174
- "@gjsify/oxfmt-native": "^0.64.29",
175
- "@gjsify/rolldown-native": "^0.64.29"
174
+ "@gjsify/oxfmt-native": "^0.64.31",
175
+ "@gjsify/rolldown-native": "^0.64.31"
176
176
  },
177
177
  "peerDependenciesMeta": {
178
178
  "@gjsify/oxfmt-native": {