@leviyuan/lodestar 0.17.3 → 0.17.5

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.
@@ -1,2 +1,60 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as E$}from"node:module";var y$=Object.create;var{getPrototypeOf:T$,defineProperty:D,getOwnPropertyNames:R$}=Object;var b$=Object.prototype.hasOwnProperty;function j$($){return this[$]}var D$,w$,v$=($,q,L)=>{var J=$!=null&&typeof $==="object";if(J){var Q=q?D$??=new WeakMap:w$??=new WeakMap,Z=Q.get($);if(Z)return Z}L=$!=null?y$(T$($)):{};let z=q||!$||!$.__esModule?D(L,"default",{value:$,enumerable:!0}):L;for(let Y of R$($))if(!b$.call(z,Y))D(z,Y,{get:j$.bind($,Y),enumerable:!0});if(J)Q.set($,z);return z};var V=($,q)=>()=>(q||$((q={exports:{}}).exports,q),q.exports);var k=E$(import.meta.url);var m=V((o0,c)=>{c.exports=h;h.sync=g$;var A=k("fs");function m$($,q){var L=q.pathExt!==void 0?q.pathExt:process.env.PATHEXT;if(!L)return!0;if(L=L.split(";"),L.indexOf("")!==-1)return!0;for(var J=0;J<L.length;J++){var Q=L[J].toLowerCase();if(Q&&$.substr(-Q.length).toLowerCase()===Q)return!0}return!1}function u($,q,L){if(!$.isSymbolicLink()&&!$.isFile())return!1;return m$(q,L)}function h($,q,L){A.stat($,function(J,Q){L(J,J?!1:u(Q,$,q))})}function g$($,q){return u(A.statSync($),$,q)}});var i=V((a0,p)=>{p.exports=l;l.sync=l$;var g=k("fs");function l($,q,L){g.stat($,function(J,Q){L(J,J?!1:d(Q,q))})}function l$($,q){return d(g.statSync($),q)}function d($,q){return $.isFile()&&d$($,q)}function d$($,q){var{mode:L,uid:J,gid:Q}=$,Z=q.uid!==void 0?q.uid:process.getuid&&process.getuid(),z=q.gid!==void 0?q.gid:process.getgid&&process.getgid(),Y=parseInt("100",8),W=parseInt("010",8),H=parseInt("001",8),G=Y|W,K=L&H||L&W&&Q===z||L&Y&&J===Z||L&G&&Z===0;return K}});var s=V((e0,n)=>{var r0=k("fs"),S;if(process.platform==="win32"||global.TESTING_WINDOWS)S=m();else S=i();n.exports=I;I.sync=p$;function I($,q,L){if(typeof q==="function")L=q,q={};if(!L){if(typeof Promise!=="function")throw TypeError("callback not provided");return new Promise(function(J,Q){I($,q||{},function(Z,z){if(Z)Q(Z);else J(z)})})}S($,q||{},function(J,Q){if(J){if(J.code==="EACCES"||q&&q.ignoreErrors)J=null,Q=!1}L(J,Q)})}function p$($,q){try{return S.sync($,q||{})}catch(L){if(q&&q.ignoreErrors||L.code==="EACCES")return!1;else throw L}}});var q$=V(($1,$$)=>{var P=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",t=k("path"),i$=P?";":":",o=s(),a=($)=>Object.assign(Error(`not found: ${$}`),{code:"ENOENT"}),r=($,q)=>{let L=q.colon||i$,J=$.match(/\//)||P&&$.match(/\\/)?[""]:[...P?[process.cwd()]:[],...(q.path||process.env.PATH||"").split(L)],Q=P?q.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",Z=P?Q.split(L):[""];if(P){if($.indexOf(".")!==-1&&Z[0]!=="")Z.unshift("")}return{pathEnv:J,pathExt:Z,pathExtExe:Q}},e=($,q,L)=>{if(typeof q==="function")L=q,q={};if(!q)q={};let{pathEnv:J,pathExt:Q,pathExtExe:Z}=r($,q),z=[],Y=(H)=>new Promise((G,K)=>{if(H===J.length)return q.all&&z.length?G(z):K(a($));let U=J[H],O=/^".*"$/.test(U)?U.slice(1,-1):U,M=t.join(O,$),C=!O&&/^\.[\\\/]/.test($)?$.slice(0,2)+M:M;G(W(C,H,0))}),W=(H,G,K)=>new Promise((U,O)=>{if(K===Q.length)return U(Y(G+1));let M=Q[K];o(H+M,{pathExt:Z},(C,f$)=>{if(!C&&f$)if(q.all)z.push(H+M);else return U(H+M);return U(W(H,G,K+1))})});return L?Y(0).then((H)=>L(null,H),L):Y(0)},n$=($,q)=>{q=q||{};let{pathEnv:L,pathExt:J,pathExtExe:Q}=r($,q),Z=[];for(let z=0;z<L.length;z++){let Y=L[z],W=/^".*"$/.test(Y)?Y.slice(1,-1):Y,H=t.join(W,$),G=!W&&/^\.[\\\/]/.test($)?$.slice(0,2)+H:H;for(let K=0;K<J.length;K++){let U=G+J[K];try{if(o.sync(U,{pathExt:Q}))if(q.all)Z.push(U);else return U}catch(O){}}}if(q.all&&Z.length)return Z;if(q.nothrow)return null;throw a($)};$$.exports=e;e.sync=n$});var J$=V((q1,x)=>{var L$=($={})=>{let q=$.env||process.env;if(($.platform||process.platform)!=="win32")return"PATH";return Object.keys(q).reverse().find((J)=>J.toUpperCase()==="PATH")||"Path"};x.exports=L$;x.exports.default=L$});var z$=V((L1,Z$)=>{var Q$=k("path"),s$=q$(),t$=J$();function X$($,q){let L=$.options.env||process.env,J=process.cwd(),Q=$.options.cwd!=null,Z=Q&&process.chdir!==void 0&&!process.chdir.disabled;if(Z)try{process.chdir($.options.cwd)}catch(Y){}let z;try{z=s$.sync($.command,{path:L[t$({env:L})],pathExt:q?Q$.delimiter:void 0})}catch(Y){}finally{if(Z)process.chdir(J)}if(z)z=Q$.resolve(Q?$.options.cwd:"",z);return z}function o$($){return X$($)||X$($,!0)}Z$.exports=o$});var B$=V((e$,f)=>{var _=/([()\][%!^"`<>&|;, *?])/g;function a$($){return $=$.replace(_,"^$1"),$}function r$($,q){if($=`${$}`,$=$.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),$=$.replace(/(?=(\\+?)?)\1$/,"$1$1"),$=`"${$}"`,$=$.replace(_,"^$1"),q)$=$.replace(_,"^$1");return $}e$.command=a$;e$.argument=r$});var H$=V((J1,Y$)=>{Y$.exports=/^#!(.*)/});var K$=V((Q1,V$)=>{var L0=H$();V$.exports=($="")=>{let q=$.match(L0);if(!q)return null;let[L,J]=q[0].replace(/#! ?/,"").split(" "),Q=L.split("/").pop();if(Q==="env")return J;return J?`${Q} ${J}`:Q}});var G$=V((X1,U$)=>{var y=k("fs"),J0=K$();function Q0($){let L=Buffer.alloc(150),J;try{J=y.openSync($,"r"),y.readSync(J,L,0,150,0),y.closeSync(J)}catch(Q){}return J0(L.toString())}U$.exports=Q0});var P$=V((Z1,M$)=>{var X0=k("path"),W$=z$(),k$=B$(),Z0=G$(),z0=process.platform==="win32",B0=/\.(?:com|exe)$/i,Y0=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function H0($){$.file=W$($);let q=$.file&&Z0($.file);if(q)return $.args.unshift($.file),$.command=q,W$($);return $.file}function V0($){if(!z0)return $;let q=H0($),L=!B0.test(q);if($.options.forceShell||L){let J=Y0.test(q);$.command=X0.normalize($.command),$.command=k$.command($.command),$.args=$.args.map((Z)=>k$.argument(Z,J));let Q=[$.command].concat($.args).join(" ");$.args=["/d","/s","/c",`"${Q}"`],$.command=process.env.comspec||"cmd.exe",$.options.windowsVerbatimArguments=!0}return $}function K0($,q,L){if(q&&!Array.isArray(q))L=q,q=null;q=q?q.slice(0):[],L=Object.assign({},L);let J={command:$,args:q,options:L,file:void 0,original:{command:$,args:q}};return L.shell?J:V0(J)}M$.exports=K0});var F$=V((z1,O$)=>{var T=process.platform==="win32";function R($,q){return Object.assign(Error(`${q} ${$.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${q} ${$.command}`,path:$.command,spawnargs:$.args})}function U0($,q){if(!T)return;let L=$.emit;$.emit=function(J,Q){if(J==="exit"){let Z=N$(Q,q);if(Z)return L.call($,"error",Z)}return L.apply($,arguments)}}function N$($,q){if(T&&$===1&&!q.file)return R(q.original,"spawn");return null}function G0($,q){if(T&&$===1&&!q.file)return R(q.original,"spawnSync");return null}O$.exports={hookChildProcess:U0,verifyENOENT:N$,verifyENOENTSync:G0,notFoundError:R}});var I$=V((B1,N)=>{var S$=k("child_process"),b=P$(),j=F$();function C$($,q,L){let J=b($,q,L),Q=S$.spawn(J.command,J.args,J.options);return j.hookChildProcess(Q,J),Q}function W0($,q,L){let J=b($,q,L),Q=S$.spawnSync(J.command,J.args,J.options);return Q.error=Q.error||j.verifyENOENTSync(Q.status,J),Q}N.exports=C$;N.exports.spawn=C$;N.exports.sync=W0;N.exports._parse=b;N.exports._enoent=j});import{readFileSync as C0}from"node:fs";import{fileURLToPath as I0}from"node:url";import{existsSync as P0,readFileSync as N0}from"node:fs";import{join as O0,isAbsolute as F0}from"node:path";import{homedir as A$}from"node:os";import{join as X}from"node:path";var F=A$(),w=process.platform==="win32";function v($,q,L){if($)return $;if(q)return X(q,"lodestar");return L}function u$(){if(w)return X(process.env.APPDATA??X(F,"AppData","Roaming"),"Lodestar");return X(F,".config","lodestar")}function h$(){if(w)return X(process.env.LOCALAPPDATA??X(F,"AppData","Local"),"Lodestar");return X(F,".local","share","lodestar")}var c$=v(process.env.LODESTAR_CONFIG_DIR,process.env.XDG_CONFIG_HOME,u$()),B=v(process.env.LODESTAR_DATA_DIR,process.env.XDG_DATA_HOME,h$()),R0=process.env.LODESTAR_CONFIG??X(c$,"config.toml"),b0=X(B,"daemon.pid"),j0=X(B,"daemon.log"),D0=X(B,"session-chat-map.json"),w0=X(B,"session-resume-map.json"),v0=X(B,"session-turns-map.json"),E0=X(B,"session-model-map.json"),A0=X(B,"temp-session-leases.json"),u0=X(B,"tasklist-map.json"),h0=X(B,"agent-runs"),c0=X(B,"agent-session-ids.json"),m0=X(B,"managed-claude-plugin"),g0=X(B,"dsh"),E=X(B,"agent-runtimes"),l0=X(B,"context-window-cache.json"),d0=X(B,"notify-callbacks.json"),p0=X(B,"alive-on-shutdown.json"),i0=X(B,"inbox"),n0=X(B,"debug.sock"),s0=X(B,"debug-context.json");var k0=v$(I$(),1);var x$=["codex","claude","dsh"];function S0($,q=E){let L=O0(q,$,"current.json");if(!P0(L))return null;let J=JSON.parse(N0(L,"utf8"));if(!Number.isFinite(J.checkedAt)||J.directory!==void 0&&!F0(J.directory))throw Error(`Invalid ${$} runtime state: ${L}`);return J}function _$($){return S0($)}var x0=JSON.parse(C0(I0(new URL("../package.json",import.meta.url)),"utf8"));console.log(`Lodestar v${x0.version}`);for(let $ of x$)try{let q=_$($);if(!q){console.log(`${$}: MISS(尚未自动安装)`);continue}if(q.error){console.log(`${$}: MISS(自动更新失败:${q.error})`),process.exitCode=1;continue}let L=$==="dsh"?["@deepseek-ai/dsh"]:Object.keys(q.versions??{});console.log(`${$}: ${L.map((J)=>`${J}@${q.versions?.[J]??"MISS"}`).join(", ")}`),console.log(` ${q.directory}`)}catch(q){console.error(`${$}: MISS(${q})`),process.exitCode=1}console.log(`Runtime: ${process.version} (${process.platform}-${process.arch})`);
2
+ import{createRequire as E8}from"node:module";var w8=Object.create;var{getPrototypeOf:N8,defineProperty:F0,getOwnPropertyNames:C8}=Object;var R8=Object.prototype.hasOwnProperty;function T8($){return this[$]}var j8,S8,L$=($,J,Q)=>{var Y=$!=null&&typeof $==="object";if(Y){var Z=J?j8??=new WeakMap:S8??=new WeakMap,K=Z.get($);if(K)return K}Q=$!=null?w8(N8($)):{};let X=J||!$||!$.__esModule?F0(Q,"default",{value:$,enumerable:!0}):Q;for(let W of C8($))if(!R8.call(X,W))F0(X,W,{get:T8.bind($,W),enumerable:!0});if(Y)Z.set($,X);return X};var F=($,J)=>()=>(J||$((J={exports:{}}).exports,J),J.exports);var q=E8(import.meta.url);var B0=F((r4,U0)=>{var J$=1000,Q$=J$*60,Y$=Q$*60,a=Y$*24,I8=a*7,D8=a*365.25;U0.exports=function($,J){J=J||{};var Q=typeof $;if(Q==="string"&&$.length>0)return f8($);else if(Q==="number"&&isFinite($))return J.long?y8($):_8($);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify($))};function f8($){if($=String($),$.length>100)return;var J=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec($);if(!J)return;var Q=parseFloat(J[1]),Y=(J[2]||"ms").toLowerCase();switch(Y){case"years":case"year":case"yrs":case"yr":case"y":return Q*D8;case"weeks":case"week":case"w":return Q*I8;case"days":case"day":case"d":return Q*a;case"hours":case"hour":case"hrs":case"hr":case"h":return Q*Y$;case"minutes":case"minute":case"mins":case"min":case"m":return Q*Q$;case"seconds":case"second":case"secs":case"sec":case"s":return Q*J$;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return Q;default:return}}function _8($){var J=Math.abs($);if(J>=a)return Math.round($/a)+"d";if(J>=Y$)return Math.round($/Y$)+"h";if(J>=Q$)return Math.round($/Q$)+"m";if(J>=J$)return Math.round($/J$)+"s";return $+"ms"}function y8($){var J=Math.abs($);if(J>=a)return P$($,J,a,"day");if(J>=Y$)return P$($,J,Y$,"hour");if(J>=Q$)return P$($,J,Q$,"minute");if(J>=J$)return P$($,J,J$,"second");return $+" ms"}function P$($,J,Q,Y){var Z=J>=Q*1.5;return Math.round($/Q)+" "+Y+(Z?"s":"")}});var m$=F((s4,M0)=>{function A8($){Q.debug=Q,Q.default=Q,Q.coerce=M,Q.disable=X,Q.enable=Z,Q.enabled=W,Q.humanize=B0(),Q.destroy=O,Object.keys($).forEach((V)=>{Q[V]=$[V]}),Q.names=[],Q.skips=[],Q.formatters={};function J(V){let z=0;for(let H=0;H<V.length;H++)z=(z<<5)-z+V.charCodeAt(H),z|=0;return Q.colors[Math.abs(z)%Q.colors.length]}Q.selectColor=J;function Q(V){let z,H=null,G,C;function U(...w){if(!U.enabled)return;let j=U,I=Number(new Date),p=I-(z||I);if(j.diff=p,j.prev=z,j.curr=I,z=I,w[0]=Q.coerce(w[0]),typeof w[0]!=="string")w.unshift("%O");let y=0;w[0]=w[0].replace(/%([a-zA-Z%])/g,(b,d)=>{if(b==="%%")return"%";y++;let U$=Q.formatters[d];if(typeof U$==="function"){let l$=w[y];b=U$.call(j,l$),w.splice(y,1),y--}return b}),Q.formatArgs.call(j,w),(j.log||Q.log).apply(j,w)}if(U.namespace=V,U.useColors=Q.useColors(),U.color=Q.selectColor(V),U.extend=Y,U.destroy=Q.destroy,Object.defineProperty(U,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(H!==null)return H;if(G!==Q.namespaces)G=Q.namespaces,C=Q.enabled(V);return C},set:(w)=>{H=w}}),typeof Q.init==="function")Q.init(U);return U}function Y(V,z){let H=Q(this.namespace+(typeof z>"u"?":":z)+V);return H.log=this.log,H}function Z(V){Q.save(V),Q.namespaces=V,Q.names=[],Q.skips=[];let z=(typeof V==="string"?V:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let H of z)if(H[0]==="-")Q.skips.push(H.slice(1));else Q.names.push(H)}function K(V,z){let H=0,G=0,C=-1,U=0;while(H<V.length)if(G<z.length&&(z[G]===V[H]||z[G]==="*"))if(z[G]==="*")C=G,U=H,G++;else H++,G++;else if(C!==-1)G=C+1,U++,H=U;else return!1;while(G<z.length&&z[G]==="*")G++;return G===z.length}function X(){let V=[...Q.names,...Q.skips.map((z)=>"-"+z)].join(",");return Q.enable(""),V}function W(V){for(let z of Q.skips)if(K(V,z))return!1;for(let z of Q.names)if(K(V,z))return!0;return!1}function M(V){if(V instanceof Error)return V.stack||V.message;return V}function O(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return Q.enable(Q.load()),Q}M0.exports=A8});var q0=F((O0,w$)=>{O0.formatArgs=x8;O0.save=h8;O0.load=b8;O0.useColors=v8;O0.storage=k8();O0.destroy=(()=>{let $=!1;return()=>{if(!$)$=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();O0.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function v8(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let $;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&($=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt($[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function x8($){if($[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+$[0]+(this.useColors?"%c ":" ")+"+"+w$.exports.humanize(this.diff),!this.useColors)return;let J="color: "+this.color;$.splice(1,0,J,"color: inherit");let Q=0,Y=0;$[0].replace(/%[a-zA-Z%]/g,(Z)=>{if(Z==="%%")return;if(Q++,Z==="%c")Y=Q}),$.splice(Y,0,J)}O0.log=console.debug||console.log||(()=>{});function h8($){try{if($)O0.storage.setItem("debug",$);else O0.storage.removeItem("debug")}catch(J){}}function b8(){let $;try{$=O0.storage.getItem("debug")||O0.storage.getItem("DEBUG")}catch(J){}if(!$&&typeof process<"u"&&"env"in process)$=process.env.DEBUG;return $}function k8(){try{return localStorage}catch($){}}w$.exports=m$()(O0);var{formatters:g8}=w$.exports;g8.j=function($){try{return JSON.stringify($)}catch(J){return"[UnexpectedJSONParseError]: "+J.message}}});var N0=F((P0,C$)=>{var d8=q("tty"),N$=q("util");P0.init=$9;P0.log=r8;P0.formatArgs=o8;P0.save=s8;P0.load=e8;P0.useColors=a8;P0.destroy=N$.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");P0.colors=[6,2,3,4,5,1];try{let $=(()=>{throw new Error("Cannot require module "+"supports-color");})();if($&&($.stderr||$).level>=2)P0.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch($){}P0.inspectOpts=Object.keys(process.env).filter(($)=>{return/^debug_/i.test($)}).reduce(($,J)=>{let Q=J.substring(6).toLowerCase().replace(/_([a-z])/g,(Z,K)=>{return K.toUpperCase()}),Y=process.env[J];if(/^(yes|on|true|enabled)$/i.test(Y))Y=!0;else if(/^(no|off|false|disabled)$/i.test(Y))Y=!1;else if(Y==="null")Y=null;else Y=Number(Y);return $[Q]=Y,$},{});function a8(){return"colors"in P0.inspectOpts?Boolean(P0.inspectOpts.colors):d8.isatty(process.stderr.fd)}function o8($){let{namespace:J,useColors:Q}=this;if(Q){let Y=this.color,Z="\x1B[3"+(Y<8?Y:"8;5;"+Y),K=` ${Z};1m${J} \x1B[0m`;$[0]=K+$[0].split(`
3
+ `).join(`
4
+ `+K),$.push(Z+"m+"+C$.exports.humanize(this.diff)+"\x1B[0m")}else $[0]=t8()+J+" "+$[0]}function t8(){if(P0.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function r8(...$){return process.stderr.write(N$.formatWithOptions(P0.inspectOpts,...$)+`
5
+ `)}function s8($){if($)process.env.DEBUG=$;else delete process.env.DEBUG}function e8(){return process.env.DEBUG}function $9($){$.inspectOpts={};let J=Object.keys(P0.inspectOpts);for(let Q=0;Q<J.length;Q++)$.inspectOpts[J[Q]]=P0.inspectOpts[J[Q]]}C$.exports=m$()(P0);var{formatters:L0}=C$.exports;L0.o=function($){return this.inspectOpts.colors=this.useColors,N$.inspect($,this.inspectOpts).split(`
6
+ `).map((J)=>J.trim()).join(" ")};L0.O=function($){return this.inspectOpts.colors=this.useColors,N$.inspect($,this.inspectOpts)}});var C0=F((J6,i$)=>{if(typeof process>"u"||process.type==="renderer"||!1||process.__nwjs)i$.exports=q0();else i$.exports=N0()});var j0=F((D)=>{var z9=D&&D.__createBinding||(Object.create?function($,J,Q,Y){if(Y===void 0)Y=Q;var Z=Object.getOwnPropertyDescriptor(J,Q);if(!Z||("get"in Z?!J.__esModule:Z.writable||Z.configurable))Z={enumerable:!0,get:function(){return J[Q]}};Object.defineProperty($,Y,Z)}:function($,J,Q,Y){if(Y===void 0)Y=Q;$[Y]=J[Q]}),W9=D&&D.__setModuleDefault||(Object.create?function($,J){Object.defineProperty($,"default",{enumerable:!0,value:J})}:function($,J){$.default=J}),R0=D&&D.__importStar||function($){if($&&$.__esModule)return $;var J={};if($!=null){for(var Q in $)if(Q!=="default"&&Object.prototype.hasOwnProperty.call($,Q))z9(J,$,Q)}return W9(J,$),J};Object.defineProperty(D,"__esModule",{value:!0});D.req=D.json=D.toBuffer=void 0;var H9=R0(q("http")),G9=R0(q("https"));async function T0($){let J=0,Q=[];for await(let Y of $)J+=Y.length,Q.push(Y);return Buffer.concat(Q,J)}D.toBuffer=T0;async function F9($){let Q=(await T0($)).toString("utf8");try{return JSON.parse(Q)}catch(Y){let Z=Y;throw Z.message+=` (input: ${Q})`,Z}}D.json=F9;function U9($,J={}){let Y=((typeof $==="string"?$:$.href).startsWith("https:")?G9:H9).request($,J),Z=new Promise((K,X)=>{Y.once("response",K).once("error",X).end()});return Y.then=Z.then.bind(Z),Y}D.req=U9});var f0=F((A)=>{var E0=A&&A.__createBinding||(Object.create?function($,J,Q,Y){if(Y===void 0)Y=Q;var Z=Object.getOwnPropertyDescriptor(J,Q);if(!Z||("get"in Z?!J.__esModule:Z.writable||Z.configurable))Z={enumerable:!0,get:function(){return J[Q]}};Object.defineProperty($,Y,Z)}:function($,J,Q,Y){if(Y===void 0)Y=Q;$[Y]=J[Q]}),B9=A&&A.__setModuleDefault||(Object.create?function($,J){Object.defineProperty($,"default",{enumerable:!0,value:J})}:function($,J){$.default=J}),I0=A&&A.__importStar||function($){if($&&$.__esModule)return $;var J={};if($!=null){for(var Q in $)if(Q!=="default"&&Object.prototype.hasOwnProperty.call($,Q))E0(J,$,Q)}return B9(J,$),J},M9=A&&A.__exportStar||function($,J){for(var Q in $)if(Q!=="default"&&!Object.prototype.hasOwnProperty.call(J,Q))E0(J,$,Q)};Object.defineProperty(A,"__esModule",{value:!0});A.Agent=void 0;var O9=I0(q("net")),S0=I0(q("http")),q9=q("https");M9(j0(),A);var k=Symbol("AgentBaseInternalState");class D0 extends S0.Agent{constructor($){super($);this[k]={}}isSecureEndpoint($){if($){if(typeof $.secureEndpoint==="boolean")return $.secureEndpoint;if(typeof $.protocol==="string")return $.protocol==="https:"}let{stack:J}=Error();if(typeof J!=="string")return!1;return J.split(`
7
+ `).some((Q)=>Q.indexOf("(https.js:")!==-1||Q.indexOf("node:https:")!==-1)}incrementSockets($){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;if(!this.sockets[$])this.sockets[$]=[];let J=new O9.Socket({writable:!1});return this.sockets[$].push(J),this.totalSocketCount++,J}decrementSockets($,J){if(!this.sockets[$]||J===null)return;let Q=this.sockets[$],Y=Q.indexOf(J);if(Y!==-1){if(Q.splice(Y,1),this.totalSocketCount--,Q.length===0)delete this.sockets[$]}}getName($){if(this.isSecureEndpoint($))return q9.Agent.prototype.getName.call(this,$);return super.getName($)}createSocket($,J,Q){let Y={...J,secureEndpoint:this.isSecureEndpoint(J)},Z=this.getName(Y),K=this.incrementSockets(Z);Promise.resolve().then(()=>this.connect($,Y)).then((X)=>{if(this.decrementSockets(Z,K),X instanceof S0.Agent)try{return X.addRequest($,Y)}catch(W){return Q(W)}this[k].currentSocket=X,super.createSocket($,J,Q)},(X)=>{this.decrementSockets(Z,K),Q(X)})}createConnection(){let $=this[k].currentSocket;if(this[k].currentSocket=void 0,!$)throw Error("No socket was returned in the `connect()` function");return $}get defaultPort(){return this[k].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort($){if(this[k])this[k].defaultPort=$}get protocol(){return this[k].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol($){if(this[k])this[k].protocol=$}}A.Agent=D0});var A0=F((x)=>{var L9=x&&x.__createBinding||(Object.create?function($,J,Q,Y){if(Y===void 0)Y=Q;var Z=Object.getOwnPropertyDescriptor(J,Q);if(!Z||("get"in Z?!J.__esModule:Z.writable||Z.configurable))Z={enumerable:!0,get:function(){return J[Q]}};Object.defineProperty($,Y,Z)}:function($,J,Q,Y){if(Y===void 0)Y=Q;$[Y]=J[Q]}),P9=x&&x.__setModuleDefault||(Object.create?function($,J){Object.defineProperty($,"default",{enumerable:!0,value:J})}:function($,J){$.default=J}),y0=x&&x.__importStar||function($){if($&&$.__esModule)return $;var J={};if($!=null){for(var Q in $)if(Q!=="default"&&Object.prototype.hasOwnProperty.call($,Q))L9(J,$,Q)}return P9(J,$),J},w9=x&&x.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(x,"__esModule",{value:!0});x.HttpProxyAgent=void 0;var N9=y0(q("net")),C9=y0(q("tls")),R9=w9(C0()),T9=q("events"),j9=f0(),_0=q("url"),Z$=(0,R9.default)("http-proxy-agent");class p$ extends j9.Agent{constructor($,J){super(J);this.proxy=typeof $==="string"?new _0.URL($):$,this.proxyHeaders=J?.headers??{},Z$("Creating new HttpProxyAgent instance: %o",this.proxy.href);let Q=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),Y=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={...J?S9(J,"headers"):null,host:Q,port:Y}}addRequest($,J){$._header=null,this.setRequestProps($,J),super.addRequest($,J)}setRequestProps($,J){let{proxy:Q}=this,Y=J.secureEndpoint?"https:":"http:",Z=$.getHeader("host")||"localhost",K=`${Y}//${Z}`,X=new _0.URL($.path,K);if(J.port!==80)X.port=String(J.port);$.path=String(X);let W=typeof this.proxyHeaders==="function"?this.proxyHeaders():{...this.proxyHeaders};if(Q.username||Q.password){let M=`${decodeURIComponent(Q.username)}:${decodeURIComponent(Q.password)}`;W["Proxy-Authorization"]=`Basic ${Buffer.from(M).toString("base64")}`}if(!W["Proxy-Connection"])W["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close";for(let M of Object.keys(W)){let O=W[M];if(O)$.setHeader(M,O)}}async connect($,J){if($._header=null,!$.path.includes("://"))this.setRequestProps($,J);let Q,Y;if(Z$("Regenerating stored HTTP header string for request"),$._implicitHeader(),$.outputData&&$.outputData.length>0)Z$("Patching connection write() output buffer with updated header"),Q=$.outputData[0].data,Y=Q.indexOf(`\r
8
+ \r
9
+ `)+4,$.outputData[0].data=$._header+Q.substring(Y),Z$("Output buffer: %o",$.outputData[0].data);let Z;if(this.proxy.protocol==="https:")Z$("Creating `tls.Socket`: %o",this.connectOpts),Z=C9.connect(this.connectOpts);else Z$("Creating `net.Socket`: %o",this.connectOpts),Z=N9.connect(this.connectOpts);return await(0,T9.once)(Z,"connect"),Z}}p$.protocols=["http","https"];x.HttpProxyAgent=p$;function S9($,...J){let Q={},Y;for(Y in $)if(!J.includes(Y))Q[Y]=$[Y];return Q}});var x0=F((K6,v0)=>{var K$=1000,X$=K$*60,V$=X$*60,t=V$*24,E9=t*7,I9=t*365.25;v0.exports=function($,J){J=J||{};var Q=typeof $;if(Q==="string"&&$.length>0)return D9($);else if(Q==="number"&&isFinite($))return J.long?_9($):f9($);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify($))};function D9($){if($=String($),$.length>100)return;var J=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec($);if(!J)return;var Q=parseFloat(J[1]),Y=(J[2]||"ms").toLowerCase();switch(Y){case"years":case"year":case"yrs":case"yr":case"y":return Q*I9;case"weeks":case"week":case"w":return Q*E9;case"days":case"day":case"d":return Q*t;case"hours":case"hour":case"hrs":case"hr":case"h":return Q*V$;case"minutes":case"minute":case"mins":case"min":case"m":return Q*X$;case"seconds":case"second":case"secs":case"sec":case"s":return Q*K$;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return Q;default:return}}function f9($){var J=Math.abs($);if(J>=t)return Math.round($/t)+"d";if(J>=V$)return Math.round($/V$)+"h";if(J>=X$)return Math.round($/X$)+"m";if(J>=K$)return Math.round($/K$)+"s";return $+"ms"}function _9($){var J=Math.abs($);if(J>=t)return R$($,J,t,"day");if(J>=V$)return R$($,J,V$,"hour");if(J>=X$)return R$($,J,X$,"minute");if(J>=K$)return R$($,J,K$,"second");return $+" ms"}function R$($,J,Q,Y){var Z=J>=Q*1.5;return Math.round($/Q)+" "+Y+(Z?"s":"")}});var n$=F((X6,h0)=>{function y9($){Q.debug=Q,Q.default=Q,Q.coerce=M,Q.disable=X,Q.enable=Z,Q.enabled=W,Q.humanize=x0(),Q.destroy=O,Object.keys($).forEach((V)=>{Q[V]=$[V]}),Q.names=[],Q.skips=[],Q.formatters={};function J(V){let z=0;for(let H=0;H<V.length;H++)z=(z<<5)-z+V.charCodeAt(H),z|=0;return Q.colors[Math.abs(z)%Q.colors.length]}Q.selectColor=J;function Q(V){let z,H=null,G,C;function U(...w){if(!U.enabled)return;let j=U,I=Number(new Date),p=I-(z||I);if(j.diff=p,j.prev=z,j.curr=I,z=I,w[0]=Q.coerce(w[0]),typeof w[0]!=="string")w.unshift("%O");let y=0;w[0]=w[0].replace(/%([a-zA-Z%])/g,(b,d)=>{if(b==="%%")return"%";y++;let U$=Q.formatters[d];if(typeof U$==="function"){let l$=w[y];b=U$.call(j,l$),w.splice(y,1),y--}return b}),Q.formatArgs.call(j,w),(j.log||Q.log).apply(j,w)}if(U.namespace=V,U.useColors=Q.useColors(),U.color=Q.selectColor(V),U.extend=Y,U.destroy=Q.destroy,Object.defineProperty(U,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(H!==null)return H;if(G!==Q.namespaces)G=Q.namespaces,C=Q.enabled(V);return C},set:(w)=>{H=w}}),typeof Q.init==="function")Q.init(U);return U}function Y(V,z){let H=Q(this.namespace+(typeof z>"u"?":":z)+V);return H.log=this.log,H}function Z(V){Q.save(V),Q.namespaces=V,Q.names=[],Q.skips=[];let z=(typeof V==="string"?V:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let H of z)if(H[0]==="-")Q.skips.push(H.slice(1));else Q.names.push(H)}function K(V,z){let H=0,G=0,C=-1,U=0;while(H<V.length)if(G<z.length&&(z[G]===V[H]||z[G]==="*"))if(z[G]==="*")C=G,U=H,G++;else H++,G++;else if(C!==-1)G=C+1,U++,H=U;else return!1;while(G<z.length&&z[G]==="*")G++;return G===z.length}function X(){let V=[...Q.names,...Q.skips.map((z)=>"-"+z)].join(",");return Q.enable(""),V}function W(V){for(let z of Q.skips)if(K(V,z))return!1;for(let z of Q.names)if(K(V,z))return!0;return!1}function M(V){if(V instanceof Error)return V.stack||V.message;return V}function O(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return Q.enable(Q.load()),Q}h0.exports=y9});var k0=F((b0,T$)=>{b0.formatArgs=v9;b0.save=x9;b0.load=h9;b0.useColors=A9;b0.storage=b9();b0.destroy=(()=>{let $=!1;return()=>{if(!$)$=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();b0.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function A9(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let $;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&($=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt($[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function v9($){if($[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+$[0]+(this.useColors?"%c ":" ")+"+"+T$.exports.humanize(this.diff),!this.useColors)return;let J="color: "+this.color;$.splice(1,0,J,"color: inherit");let Q=0,Y=0;$[0].replace(/%[a-zA-Z%]/g,(Z)=>{if(Z==="%%")return;if(Q++,Z==="%c")Y=Q}),$.splice(Y,0,J)}b0.log=console.debug||console.log||(()=>{});function x9($){try{if($)b0.storage.setItem("debug",$);else b0.storage.removeItem("debug")}catch(J){}}function h9(){let $;try{$=b0.storage.getItem("debug")||b0.storage.getItem("DEBUG")}catch(J){}if(!$&&typeof process<"u"&&"env"in process)$=process.env.DEBUG;return $}function b9(){try{return localStorage}catch($){}}T$.exports=n$()(b0);var{formatters:k9}=T$.exports;k9.j=function($){try{return JSON.stringify($)}catch(J){return"[UnexpectedJSONParseError]: "+J.message}}});var l0=F((u0,S$)=>{var n9=q("tty"),j$=q("util");u0.init=e9;u0.log=t9;u0.formatArgs=a9;u0.save=r9;u0.load=s9;u0.useColors=d9;u0.destroy=j$.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");u0.colors=[6,2,3,4,5,1];try{let $=(()=>{throw new Error("Cannot require module "+"supports-color");})();if($&&($.stderr||$).level>=2)u0.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch($){}u0.inspectOpts=Object.keys(process.env).filter(($)=>{return/^debug_/i.test($)}).reduce(($,J)=>{let Q=J.substring(6).toLowerCase().replace(/_([a-z])/g,(Z,K)=>{return K.toUpperCase()}),Y=process.env[J];if(/^(yes|on|true|enabled)$/i.test(Y))Y=!0;else if(/^(no|off|false|disabled)$/i.test(Y))Y=!1;else if(Y==="null")Y=null;else Y=Number(Y);return $[Q]=Y,$},{});function d9(){return"colors"in u0.inspectOpts?Boolean(u0.inspectOpts.colors):n9.isatty(process.stderr.fd)}function a9($){let{namespace:J,useColors:Q}=this;if(Q){let Y=this.color,Z="\x1B[3"+(Y<8?Y:"8;5;"+Y),K=` ${Z};1m${J} \x1B[0m`;$[0]=K+$[0].split(`
10
+ `).join(`
11
+ `+K),$.push(Z+"m+"+S$.exports.humanize(this.diff)+"\x1B[0m")}else $[0]=o9()+J+" "+$[0]}function o9(){if(u0.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function t9(...$){return process.stderr.write(j$.formatWithOptions(u0.inspectOpts,...$)+`
12
+ `)}function r9($){if($)process.env.DEBUG=$;else delete process.env.DEBUG}function s9(){return process.env.DEBUG}function e9($){$.inspectOpts={};let J=Object.keys(u0.inspectOpts);for(let Q=0;Q<J.length;Q++)$.inspectOpts[J[Q]]=u0.inspectOpts[J[Q]]}S$.exports=n$()(u0);var{formatters:g0}=S$.exports;g0.o=function($){return this.inspectOpts.colors=this.useColors,j$.inspect($,this.inspectOpts).split(`
13
+ `).map((J)=>J.trim()).join(" ")};g0.O=function($){return this.inspectOpts.colors=this.useColors,j$.inspect($,this.inspectOpts)}});var a$=F((W6,d$)=>{if(typeof process>"u"||process.type==="renderer"||!1||process.__nwjs)d$.exports=k0();else d$.exports=l0()});var p0=F((f)=>{var VJ=f&&f.__createBinding||(Object.create?function($,J,Q,Y){if(Y===void 0)Y=Q;var Z=Object.getOwnPropertyDescriptor(J,Q);if(!Z||("get"in Z?!J.__esModule:Z.writable||Z.configurable))Z={enumerable:!0,get:function(){return J[Q]}};Object.defineProperty($,Y,Z)}:function($,J,Q,Y){if(Y===void 0)Y=Q;$[Y]=J[Q]}),zJ=f&&f.__setModuleDefault||(Object.create?function($,J){Object.defineProperty($,"default",{enumerable:!0,value:J})}:function($,J){$.default=J}),m0=f&&f.__importStar||function($){if($&&$.__esModule)return $;var J={};if($!=null){for(var Q in $)if(Q!=="default"&&Object.prototype.hasOwnProperty.call($,Q))VJ(J,$,Q)}return zJ(J,$),J};Object.defineProperty(f,"__esModule",{value:!0});f.req=f.json=f.toBuffer=void 0;var WJ=m0(q("http")),HJ=m0(q("https"));async function i0($){let J=0,Q=[];for await(let Y of $)J+=Y.length,Q.push(Y);return Buffer.concat(Q,J)}f.toBuffer=i0;async function GJ($){let Q=(await i0($)).toString("utf8");try{return JSON.parse(Q)}catch(Y){let Z=Y;throw Z.message+=` (input: ${Q})`,Z}}f.json=GJ;function FJ($,J={}){let Y=((typeof $==="string"?$:$.href).startsWith("https:")?HJ:WJ).request($,J),Z=new Promise((K,X)=>{Y.once("response",K).once("error",X).end()});return Y.then=Z.then.bind(Z),Y}f.req=FJ});var t0=F((v)=>{var d0=v&&v.__createBinding||(Object.create?function($,J,Q,Y){if(Y===void 0)Y=Q;var Z=Object.getOwnPropertyDescriptor(J,Q);if(!Z||("get"in Z?!J.__esModule:Z.writable||Z.configurable))Z={enumerable:!0,get:function(){return J[Q]}};Object.defineProperty($,Y,Z)}:function($,J,Q,Y){if(Y===void 0)Y=Q;$[Y]=J[Q]}),UJ=v&&v.__setModuleDefault||(Object.create?function($,J){Object.defineProperty($,"default",{enumerable:!0,value:J})}:function($,J){$.default=J}),a0=v&&v.__importStar||function($){if($&&$.__esModule)return $;var J={};if($!=null){for(var Q in $)if(Q!=="default"&&Object.prototype.hasOwnProperty.call($,Q))d0(J,$,Q)}return UJ(J,$),J},BJ=v&&v.__exportStar||function($,J){for(var Q in $)if(Q!=="default"&&!Object.prototype.hasOwnProperty.call(J,Q))d0(J,$,Q)};Object.defineProperty(v,"__esModule",{value:!0});v.Agent=void 0;var MJ=a0(q("net")),n0=a0(q("http")),OJ=q("https");BJ(p0(),v);var g=Symbol("AgentBaseInternalState");class o0 extends n0.Agent{constructor($){super($);this[g]={}}isSecureEndpoint($){if($){if(typeof $.secureEndpoint==="boolean")return $.secureEndpoint;if(typeof $.protocol==="string")return $.protocol==="https:"}let{stack:J}=Error();if(typeof J!=="string")return!1;return J.split(`
14
+ `).some((Q)=>Q.indexOf("(https.js:")!==-1||Q.indexOf("node:https:")!==-1)}incrementSockets($){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;if(!this.sockets[$])this.sockets[$]=[];let J=new MJ.Socket({writable:!1});return this.sockets[$].push(J),this.totalSocketCount++,J}decrementSockets($,J){if(!this.sockets[$]||J===null)return;let Q=this.sockets[$],Y=Q.indexOf(J);if(Y!==-1){if(Q.splice(Y,1),this.totalSocketCount--,Q.length===0)delete this.sockets[$]}}getName($){if(this.isSecureEndpoint($))return OJ.Agent.prototype.getName.call(this,$);return super.getName($)}createSocket($,J,Q){let Y={...J,secureEndpoint:this.isSecureEndpoint(J)},Z=this.getName(Y),K=this.incrementSockets(Z);Promise.resolve().then(()=>this.connect($,Y)).then((X)=>{if(this.decrementSockets(Z,K),X instanceof n0.Agent)try{return X.addRequest($,Y)}catch(W){return Q(W)}this[g].currentSocket=X,super.createSocket($,J,Q)},(X)=>{this.decrementSockets(Z,K),Q(X)})}createConnection(){let $=this[g].currentSocket;if(this[g].currentSocket=void 0,!$)throw Error("No socket was returned in the `connect()` function");return $}get defaultPort(){return this[g].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort($){if(this[g])this[g].defaultPort=$}get protocol(){return this[g].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol($){if(this[g])this[g].protocol=$}}v.Agent=o0});var r0=F((z$)=>{var qJ=z$&&z$.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(z$,"__esModule",{value:!0});z$.parseProxyResponse=void 0;var LJ=qJ(a$()),E$=(0,LJ.default)("https-proxy-agent:parse-proxy-response");function PJ($){return new Promise((J,Q)=>{let Y=0,Z=[];function K(){let V=$.read();if(V)O(V);else $.once("readable",K)}function X(){$.removeListener("end",W),$.removeListener("error",M),$.removeListener("readable",K)}function W(){X(),E$("onend"),Q(Error("Proxy connection ended before receiving CONNECT response"))}function M(V){X(),E$("onerror %o",V),Q(V)}function O(V){Z.push(V),Y+=V.length;let z=Buffer.concat(Z,Y),H=z.indexOf(`\r
15
+ \r
16
+ `);if(H===-1){E$("have not received end of HTTP headers yet..."),K();return}let G=z.slice(0,H).toString("ascii").split(`\r
17
+ `),C=G.shift();if(!C)return $.destroy(),Q(Error("No header received from proxy CONNECT response"));let U=C.split(" "),w=+U[1],j=U.slice(2).join(" "),I={};for(let p of G){if(!p)continue;let y=p.indexOf(":");if(y===-1)return $.destroy(),Q(Error(`Invalid header from proxy CONNECT response: "${p}"`));let F$=p.slice(0,y).toLowerCase(),b=p.slice(y+1).trimStart(),d=I[F$];if(typeof d==="string")I[F$]=[d,b];else if(Array.isArray(d))d.push(b);else I[F$]=b}E$("got proxy server response: %o %o",C,I),X(),J({connect:{statusCode:w,statusText:j,headers:I},buffered:z})}$.on("error",M),$.on("end",W),K()})}z$.parseProxyResponse=PJ});var Y1=F((h)=>{var wJ=h&&h.__createBinding||(Object.create?function($,J,Q,Y){if(Y===void 0)Y=Q;var Z=Object.getOwnPropertyDescriptor(J,Q);if(!Z||("get"in Z?!J.__esModule:Z.writable||Z.configurable))Z={enumerable:!0,get:function(){return J[Q]}};Object.defineProperty($,Y,Z)}:function($,J,Q,Y){if(Y===void 0)Y=Q;$[Y]=J[Q]}),NJ=h&&h.__setModuleDefault||(Object.create?function($,J){Object.defineProperty($,"default",{enumerable:!0,value:J})}:function($,J){$.default=J}),J1=h&&h.__importStar||function($){if($&&$.__esModule)return $;var J={};if($!=null){for(var Q in $)if(Q!=="default"&&Object.prototype.hasOwnProperty.call($,Q))wJ(J,$,Q)}return NJ(J,$),J},Q1=h&&h.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(h,"__esModule",{value:!0});h.HttpsProxyAgent=void 0;var I$=J1(q("net")),s0=J1(q("tls")),CJ=Q1(q("assert")),RJ=Q1(a$()),TJ=t0(),jJ=q("url"),SJ=r0(),O$=(0,RJ.default)("https-proxy-agent"),e0=($)=>{if($.servername===void 0&&$.host&&!I$.isIP($.host))return{...$,servername:$.host};return $};class o$ extends TJ.Agent{constructor($,J){super(J);this.options={path:void 0},this.proxy=typeof $==="string"?new jJ.URL($):$,this.proxyHeaders=J?.headers??{},O$("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let Q=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),Y=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...J?$1(J,"headers"):null,host:Q,port:Y}}async connect($,J){let{proxy:Q}=this;if(!J.host)throw TypeError('No "host" provided');let Y;if(Q.protocol==="https:")O$("Creating `tls.Socket`: %o",this.connectOpts),Y=s0.connect(e0(this.connectOpts));else O$("Creating `net.Socket`: %o",this.connectOpts),Y=I$.connect(this.connectOpts);let Z=typeof this.proxyHeaders==="function"?this.proxyHeaders():{...this.proxyHeaders},K=I$.isIPv6(J.host)?`[${J.host}]`:J.host,X=`CONNECT ${K}:${J.port} HTTP/1.1\r
18
+ `;if(Q.username||Q.password){let z=`${decodeURIComponent(Q.username)}:${decodeURIComponent(Q.password)}`;Z["Proxy-Authorization"]=`Basic ${Buffer.from(z).toString("base64")}`}if(Z.Host=`${K}:${J.port}`,!Z["Proxy-Connection"])Z["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close";for(let z of Object.keys(Z))X+=`${z}: ${Z[z]}\r
19
+ `;let W=(0,SJ.parseProxyResponse)(Y);Y.write(`${X}\r
20
+ `);let{connect:M,buffered:O}=await W;if($.emit("proxyConnect",M),this.emit("proxyConnect",M,$),M.statusCode===200){if($.once("socket",EJ),J.secureEndpoint)return O$("Upgrading socket connection to TLS"),s0.connect({...$1(e0(J),"host","path","port"),socket:Y});return Y}Y.destroy();let V=new I$.Socket({writable:!1});return V.readable=!0,$.once("socket",(z)=>{O$("Replaying proxy buffer for failed request"),(0,CJ.default)(z.listenerCount("data")>0),z.push(O),z.push(null)}),V}}o$.protocols=["http","https"];h.HttpsProxyAgent=o$;function EJ($){$.resume()}function $1($,...J){let Q={},Y;for(Y in $)if(!J.includes(Y))Q[Y]=$[Y];return Q}});var q$=F((K1)=>{Object.defineProperty(K1,"__esModule",{value:!0});K1.AddressError=void 0;class Z1 extends Error{constructor($,J){super($);this.name="AddressError",this.parseMessage=J}}K1.AddressError=Z1});var f$=F((W1)=>{Object.defineProperty(W1,"__esModule",{value:!0});W1.isInSubnet=IJ;W1.isHostInSubnet=V1;W1.isCorrect=DJ;W1.prefixLengthFromMask=fJ;W1.assertByteArray=_J;W1.numberToPaddedHex=z1;W1.stringToPaddedHex=yJ;W1.testBit=AJ;var D$=q$();function IJ($){if(this.subnetMask<$.subnetMask)return!1;return V1.call(this,$)}function V1($){return this.mask($.subnetMask)===$.mask()}function DJ($){return function(){if(this.addressMinusSuffix!==this.correctForm())return!1;if(this.subnetMask===$&&!this.parsedSubnet)return!0;return this.parsedSubnet===String(this.subnetMask)}}function fJ($,J){let Q=$.toString(2).padStart(J,"0");if(Q.length>J)throw new D$.AddressError("Invalid subnet mask.");let Y=Q.indexOf("0");if(Y===-1)return J;if(Q.slice(Y).includes("1"))throw new D$.AddressError("Invalid subnet mask.");return Y}function _J($,J,Q,Y){if($.length!==J)throw new D$.AddressError(`${Q} addresses require exactly ${J} bytes`);for(let Z=0;Z<$.length;Z++)if(!Number.isInteger($[Z])||$[Z]<Y||$[Z]>255)throw new D$.AddressError(`All bytes must be integers between ${Y} and 255`)}function z1($){return $.toString(16).padStart(2,"0")}function yJ($){return z1(parseInt($,10))}function AJ($,J){let{length:Q}=$;if(J>Q)return!1;let Y=Q-J;return $.substring(Y,Y+1)==="1"}});var t$=F((H1)=>{Object.defineProperty(H1,"__esModule",{value:!0});H1.RE_SUBNET_STRING=H1.RE_ADDRESS=H1.GROUPS=H1.BITS=void 0;H1.BITS=32;H1.GROUPS=4;H1.RE_ADDRESS=/^(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])$/g;H1.RE_SUBNET_STRING=/\/\d{1,2}$/});var r$=F((c)=>{var pJ=c&&c.__createBinding||(Object.create?function($,J,Q,Y){if(Y===void 0)Y=Q;var Z=Object.getOwnPropertyDescriptor(J,Q);if(!Z||("get"in Z?!J.__esModule:Z.writable||Z.configurable))Z={enumerable:!0,get:function(){return J[Q]}};Object.defineProperty($,Y,Z)}:function($,J,Q,Y){if(Y===void 0)Y=Q;$[Y]=J[Q]}),nJ=c&&c.__setModuleDefault||(Object.create?function($,J){Object.defineProperty($,"default",{enumerable:!0,value:J})}:function($,J){$.default=J}),F1=c&&c.__importStar||function($){if($&&$.__esModule)return $;var J={};if($!=null){for(var Q in $)if(Q!=="default"&&Object.prototype.hasOwnProperty.call($,Q))pJ(J,$,Q)}return nJ(J,$),J};Object.defineProperty(c,"__esModule",{value:!0});c.Address4=void 0;var u=F1(f$()),T=F1(t$()),n=q$(),dJ=u.isCorrect(T.BITS);class N{constructor($){this.addressMinusSuffix="",this.groups=T.GROUPS,this.parsedAddress=[],this.parsedSubnet="",this.subnet="/32",this.subnetMask=32,this.v4=!0,this.isCorrect=dJ,this.isInSubnet=u.isInSubnet,this.isHostInSubnet=u.isHostInSubnet,this.address=$;let J=T.RE_SUBNET_STRING.exec($);if(J){if(this.parsedSubnet=J[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,this.subnetMask<0||this.subnetMask>T.BITS)throw new n.AddressError("Invalid subnet mask.");$=$.replace(T.RE_SUBNET_STRING,"")}this.addressMinusSuffix=$,this.parsedAddress=this.parse($)}static isValid($){try{return new N($),!0}catch{return!1}}parse($){let J=$.split(".");if(J.some((Q)=>/^0\d/.test(Q)))throw new n.AddressError("IPv4 addresses can't have leading zeroes.");if(!$.match(T.RE_ADDRESS))throw new n.AddressError("Invalid IPv4 address.");return J}correctForm(){return this.parsedAddress.map(($)=>parseInt($,10)).join(".")}static fromAddressAndMask($,J){let Q=u.prefixLengthFromMask(new N(J).bigInt(),T.BITS);return new N(`${$}/${Q}`)}static fromAddressAndWildcardMask($,J){let Q=new N(J).bigInt(),Y=(BigInt(1)<<BigInt(T.BITS))-BigInt(1),Z=Q^Y,K=u.prefixLengthFromMask(Z,T.BITS);return new N(`${$}/${K}`)}static fromWildcard($){let J=$.split(".");if(J.length!==T.GROUPS)throw new n.AddressError("Wildcard pattern must have 4 octets");let Q=-1;for(let X=0;X<J.length;X++)if(J[X]==="*"){if(Q===-1)Q=X}else if(Q!==-1)throw new n.AddressError("Wildcard `*` must only appear in trailing octets (e.g. `192.168.0.*`)");let Y=Q===-1?0:J.length-Q,Z=J.map((X)=>X==="*"?"0":X),K=T.BITS-Y*8;return new N(`${Z.join(".")}/${K}`)}static fromHex($){let J=$.replace(/:/g,"");if(!/^[0-9a-fA-F]{8}$/.test(J))throw new n.AddressError("IPv4 hex must be exactly 8 hex digits");let Q=[];for(let Y=0;Y<8;Y+=2)Q.push(parseInt(J.slice(Y,Y+2),16));return new N(Q.join("."))}static fromInteger($){if(!Number.isInteger($)||$<0||$>4294967295)throw new n.AddressError("IPv4 integer must be in the range 0 to 2**32 - 1");return N.fromHex($.toString(16).padStart(8,"0"))}static fromArpa($){let Q=$.replace(/(\.in-addr\.arpa)?\.$/,"").split(".").reverse().join(".");return new N(Q)}toHex(){return this.parsedAddress.map(($)=>u.stringToPaddedHex($)).join(":")}toArray(){return this.parsedAddress.map(($)=>parseInt($,10))}toGroup6(){let $=[],J;for(J=0;J<T.GROUPS;J+=2)$.push(`${u.stringToPaddedHex(this.parsedAddress[J])}${u.stringToPaddedHex(this.parsedAddress[J+1])}`);return $.join(":")}bigInt(){return BigInt(`0x${this.parsedAddress.map(($)=>u.stringToPaddedHex($)).join("")}`)}_startAddress(){return BigInt(`0b${this.mask()+"0".repeat(T.BITS-this.subnetMask)}`)}startAddress(){return N.fromBigInt(this._startAddress())}startAddressExclusive(){let $=BigInt("1");return N.fromBigInt(this._startAddress()+$)}_endAddress(){return BigInt(`0b${this.mask()+"1".repeat(T.BITS-this.subnetMask)}`)}endAddress(){return N.fromBigInt(this._endAddress())}endAddressExclusive(){let $=BigInt("1");return N.fromBigInt(this._endAddress()-$)}subnetMaskAddress(){return N.fromBigInt(BigInt(`0b${"1".repeat(this.subnetMask)}${"0".repeat(T.BITS-this.subnetMask)}`))}wildcardMask(){return N.fromBigInt(BigInt(`0b${"0".repeat(this.subnetMask)}${"1".repeat(T.BITS-this.subnetMask)}`))}networkForm(){return`${this.startAddress().correctForm()}/${this.subnetMask}`}static fromBigInt($){if($<BigInt(0)||$>BigInt(4294967295))throw new n.AddressError("IPv4 BigInt must be in the range 0 to 2**32 - 1");return N.fromHex($.toString(16).padStart(8,"0"))}static fromByteArray($){return u.assertByteArray($,4,"IPv4",0),this.fromUnsignedByteArray($)}static fromUnsignedByteArray($){if($.length!==4)throw new n.AddressError("IPv4 addresses require exactly 4 bytes");let J=$.join(".");return new N(J)}mask($){if($===void 0)$=this.subnetMask;return this.getBitsBase2(0,$)}getBitsBase2($,J){return this.binaryZeroPad().slice($,J)}reverseForm($){if(!$)$={};let J=this.correctForm().split(".").reverse().join(".");if($.omitSuffix)return J;return`${J}.in-addr.arpa.`}isMulticast(){return this.isHostInSubnet(aJ)}isPrivate(){return oJ.some(($)=>this.isHostInSubnet($))}isLoopback(){return this.isHostInSubnet(tJ)}isLinkLocal(){return this.isHostInSubnet(rJ)}isUnspecified(){return this.isHostInSubnet(sJ)}isBroadcast(){return this.isHostInSubnet(eJ)}isCGNAT(){return this.isHostInSubnet($Q)}binaryZeroPad(){if(this._binaryZeroPad===void 0)this._binaryZeroPad=this.bigInt().toString(2).padStart(T.BITS,"0");return this._binaryZeroPad}groupForV6(){let $=this.parsedAddress;return this.correctForm().replace(T.RE_ADDRESS,`<span class="hover-group group-v4 group-6">${$.slice(0,2).join(".")}</span>.<span class="hover-group group-v4 group-7">${$.slice(2,4).join(".")}</span>`)}}c.Address4=N;var aJ=new N("224.0.0.0/4"),oJ=[new N("10.0.0.0/8"),new N("172.16.0.0/12"),new N("192.168.0.0/16")],tJ=new N("127.0.0.0/8"),rJ=new N("169.254.0.0/16"),sJ=new N("0.0.0.0/32"),eJ=new N("255.255.255.255/32"),$Q=new N("100.64.0.0/10")});var s$=F((U1)=>{Object.defineProperty(U1,"__esModule",{value:!0});U1.RE_URL_WITH_PORT=U1.RE_URL=U1.RE_ZONE_STRING=U1.RE_SUBNET_STRING=U1.RE_BAD_ADDRESS=U1.RE_BAD_CHARACTERS=U1.TYPES=U1.SCOPES=U1.GROUPS=U1.BITS=void 0;U1.BITS=128;U1.GROUPS=8;U1.SCOPES={0:"Reserved",1:"Interface local",2:"Link local",4:"Admin local",5:"Site local",8:"Organization local",14:"Global",15:"Reserved"};U1.TYPES={"ff01::1/128":"Multicast (All nodes on this interface)","ff01::2/128":"Multicast (All routers on this interface)","ff02::1/128":"Multicast (All nodes on this link)","ff02::2/128":"Multicast (All routers on this link)","ff05::2/128":"Multicast (All routers in this site)","ff02::5/128":"Multicast (OSPFv3 AllSPF routers)","ff02::6/128":"Multicast (OSPFv3 AllDR routers)","ff02::9/128":"Multicast (RIP routers)","ff02::a/128":"Multicast (EIGRP routers)","ff02::d/128":"Multicast (PIM routers)","ff02::16/128":"Multicast (MLDv2 reports)","ff01::fb/128":"Multicast (mDNSv6)","ff02::fb/128":"Multicast (mDNSv6)","ff05::fb/128":"Multicast (mDNSv6)","ff02::1:2/128":"Multicast (All DHCP servers and relay agents on this link)","ff05::1:2/128":"Multicast (All DHCP servers and relay agents in this site)","ff02::1:3/128":"Multicast (All DHCP servers on this link)","ff05::1:3/128":"Multicast (All DHCP servers in this site)","::/128":"Unspecified","::1/128":"Loopback","::ffff:0:0/96":"IPv4-mapped","ff00::/8":"Multicast","fe80::/10":"Link-local unicast","fc00::/7":"Unique local","2002::/16":"6to4","2001:db8::/32":"Documentation","64:ff9b::/96":"NAT64 (well-known)","64:ff9b:1::/48":"NAT64 (local-use)"};U1.RE_BAD_CHARACTERS=/([^0-9a-f:/%])/gi;U1.RE_BAD_ADDRESS=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi;U1.RE_SUBNET_STRING=/\/\d{1,3}(?=%|$)/;U1.RE_ZONE_STRING=/%.*$/;U1.RE_URL=/^(?:\[([0-9a-f:.]+)\]|([0-9a-f:.]+))(?:[/?#].*)?$/i;U1.RE_URL_WITH_PORT=/^\[([0-9a-f:.]+)\]:([0-9]{1,5})(?:[/?#].*)?$/i});var e$=F((q1)=>{Object.defineProperty(q1,"__esModule",{value:!0});q1.escapeHtml=_$;q1.spanAllZeroes=M1;q1.spanAll=HQ;q1.spanLeadingZeroes=GQ;q1.simpleGroup=FQ;function _$($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function M1($){return _$($).replace(/(0+)/g,'<span class="zero">$1</span>')}function HQ($,J=0){return $.split("").map((Y,Z)=>`<span class="digit value-${_$(Y)} position-${Z+J}">${M1(Y)}</span>`).join("")}function O1($){return _$($).replace(/^(0+)/,'<span class="zero">$1</span>')}function GQ($){return $.split(":").map((Q)=>O1(Q)).join(":")}function FQ($,J=0){return $.split(":").map((Y,Z)=>{if(/group-v4/.test(Y))return Y;return`<span class="hover-group group-${Z+J}">${O1(Y)}</span>`})}});var L1=F((_)=>{var LQ=_&&_.__createBinding||(Object.create?function($,J,Q,Y){if(Y===void 0)Y=Q;var Z=Object.getOwnPropertyDescriptor(J,Q);if(!Z||("get"in Z?!J.__esModule:Z.writable||Z.configurable))Z={enumerable:!0,get:function(){return J[Q]}};Object.defineProperty($,Y,Z)}:function($,J,Q,Y){if(Y===void 0)Y=Q;$[Y]=J[Q]}),PQ=_&&_.__setModuleDefault||(Object.create?function($,J){Object.defineProperty($,"default",{enumerable:!0,value:J})}:function($,J){$.default=J}),wQ=_&&_.__importStar||function($){if($&&$.__esModule)return $;var J={};if($!=null){for(var Q in $)if(Q!=="default"&&Object.prototype.hasOwnProperty.call($,Q))LQ(J,$,Q)}return PQ(J,$),J};Object.defineProperty(_,"__esModule",{value:!0});_.ADDRESS_BOUNDARY=void 0;_.groupPossibilities=A$;_.padGroup=y$;_.simpleRegularExpression=CQ;_.possibleElisions=RQ;var NQ=wQ(s$());function A$($){return`(${$.join("|")})`}function y$($){if($.length<4)return`0{0,${4-$.length}}${$}`;return $}_.ADDRESS_BOUNDARY="[^A-Fa-f0-9:]";function CQ($){let J=[];$.forEach((Y,Z)=>{if(parseInt(Y,16)===0)J.push(Z)});let Q=J.map((Y)=>$.map((Z,K)=>{if(K===Y){let X=K===0||K===NQ.GROUPS-1?":":"";return A$([y$(Z),X])}return y$(Z)}).join(":"));return Q.push($.map(y$).join(":")),A$(Q)}function RQ($,J,Q){let Y=J?"":":",Z=Q?"":":",K=[];if(!J&&!Q)K.push("::");if(J&&Q)K.push("");if(Q&&!J||!Q&&J)K.push(":");K.push(`${Y}(:0{1,4}){1,${$-1}}`),K.push(`(0{1,4}:){1,${$-1}}${Z}`),K.push(`(0{1,4}:){${$-1}}0{1,4}`);for(let X=1;X<$-1;X++)for(let W=1;W<$-X;W++)K.push(`(0{1,4}:){${W}}:(0{1,4}:){${$-W-X-1}}0{1,4}`);return A$(K)}});var C1=F((m)=>{var TQ=m&&m.__createBinding||(Object.create?function($,J,Q,Y){if(Y===void 0)Y=Q;var Z=Object.getOwnPropertyDescriptor(J,Q);if(!Z||("get"in Z?!J.__esModule:Z.writable||Z.configurable))Z={enumerable:!0,get:function(){return J[Q]}};Object.defineProperty($,Y,Z)}:function($,J,Q,Y){if(Y===void 0)Y=Q;$[Y]=J[Q]}),jQ=m&&m.__setModuleDefault||(Object.create?function($,J){Object.defineProperty($,"default",{enumerable:!0,value:J})}:function($,J){$.default=J}),h$=m&&m.__importStar||function($){if($&&$.__esModule)return $;var J={};if($!=null){for(var Q in $)if(Q!=="default"&&Object.prototype.hasOwnProperty.call($,Q))TQ(J,$,Q)}return jQ(J,$),J};Object.defineProperty(m,"__esModule",{value:!0});m.Address6=void 0;var $$=h$(f$()),$0=h$(t$()),B=h$(s$()),s=h$(e$()),l=r$(),e=L1(),S=q$(),v$=f$(),SQ=$$.isCorrect(B.BITS);function x$($){if(!$)throw Error("Assertion failed.")}function EQ($){let J=/(\d+)(\d{3})/;while(J.test($))$=$.replace(J,"$1,$2");return $}function IQ($){return $=$.replace(/^(0{1,})([1-9]+)$/,'<span class="parse-error">$1</span>$2'),$=$.replace(/^(0{1,})(0)$/,'<span class="parse-error">$1</span>$2'),$}function DQ($,J){let Q=[],Y=[],Z;for(Z=0;Z<$.length;Z++)if(Z<J[0])Q.push($[Z]);else if(Z>J[1])Y.push($[Z]);return Q.concat(["compact"]).concat(Y)}function P1($){return parseInt($,16).toString(16).padStart(4,"0")}function w1($){return $&255}class L{constructor($,J){if(this.addressMinusSuffix="",this.parsedSubnet="",this.subnet="/128",this.subnetMask=128,this.v4=!1,this.zone="",this.isInSubnet=$$.isInSubnet,this.isHostInSubnet=$$.isHostInSubnet,this.isCorrect=SQ,J===void 0)this.groups=B.GROUPS;else this.groups=J;this.address=$;let Q=B.RE_SUBNET_STRING.exec($);if(Q){if(this.parsedSubnet=Q[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,Number.isNaN(this.subnetMask)||this.subnetMask<0||this.subnetMask>B.BITS)throw new S.AddressError("Invalid subnet mask.");$=$.replace(B.RE_SUBNET_STRING,"")}if(/\//.test($))throw new S.AddressError("Invalid subnet mask.");let Y=B.RE_ZONE_STRING.exec($);if(Y)this.zone=Y[0],$=$.replace(B.RE_ZONE_STRING,"");this.addressMinusSuffix=$,this.parsedAddress=this.parse(this.addressMinusSuffix)}static isValid($){try{return new L($),!0}catch{return!1}}static fromBigInt($){if($<BigInt(0)||$>(BigInt(1)<<BigInt(B.BITS))-BigInt(1))throw new S.AddressError("IPv6 BigInt must be in the range 0 to 2**128 - 1");let J=$.toString(16).padStart(32,"0"),Q=[];for(let Y=0;Y<B.GROUPS;Y++)Q.push(J.slice(Y*4,(Y+1)*4));return new L(Q.join(":"))}static fromURL($){var J;let Q,Y=null,Z,K,X=$.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"");if(X.indexOf("[")!==-1&&X.indexOf("]:")!==-1){if(K="failed to parse address with port",Z=B.RE_URL_WITH_PORT.exec(X),Z===null)return{error:K,address:null,port:null};Q=Z[1],Y=Z[2]}else{if(K="failed to parse address from URL",Z=B.RE_URL.exec(X),Z===null)return{error:K,address:null,port:null};Q=(J=Z[1])!==null&&J!==void 0?J:Z[2]}if(Y){if(Y=parseInt(Y,10),Y<0||Y>65535)Y=null}else Y=null;let W;try{W=new L(Q)}catch{return{error:K,address:null,port:null}}return{address:W,port:Y}}static fromAddressAndMask($,J){let Q=$$.prefixLengthFromMask(new L(J).bigInt(),B.BITS);return new L(`${$}/${Q}`)}static fromAddressAndWildcardMask($,J){let Q=new L(J).bigInt(),Y=(BigInt(1)<<BigInt(B.BITS))-BigInt(1),Z=Q^Y,K=$$.prefixLengthFromMask(Z,B.BITS);return new L(`${$}/${K}`)}static fromWildcard($){if($.includes("%")||$.includes("/"))throw new S.AddressError("Wildcard pattern must not include a zone or CIDR suffix");let J=$.split("::");if(J.length>2)throw new S.AddressError("Wildcard pattern cannot contain more than one '::'");let Q;if(J.length===2){let W=J[0]===""?[]:J[0].split(":"),M=J[1]===""?[]:J[1].split(":"),O=B.GROUPS-W.length-M.length;if(O<1)throw new S.AddressError("Wildcard pattern with '::' has too many groups");Q=[...W,...Array(O).fill("0"),...M]}else Q=$.split(":");if(Q.length!==B.GROUPS)throw new S.AddressError("Wildcard pattern must have 8 groups");let Y=-1;for(let W=0;W<Q.length;W++)if(Q[W]==="*"){if(Y===-1)Y=W}else if(Y!==-1)throw new S.AddressError("Wildcard `*` must only appear in trailing groups (e.g. `2001:db8:*:*:*:*:*:*`)");let Z=Y===-1?0:Q.length-Y,K=Q.map((W)=>W==="*"?"0":W),X=B.BITS-Z*16;return new L(`${K.join(":")}/${X}`)}static fromAddress4($){let J=new l.Address4($),Q=B.BITS-($0.BITS-J.subnetMask);return new L(`::ffff:${J.correctForm()}/${Q}`)}static fromArpa($){let J=$.replace(/(\.ip6\.arpa)?\.$/,""),Q=7;if(J.length!==63)throw new S.AddressError("Invalid 'ip6.arpa' form.");let Y=J.split(".").reverse();for(let Z=Q;Z>0;Z--){let K=Z*4;Y.splice(K,0,":")}return J=Y.join(""),new L(J)}microsoftTranscription(){return`${this.correctForm().replace(/:/g,"-")}.ipv6-literal.net`}mask($=this.subnetMask){return this.getBitsBase2(0,$)}possibleSubnets($=128){let J=B.BITS-this.subnetMask,Q=Math.abs($-B.BITS),Y=J-Q;if(Y<0)return"0";return EQ((BigInt("2")**BigInt(Y)).toString(10))}_startAddress(){return BigInt(`0b${this.mask()+"0".repeat(B.BITS-this.subnetMask)}`)}startAddress(){return L.fromBigInt(this._startAddress())}startAddressExclusive(){let $=BigInt("1");return L.fromBigInt(this._startAddress()+$)}_endAddress(){return BigInt(`0b${this.mask()+"1".repeat(B.BITS-this.subnetMask)}`)}endAddress(){return L.fromBigInt(this._endAddress())}endAddressExclusive(){let $=BigInt("1");return L.fromBigInt(this._endAddress()-$)}subnetMaskAddress(){return L.fromBigInt(BigInt(`0b${"1".repeat(this.subnetMask)}${"0".repeat(B.BITS-this.subnetMask)}`))}wildcardMask(){return L.fromBigInt(BigInt(`0b${"0".repeat(this.subnetMask)}${"1".repeat(B.BITS-this.subnetMask)}`))}networkForm(){return`${this.startAddress().correctForm()}/${this.subnetMask}`}getScope(){let $=this.getType();if($==="Multicast"||$.startsWith("Multicast "))return B.SCOPES[parseInt(this.getBits(12,16).toString(10),10)]||"Unknown";if($==="Link-local unicast"||$==="Loopback")return"Link local";if($==="Unspecified")return"Unknown";return"Global"}getType(){for(let $=0;$<N1.length;$++){let J=N1[$];if(this.isHostInSubnet(J[0]))return J[1]}return"Global unicast"}getBits($,J){return BigInt(`0b${this.getBitsBase2($,J)}`)}getBitsBase2($,J){return this.binaryZeroPad().slice($,J)}getBitsBase16($,J){let Q=J-$;if(Q%4!==0)throw Error("Length of bits to retrieve must be divisible by four");return this.getBits($,J).toString(16).padStart(Q/4,"0")}getBitsPastSubnet(){return this.getBitsBase2(this.subnetMask,B.BITS)}reverseForm($){if(!$)$={};let J=Math.floor(this.subnetMask/4),Q=this.canonicalForm().replace(/:/g,"").split("").slice(0,J).reverse().join(".");if(J>0){if($.omitSuffix)return Q;return`${Q}.ip6.arpa.`}if($.omitSuffix)return"";return"ip6.arpa."}correctForm(){let $,J=[],Q=0,Y=[];for($=0;$<this.parsedAddress.length;$++){let X=parseInt(this.parsedAddress[$],16);if(X===0)Q++;if(X!==0&&Q>0){if(Q>1)Y.push([$-Q,$-1]);Q=0}}if(Q>1)Y.push([this.parsedAddress.length-Q,this.parsedAddress.length-1]);let Z=Y.map((X)=>X[1]-X[0]+1);if(Y.length>0){let X=Z.indexOf(Math.max(...Z));J=DQ(this.parsedAddress,Y[X])}else J=this.parsedAddress;for($=0;$<J.length;$++)if(J[$]!=="compact")J[$]=parseInt(J[$],16).toString(16);let K=J.join(":");return K=K.replace(/^compact$/,"::"),K=K.replace(/(^compact)|(compact$)/,":"),K=K.replace(/compact/,""),K}binaryZeroPad(){if(this._binaryZeroPad===void 0)this._binaryZeroPad=this.bigInt().toString(2).padStart(B.BITS,"0");return this._binaryZeroPad}parse4in6($){if($.indexOf(".")===-1)return $;let J=$.split(":"),Q=J.slice(-1)[0],Y=Q.split(".");if(Y.length===$0.GROUPS&&Y.every((K)=>/^\d{1,3}$/.test(K))){if(Y.some((K)=>/^0\d/.test(K))){let K=Y.map(IQ).join("."),X=J.slice(0,-1).map(s.escapeHtml).join(":"),W=J.length>1?":":"";throw new S.AddressError("IPv4 addresses can't have leading zeroes.",`${X}${W}${K}`)}}let Z=Q.match($0.RE_ADDRESS);if(Z){this.parsedAddress4=Z[0];let K=this.subnetMask>=96?`/${this.subnetMask-96}`:"";this.address4=new l.Address4(`${this.parsedAddress4}${K}`),this.v4=!0,J[J.length-1]=this.address4.toGroup6(),$=J.join(":")}return $}parse($){$=this.parse4in6($);let J=$.match(B.RE_BAD_CHARACTERS);if(J)throw new S.AddressError(`Bad character${J.length>1?"s":""} detected in address: ${J.join("")}`,$.replace(B.RE_BAD_CHARACTERS,'<span class="parse-error">$1</span>'));let Q=$.match(B.RE_BAD_ADDRESS);if(Q)throw new S.AddressError(`Address failed regex: ${Q.join("")}`,$.replace(B.RE_BAD_ADDRESS,'<span class="parse-error">$1</span>'));let Y=[],Z=$.split("::");if(Z.length===2){let K=Z[0].split(":"),X=Z[1].split(":");if(K.length===1&&K[0]==="")K=[];if(X.length===1&&X[0]==="")X=[];let W=this.groups-(K.length+X.length);if(!W)throw new S.AddressError("Error parsing groups");this.elidedGroups=W,this.elisionBegin=K.length,this.elisionEnd=K.length+this.elidedGroups,Y=Y.concat(K);for(let M=0;M<W;M++)Y.push("0");Y=Y.concat(X)}else if(Z.length===1)Y=$.split(":"),this.elidedGroups=0;else throw new S.AddressError("Too many :: groups found");if(Y=Y.map((K)=>parseInt(K,16).toString(16)),Y.length!==this.groups)throw new S.AddressError("Incorrect number of groups found");return Y}canonicalForm(){return this.parsedAddress.map(P1).join(":")}decimal(){return this.parsedAddress.map(($)=>parseInt($,16).toString(10).padStart(5,"0")).join(":")}bigInt(){return BigInt(`0x${this.parsedAddress.map(P1).join("")}`)}to4(){let $=this.binaryZeroPad().split(""),J=BigInt(`0b${$.slice(96,128).join("")}`).toString(16).padStart(8,"0");if(this.subnetMask>=96){let Q=this.subnetMask-96,Y=[];for(let Z=0;Z<8;Z+=2)Y.push(parseInt(J.slice(Z,Z+2),16));return new l.Address4(`${Y.join(".")}/${Q}`)}return l.Address4.fromHex(J)}to4in6(){let $=this.to4(),Q=new L(this.parsedAddress.slice(0,6).join(":"),6).correctForm(),Y="";if(!/:$/.test(Q))Y=":";return Q+Y+$.correctForm()}inspectTeredo(){let $=this.getBitsBase16(0,32),Q=(this.getBits(80,96)^BigInt("0xffff")).toString(),Y=l.Address4.fromHex(this.getBitsBase16(32,64)),Z=this.getBits(96,128),K=l.Address4.fromHex((Z^BigInt("0xffffffff")).toString(16).padStart(8,"0")),X=this.getBitsBase2(64,80),W=(0,v$.testBit)(X,15),M=(0,v$.testBit)(X,14),O=(0,v$.testBit)(X,8),V=(0,v$.testBit)(X,9),z=BigInt(`0b${X.slice(2,6)+X.slice(8,16)}`).toString(10);return{prefix:`${$.slice(0,4)}:${$.slice(4,8)}`,server4:Y.address,client4:K.address,flags:X,coneNat:W,microsoft:{reserved:M,universalLocal:V,groupIndividual:O,nonce:z},udpPort:Q}}inspect6to4(){let $=this.getBitsBase16(0,16),J=l.Address4.fromHex(this.getBitsBase16(16,48));return{prefix:$.slice(0,4),gateway:J.address}}to6to4(){if(!this.is4())return null;let $=["2002",this.getBitsBase16(96,112),this.getBitsBase16(112,128),"","/16"].join(":");return new L($)}static fromAddress4Nat64($,J="64:ff9b::/96"){let Q=new l.Address4($),Y=new L(J),Z=Y.subnetMask;if(Z!==32&&Z!==40&&Z!==48&&Z!==56&&Z!==64&&Z!==96)throw new S.AddressError("NAT64 prefix length must be 32, 40, 48, 56, 64, or 96");let K=Y.binaryZeroPad(),X=Q.binaryZeroPad(),W;if(Z===96)W=K.slice(0,96)+X;else{let V=64-Z;W=[K.slice(0,Z),X.slice(0,V),"00000000",X.slice(V),"0".repeat(56-(32-V))].join("")}let M=BigInt(`0b${W}`).toString(16).padStart(32,"0"),O=[];for(let V=0;V<8;V++)O.push(M.slice(V*4,(V+1)*4));return new L(O.join(":"))}toAddress4Nat64($="64:ff9b::/96"){let J=new L($),Q=J.subnetMask;if(Q!==32&&Q!==40&&Q!==48&&Q!==56&&Q!==64&&Q!==96)throw new S.AddressError("NAT64 prefix length must be 32, 40, 48, 56, 64, or 96");if(!this.isHostInSubnet(J))return null;let Y=this.binaryZeroPad(),Z;if(Q===96)Z=Y.slice(96,128);else{let X=64-Q;Z=Y.slice(Q,Q+X)+Y.slice(72,72+(32-X))}let K=[];for(let X=0;X<4;X++)K.push(parseInt(Z.slice(X*8,(X+1)*8),2).toString());return new l.Address4(K.join("."))}toByteArray(){let $=this.bigInt().toString(16).padStart(B.BITS/4,"0"),J=[];for(let Q=0,Y=$.length;Q<Y;Q+=2)J.push(parseInt($.substring(Q,Q+2),16));return J}toUnsignedByteArray(){return this.toByteArray().map(w1)}static fromByteArray($){return $$.assertByteArray($,16,"IPv6",-128),this.fromUnsignedByteArray($.map(w1))}static fromUnsignedByteArray($){$$.assertByteArray($,16,"IPv6",0);let J=BigInt("256"),Q=BigInt("0"),Y=BigInt("1");for(let Z=$.length-1;Z>=0;Z--)Q+=Y*BigInt($[Z].toString(10)),Y*=J;return L.fromBigInt(Q)}isCanonical(){return this.addressMinusSuffix===this.canonicalForm()}isLinkLocal(){let $=this.embeddedIPv4();if($)return $.isLinkLocal();if(this.getBitsBase2(0,64)==="1111111010000000000000000000000000000000000000000000000000000000")return!0;return!1}isMulticast(){let $=this.embeddedIPv4();if($)return $.isMulticast();let J=this.getType();return J==="Multicast"||J.startsWith("Multicast ")}is4(){return this.v4}isMapped4(){return this.isHostInSubnet(vQ)}embeddedIPv4(){if(this.isMapped4()||this.isHostInSubnet(xQ))return this.to4();return null}isTeredo(){return this.isHostInSubnet(fQ)}is6to4(){return this.isHostInSubnet(_Q)}isLoopback(){let $=this.embeddedIPv4();if($)return $.isLoopback();return this.getType()==="Loopback"}isULA(){return this.isHostInSubnet(yQ)}isPrivate(){let $=this.embeddedIPv4();if($)return $.isPrivate();return this.isULA()}isCGNAT(){let $=this.embeddedIPv4();if($)return $.isCGNAT();return!1}isBroadcast(){let $=this.embeddedIPv4();if($)return $.isBroadcast();return!1}isUnspecified(){let $=this.embeddedIPv4();if($)return $.isUnspecified();return this.getType()==="Unspecified"}isDocumentation(){return this.isHostInSubnet(AQ)}href($){if($===void 0)$="";else $=`:${$}`;return`http://[${this.correctForm()}]${$}/`}link($){if(!$)$={};if($.className===void 0)$.className="";if($.prefix===void 0)$.prefix="/#address=";if($.v4===void 0)$.v4=!1;let J=this.correctForm;if($.v4)J=this.to4in6;let Q=J.call(this),Y=s.escapeHtml(`${$.prefix}${Q}`),Z=s.escapeHtml(Q);if($.className){let K=s.escapeHtml($.className);return`<a href="${Y}" class="${K}">${Z}</a>`}return`<a href="${Y}">${Z}</a>`}group(){if(this.elidedGroups===0)return s.simpleGroup(this.addressMinusSuffix).join(":");x$(typeof this.elidedGroups==="number"),x$(typeof this.elisionBegin==="number");let $=[],[J,Q]=this.addressMinusSuffix.split("::");if(J.length)$.push(...s.simpleGroup(J));else $.push("");let Y=["hover-group"];for(let Z=this.elisionBegin;Z<this.elisionBegin+this.elidedGroups;Z++)Y.push(`group-${Z}`);if($.push(`<span class="${Y.join(" ")}"></span>`),Q.length)$.push(...s.simpleGroup(Q,this.elisionEnd));else $.push("");if(this.is4())x$(this.address4 instanceof l.Address4),$.pop(),$.push(this.address4.groupForV6());return $.join(":")}regularExpressionString($=!1){let J=[],Q=new L(this.correctForm());if(Q.elidedGroups===0)J.push((0,e.simpleRegularExpression)(Q.parsedAddress));else if(Q.elidedGroups===B.GROUPS)J.push((0,e.possibleElisions)(B.GROUPS));else{let Y=Q.address.split("::");if(Y[0].length)J.push((0,e.simpleRegularExpression)(Y[0].split(":")));if(x$(typeof Q.elidedGroups==="number"),J.push((0,e.possibleElisions)(Q.elidedGroups,Y[0].length!==0,Y[1].length!==0)),Y[1].length)J.push((0,e.simpleRegularExpression)(Y[1].split(":")));J=[J.join(":")]}if(!$)J=["(?=^|",e.ADDRESS_BOUNDARY,"|[^\\w\\:])(",...J,")(?=[^\\w\\:]|",e.ADDRESS_BOUNDARY,"|$)"];return J.join("")}regularExpression($=!1){return new RegExp(this.regularExpressionString($),"i")}}m.Address6=L;var N1=Object.keys(B.TYPES).map(($)=>[new L($),B.TYPES[$]]),fQ=new L("2001::/32"),_Q=new L("2002::/16"),yQ=new L("fc00::/7"),AQ=new L("2001:db8::/32"),vQ=new L("::ffff:0:0/96"),xQ=new L("64:ff9b::/96")});var R1=F((E)=>{var hQ=E&&E.__createBinding||(Object.create?function($,J,Q,Y){if(Y===void 0)Y=Q;var Z=Object.getOwnPropertyDescriptor(J,Q);if(!Z||("get"in Z?!J.__esModule:Z.writable||Z.configurable))Z={enumerable:!0,get:function(){return J[Q]}};Object.defineProperty($,Y,Z)}:function($,J,Q,Y){if(Y===void 0)Y=Q;$[Y]=J[Q]}),bQ=E&&E.__setModuleDefault||(Object.create?function($,J){Object.defineProperty($,"default",{enumerable:!0,value:J})}:function($,J){$.default=J}),kQ=E&&E.__importStar||function($){if($&&$.__esModule)return $;var J={};if($!=null){for(var Q in $)if(Q!=="default"&&Object.prototype.hasOwnProperty.call($,Q))hQ(J,$,Q)}return bQ(J,$),J};Object.defineProperty(E,"__esModule",{value:!0});E.v6=E.AddressError=E.Address6=E.Address4=void 0;var gQ=r$();Object.defineProperty(E,"Address4",{enumerable:!0,get:function(){return gQ.Address4}});var uQ=C1();Object.defineProperty(E,"Address6",{enumerable:!0,get:function(){return uQ.Address6}});var cQ=q$();Object.defineProperty(E,"AddressError",{enumerable:!0,get:function(){return cQ.AddressError}});var lQ=kQ(e$());E.v6={helpers:lQ}});var v1=F((XY,A1)=>{A1.exports=y1;y1.sync=G4;var f1=q("fs");function H4($,J){var Q=J.pathExt!==void 0?J.pathExt:process.env.PATHEXT;if(!Q)return!0;if(Q=Q.split(";"),Q.indexOf("")!==-1)return!0;for(var Y=0;Y<Q.length;Y++){var Z=Q[Y].toLowerCase();if(Z&&$.substr(-Z.length).toLowerCase()===Z)return!0}return!1}function _1($,J,Q){if(!$.isSymbolicLink()&&!$.isFile())return!1;return H4(J,Q)}function y1($,J,Q){f1.stat($,function(Y,Z){Q(Y,Y?!1:_1(Z,$,J))})}function G4($,J){return _1(f1.statSync($),$,J)}});var g1=F((VY,k1)=>{k1.exports=h1;h1.sync=F4;var x1=q("fs");function h1($,J,Q){x1.stat($,function(Y,Z){Q(Y,Y?!1:b1(Z,J))})}function F4($,J){return b1(x1.statSync($),J)}function b1($,J){return $.isFile()&&U4($,J)}function U4($,J){var{mode:Q,uid:Y,gid:Z}=$,K=J.uid!==void 0?J.uid:process.getuid&&process.getuid(),X=J.gid!==void 0?J.gid:process.getgid&&process.getgid(),W=parseInt("100",8),M=parseInt("010",8),O=parseInt("001",8),V=W|M,z=Q&O||Q&M&&Z===X||Q&W&&Y===K||Q&V&&K===0;return z}});var c1=F((WY,u1)=>{var zY=q("fs"),c$;if(process.platform==="win32"||global.TESTING_WINDOWS)c$=v1();else c$=g1();u1.exports=Y0;Y0.sync=B4;function Y0($,J,Q){if(typeof J==="function")Q=J,J={};if(!Q){if(typeof Promise!=="function")throw TypeError("callback not provided");return new Promise(function(Y,Z){Y0($,J||{},function(K,X){if(K)Z(K);else Y(X)})})}c$($,J||{},function(Y,Z){if(Y){if(Y.code==="EACCES"||J&&J.ignoreErrors)Y=null,Z=!1}Q(Y,Z)})}function B4($,J){try{return c$.sync($,J||{})}catch(Q){if(J&&J.ignoreErrors||Q.code==="EACCES")return!1;else throw Q}}});var a1=F((HY,d1)=>{var H$=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",l1=q("path"),M4=H$?";":":",m1=c1(),i1=($)=>Object.assign(Error(`not found: ${$}`),{code:"ENOENT"}),p1=($,J)=>{let Q=J.colon||M4,Y=$.match(/\//)||H$&&$.match(/\\/)?[""]:[...H$?[process.cwd()]:[],...(J.path||process.env.PATH||"").split(Q)],Z=H$?J.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",K=H$?Z.split(Q):[""];if(H$){if($.indexOf(".")!==-1&&K[0]!=="")K.unshift("")}return{pathEnv:Y,pathExt:K,pathExtExe:Z}},n1=($,J,Q)=>{if(typeof J==="function")Q=J,J={};if(!J)J={};let{pathEnv:Y,pathExt:Z,pathExtExe:K}=p1($,J),X=[],W=(O)=>new Promise((V,z)=>{if(O===Y.length)return J.all&&X.length?V(X):z(i1($));let H=Y[O],G=/^".*"$/.test(H)?H.slice(1,-1):H,C=l1.join(G,$),U=!G&&/^\.[\\\/]/.test($)?$.slice(0,2)+C:C;V(M(U,O,0))}),M=(O,V,z)=>new Promise((H,G)=>{if(z===Z.length)return H(W(V+1));let C=Z[z];m1(O+C,{pathExt:K},(U,w)=>{if(!U&&w)if(J.all)X.push(O+C);else return H(O+C);return H(M(O,V,z+1))})});return Q?W(0).then((O)=>Q(null,O),Q):W(0)},O4=($,J)=>{J=J||{};let{pathEnv:Q,pathExt:Y,pathExtExe:Z}=p1($,J),K=[];for(let X=0;X<Q.length;X++){let W=Q[X],M=/^".*"$/.test(W)?W.slice(1,-1):W,O=l1.join(M,$),V=!M&&/^\.[\\\/]/.test($)?$.slice(0,2)+O:O;for(let z=0;z<Y.length;z++){let H=V+Y[z];try{if(m1.sync(H,{pathExt:Z}))if(J.all)K.push(H);else return H}catch(G){}}}if(J.all&&K.length)return K;if(J.nothrow)return null;throw i1($)};d1.exports=n1;n1.sync=O4});var t1=F((GY,Z0)=>{var o1=($={})=>{let J=$.env||process.env;if(($.platform||process.platform)!=="win32")return"PATH";return Object.keys(J).reverse().find((Y)=>Y.toUpperCase()==="PATH")||"Path"};Z0.exports=o1;Z0.exports.default=o1});var $8=F((FY,e1)=>{var r1=q("path"),q4=a1(),L4=t1();function s1($,J){let Q=$.options.env||process.env,Y=process.cwd(),Z=$.options.cwd!=null,K=Z&&process.chdir!==void 0&&!process.chdir.disabled;if(K)try{process.chdir($.options.cwd)}catch(W){}let X;try{X=q4.sync($.command,{path:Q[L4({env:Q})],pathExt:J?r1.delimiter:void 0})}catch(W){}finally{if(K)process.chdir(Y)}if(X)X=r1.resolve(Z?$.options.cwd:"",X);return X}function P4($){return s1($)||s1($,!0)}e1.exports=P4});var J8=F((C4,X0)=>{var K0=/([()\][%!^"`<>&|;, *?])/g;function w4($){return $=$.replace(K0,"^$1"),$}function N4($,J){if($=`${$}`,$=$.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),$=$.replace(/(?=(\\+?)?)\1$/,"$1$1"),$=`"${$}"`,$=$.replace(K0,"^$1"),J)$=$.replace(K0,"^$1");return $}C4.command=w4;C4.argument=N4});var Y8=F((UY,Q8)=>{Q8.exports=/^#!(.*)/});var K8=F((BY,Z8)=>{var j4=Y8();Z8.exports=($="")=>{let J=$.match(j4);if(!J)return null;let[Q,Y]=J[0].replace(/#! ?/,"").split(" "),Z=Q.split("/").pop();if(Z==="env")return Y;return Y?`${Z} ${Y}`:Z}});var V8=F((MY,X8)=>{var V0=q("fs"),S4=K8();function E4($){let Q=Buffer.alloc(150),Y;try{Y=V0.openSync($,"r"),V0.readSync(Y,Q,0,150,0),V0.closeSync(Y)}catch(Z){}return S4(Q.toString())}X8.exports=E4});var G8=F((OY,H8)=>{var I4=q("path"),z8=$8(),W8=J8(),D4=V8(),f4=process.platform==="win32",_4=/\.(?:com|exe)$/i,y4=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function A4($){$.file=z8($);let J=$.file&&D4($.file);if(J)return $.args.unshift($.file),$.command=J,z8($);return $.file}function v4($){if(!f4)return $;let J=A4($),Q=!_4.test(J);if($.options.forceShell||Q){let Y=y4.test(J);$.command=I4.normalize($.command),$.command=W8.command($.command),$.args=$.args.map((K)=>W8.argument(K,Y));let Z=[$.command].concat($.args).join(" ");$.args=["/d","/s","/c",`"${Z}"`],$.command=process.env.comspec||"cmd.exe",$.options.windowsVerbatimArguments=!0}return $}function x4($,J,Q){if(J&&!Array.isArray(J))Q=J,J=null;J=J?J.slice(0):[],Q=Object.assign({},Q);let Y={command:$,args:J,options:Q,file:void 0,original:{command:$,args:J}};return Q.shell?Y:v4(Y)}H8.exports=x4});var B8=F((qY,U8)=>{var z0=process.platform==="win32";function W0($,J){return Object.assign(Error(`${J} ${$.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${J} ${$.command}`,path:$.command,spawnargs:$.args})}function h4($,J){if(!z0)return;let Q=$.emit;$.emit=function(Y,Z){if(Y==="exit"){let K=F8(Z,J);if(K)return Q.call($,"error",K)}return Q.apply($,arguments)}}function F8($,J){if(z0&&$===1&&!J.file)return W0(J.original,"spawn");return null}function b4($,J){if(z0&&$===1&&!J.file)return W0(J.original,"spawnSync");return null}U8.exports={hookChildProcess:h4,verifyENOENT:F8,verifyENOENTSync:b4,notFoundError:W0}});var q8=F((LY,G$)=>{var M8=q("child_process"),H0=G8(),G0=B8();function O8($,J,Q){let Y=H0($,J,Q),Z=M8.spawn(Y.command,Y.args,Y.options);return G0.hookChildProcess(Z,Y),Z}function k4($,J,Q){let Y=H0($,J,Q),Z=M8.spawnSync(Y.command,Y.args,Y.options);return Z.error=Z.error||G0.verifyENOENTSync(Z.status,Y),Z}G$.exports=O8;G$.exports.spawn=O8;G$.exports.sync=k4;G$.exports._parse=H0;G$.exports._enoent=G0});import{readFileSync as n4}from"node:fs";import{fileURLToPath as d4}from"node:url";import{Agent as Q4}from"node:http";import{Agent as Y4}from"node:https";var Z4=L$(A0(),1),K4=L$(Y1(),1);var i=L$(R1(),1);import{execFile as mQ}from"node:child_process";import{readFile as iQ}from"node:fs/promises";import{homedir as pQ}from"node:os";import{join as T1}from"node:path";import{promisify as nQ}from"node:util";var dQ=nQ(mQ);function W$($,J){return $[J.toLowerCase()]?.trim()||$[J]?.trim()||void 0}function Q0($){let J=$.hostname.replace(/^\[|\]$/g,"").toLowerCase();return J==="localhost"||J.endsWith(".localhost")||J==="::1"||/^127\.(?:\d{1,3}\.){2}\d{1,3}$/.test(J)||/^::ffff:(?:127\.|7f[0-9a-f]{2}:)/.test(J)}function J0($,J=""){let Q=$.hostname.replace(/^\[|\]$/g,"").toLowerCase(),Y=$.port||($.protocol==="https:"?"443":"80");return J.split(/[,;\s]+/).filter(Boolean).some((Z)=>{let K=Z.toLowerCase();if(K==="*")return!0;if(K==="<local>")return!Q.includes(".")&&!Q.includes(":");if(K.includes("/")){if(i.Address4.isValid(K))return i.Address4.isValid(Q)&&new i.Address4(Q).isInSubnet(new i.Address4(K));if(i.Address6.isValid(K))return i.Address6.isValid(Q)&&new i.Address6(Q).isInSubnet(new i.Address6(K));throw Error("network proxy: invalid IP range in bypass list")}let X=K.match(/^(\[[^\]]+\]|[^:]+):(\d+)$/);if(X&&X[2]!==Y)return!1;let W=(X?X[1]:K).replace(/^\[|\]$/g,"").replace(/^\*?\./,"");return Q===W||Q.endsWith(`.${W}`)})}function j1($,J){let Q;try{Q=new URL($)}catch{throw Error(`network proxy: ${J} contains an invalid proxy URL`)}if(!["http:","https:"].includes(Q.protocol))throw Error(`network proxy: ${J} must use an HTTP(S) proxy; SOCKS and PAC are not supported`);if(!Q.hostname||Q.search||Q.hash||Q.pathname&&Q.pathname!=="/")throw Error(`network proxy: ${J} must contain a proxy host and port without a path or query`);return Q.href}function S1($,J,Q={}){if(!["http:","https:"].includes($.protocol))throw Error(`network: unsupported URL protocol ${$.protocol}`);if(Q0($)||J0($,W$(J,"NO_PROXY")))return;let Y=$.protocol==="https:"?"HTTPS_PROXY":"HTTP_PROXY",Z=W$(J,Y)||W$(J,"ALL_PROXY");if(Z)return j1(Z,"environment");if(Q.unsupported)throw Error(`network proxy: ${Q.unsupported}`);if(J0($,Q.bypass))return;let K=($.protocol==="https:"?Q.https:Q.http)||Q.all;return K?j1(K,"system settings"):void 0}function g$($,J,Q="http"){if(typeof $!=="string"||!$.trim()||!Number.isInteger(Number(J))||Number(J)<1||Number(J)>65535)throw Error("network proxy: system proxy has an invalid host or port");let Y=$.includes(":")&&!$.startsWith("[")?`[${$}]`:$;return`${Q}://${Y}:${J}`}function aQ($){if($.AutoConfigURL)return{unsupported:"Windows PAC proxy is not supported; configure a manual HTTP(S) proxy or proxy environment variables"};if(!$.ProxyEnable)return $.AutoDetect?{unsupported:"Windows automatic proxy discovery is not supported; configure a manual HTTP(S) proxy or proxy environment variables"}:{};if(typeof $.ProxyServer!=="string"||!$.ProxyServer.trim())throw Error("network proxy: Windows proxy is enabled without a server");let J={bypass:String($.ProxyOverride??"")};for(let Q of $.ProxyServer.split(";").map((Y)=>Y.trim()).filter(Boolean)){let Y=Q.match(/^(http|https|socks)=(.+)$/i),Z=Y?Y[2]:Q,K=/^[a-z][\w+.-]*:\/\//i.test(Z)?Z:`http://${Z}`;if(!Y)J.all=K;else if(Y[1].toLowerCase()==="socks")J.all=`socks://${Z.replace(/^socks\w*:\/\//,"")}`;else J[Y[1].toLowerCase()]=K}return J}function oQ($){let J=(Z)=>$.match(new RegExp(`^\\s*${Z}\\s*:\\s*(.*?)\\s*$`,"m"))?.[1];if(J("ProxyAutoConfigEnable")==="1"||J("ProxyAutoDiscoveryEnable")==="1")return{unsupported:"macOS PAC/automatic proxy discovery is not supported; configure a manual HTTP(S) proxy or proxy environment variables"};let Q={};if(J("HTTPEnable")==="1")Q.http=g$(J("HTTPProxy"),J("HTTPPort"));if(J("HTTPSEnable")==="1")Q.https=g$(J("HTTPSProxy"),J("HTTPSPort"));if(J("SOCKSEnable")==="1")Q.all=g$(J("SOCKSProxy"),J("SOCKSPort"),"socks");let Y=$.match(/ExceptionsList\s*:\s*<array>\s*\{([^}]*)\}/)?.[1]??"";if(Q.bypass=[...Y.matchAll(/^\s*\d+\s*:\s*(.*?)\s*$/gm)].map((Z)=>Z[1]).join(","),J("ExcludeSimpleHostnames")==="1")Q.bypass+=",<local>";return Q}function b$($){if($===void 0)return"";if(!/^(['"]).*\1$/.test($))throw Error("network proxy: invalid GNOME proxy string");return $.slice(1,-1).replace(/\\([\\'"])/g,"$1")}function tQ($){let J=new Map($.split(`
21
+ `).filter(Boolean).map((Z)=>{let K=Z.match(/^org\.gnome\.system\.proxy(\.\w+)?\s+([\w-]+)\s+(.*)$/);if(!K)throw Error("network proxy: invalid GNOME proxy settings");return[`${K[1]??""}/${K[2]}`,K[3]]})),Q=b$(J.get("/mode"));if(Q==="none")return{};if(Q==="auto")return{unsupported:"GNOME PAC proxy is not supported; configure a manual HTTP(S) proxy or proxy environment variables"};if(Q!=="manual")throw Error("network proxy: unknown GNOME proxy mode");let Y={};for(let Z of["http","https","socks"]){let K=b$(J.get(`.${Z}/host`));if(!K)continue;let X=new URL(g$(K,J.get(`.${Z}/port`),Z==="socks"?"socks":"http"));if(Z==="http"&&J.get(".http/use-authentication")==="true")X.username=b$(J.get(".http/authentication-user")),X.password=b$(J.get(".http/authentication-password"));Y[Z==="socks"?"all":Z]=X.href}if(J.get("/use-same-proxy")==="true"&&Y.http)Y.https=Y.http;return Y.bypass=[...(J.get("/ignore-hosts")??"").matchAll(/'((?:\\.|[^'])*)'/g)].map((Z)=>Z[1]).join(","),Y}function rQ($){let J=$.match(/^\[Proxy Settings\]\s*\n([\s\S]*?)(?=^\[|$(?![\s\S]))/m)?.[1];if(J===void 0)return;let Q=new Map(J.split(`
22
+ `).filter((K)=>K.includes("=")).map((K)=>{let X=K.indexOf("=");return[K.slice(0,X).trim(),K.slice(X+1).trim()]})),Y=Q.get("ProxyType")??"0";if(Y==="0"||Y==="4")return{};if(Y!=="1")return{unsupported:"KDE PAC/automatic proxy discovery is not supported; configure a manual HTTP(S) proxy or proxy environment variables"};if(Q.get("ReversedException")==="true")return{unsupported:"KDE reversed proxy exceptions are not supported"};let Z={bypass:Q.get("NoProxyFor")};for(let K of["http","https","socks"]){let X=Q.get(`${K}Proxy`);if(!X)continue;let W=X.replace(/\s+(\d+)$/,":$1");Z[K==="socks"?"all":K]=/^[a-z][\w+.-]*:\/\//i.test(W)?W:`${K==="socks"?"socks":"http"}://${W}`}return Z}async function k$($,J){let{stdout:Q}=await dQ($,J,{encoding:"utf8",timeout:5000,maxBuffer:262144,windowsHide:!0});return Q}var sQ=String.raw`
23
+ $ErrorActionPreference = 'Stop'
24
+ [Console]::OutputEncoding = New-Object Text.UTF8Encoding($false)
25
+ Add-Type @'
26
+ using System;
27
+ using System.Runtime.InteropServices;
28
+ public static class LodestarProxy {
29
+ [StructLayout(LayoutKind.Sequential)]
30
+ public struct Settings {
31
+ [MarshalAs(UnmanagedType.Bool)] public bool AutoDetect;
32
+ public IntPtr AutoConfigUrl, Proxy, Bypass;
33
+ }
34
+ [DllImport("winhttp.dll", SetLastError = true)]
35
+ [return: MarshalAs(UnmanagedType.Bool)]
36
+ public static extern bool WinHttpGetIEProxyConfigForCurrentUser(out Settings settings);
37
+ [DllImport("kernel32.dll")] public static extern IntPtr GlobalFree(IntPtr pointer);
38
+ }
39
+ '@
40
+ $settings = New-Object LodestarProxy+Settings
41
+ if (-not [LodestarProxy]::WinHttpGetIEProxyConfigForCurrentUser([ref]$settings)) {
42
+ $code = [Runtime.InteropServices.Marshal]::GetLastWin32Error()
43
+ if ($code -eq 2) { '{}'; exit 0 }
44
+ throw (New-Object ComponentModel.Win32Exception($code))
45
+ }
46
+ try {
47
+ $proxy = [Runtime.InteropServices.Marshal]::PtrToStringUni($settings.Proxy)
48
+ @{
49
+ ProxyEnable = -not [string]::IsNullOrEmpty($proxy)
50
+ ProxyServer = $proxy
51
+ ProxyOverride = [Runtime.InteropServices.Marshal]::PtrToStringUni($settings.Bypass)
52
+ AutoConfigURL = [Runtime.InteropServices.Marshal]::PtrToStringUni($settings.AutoConfigUrl)
53
+ AutoDetect = $settings.AutoDetect
54
+ } | ConvertTo-Json -Compress
55
+ } finally {
56
+ foreach ($pointer in @($settings.Proxy, $settings.Bypass, $settings.AutoConfigUrl)) {
57
+ if ($pointer -ne [IntPtr]::Zero) { [void][LodestarProxy]::GlobalFree($pointer) }
58
+ }
59
+ }
60
+ `;async function eQ(){if(process.platform==="win32")return aQ(JSON.parse(await k$("powershell.exe",["-NoProfile","-NonInteractive","-Command",sQ])));if(process.platform==="darwin")return oQ(await k$("/usr/sbin/scutil",["--proxy"]));if(process.platform==="linux"){let $=T1(process.env.XDG_CONFIG_HOME||T1(pQ(),".config"),"kioslaverc");try{let Q=rQ(await iQ($,"utf8"));if(Q&&(!process.env.XDG_CURRENT_DESKTOP||/kde/i.test(process.env.XDG_CURRENT_DESKTOP)))return Q}catch(Q){if(Q?.code!=="ENOENT")throw Q}let J;try{J=await k$("gsettings",["list-schemas"])}catch(Q){if(Q?.code==="ENOENT")return{};throw Q}if(!J.split(/\r?\n/).includes("org.gnome.system.proxy"))return{};return tQ(await k$("gsettings",["list-recursively","org.gnome.system.proxy"]))}return{}}function $4($=eQ,J=process.env,Q=Date.now){let Y;return async(Z)=>{if(Q0(Z)||J0(Z,W$(J,"NO_PROXY"))||W$(J,Z.protocol==="https:"?"HTTPS_PROXY":"HTTP_PROXY")||W$(J,"ALL_PROXY"))return S1(Z,J);if(!Y||Y.until<=Q()){let K=$().catch((X)=>{if(Y?.value===K)Y=void 0;if(X instanceof Error&&X.message.startsWith("network proxy:"))throw X;let W=X instanceof Error?X.code??X.name:"unknown error";throw Error(`network proxy: failed to read ${process.platform} system proxy settings (${W})`,{cause:X})});Y={until:Q()+30000,value:K}}return S1(Z,J,await Y.value)}}var J4=$4();var y6=new Q4({keepAlive:!0}),A6=new Y4({keepAlive:!0});import{existsSync as c4,readFileSync as l4}from"node:fs";import{join as m4,isAbsolute as i4}from"node:path";import{homedir as X4}from"node:os";import{join as P}from"node:path";var u$=X4(),E1=process.platform==="win32";function I1($,J,Q){if($)return $;if(J)return P(J,"lodestar");return Q}function V4(){if(E1)return P(process.env.APPDATA??P(u$,"AppData","Roaming"),"Lodestar");return P(u$,".config","lodestar")}function z4(){if(E1)return P(process.env.LOCALAPPDATA??P(u$,"AppData","Local"),"Lodestar");return P(u$,".local","share","lodestar")}var W4=I1(process.env.LODESTAR_CONFIG_DIR,process.env.XDG_CONFIG_HOME,V4()),R=I1(process.env.LODESTAR_DATA_DIR,process.env.XDG_DATA_HOME,z4()),b6=process.env.LODESTAR_CONFIG??P(W4,"config.toml"),k6=P(R,"daemon.pid"),g6=P(R,"daemon.log"),u6=P(R,"session-chat-map.json"),c6=P(R,"session-resume-map.json"),l6=P(R,"session-turns-map.json"),m6=P(R,"session-model-map.json"),i6=P(R,"temp-session-leases.json"),p6=P(R,"tasklist-map.json"),n6=P(R,"agent-runs"),d6=P(R,"agent-session-ids.json"),a6=P(R,"managed-claude-plugin"),o6=P(R,"dsh"),t6=P(R,"codex-accounts"),r6=P(R,"codex-accounts.json"),s6=P(R,"codex-quota-blocks.json"),D1=P(R,"agent-runtimes"),e6=P(R,"context-window-cache.json"),$Y=P(R,"notify-callbacks.json"),JY=P(R,"alive-on-shutdown.json"),QY=P(R,"inbox"),YY=P(R,"debug.sock"),ZY=P(R,"debug-context.json");var g4=L$(q8(),1);var L8=["codex","claude","dsh"];function p4($,J=D1){let Q=m4(J,$,"current.json");if(!c4(Q))return null;let Y=JSON.parse(l4(Q,"utf8"));if(!Number.isFinite(Y.checkedAt)||Y.directory!==void 0&&!i4(Y.directory))throw Error(`Invalid ${$} runtime state: ${Q}`);return Y}function P8($){return p4($)}var a4=JSON.parse(n4(d4(new URL("../package.json",import.meta.url)),"utf8"));console.log(`Lodestar v${a4.version}`);for(let $ of L8)try{let J=P8($);if(!J){console.log(`${$}: MISS(尚未自动安装)`);continue}if(J.error){console.log(`${$}: MISS(自动更新失败:${J.error})`),process.exitCode=1;continue}let Q=$==="dsh"?["@deepseek-ai/dsh"]:Object.keys(J.versions??{});console.log(`${$}: ${Q.map((Y)=>`${Y}@${J.versions?.[Y]??"MISS"}`).join(", ")}`),console.log(` ${J.directory}`)}catch(J){console.error(`${$}: MISS(${J})`),process.exitCode=1}console.log(`Runtime: ${process.version} (${process.platform}-${process.arch})`);