@visulima/vis 1.0.0-alpha.14 → 1.0.0-alpha.15

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.
Files changed (87) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/LICENSE.md +936 -1
  3. package/dist/bin.js +1 -1
  4. package/dist/config/index.js +1 -1
  5. package/dist/packem_chunks/applyDefaults.js +2 -2
  6. package/dist/packem_chunks/bin.js +314 -311
  7. package/dist/packem_chunks/fix.js +1 -1
  8. package/dist/packem_chunks/handler.js +1 -1
  9. package/dist/packem_chunks/handler10.js +1 -1
  10. package/dist/packem_chunks/handler12.js +5 -5
  11. package/dist/packem_chunks/handler14.js +3 -3
  12. package/dist/packem_chunks/handler15.js +1 -1
  13. package/dist/packem_chunks/handler18.js +1 -1
  14. package/dist/packem_chunks/handler19.js +1 -1
  15. package/dist/packem_chunks/handler2.js +1 -1
  16. package/dist/packem_chunks/handler20.js +1 -1
  17. package/dist/packem_chunks/handler22.js +1 -1
  18. package/dist/packem_chunks/handler23.js +1 -1
  19. package/dist/packem_chunks/handler24.js +1 -1
  20. package/dist/packem_chunks/handler25.js +1 -1
  21. package/dist/packem_chunks/handler26.js +1 -1
  22. package/dist/packem_chunks/handler27.js +2 -2
  23. package/dist/packem_chunks/handler28.js +7 -7
  24. package/dist/packem_chunks/handler3.js +1 -1
  25. package/dist/packem_chunks/handler30.js +10 -10
  26. package/dist/packem_chunks/handler31.js +1 -1
  27. package/dist/packem_chunks/handler32.js +1 -1
  28. package/dist/packem_chunks/handler33.js +21 -21
  29. package/dist/packem_chunks/handler34.js +2 -2
  30. package/dist/packem_chunks/handler35.js +3 -3
  31. package/dist/packem_chunks/handler36.js +20 -20
  32. package/dist/packem_chunks/handler37.js +1 -1
  33. package/dist/packem_chunks/handler38.js +2 -2
  34. package/dist/packem_chunks/handler39.js +10 -10
  35. package/dist/packem_chunks/handler40.js +5 -5
  36. package/dist/packem_chunks/handler41.js +10 -24
  37. package/dist/packem_chunks/handler42.js +24 -10
  38. package/dist/packem_chunks/handler43.js +5 -5
  39. package/dist/packem_chunks/handler44.js +5 -5
  40. package/dist/packem_chunks/handler45.js +3 -3
  41. package/dist/packem_chunks/handler46.js +11 -11
  42. package/dist/packem_chunks/handler47.js +15 -15
  43. package/dist/packem_chunks/handler48.js +6 -6
  44. package/dist/packem_chunks/handler5.js +1 -1
  45. package/dist/packem_chunks/handler6.js +1 -1
  46. package/dist/packem_chunks/handler7.js +1 -1
  47. package/dist/packem_chunks/heal-accept.js +1 -1
  48. package/dist/packem_chunks/heal.js +1 -1
  49. package/dist/packem_chunks/help-command.js +1 -1
  50. package/dist/packem_chunks/index.js +2 -2
  51. package/dist/packem_chunks/loader.js +1 -1
  52. package/dist/packem_chunks/tar.js +1 -1
  53. package/dist/packem_shared/{ai-analysis-Dzs_nUwM.js → ai-analysis-CGVjqwdc.js} +1 -1
  54. package/dist/packem_shared/ai-cache-BdPgSfg2.js +1 -0
  55. package/dist/packem_shared/{ai-fix-BmLM72GS.js → ai-fix-iHtGLkJS.js} +1 -1
  56. package/dist/packem_shared/cache-directory-DTfMSzT9.js +1 -0
  57. package/dist/packem_shared/dependency-scan-SQeRzrpJ.js +2 -0
  58. package/dist/packem_shared/docker-D5p9mRPU.js +2 -0
  59. package/dist/packem_shared/failure-log-CElcbnb9.js +2 -0
  60. package/dist/packem_shared/flakiness-C4t4_NoA.js +1 -0
  61. package/dist/packem_shared/{giget-BX2ixMoa.js → giget-CcEy_Elm.js} +2 -2
  62. package/dist/packem_shared/lockfile-B7JJzxnL.js +1 -0
  63. package/dist/packem_shared/otel-CO8UEfTa.js +17 -0
  64. package/dist/packem_shared/otelPlugin-DTynZDWh.js +1 -0
  65. package/dist/packem_shared/readTomlSync-1fKo0R52-DAKNI1Me.js +109 -0
  66. package/dist/packem_shared/registry-D04iOQ5H.js +2 -0
  67. package/dist/packem_shared/run-summary-utils-BPraMTcm.js +1 -0
  68. package/dist/packem_shared/{runtime-check-BaKni2y1.js → runtime-check-l4qFpo08.js} +1 -1
  69. package/dist/packem_shared/{selectors-BvtUXWGY.js → selectors-Sem2CTYA.js} +1 -1
  70. package/dist/packem_shared/{toolchain-B7sIiJxK.js → toolchain-BhZNts--.js} +3 -3
  71. package/dist/packem_shared/typosquats-Dr7VIL2B.js +1 -0
  72. package/dist/packem_shared/verify-C6NNOhTA.js +1 -0
  73. package/dist/packem_shared/{vis-update-app-DR8c4OfG.js → vis-update-app-DGiMc5kb.js} +1 -1
  74. package/package.json +10 -12
  75. package/dist/packem_shared/ai-cache-Dtvmbsru.js +0 -1
  76. package/dist/packem_shared/cache-directory-xASJia6M.js +0 -1
  77. package/dist/packem_shared/dependency-scan-DmwPKwLy.js +0 -2
  78. package/dist/packem_shared/docker-CA-scYu0.js +0 -2
  79. package/dist/packem_shared/failure-log-fD4DiFb1.js +0 -2
  80. package/dist/packem_shared/flakiness-BIg1rwvp.js +0 -1
  81. package/dist/packem_shared/index-OlP7U_t5.js +0 -6
  82. package/dist/packem_shared/lockfile-BXylopgH.js +0 -1
  83. package/dist/packem_shared/otelPlugin-y5hoCw4b.js +0 -1
  84. package/dist/packem_shared/registry-BHqKXiLb.js +0 -2
  85. package/dist/packem_shared/run-summary-utils-D39XBHWW.js +0 -1
  86. package/dist/packem_shared/typosquats-XkC1CnOa.js +0 -1
  87. package/dist/packem_shared/verify-BVTcVfoW.js +0 -1
@@ -1,2 +1,2 @@
1
- var De=Object.defineProperty;var f=(r,e)=>De(r,"name",{value:e,configurable:!0});import{createRequire as Fe}from"node:module";const Ne=Fe(import.meta.url),z=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=f(r=>{if(typeof z<"u"&&z.versions&&z.versions.node){const[e,t]=z.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return z.getBuiltinModule(r)}return Ne(r)},"__cjs_getBuiltinModule"),{createRequire:Me}=k("node:module"),{existsSync:x,createWriteStream:se,readdirSync:Ge,renameSync:He}=k("node:fs"),{readFile:ie,mkdir:H,rm:M,writeFile:Be,mkdtemp:Le}=k("node:fs/promises"),{PassThrough:ae,Readable:J,pipeline:Re}=k("node:stream"),{spawn:ce,spawnSync:Ue}=k("node:child_process"),{delimiter:q,resolve:We,dirname:Xe,normalize:Je,join:Y}=k("node:path"),{cwd:qe}=z,Ye=k("node:readline"),{pipeline:Ze}=k("node:stream/promises"),{homedir:Ve,tmpdir:le}=k("node:os"),{promisify:Ke}=k("node:util");var Qe=Object.defineProperty,et=f((r,e)=>Qe(r,"name",{value:e,configurable:!0}),"a$1"),Z=Object.defineProperty,tt=et((r,e)=>{let t={};for(var n in r)Z(t,n,{get:r[n],enumerable:!0});return e||Z(t,Symbol.toStringTag,{value:"Module"}),t},"__exportAll"),rt=Object.defineProperty,p=f((r,e)=>rt(r,"name",{value:e,configurable:!0}),"a");const nt=/^[A-Za-z]:\//;function F(r=""){return r&&r.replace(/\\/g,"/").replace(nt,e=>e.toUpperCase())}f(F,"P");p(F,"p");const ot=/^[/\\]{2}/,st=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,ue=/^[A-Za-z]:$/,V=/^\/([A-Za-z]:)?$/,pe=p(function(r){if(r.length===0)return".";r=F(r);let e=r.match(ot),t=D(r),n=r[r.length-1]==="/";return r=R(r,!t),r.length===0?t?"/":n?"./":".":(n&&(r+="/"),ue.test(r)&&(r+="/"),e?t?`//${r}`:`//./${r}`:t&&!D(r)?`/${r}`:r)},"g"),K=p(function(...r){let e="";for(let t of r)if(t)if(e.length>0){let n=e[e.length-1]==="/",o=t[0]==="/";n&&o?e+=t.slice(1):e+=n||o?t:`/${t}`}else e+=t;return pe(e)},"_");function de(){return typeof process.cwd=="function"?process.cwd().replace(/\\/g,"/"):"/"}f(de,"st");p(de,"v");const $=p(function(...r){r=r.map(n=>F(n));let e="",t=!1;for(let n=r.length-1;n>=-1&&!t;n--){let o=n>=0?r[n]:de();!o||o.length===0||(e=`${o}/${e}`,t=D(o))}return e=R(e,!t),t&&!D(e)?`/${e}`:e.length>0?e:"."},"y");function R(r,e){let t="",n=0,o=-1,i=0,c=null;for(let s=0;s<=r.length;++s){if(s<r.length)c=r[s];else{if(c==="/")break;c="/"}if(c==="/"){if(!(o===s-1||i===1))if(i===2){if(t.length<2||n!==2||t[t.length-1]!=="."||t[t.length-2]!=="."){if(t.length>2){let a=t.lastIndexOf("/");a===-1?(t="",n=0):(t=t.slice(0,a),n=t.length-1-t.lastIndexOf("/")),o=s,i=0;continue}else if(t.length>0){t="",n=0,o=s,i=0;continue}}e&&(t+=t.length>0?"/..":"..",n=2)}else t.length>0?t+=`/${r.slice(o+1,s)}`:t=r.slice(o+1,s),n=s-o-1;o=s,i=0}else c==="."&&i!==-1?++i:i=-1}return t}f(R,"W");p(R,"b");const D=p(function(r){return st.test(r)},"x"),he=p(function(r,e){let t=$(r).replace(V,"$1").split("/"),n=$(e).replace(V,"$1").split("/");if(n[0][1]===":"&&t[0][1]===":"&&t[0]!==n[0])return n.join("/");let o=[...t];for(let i of o){if(n[0]!==i)break;t.shift(),n.shift()}return[...t.map(()=>".."),...n].join("/")},"S"),fe=p(function(r){let e=F(r).replace(/\/$/,"").split("/").slice(0,-1);return e.length===1&&ue.test(e[0])&&(e[0]+="/"),e.join("/")||(D(r)?"/":".")},"C"),me=p(function(r,e){let t=F(r).split("/"),n="";for(let o=t.length-1;o>=0;o--){let i=t[o];if(i){n=i;break}}return e&&n.endsWith(e)?n.slice(0,-e.length):n},"ne");var _=p((r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),"w"),O=Me(import.meta.url);const it=/^path$/i,Q={key:"PATH",value:""};function ge(r){for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e)||!it.test(e))continue;let t=r[e];return t?{key:e,value:t}:Q}return Q}f(ge,"pt");p(ge,"D");function we(r,e){let t=e.value.split(q),n=[],o=r,i;do n.push(We(o,"node_modules",".bin")),i=o,o=Xe(o);while(o!==i);let c=n.concat(t).join(q);return{key:e.key,value:c}}f(we,"ut");p(we,"O");function ve(r,e){let t={...process.env,...e},n=we(r,ge(t));return t[n.key]=n.value,t}f(ve,"ft");p(ve,"k");const at=p(r=>{let e=r.length,t=new ae,n=p(()=>{--e===0&&t.emit("end")},"r");for(let o of r)o.pipe(t,{end:!1}),o.on("end",n);return t},"A");var ct=_(((r,e)=>{e.exports=i,i.sync=c;var t=O("fs");function n(s,a){var l=a.pathExt===void 0?process.env.PATHEXT:a.pathExt;if(!l||(l=l.split(";"),l.indexOf("")!==-1))return!0;for(var u=0;u<l.length;u++){var h=l[u].toLowerCase();if(h&&s.substr(-h.length).toLowerCase()===h)return!0}return!1}f(n,"n"),p(n,"r");function o(s,a,l){return!s.isSymbolicLink()&&!s.isFile()?!1:n(a,l)}f(o,"s"),p(o,"i");function i(s,a,l){t.stat(s,function(u,h){l(u,u?!1:o(h,s,a))})}f(i,"i"),p(i,"a");function c(s,a){return o(t.statSync(s),s,a)}f(c,"c"),p(c,"o")})),lt=_(((r,e)=>{e.exports=n,n.sync=o;var t=O("fs");function n(s,a,l){t.stat(s,function(u,h){l(u,u?!1:i(h,a))})}f(n,"n"),p(n,"r");function o(s,a){return i(t.statSync(s),a)}f(o,"s"),p(o,"i");function i(s,a){return s.isFile()&&c(s,a)}f(i,"i"),p(i,"a");function c(s,a){var l=s.mode,u=s.uid,h=s.gid,d=a.uid===void 0?process.getuid&&process.getuid():a.uid,m=a.gid===void 0?process.getgid&&process.getgid():a.gid,g=64,v=8,E=1,S=g|v;return l&E||l&v&&h===m||l&g&&u===d||l&S&&d===0}f(c,"c"),p(c,"o")})),ut=_(((r,e)=>{O("fs");var t=process.platform==="win32"||global.TESTING_WINDOWS?ct():lt();e.exports=n,n.sync=o;function n(i,c,s){if(typeof c=="function"&&(s=c,c={}),!s){if(typeof Promise!="function")throw TypeError("callback not provided");return new Promise(function(a,l){n(i,c||{},function(u,h){u?l(u):a(h)})})}t(i,c||{},function(a,l){a&&(a.code==="EACCES"||c&&c.ignoreErrors)&&(a=null,l=!1),s(a,l)})}f(n,"n"),p(n,"r");function o(i,c){try{return t.sync(i,c||{})}catch(s){if(c&&c.ignoreErrors||s.code==="EACCES")return!1;throw s}}f(o,"s"),p(o,"i")})),pt=_(((r,e)=>{let t=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",n=O("path"),o=t?";":":",i=ut(),c=p(l=>Object.assign(Error(`not found: ${l}`),{code:"ENOENT"}),"o"),s=p((l,u)=>{let h=u.colon||o,d=l.match(/\//)||t&&l.match(/\\/)?[""]:[...t?[process.cwd()]:[],...(u.path||process.env.PATH||"").split(h)],m=t?u.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",g=t?m.split(h):[""];return t&&l.indexOf(".")!==-1&&g[0]!==""&&g.unshift(""),{pathEnv:d,pathExt:g,pathExtExe:m}},"s"),a=p((l,u,h)=>{typeof u=="function"&&(h=u,u={}),u||={};let{pathEnv:d,pathExt:m,pathExtExe:g}=s(l,u),v=[],E=p(b=>new Promise((A,T)=>{if(b===d.length)return u.all&&v.length?A(v):T(c(l));let y=d[b],G=/^".*"$/.test(y)?y.slice(1,-1):y,P=n.join(G,l);A(S(!G&&/^\.[\\\/]/.test(l)?l.slice(0,2)+P:P,b,0))}),"d"),S=p((b,A,T)=>new Promise((y,G)=>{if(T===m.length)return y(E(A+1));let P=m[T];i(b+P,{pathExt:g},(ze,Ie)=>{if(!ze&&Ie)if(u.all)v.push(b+P);else return y(b+P);return y(S(b,A,T+1))})}),"f");return h?E(0).then(b=>h(null,b),h):E(0)},"c");e.exports=a,a.sync=(l,u)=>{u||={};let{pathEnv:h,pathExt:d,pathExtExe:m}=s(l,u),g=[];for(let v=0;v<h.length;v++){let E=h[v],S=/^".*"$/.test(E)?E.slice(1,-1):E,b=n.join(S,l),A=!S&&/^\.[\\\/]/.test(l)?l.slice(0,2)+b:b;for(let T=0;T<d.length;T++){let y=A+d[T];try{if(i.sync(y,{pathExt:m}))if(u.all)g.push(y);else return y}catch{}}}if(u.all&&g.length)return g;if(u.nothrow)return null;throw c(l)}})),dt=_(((r,e)=>{let t=p((n={})=>{let o=n.env||process.env;return(n.platform||process.platform)==="win32"?Object.keys(o).reverse().find(i=>i.toUpperCase()==="PATH")||"Path":"PATH"},"n");e.exports=t,e.exports.default=t})),ht=_(((r,e)=>{let t=O("path"),n=pt(),o=dt();function i(s,a){let l=s.options.env||process.env,u=process.cwd(),h=s.options.cwd!=null,d=h&&process.chdir!==void 0&&!process.chdir.disabled;if(d)try{process.chdir(s.options.cwd)}catch{}let m;try{m=n.sync(s.command,{path:l[o({env:l})],pathExt:a?t.delimiter:void 0})}catch{}finally{d&&process.chdir(u)}return m&&=t.resolve(h?s.options.cwd:"",m),m}f(i,"i"),p(i,"a");function c(s){return i(s)||i(s,!0)}f(c,"c"),p(c,"o"),e.exports=c})),ft=_(((r,e)=>{let t=/([()\][%!^"`<>&|;, *?])/g;function n(i){return i=i.replace(t,"^$1"),i}f(n,"n"),p(n,"r");function o(i,c){return i=`${i}`,i=i.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),i=i.replace(/(?=(\\+?)?)\1$/,"$1$1"),i=`"${i}"`,i=i.replace(t,"^$1"),c&&(i=i.replace(t,"^$1")),i}f(o,"s"),p(o,"i"),e.exports.command=n,e.exports.argument=o})),mt=_(((r,e)=>{e.exports=/^#!(.*)/})),gt=_(((r,e)=>{let t=mt();e.exports=(n="")=>{let o=n.match(t);if(!o)return null;let[i,c]=o[0].replace(/#! ?/,"").split(" "),s=i.split("/").pop();return s==="env"?c:c?`${s} ${c}`:s}})),wt=_(((r,e)=>{let t=O("fs"),n=gt();function o(i){let c=Buffer.alloc(150),s;try{s=t.openSync(i,"r"),t.readSync(s,c,0,150,0),t.closeSync(s)}catch{}return n(c.toString())}f(o,"s"),p(o,"i"),e.exports=o})),vt=_(((r,e)=>{let t=O("path"),n=ht(),o=ft(),i=wt(),c=process.platform==="win32",s=/\.(?:com|exe)$/i,a=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function l(d){d.file=n(d);let m=d.file&&i(d.file);return m?(d.args.unshift(d.file),d.command=m,n(d)):d.file}f(l,"p"),p(l,"l");function u(d){if(!c)return d;let m=l(d),g=!s.test(m);if(d.options.forceShell||g){let v=a.test(m);d.command=t.normalize(d.command),d.command=o.command(d.command),d.args=d.args.map(E=>o.argument(E,v)),d.args=["/d","/s","/c",`"${[d.command].concat(d.args).join(" ")}"`],d.command=process.env.comspec||"cmd.exe",d.options.windowsVerbatimArguments=!0}return d}f(u,"u"),p(u,"u");function h(d,m,g){m&&!Array.isArray(m)&&(g=m,m=null),m=m?m.slice(0):[],g=Object.assign({},g);let v={command:d,args:m,options:g,file:void 0,original:{command:d,args:m}};return g.shell?v:u(v)}f(h,"d"),p(h,"d"),e.exports=h})),$t=_(((r,e)=>{let t=process.platform==="win32";function n(s,a){return Object.assign(Error(`${a} ${s.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${a} ${s.command}`,path:s.command,spawnargs:s.args})}f(n,"n"),p(n,"r");function o(s,a){if(!t)return;let l=s.emit;s.emit=function(u,h){if(u==="exit"){let d=i(h,a);if(d)return l.call(s,"error",d)}return l.apply(s,arguments)}}f(o,"s"),p(o,"i");function i(s,a){return t&&s===1&&!a.file?n(a.original,"spawn"):null}f(i,"i"),p(i,"a");function c(s,a){return t&&s===1&&!a.file?n(a.original,"spawnSync"):null}f(c,"c"),p(c,"o"),e.exports={hookChildProcess:o,verifyENOENT:i,verifyENOENTSync:c,notFoundError:n}})),bt=_(((r,e)=>{let t=O("child_process"),n=vt(),o=$t();function i(s,a,l){let u=n(s,a,l),h=t.spawn(u.command,u.args,u.options);return o.hookChildProcess(h,u),h}f(i,"i"),p(i,"a");function c(s,a,l){let u=n(s,a,l),h=t.spawnSync(u.command,u.args,u.options);return h.error=h.error||o.verifyENOENTSync(h.status,u),h}f(c,"c"),p(c,"o"),e.exports=i,e.exports.spawn=i,e.exports.sync=c,e.exports._parse=n,e.exports._enoent=o}))(),ee=class extends Error{static{f(this,"L")}static{p(this,"U")}result;output;get exitCode(){if(this.result.exitCode!==null)return this.result.exitCode}constructor(r,e){super(`Process exited with non-zero status (${r.exitCode})`),this.result=r,this.output=e}};const _t={timeout:void 0,persist:!1},Et={windowsHide:!0};function $e(r,e){return{command:Je(r),args:e??[]}}f($e,"Pt");p($e,"K");function be(r){let e=new AbortController;for(let t of r){if(t.aborted)return e.abort(),t;t.addEventListener("abort",()=>{e.abort(t.reason)},{signal:e.signal})}return e.signal}f(be,"Tt");p(be,"q");async function B(r){let e="";for await(let t of r)e+=t.toString();return e}f(B,"H");p(B,"J");var yt=class{static{f(this,"At")}static{p(this,"Y")}_process;_aborted=!1;_options;_command;_args;_resolveClose;_processClosed;_thrownError;get process(){return this._process}get pid(){return this._process?.pid}get exitCode(){if(this._process&&this._process.exitCode!==null)return this._process.exitCode}constructor(r,e,t){this._options={..._t,...t},this._command=r,this._args=e??[],this._processClosed=new Promise(n=>{this._resolveClose=n})}kill(r){return this._process?.kill(r)===!0}get aborted(){return this._aborted}get killed(){return this._process?.killed===!0}pipe(r,e,t){return xt(r,e,{...t,stdin:this})}async*[Symbol.asyncIterator](){let r=this._process;if(!r)return;let e=[];this._streamErr&&e.push(this._streamErr),this._streamOut&&e.push(this._streamOut);let t=at(e),n=Ye.createInterface({input:t});for await(let o of n)yield o.toString();if(await this._processClosed,r.removeAllListeners(),this._thrownError)throw this._thrownError;if(this._options?.throwOnError&&this.exitCode!==0&&this.exitCode!==void 0)throw new ee(this)}async _waitForOutput(){let r=this._process;if(!r)throw Error("No process was started");let[e,t]=await Promise.all([this._streamOut?B(this._streamOut):"",this._streamErr?B(this._streamErr):""]);if(await this._processClosed,this._options?.stdin&&await this._options.stdin,r.removeAllListeners(),this._thrownError)throw this._thrownError;let n={stderr:t,stdout:e,exitCode:this.exitCode};if(this._options.throwOnError&&this.exitCode!==0&&this.exitCode!==void 0)throw new ee(this,n);return n}then(r,e){return this._waitForOutput().then(r,e)}_streamOut;_streamErr;spawn(){let r=qe(),e=this._options,t={...Et,...e.nodeOptions},n=[];this._resetState(),e.timeout!==void 0&&n.push(AbortSignal.timeout(e.timeout)),e.signal!==void 0&&n.push(e.signal),e.persist===!0&&(t.detached=!0),n.length>0&&(t.signal=be(n)),t.env=ve(r,t.env);let{command:o,args:i}=$e(this._command,this._args),c=(0,bt._parse)(o,i,t),s=ce(c.command,c.args,c.options);if(s.stderr&&(this._streamErr=s.stderr),s.stdout&&(this._streamOut=s.stdout),this._process=s,s.once("error",this._onError),s.once("close",this._onClose),e.stdin!==void 0&&s.stdin&&e.stdin.process){let{stdout:a}=e.stdin.process;a&&a.pipe(s.stdin)}}_resetState(){this._aborted=!1,this._processClosed=new Promise(r=>{this._resolveClose=r}),this._thrownError=void 0}_onError=p(r=>{if(r.name==="AbortError"&&(!(r.cause instanceof Error)||r.cause.name!=="TimeoutError")){this._aborted=!0;return}this._thrownError=r},"_onError");_onClose=p(()=>{this._resolveClose&&this._resolveClose()},"_onClose")};const U=p((r,e,t)=>{let n=new yt(r,e,t);return n.spawn(),n},"X"),xt=U;var kt=tt({detectPackageManager:p(()=>W,"detectPackageManager"),installDependencies:p(()=>Te,"installDependencies"),packageManagers:p(()=>j,"packageManagers")});async function _e(r,e,t={}){let n=pe(r).split("/");for(;n.length>0;){let o=await e(n.join("/")||"/");if(o||!t.includeParentDirs)return o;n.pop()}}f(_e,"Mt");p(_e,"se");function Ee(r){let e;return()=>(e===void 0&&(e=r().then(t=>(e=t,e))),e)}f(Ee,"zt");p(Ee,"ce");const Tt=Ee(async()=>{if(globalThis.process?.versions?.webcontainer)return!1;try{let{exitCode:r}=await U("corepack",["--version"]);return r===0}catch{return!1}});async function ye(r,e,t={}){let n=r!=="npm"&&r!=="bun"&&r!=="deno"&&t.corepack!==!1&&await Tt()?["corepack",[r,...e]]:[r,e],{exitCode:o,stdout:i,stderr:c}=await U(n[0],n[1],{nodeOptions:{cwd:$(t.cwd||process.cwd()),env:t.env,stdio:t.silent?"pipe":"inherit"}});if(o!==0)throw Error(`\`${n.flat().join(" ")}\` failed.${t.silent?["",i,c].join(`
2
- `):""}`)}f(ye,"Lt");p(ye,"le");async function xe(r={}){let e=r.cwd||process.cwd(),t={...process.env,...r.env},n=(typeof r.packageManager=="string"?j.find(o=>o.name===r.packageManager):r.packageManager)||await W(r.cwd||process.cwd());if(!n)throw Error("No package manager auto-detected.");return{cwd:e,env:t,silent:r.silent??!1,packageManager:n,dev:r.dev??!1,workspace:r.workspace,global:r.global??!1,dry:r.dry??!1,corepack:r.corepack??!0}}f(xe,"Ht");p(xe,"ue");function ke(r){let[e,t]=(r||"").split("@"),[n,o]=t?.split("+")||[];if(e&&e!=="-"&&/^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(e))return{name:e,version:n,buildMeta:o};let i=(e||"").replace(/\W+/g,"");return{name:i,version:n,buildMeta:o,warnings:[`Abnormal characters found in \`packageManager\` field, sanitizing from \`${e}\` to \`${i}\``]}}f(ke,"Dt");p(ke,"de");const j=[{name:"npm",command:"npm",lockFile:"package-lock.json"},{name:"pnpm",command:"pnpm",lockFile:"pnpm-lock.yaml",files:["pnpm-workspace.yaml"]},{name:"bun",command:"bun",lockFile:["bun.lockb","bun.lock"]},{name:"yarn",command:"yarn",lockFile:"yarn.lock",files:[".yarnrc.yml"]},{name:"deno",command:"deno",lockFile:"deno.lock",files:["deno.json"]}];async function W(r,e={}){let t=await _e($(r||"."),async n=>{if(!e.ignorePackageJSON){let o=K(n,"package.json");if(x(o)){let i=JSON.parse(await ie(o,"utf8"));if(i?.packageManager){let{name:c,version:s="0.0.0",buildMeta:a,warnings:l}=ke(i.packageManager);if(c){let u=s.split(".")[0],h=j.find(d=>d.name===c&&d.majorVersion===u)||j.find(d=>d.name===c);return{name:c,command:c,version:s,majorVersion:u,buildMeta:a,warnings:l,files:h?.files,lockFile:h?.lockFile}}}}if(x(K(n,"deno.json")))return j.find(i=>i.name==="deno")}if(!e.ignoreLockFile){for(let o of j)if([o.lockFile,o.files].flat().filter(Boolean).some(i=>x($(n,i))))return{...o}}},{includeParentDirs:e.includeParentDirs??!0});if(!t&&!e.ignoreArgv){let n=process.argv[1];if(n){for(let o of j)if(RegExp(`[/\\\\]\\.?${o.command}`).test(n))return o}}return t}f(W,"Z$1");p(W,"$");async function Te(r={}){let e=await xe(r),t=r.frozenLockFile?{npm:["ci"],yarn:["install","--immutable"],bun:["install","--frozen-lockfile"],pnpm:["install","--frozen-lockfile"],deno:["install","--frozen"]}[e.packageManager.name]:["install"];return r.ignoreWorkspace&&e.packageManager.name==="pnpm"&&t.push("--ignore-workspace"),e.dry||await ye(e.packageManager.command,t,{cwd:e.cwd,silent:e.silent,corepack:e.corepack}),{exec:{command:e.packageManager.command,args:t}}}f(Te,"It");p(Te,"fe");const Ct=Object.defineProperty({__proto__:null,a:$,i:he,n:me,r:fe,t:kt},Symbol.toStringTag,{value:"Module"});var Ot=Object.defineProperty,w=f((r,e)=>Ot(r,"name",{value:e,configurable:!0}),"o");async function Ce(r,e,t={}){const n=e+".json",o=JSON.parse(await ie(n,"utf8").catch(()=>"{}")),i=(await I(r,{method:"HEAD",headers:t.headers}).catch(()=>{}))?.headers.get("etag");if(o.etag===i&&x(e))return;typeof i=="string"&&(o.etag=i);const c=await I(r,{headers:t.headers});if(c.status>=400)throw new Error(`Failed to download ${r}: ${c.status} ${c.statusText}`);const s=se(e);await Ke(Re)(c.body,s),await Be(n,JSON.stringify(o),"utf8")}f(Ce,"q");w(Ce,"download");const St=/^(?<repo>[-\w.]+\/[-\w.]+)(?<subdir>[^#]+)?(?<ref>#[-\w./@]+)?/,At=/^(?<repo>[-\w.]+(?:\/[-\w.]+)+?)(?:::(?<subdir>[^#]*))?(?<ref>#[-\w./@]+)?$/;function N(r,e){const t=e?.expandRepo||r.includes("::"),n=r.match(t?At:St)?.groups||{},o=t?n.subdir?"/"+n.subdir:"/":n.subdir||"/";return{repo:n.repo||"",subdir:o,ref:n.ref?n.ref.slice(1):"main"}}f(N,"x");w(N,"parseGitURI");function C(...r){process.env.DEBUG&&console.debug("[giget]",...r)}f(C,"$");w(C,"debug");async function I(r,e={}){e.headers?.["sec-fetch-mode"]&&(e.mode=e.headers["sec-fetch-mode"]);const t=await fetch(r,{...e,headers:X(e.headers)}).catch(n=>{throw new Error(`Failed to download ${r}: ${n}`,{cause:n})});if(e.validateStatus&&t.status>=400)throw new Error(`Failed to fetch ${r}: ${t.status} ${t.statusText}`);return t}f(I,"v");w(I,"sendFetch");function Oe(){const r=process.env.XDG_CACHE_HOME?$(process.env.XDG_CACHE_HOME,"giget"):$(Ve(),".cache/giget");if(process.platform==="win32"){const e=$(le(),"giget");if(!x(e)&&x(r))try{He(r,e)}catch{}return e}return r}f(Oe,"ee");w(Oe,"cacheDirectory");function X(r={}){const e={};for(const[t,n]of Object.entries(r))n&&(e[t.toLowerCase()]=n);return e}f(X,"F");w(X,"normalizeHeaders");function Se(){return process.env.SHELL?process.env.SHELL:process.platform==="win32"?"cmd.exe":"/bin/bash"}f(Se,"te");w(Se,"currentShell");function jt(r){r=$(r);const e=Se();console.info(`(experimental) Opening shell in ${he(process.cwd(),r)}...`),Ue(e,[],{cwd:r,shell:!0,stdio:"inherit"})}f(jt,"re");w(jt,"startShell");const Pt=w((r,e)=>{const t=Ae(r);return{name:t.name,version:t.subdir?`${t.version||"default"}-${t.subdir.replaceAll("/","-")}`:t.version,tar:w(({auth:n}={})=>je(t,n??e.auth),"tar")}},"git");function Ae(r,e={}){const t=e.cwd??process.cwd();let n=r.replace(/#.*$/,""),o;if(/^[./]/.test(r))n=$(t,n);else if(/^https?:\/\//.test(n)){const u=/^(https?:\/\/[^/]+)\/([\w.-]+\/[\w.-]+?)(?:\.git)?(?:\/(.+))?$/.exec(n);if(u){const[,h,d,m]=u;n=`${h}/${d}`,m&&(o=m)}}else if(n.includes("@")){const u=/^(.*?:[\w.-]+\/[\w.-]+?)(?:\.git)?(?:\/(.+))?$/.exec(n);if(u){const[,h,d]=u;n=h,d&&(o=d)}}else{const u={"github:":"https://github.com/","gh:":"https://github.com/","gitlab:":"https://gitlab.com/","bitbucket:":"https://bitbucket.org/","sourcehut:":"https://git.sr.ht/~"},h=/^(.+?:)/.exec(n)?.at(1);h&&u[h]?n=n.replace(h,u[h]):h||(n=`${(process.env.GIGET_GIT_HOST||"https://github.com/").replace(/\/$/,"")}/${n}`);const d=/^(https?:\/\/[^/]+\/~?[\w.-]+\/[\w.-]+?)(?:\.git)?(?:\/(.+))?$/.exec(n);if(d){const[,m,g]=d;n=m,g&&(o=g)}}const i=n.replace(/^https?:\/\//,"").replace(/^.+@/,"").replace(/(\.git)?(#.*)?$/,"").replace(/^\W+/,"").replaceAll(/[:/]/g,"-"),[c,s]=/#(.+)$/.exec(r)?.at(1)?.split(":")??[],a=c||void 0,l=s||o;return{uri:n,name:i,...a&&{version:a},...l&&{subdir:l}}}f(Ae,"ie");w(Ae,"parseGitCloneURI");async function je(r,e){const t=await Le(Y(le(),"giget-git-"));if(e&&/[\r\n]/.test(e))throw new Error("Auth token must not contain newline characters");const n={...process.env,GIT_TERMINAL_PROMPT:"0"};e&&(n.GIT_CONFIG_COUNT="1",n.GIT_CONFIG_KEY_0="http.extraHeader",n.GIT_CONFIG_VALUE_0=`Authorization: Bearer ${e}`);const o={env:n,timeout:6e4},i=Pe(),c=w(a=>L(a,o,i),"gitExec"),s=w(a=>L(a,{...o,cwd:t},i),"gitExecIn");try{const a=["clone","--progress","--depth","1"];r.subdir&&a.push("--filter=blob:none","--sparse","--no-checkout"),r.version&&a.push("--branch",r.version),a.push("--",r.uri,t);try{i.update("Cloning..."),await c(a),i.update("Cloned.")}catch(g){if(!r.version)throw g;C("Shallow clone failed, falling back to full clone:",g),i.update("Shallow clone failed, cloning..."),await M(t,{recursive:!0,force:!0}),await H(t,{recursive:!0}),await s(["init"]),await s(["remote","add","origin",r.uri]),await s(["fetch","origin"]),await s(["checkout",r.version]),i.update("Fetched.")}r.subdir&&(i.update(`Sparse checkout ${r.subdir}...`),await s(["sparse-checkout","set",r.subdir]),await s(["checkout"])),i.update("Packing...");const l=r.subdir?Y(t,r.subdir):t,{create:u}=await import("../packem_chunks/tar.js").then(g=>g.t);i.done();const h=u({gzip:!0,cwd:l,filter:w(g=>!g.startsWith(".git/")&&g!==".git"&&!g.startsWith("./.git/")&&g!=="./.git","filter")},["."]).pipe(new ae);let d=!1;const m=w(()=>{d||(d=!0,M(t,{recursive:!0,force:!0}))},"cleanup");return h.on("end",m),h.on("error",m),h.on("close",m),h}catch(a){throw i.done(),await M(t,{recursive:!0,force:!0}),a}}f(je,"se");w(je,"_cloneAndTar");const te=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];function L(r,e,t){return new Promise((n,o)=>{const i=ce("git",r,{...e,stdio:["ignore","pipe","pipe"]});i.stdout.resume();let c="";i.stderr?.on("data",s=>{const a=s.toString();for(const l of a.split(/[\r\n]/)){const u=l.trim();u&&(c=u)}t&&t.update(c)}),i.on("close",s=>{s===0?n(c):o(new Error(`git ${r[0]} exited with code ${s}. Is git installed?`))}),i.on("error",s=>{s.code==="ENOENT"?o(new Error("git is not installed or not found in PATH")):o(s)})})}f(L,"G");w(L,"_gitSpawn");function Pe(){if(!process.stderr.isTTY)return{update(o){},done(){}};let r="",e=0;const t=w(()=>{const o=te[e%te.length];e++,process.stderr.write(`\x1B[2K\r\x1B[2m${o} ${r}\x1B[0m`)},"render"),n=setInterval(t,80);return{update(o){r=o,t()},done(){clearInterval(n),process.stderr.write("\x1B[2K\r")}}}f(Pe,"ne");w(Pe,"_createStatus");const re=w(async(r,e)=>{if(r.endsWith(".json"))return await ne(r,e);const t=new URL(r);let n=me(t.pathname);try{const o=await I(t.href,{method:"HEAD",validateStatus:!0,headers:{authorization:e.auth?`Bearer ${e.auth}`:void 0}});if((o.headers.get("content-type")||"").includes("application/json"))return await ne(r,e);const i=o.headers.get("content-disposition")?.match(/filename="?(.+)"?/)?.[1];i&&(n=i.split(".")[0])}catch(o){C(`Failed to fetch HEAD for ${t.href}:`,o)}return{name:`${n}-${t.href.slice(0,8)}`,version:"",subdir:"",tar:t.href,defaultDir:n,headers:{Authorization:e.auth?`Bearer ${e.auth}`:void 0}}},"http"),ne=w(async(r,e)=>{const t=await(await I(r,{validateStatus:!0,headers:{authorization:e.auth?`Bearer ${e.auth}`:void 0}})).json();if(!t.tar||!t.name)throw new Error(`Invalid template info from ${r}. name or tar fields are missing!`);return t},"_httpJSON"),oe=w((r,e)=>{const t=N(r),n=process.env.GIGET_GITHUB_URL||"https://api.github.com";return{name:t.repo.replace("/","-"),version:t.ref,subdir:t.subdir,headers:{Authorization:e.auth?`Bearer ${e.auth}`:void 0,Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"},url:`${n.replace("api.github.com","github.com")}/${t.repo}/tree/${t.ref}${t.subdir}`,tar:`${n}/repos/${t.repo}/tarball/${t.ref}`}},"github"),zt=w((r,e)=>{const t=N(r,{expandRepo:!0}),n=process.env.GIGET_GITLAB_URL||"https://gitlab.com";return{name:t.repo.replace("/","-"),version:t.ref,subdir:t.subdir,headers:{authorization:e.auth?`Bearer ${e.auth}`:void 0,"sec-fetch-mode":"same-origin"},url:`${n}/${t.repo}/tree/${t.ref}${t.subdir}`,tar:`${n}/${t.repo}/-/archive/${t.ref}.tar.gz`}},"gitlab"),It=w((r,e)=>{const t=N(r);return{name:t.repo.replace("/","-"),version:t.ref,subdir:t.subdir,headers:{authorization:e.auth?`Bearer ${e.auth}`:void 0},url:`https://bitbucket.com/${t.repo}/src/${t.ref}${t.subdir}`,tar:`https://bitbucket.org/${t.repo}/get/${t.ref}.tar.gz`}},"bitbucket"),Dt=w((r,e)=>{const t=N(r);return{name:t.repo.replace("/","-"),version:t.ref,subdir:t.subdir,headers:{authorization:e.auth?`Bearer ${e.auth}`:void 0},url:`https://git.sr.ht/~${t.repo}/tree/${t.ref}/item${t.subdir}`,tar:`https://git.sr.ht/~${t.repo}/archive/${t.ref}.tar.gz`}},"sourcehut"),Ft={http:re,https:re,git:Pt,github:oe,gh:oe,gitlab:zt,bitbucket:It,sourcehut:Dt},Nt="https://raw.githubusercontent.com/unjs/giget/main/templates",Mt=w((r=Nt,e={})=>(async t=>{const n=Date.now(),o=`${r}/${t}.json`,i=await I(o,{headers:{authorization:e.auth?`Bearer ${e.auth}`:void 0}});if(i.status>=400)throw new Error(`Failed to download ${t} template info from ${o}: ${i.status} ${i.statusText}`);const c=await i.json();if(!c.tar||!c.name)throw new Error(`Invalid template info from ${o}. name or tar fields are missing!`);return C(`Fetched ${t} template info from ${o} in ${Date.now()-n}ms`),c}),"registryProvider"),Gt=/^([\w+-.]+):/;async function Ht(r,e={}){e.registry=process.env.GIGET_REGISTRY??e.registry,e.auth=process.env.GIGET_AUTH??e.auth;const t=e.registry===!1?void 0:Mt(e.registry,{auth:e.auth});let n=e.provider||(t?"registry":"github"),o=r;const i=r.match(Gt);i&&(n=i[1],o=r.slice(i[0].length),(n==="http"||n==="https")&&(o=r)),n.endsWith("+git")&&(o=`${n.slice(0,-4)}:${o}`,n="git");const c=e.providers?.[n]||Ft[n]||t;if(!c)throw new Error(`Unsupported provider: ${n}`);const s=await Promise.resolve().then(()=>c(o,{auth:e.auth})).catch(m=>{throw new Error(`Failed to download template from ${n}: ${m.message}`)});if(!s)throw new Error(`Failed to resolve template from ${n}`);s.name=(s.name||"template").replace(/[^\da-z-]/gi,"-"),s.defaultDir=(s.defaultDir||s.name).replace(/[^\da-z-]/gi,"-");const a=$($(Oe(),n,s.name),(s.version||s.name)+".tar.gz");if(e.preferOffline&&x(a)&&(e.offline=!0),!e.offline){await H(fe(a),{recursive:!0});const m=Date.now();if(typeof s.tar=="function"){const g=s.tar;await(async()=>{const v=await g({auth:e.auth});await Ze(v instanceof J?v:J.fromWeb(v),se(a))})().catch(v=>{if(!x(a))throw v;C("Download error. Using cached version:",v),e.offline=!0})}else await Ce(s.tar,a,{headers:{Authorization:e.auth?`Bearer ${e.auth}`:void 0,...X(s.headers)}}).catch(g=>{if(!x(a))throw g;C("Download error. Using cached version:",g),e.offline=!0});C(`Downloaded to ${a} in ${Date.now()-m}ms`)}if(!x(a))throw new Error(`Tarball not found: ${a} (offline: ${e.offline})`);const l=$($(e.cwd||"."),e.dir||s.defaultDir);if(e.forceClean&&await M(l,{recursive:!0,force:!0}),!e.force&&x(l)&&Ge(l).length>0)throw new Error(`Destination ${l} already exists.`);await H(l,{recursive:!0});const u=Date.now(),h=s.subdir?.replace(/^\//,"")||"",{extract:d}=await import("../packem_chunks/tar.js").then(m=>m.t);if(await d({file:a,cwd:l,onReadEntry(m){m.path=m.path.split("/").splice(1).join("/"),h&&(m.path.startsWith(h+"/")?m.path=m.path.slice(h.length):m.path="")}}),C(`Extracted to ${l} in ${Date.now()-u}ms`),e.install){C("Installing dependencies...");const{installDependencies:m}=await Promise.resolve().then(()=>Ct).then(g=>g.t);await m({cwd:l,silent:e.silent,...typeof e.install=="object"?e.install:{}})}return{...s,source:o,dir:l}}f(Ht,"fe");w(Ht,"downloadTemplate");export{Ht as f,tt as p};
1
+ var De=Object.defineProperty;var f=(r,e)=>De(r,"name",{value:e,configurable:!0});import{createRequire as Fe}from"node:module";const Ne=Fe(import.meta.url),z=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=f(r=>{if(typeof z<"u"&&z.versions&&z.versions.node){const[e,t]=z.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return z.getBuiltinModule(r)}return Ne(r)},"__cjs_getBuiltinModule"),{createRequire:Me}=k("node:module"),{existsSync:x,createWriteStream:se,readdirSync:Ge,renameSync:He}=k("node:fs"),{readFile:ie,mkdir:H,rm:M,writeFile:Be,mkdtemp:Le}=k("node:fs/promises"),{PassThrough:ae,Readable:q,pipeline:Re}=k("node:stream"),{spawn:ce,spawnSync:Ue}=k("node:child_process"),{delimiter:J,resolve:We,dirname:Xe,normalize:qe,join:Y}=k("node:path"),{cwd:Je}=z,Ye=k("node:readline"),{pipeline:Ze}=k("node:stream/promises"),{homedir:Ve,tmpdir:le}=k("node:os"),{promisify:Ke}=k("node:util");var Qe=Object.defineProperty,et=f((r,e)=>Qe(r,"name",{value:e,configurable:!0}),"a$1"),Z=Object.defineProperty,tt=et((r,e)=>{let t={};for(var n in r)Z(t,n,{get:r[n],enumerable:!0});return e||Z(t,Symbol.toStringTag,{value:"Module"}),t},"__exportAll"),rt=Object.defineProperty,p=f((r,e)=>rt(r,"name",{value:e,configurable:!0}),"a");const nt=/^[A-Za-z]:\//;function F(r=""){return r&&r.replace(/\\/g,"/").replace(nt,e=>e.toUpperCase())}f(F,"P");p(F,"p");const ot=/^[/\\]{2}/,st=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,ue=/^[A-Za-z]:$/,V=/^\/([A-Za-z]:)?$/,pe=p(function(r){if(r.length===0)return".";r=F(r);let e=r.match(ot),t=D(r),n=r[r.length-1]==="/";return r=R(r,!t),r.length===0?t?"/":n?"./":".":(n&&(r+="/"),ue.test(r)&&(r+="/"),e?t?`//${r}`:`//./${r}`:t&&!D(r)?`/${r}`:r)},"g"),K=p(function(...r){let e="";for(let t of r)if(t)if(e.length>0){let n=e[e.length-1]==="/",o=t[0]==="/";n&&o?e+=t.slice(1):e+=n||o?t:`/${t}`}else e+=t;return pe(e)},"_");function de(){return typeof process.cwd=="function"?process.cwd().replace(/\\/g,"/"):"/"}f(de,"st");p(de,"v");const $=p(function(...r){r=r.map(n=>F(n));let e="",t=!1;for(let n=r.length-1;n>=-1&&!t;n--){let o=n>=0?r[n]:de();!o||o.length===0||(e=`${o}/${e}`,t=D(o))}return e=R(e,!t),t&&!D(e)?`/${e}`:e.length>0?e:"."},"y");function R(r,e){let t="",n=0,o=-1,i=0,c=null;for(let s=0;s<=r.length;++s){if(s<r.length)c=r[s];else{if(c==="/")break;c="/"}if(c==="/"){if(!(o===s-1||i===1))if(i===2){if(t.length<2||n!==2||t[t.length-1]!=="."||t[t.length-2]!=="."){if(t.length>2){let a=t.lastIndexOf("/");a===-1?(t="",n=0):(t=t.slice(0,a),n=t.length-1-t.lastIndexOf("/")),o=s,i=0;continue}else if(t.length>0){t="",n=0,o=s,i=0;continue}}e&&(t+=t.length>0?"/..":"..",n=2)}else t.length>0?t+=`/${r.slice(o+1,s)}`:t=r.slice(o+1,s),n=s-o-1;o=s,i=0}else c==="."&&i!==-1?++i:i=-1}return t}f(R,"W");p(R,"b");const D=p(function(r){return st.test(r)},"x"),he=p(function(r,e){let t=$(r).replace(V,"$1").split("/"),n=$(e).replace(V,"$1").split("/");if(n[0][1]===":"&&t[0][1]===":"&&t[0]!==n[0])return n.join("/");let o=[...t];for(let i of o){if(n[0]!==i)break;t.shift(),n.shift()}return[...t.map(()=>".."),...n].join("/")},"S"),fe=p(function(r){let e=F(r).replace(/\/$/,"").split("/").slice(0,-1);return e.length===1&&ue.test(e[0])&&(e[0]+="/"),e.join("/")||(D(r)?"/":".")},"C"),me=p(function(r,e){let t=F(r).split("/"),n="";for(let o=t.length-1;o>=0;o--){let i=t[o];if(i){n=i;break}}return e&&n.endsWith(e)?n.slice(0,-e.length):n},"ne");var _=p((r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),"w"),O=Me(import.meta.url);const it=/^path$/i,Q={key:"PATH",value:""};function ge(r){for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e)||!it.test(e))continue;let t=r[e];return t?{key:e,value:t}:Q}return Q}f(ge,"pt");p(ge,"D");function we(r,e){let t=e.value.split(J),n=[],o=r,i;do n.push(We(o,"node_modules",".bin")),i=o,o=Xe(o);while(o!==i);let c=n.concat(t).join(J);return{key:e.key,value:c}}f(we,"ut");p(we,"O");function ve(r,e){let t={...process.env,...e},n=we(r,ge(t));return t[n.key]=n.value,t}f(ve,"ft");p(ve,"k");const at=p(r=>{let e=r.length,t=new ae,n=p(()=>{--e===0&&t.emit("end")},"r");for(let o of r)o.pipe(t,{end:!1}),o.on("end",n);return t},"A");var ct=_(((r,e)=>{e.exports=i,i.sync=c;var t=O("fs");function n(s,a){var l=a.pathExt===void 0?process.env.PATHEXT:a.pathExt;if(!l||(l=l.split(";"),l.indexOf("")!==-1))return!0;for(var u=0;u<l.length;u++){var h=l[u].toLowerCase();if(h&&s.substr(-h.length).toLowerCase()===h)return!0}return!1}f(n,"n"),p(n,"r");function o(s,a,l){return!s.isSymbolicLink()&&!s.isFile()?!1:n(a,l)}f(o,"s"),p(o,"i");function i(s,a,l){t.stat(s,function(u,h){l(u,u?!1:o(h,s,a))})}f(i,"i"),p(i,"a");function c(s,a){return o(t.statSync(s),s,a)}f(c,"c"),p(c,"o")})),lt=_(((r,e)=>{e.exports=n,n.sync=o;var t=O("fs");function n(s,a,l){t.stat(s,function(u,h){l(u,u?!1:i(h,a))})}f(n,"n"),p(n,"r");function o(s,a){return i(t.statSync(s),a)}f(o,"s"),p(o,"i");function i(s,a){return s.isFile()&&c(s,a)}f(i,"i"),p(i,"a");function c(s,a){var l=s.mode,u=s.uid,h=s.gid,d=a.uid===void 0?process.getuid&&process.getuid():a.uid,m=a.gid===void 0?process.getgid&&process.getgid():a.gid,g=64,v=8,E=1,S=g|v;return l&E||l&v&&h===m||l&g&&u===d||l&S&&d===0}f(c,"c"),p(c,"o")})),ut=_(((r,e)=>{O("fs");var t=process.platform==="win32"||global.TESTING_WINDOWS?ct():lt();e.exports=n,n.sync=o;function n(i,c,s){if(typeof c=="function"&&(s=c,c={}),!s){if(typeof Promise!="function")throw TypeError("callback not provided");return new Promise(function(a,l){n(i,c||{},function(u,h){u?l(u):a(h)})})}t(i,c||{},function(a,l){a&&(a.code==="EACCES"||c&&c.ignoreErrors)&&(a=null,l=!1),s(a,l)})}f(n,"n"),p(n,"r");function o(i,c){try{return t.sync(i,c||{})}catch(s){if(c&&c.ignoreErrors||s.code==="EACCES")return!1;throw s}}f(o,"s"),p(o,"i")})),pt=_(((r,e)=>{let t=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",n=O("path"),o=t?";":":",i=ut(),c=p(l=>Object.assign(Error(`not found: ${l}`),{code:"ENOENT"}),"o"),s=p((l,u)=>{let h=u.colon||o,d=l.match(/\//)||t&&l.match(/\\/)?[""]:[...t?[process.cwd()]:[],...(u.path||process.env.PATH||"").split(h)],m=t?u.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",g=t?m.split(h):[""];return t&&l.indexOf(".")!==-1&&g[0]!==""&&g.unshift(""),{pathEnv:d,pathExt:g,pathExtExe:m}},"s"),a=p((l,u,h)=>{typeof u=="function"&&(h=u,u={}),u||={};let{pathEnv:d,pathExt:m,pathExtExe:g}=s(l,u),v=[],E=p(b=>new Promise((A,T)=>{if(b===d.length)return u.all&&v.length?A(v):T(c(l));let y=d[b],G=/^".*"$/.test(y)?y.slice(1,-1):y,P=n.join(G,l);A(S(!G&&/^\.[\\\/]/.test(l)?l.slice(0,2)+P:P,b,0))}),"d"),S=p((b,A,T)=>new Promise((y,G)=>{if(T===m.length)return y(E(A+1));let P=m[T];i(b+P,{pathExt:g},(ze,Ie)=>{if(!ze&&Ie)if(u.all)v.push(b+P);else return y(b+P);return y(S(b,A,T+1))})}),"f");return h?E(0).then(b=>h(null,b),h):E(0)},"c");e.exports=a,a.sync=(l,u)=>{u||={};let{pathEnv:h,pathExt:d,pathExtExe:m}=s(l,u),g=[];for(let v=0;v<h.length;v++){let E=h[v],S=/^".*"$/.test(E)?E.slice(1,-1):E,b=n.join(S,l),A=!S&&/^\.[\\\/]/.test(l)?l.slice(0,2)+b:b;for(let T=0;T<d.length;T++){let y=A+d[T];try{if(i.sync(y,{pathExt:m}))if(u.all)g.push(y);else return y}catch{}}}if(u.all&&g.length)return g;if(u.nothrow)return null;throw c(l)}})),dt=_(((r,e)=>{let t=p((n={})=>{let o=n.env||process.env;return(n.platform||process.platform)==="win32"?Object.keys(o).reverse().find(i=>i.toUpperCase()==="PATH")||"Path":"PATH"},"n");e.exports=t,e.exports.default=t})),ht=_(((r,e)=>{let t=O("path"),n=pt(),o=dt();function i(s,a){let l=s.options.env||process.env,u=process.cwd(),h=s.options.cwd!=null,d=h&&process.chdir!==void 0&&!process.chdir.disabled;if(d)try{process.chdir(s.options.cwd)}catch{}let m;try{m=n.sync(s.command,{path:l[o({env:l})],pathExt:a?t.delimiter:void 0})}catch{}finally{d&&process.chdir(u)}return m&&=t.resolve(h?s.options.cwd:"",m),m}f(i,"i"),p(i,"a");function c(s){return i(s)||i(s,!0)}f(c,"c"),p(c,"o"),e.exports=c})),ft=_(((r,e)=>{let t=/([()\][%!^"`<>&|;, *?])/g;function n(i){return i=i.replace(t,"^$1"),i}f(n,"n"),p(n,"r");function o(i,c){return i=`${i}`,i=i.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),i=i.replace(/(?=(\\+?)?)\1$/,"$1$1"),i=`"${i}"`,i=i.replace(t,"^$1"),c&&(i=i.replace(t,"^$1")),i}f(o,"s"),p(o,"i"),e.exports.command=n,e.exports.argument=o})),mt=_(((r,e)=>{e.exports=/^#!(.*)/})),gt=_(((r,e)=>{let t=mt();e.exports=(n="")=>{let o=n.match(t);if(!o)return null;let[i,c]=o[0].replace(/#! ?/,"").split(" "),s=i.split("/").pop();return s==="env"?c:c?`${s} ${c}`:s}})),wt=_(((r,e)=>{let t=O("fs"),n=gt();function o(i){let c=Buffer.alloc(150),s;try{s=t.openSync(i,"r"),t.readSync(s,c,0,150,0),t.closeSync(s)}catch{}return n(c.toString())}f(o,"s"),p(o,"i"),e.exports=o})),vt=_(((r,e)=>{let t=O("path"),n=ht(),o=ft(),i=wt(),c=process.platform==="win32",s=/\.(?:com|exe)$/i,a=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function l(d){d.file=n(d);let m=d.file&&i(d.file);return m?(d.args.unshift(d.file),d.command=m,n(d)):d.file}f(l,"p"),p(l,"l");function u(d){if(!c)return d;let m=l(d),g=!s.test(m);if(d.options.forceShell||g){let v=a.test(m);d.command=t.normalize(d.command),d.command=o.command(d.command),d.args=d.args.map(E=>o.argument(E,v)),d.args=["/d","/s","/c",`"${[d.command].concat(d.args).join(" ")}"`],d.command=process.env.comspec||"cmd.exe",d.options.windowsVerbatimArguments=!0}return d}f(u,"u"),p(u,"u");function h(d,m,g){m&&!Array.isArray(m)&&(g=m,m=null),m=m?m.slice(0):[],g=Object.assign({},g);let v={command:d,args:m,options:g,file:void 0,original:{command:d,args:m}};return g.shell?v:u(v)}f(h,"d"),p(h,"d"),e.exports=h})),$t=_(((r,e)=>{let t=process.platform==="win32";function n(s,a){return Object.assign(Error(`${a} ${s.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${a} ${s.command}`,path:s.command,spawnargs:s.args})}f(n,"n"),p(n,"r");function o(s,a){if(!t)return;let l=s.emit;s.emit=function(u,h){if(u==="exit"){let d=i(h,a);if(d)return l.call(s,"error",d)}return l.apply(s,arguments)}}f(o,"s"),p(o,"i");function i(s,a){return t&&s===1&&!a.file?n(a.original,"spawn"):null}f(i,"i"),p(i,"a");function c(s,a){return t&&s===1&&!a.file?n(a.original,"spawnSync"):null}f(c,"c"),p(c,"o"),e.exports={hookChildProcess:o,verifyENOENT:i,verifyENOENTSync:c,notFoundError:n}})),bt=_(((r,e)=>{let t=O("child_process"),n=vt(),o=$t();function i(s,a,l){let u=n(s,a,l),h=t.spawn(u.command,u.args,u.options);return o.hookChildProcess(h,u),h}f(i,"i"),p(i,"a");function c(s,a,l){let u=n(s,a,l),h=t.spawnSync(u.command,u.args,u.options);return h.error=h.error||o.verifyENOENTSync(h.status,u),h}f(c,"c"),p(c,"o"),e.exports=i,e.exports.spawn=i,e.exports.sync=c,e.exports._parse=n,e.exports._enoent=o}))(),ee=class extends Error{static{f(this,"L")}static{p(this,"U")}result;output;get exitCode(){if(this.result.exitCode!==null)return this.result.exitCode}constructor(r,e){super(`Process exited with non-zero status (${r.exitCode})`),this.result=r,this.output=e}};const _t={timeout:void 0,persist:!1},Et={windowsHide:!0};function $e(r,e){return{command:qe(r),args:e??[]}}f($e,"Pt");p($e,"K");function be(r){let e=new AbortController;for(let t of r){if(t.aborted)return e.abort(),t;t.addEventListener("abort",()=>{e.abort(t.reason)},{signal:e.signal})}return e.signal}f(be,"Tt");p(be,"q");async function B(r){let e="";for await(let t of r)e+=t.toString();return e}f(B,"H");p(B,"J");var yt=class{static{f(this,"At")}static{p(this,"Y")}_process;_aborted=!1;_options;_command;_args;_resolveClose;_processClosed;_thrownError;get process(){return this._process}get pid(){return this._process?.pid}get exitCode(){if(this._process&&this._process.exitCode!==null)return this._process.exitCode}constructor(r,e,t){this._options={..._t,...t},this._command=r,this._args=e??[],this._processClosed=new Promise(n=>{this._resolveClose=n})}kill(r){return this._process?.kill(r)===!0}get aborted(){return this._aborted}get killed(){return this._process?.killed===!0}pipe(r,e,t){return xt(r,e,{...t,stdin:this})}async*[Symbol.asyncIterator](){let r=this._process;if(!r)return;let e=[];this._streamErr&&e.push(this._streamErr),this._streamOut&&e.push(this._streamOut);let t=at(e),n=Ye.createInterface({input:t});for await(let o of n)yield o.toString();if(await this._processClosed,r.removeAllListeners(),this._thrownError)throw this._thrownError;if(this._options?.throwOnError&&this.exitCode!==0&&this.exitCode!==void 0)throw new ee(this)}async _waitForOutput(){let r=this._process;if(!r)throw Error("No process was started");let[e,t]=await Promise.all([this._streamOut?B(this._streamOut):"",this._streamErr?B(this._streamErr):""]);if(await this._processClosed,this._options?.stdin&&await this._options.stdin,r.removeAllListeners(),this._thrownError)throw this._thrownError;let n={stderr:t,stdout:e,exitCode:this.exitCode};if(this._options.throwOnError&&this.exitCode!==0&&this.exitCode!==void 0)throw new ee(this,n);return n}then(r,e){return this._waitForOutput().then(r,e)}_streamOut;_streamErr;spawn(){let r=Je(),e=this._options,t={...Et,...e.nodeOptions},n=[];this._resetState(),e.timeout!==void 0&&n.push(AbortSignal.timeout(e.timeout)),e.signal!==void 0&&n.push(e.signal),e.persist===!0&&(t.detached=!0),n.length>0&&(t.signal=be(n)),t.env=ve(r,t.env);let{command:o,args:i}=$e(this._command,this._args),c=(0,bt._parse)(o,i,t),s=ce(c.command,c.args,c.options);if(s.stderr&&(this._streamErr=s.stderr),s.stdout&&(this._streamOut=s.stdout),this._process=s,s.once("error",this._onError),s.once("close",this._onClose),e.stdin!==void 0&&s.stdin&&e.stdin.process){let{stdout:a}=e.stdin.process;a&&a.pipe(s.stdin)}}_resetState(){this._aborted=!1,this._processClosed=new Promise(r=>{this._resolveClose=r}),this._thrownError=void 0}_onError=p(r=>{if(r.name==="AbortError"&&(!(r.cause instanceof Error)||r.cause.name!=="TimeoutError")){this._aborted=!0;return}this._thrownError=r},"_onError");_onClose=p(()=>{this._resolveClose&&this._resolveClose()},"_onClose")};const U=p((r,e,t)=>{let n=new yt(r,e,t);return n.spawn(),n},"X"),xt=U;var kt=tt({detectPackageManager:p(()=>W,"detectPackageManager"),installDependencies:p(()=>Te,"installDependencies"),packageManagers:p(()=>j,"packageManagers")});async function _e(r,e,t={}){let n=pe(r).split("/");for(;n.length>0;){let o=await e(n.join("/")||"/");if(o||!t.includeParentDirs)return o;n.pop()}}f(_e,"Mt");p(_e,"se");function Ee(r){let e;return()=>(e===void 0&&(e=r().then(t=>(e=t,e))),e)}f(Ee,"zt");p(Ee,"ce");const Tt=Ee(async()=>{if(globalThis.process?.versions?.webcontainer)return!1;try{let{exitCode:r}=await U("corepack",["--version"]);return r===0}catch{return!1}});async function ye(r,e,t={}){let n=r!=="npm"&&r!=="bun"&&r!=="deno"&&t.corepack!==!1&&await Tt()?["corepack",[r,...e]]:[r,e],{exitCode:o,stdout:i,stderr:c}=await U(n[0],n[1],{nodeOptions:{cwd:$(t.cwd||process.cwd()),env:t.env,stdio:t.silent?"pipe":"inherit"}});if(o!==0)throw Error(`\`${n.flat().join(" ")}\` failed.${t.silent?["",i,c].join(`
2
+ `):""}`)}f(ye,"Lt");p(ye,"le");async function xe(r={}){let e=r.cwd||process.cwd(),t={...process.env,...r.env},n=(typeof r.packageManager=="string"?j.find(o=>o.name===r.packageManager):r.packageManager)||await W(r.cwd||process.cwd());if(!n)throw Error("No package manager auto-detected.");return{cwd:e,env:t,silent:r.silent??!1,packageManager:n,dev:r.dev??!1,workspace:r.workspace,global:r.global??!1,dry:r.dry??!1,corepack:r.corepack??!0}}f(xe,"Ht");p(xe,"ue");function ke(r){let[e,t]=(r||"").split("@"),[n,o]=t?.split("+")||[];if(e&&e!=="-"&&/^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(e))return{name:e,version:n,buildMeta:o};let i=(e||"").replace(/\W+/g,"");return{name:i,version:n,buildMeta:o,warnings:[`Abnormal characters found in \`packageManager\` field, sanitizing from \`${e}\` to \`${i}\``]}}f(ke,"Dt");p(ke,"de");const j=[{name:"npm",command:"npm",lockFile:"package-lock.json"},{name:"pnpm",command:"pnpm",lockFile:"pnpm-lock.yaml",files:["pnpm-workspace.yaml"]},{name:"bun",command:"bun",lockFile:["bun.lockb","bun.lock"]},{name:"yarn",command:"yarn",lockFile:"yarn.lock",files:[".yarnrc.yml"]},{name:"deno",command:"deno",lockFile:"deno.lock",files:["deno.json"]}];async function W(r,e={}){let t=await _e($(r||"."),async n=>{if(!e.ignorePackageJSON){let o=K(n,"package.json");if(x(o)){let i=JSON.parse(await ie(o,"utf8"));if(i?.packageManager){let{name:c,version:s="0.0.0",buildMeta:a,warnings:l}=ke(i.packageManager);if(c){let u=s.split(".")[0],h=j.find(d=>d.name===c&&d.majorVersion===u)||j.find(d=>d.name===c);return{name:c,command:c,version:s,majorVersion:u,buildMeta:a,warnings:l,files:h?.files,lockFile:h?.lockFile}}}}if(x(K(n,"deno.json")))return j.find(i=>i.name==="deno")}if(!e.ignoreLockFile){for(let o of j)if([o.lockFile,o.files].flat().filter(Boolean).some(i=>x($(n,i))))return{...o}}},{includeParentDirs:e.includeParentDirs??!0});if(!t&&!e.ignoreArgv){let n=process.argv[1];if(n){for(let o of j)if(RegExp(`[/\\\\]\\.?${o.command}`).test(n))return o}}return t}f(W,"Z$1");p(W,"$");async function Te(r={}){let e=await xe(r),t=r.frozenLockFile?{npm:["ci"],yarn:["install","--immutable"],bun:["install","--frozen-lockfile"],pnpm:["install","--frozen-lockfile"],deno:["install","--frozen"]}[e.packageManager.name]:["install"];return r.ignoreWorkspace&&e.packageManager.name==="pnpm"&&t.push("--ignore-workspace"),e.dry||await ye(e.packageManager.command,t,{cwd:e.cwd,silent:e.silent,corepack:e.corepack}),{exec:{command:e.packageManager.command,args:t}}}f(Te,"It");p(Te,"fe");const Ct=Object.defineProperty({__proto__:null,a:$,i:he,n:me,r:fe,t:kt},Symbol.toStringTag,{value:"Module"});var Ot=Object.defineProperty,w=f((r,e)=>Ot(r,"name",{value:e,configurable:!0}),"o");async function Ce(r,e,t={}){const n=e+".json",o=JSON.parse(await ie(n,"utf8").catch(()=>"{}")),i=(await I(r,{method:"HEAD",headers:t.headers}).catch(()=>{}))?.headers.get("etag");if(o.etag===i&&x(e))return;typeof i=="string"&&(o.etag=i);const c=await I(r,{headers:t.headers});if(c.status>=400)throw new Error(`Failed to download ${r}: ${c.status} ${c.statusText}`);const s=se(e);await Ke(Re)(c.body,s),await Be(n,JSON.stringify(o),"utf8")}f(Ce,"q");w(Ce,"download");const St=/^(?<repo>[-\w.]+\/[-\w.]+)(?<subdir>[^#]+)?(?<ref>#[-\w./@]+)?/,At=/^(?<repo>[-\w.]+(?:\/[-\w.]+)+?)(?:::(?<subdir>[^#]*))?(?<ref>#[-\w./@]+)?$/;function N(r,e){const t=e?.expandRepo||r.includes("::"),n=r.match(t?At:St)?.groups||{},o=t?n.subdir?"/"+n.subdir:"/":n.subdir||"/";return{repo:n.repo||"",subdir:o,ref:n.ref?n.ref.slice(1):"main"}}f(N,"x");w(N,"parseGitURI");function C(...r){process.env.DEBUG&&console.debug("[giget]",...r)}f(C,"$");w(C,"debug");async function I(r,e={}){e.headers?.["sec-fetch-mode"]&&(e.mode=e.headers["sec-fetch-mode"]);const t=await fetch(r,{...e,headers:X(e.headers)}).catch(n=>{throw new Error(`Failed to download ${r}: ${n}`,{cause:n})});if(e.validateStatus&&t.status>=400)throw new Error(`Failed to fetch ${r}: ${t.status} ${t.statusText}`);return t}f(I,"v");w(I,"sendFetch");function Oe(){const r=process.env.XDG_CACHE_HOME?$(process.env.XDG_CACHE_HOME,"giget"):$(Ve(),".cache/giget");if(process.platform==="win32"){const e=$(le(),"giget");if(!x(e)&&x(r))try{He(r,e)}catch{}return e}return r}f(Oe,"ee");w(Oe,"cacheDirectory");function X(r={}){const e={};for(const[t,n]of Object.entries(r))n&&(e[t.toLowerCase()]=n);return e}f(X,"F");w(X,"normalizeHeaders");function Se(){return process.env.SHELL?process.env.SHELL:process.platform==="win32"?"cmd.exe":"/bin/bash"}f(Se,"te");w(Se,"currentShell");function jt(r){r=$(r);const e=Se();console.info(`(experimental) Opening shell in ${he(process.cwd(),r)}...`),Ue(e,[],{cwd:r,shell:!0,stdio:"inherit"})}f(jt,"re");w(jt,"startShell");const Pt=w((r,e)=>{const t=Ae(r);return{name:t.name,version:t.subdir?`${t.version||"default"}-${t.subdir.replaceAll("/","-")}`:t.version,tar:w(({auth:n}={})=>je(t,n??e.auth),"tar")}},"git");function Ae(r,e={}){const t=e.cwd??process.cwd();let n=r.replace(/#.*$/,""),o;if(/^[./]/.test(r))n=$(t,n);else if(/^https?:\/\//.test(n)){const u=/^(https?:\/\/[^/]+)\/([\w.-]+\/[\w.-]+?)(?:\.git)?(?:\/(.+))?$/.exec(n);if(u){const[,h,d,m]=u;n=`${h}/${d}`,m&&(o=m)}}else if(n.includes("@")){const u=/^(.*?:[\w.-]+\/[\w.-]+?)(?:\.git)?(?:\/(.+))?$/.exec(n);if(u){const[,h,d]=u;n=h,d&&(o=d)}}else{const u={"github:":"https://github.com/","gh:":"https://github.com/","gitlab:":"https://gitlab.com/","bitbucket:":"https://bitbucket.org/","sourcehut:":"https://git.sr.ht/~"},h=/^(.+?:)/.exec(n)?.at(1);h&&u[h]?n=n.replace(h,u[h]):h||(n=`${(process.env.GIGET_GIT_HOST||"https://github.com/").replace(/\/$/,"")}/${n}`);const d=/^(https?:\/\/[^/]+\/~?[\w.-]+\/[\w.-]+?)(?:\.git)?(?:\/(.+))?$/.exec(n);if(d){const[,m,g]=d;n=m,g&&(o=g)}}const i=n.replace(/^https?:\/\//,"").replace(/^.+@/,"").replace(/(\.git)?(#.*)?$/,"").replace(/^\W+/,"").replaceAll(/[:/]/g,"-"),[c,s]=/#(.+)$/.exec(r)?.at(1)?.split(":")??[],a=c||void 0,l=s||o;return{uri:n,name:i,...a&&{version:a},...l&&{subdir:l}}}f(Ae,"ie");w(Ae,"parseGitCloneURI");async function je(r,e){const t=await Le(Y(le(),"giget-git-"));if(e&&/[\r\n]/.test(e))throw new Error("Auth token must not contain newline characters");const n={...process.env,GIT_TERMINAL_PROMPT:"0"};e&&(n.GIT_CONFIG_COUNT="1",n.GIT_CONFIG_KEY_0="http.extraHeader",n.GIT_CONFIG_VALUE_0=`Authorization: Bearer ${e}`);const o={env:n,timeout:6e4},i=Pe(),c=w(a=>L(a,o,i),"gitExec"),s=w(a=>L(a,{...o,cwd:t},i),"gitExecIn");try{const a=["clone","--progress","--depth","1"];r.subdir&&a.push("--filter=blob:none","--sparse","--no-checkout"),r.version&&a.push("--branch",r.version),a.push("--",r.uri,t);try{i.update("Cloning..."),await c(a),i.update("Cloned.")}catch(g){if(!r.version)throw g;C("Shallow clone failed, falling back to full clone:",g),i.update("Shallow clone failed, cloning..."),await M(t,{recursive:!0,force:!0}),await H(t,{recursive:!0}),await s(["init"]),await s(["remote","add","origin",r.uri]),await s(["fetch","origin"]),await s(["checkout",r.version]),i.update("Fetched.")}r.subdir&&(i.update(`Sparse checkout ${r.subdir}...`),await s(["sparse-checkout","set",r.subdir]),await s(["checkout"])),i.update("Packing...");const l=r.subdir?Y(t,r.subdir):t,{create:u}=await import("../packem_chunks/tar.js").then(g=>g.t);i.done();const h=u({gzip:!0,cwd:l,filter:w(g=>!g.startsWith(".git/")&&g!==".git"&&!g.startsWith("./.git/")&&g!=="./.git","filter")},["."]).pipe(new ae);let d=!1;const m=w(()=>{d||(d=!0,M(t,{recursive:!0,force:!0}))},"cleanup");return h.on("end",m),h.on("error",m),h.on("close",m),h}catch(a){throw i.done(),await M(t,{recursive:!0,force:!0}),a}}f(je,"se");w(je,"_cloneAndTar");const te=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];function L(r,e,t){return new Promise((n,o)=>{const i=ce("git",r,{...e,stdio:["ignore","pipe","pipe"]});i.stdout.resume();let c="";i.stderr?.on("data",s=>{const a=s.toString();for(const l of a.split(/[\r\n]/)){const u=l.trim();u&&(c=u)}t&&t.update(c)}),i.on("close",s=>{s===0?n(c):o(new Error(`git ${r[0]} exited with code ${s}. Is git installed?`))}),i.on("error",s=>{s.code==="ENOENT"?o(new Error("git is not installed or not found in PATH")):o(s)})})}f(L,"G");w(L,"_gitSpawn");function Pe(){if(!process.stderr.isTTY)return{update(o){},done(){}};let r="",e=0;const t=w(()=>{const o=te[e%te.length];e++,process.stderr.write(`\x1B[2K\r\x1B[2m${o} ${r}\x1B[0m`)},"render"),n=setInterval(t,80);return{update(o){r=o,t()},done(){clearInterval(n),process.stderr.write("\x1B[2K\r")}}}f(Pe,"ne");w(Pe,"_createStatus");const re=w(async(r,e)=>{if(r.endsWith(".json"))return await ne(r,e);const t=new URL(r);let n=me(t.pathname);try{const o=await I(t.href,{method:"HEAD",validateStatus:!0,headers:{authorization:e.auth?`Bearer ${e.auth}`:void 0}});if((o.headers.get("content-type")||"").includes("application/json"))return await ne(r,e);const i=o.headers.get("content-disposition")?.match(/filename="?(.+)"?/)?.[1];i&&(n=i.split(".")[0])}catch(o){C(`Failed to fetch HEAD for ${t.href}:`,o)}return{name:`${n}-${t.href.slice(0,8)}`,version:"",subdir:"",tar:t.href,defaultDir:n,headers:{Authorization:e.auth?`Bearer ${e.auth}`:void 0}}},"http"),ne=w(async(r,e)=>{const t=await(await I(r,{validateStatus:!0,headers:{authorization:e.auth?`Bearer ${e.auth}`:void 0}})).json();if(!t.tar||!t.name)throw new Error(`Invalid template info from ${r}. name or tar fields are missing!`);return t},"_httpJSON"),oe=w((r,e)=>{const t=N(r),n=process.env.GIGET_GITHUB_URL||"https://api.github.com";return{name:t.repo.replace("/","-"),version:t.ref,subdir:t.subdir,headers:{Authorization:e.auth?`Bearer ${e.auth}`:void 0,Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"},url:`${n.replace("api.github.com","github.com")}/${t.repo}/tree/${t.ref}${t.subdir}`,tar:`${n}/repos/${t.repo}/tarball/${t.ref}`}},"github"),zt=w((r,e)=>{const t=N(r,{expandRepo:!0}),n=process.env.GIGET_GITLAB_URL||"https://gitlab.com";return{name:t.repo.replace("/","-"),version:t.ref,subdir:t.subdir,headers:{authorization:e.auth?`Bearer ${e.auth}`:void 0,"sec-fetch-mode":"same-origin"},url:`${n}/${t.repo}/tree/${t.ref}${t.subdir}`,tar:`${n}/${t.repo}/-/archive/${t.ref}.tar.gz`}},"gitlab"),It=w((r,e)=>{const t=N(r);return{name:t.repo.replace("/","-"),version:t.ref,subdir:t.subdir,headers:{authorization:e.auth?`Bearer ${e.auth}`:void 0},url:`https://bitbucket.com/${t.repo}/src/${t.ref}${t.subdir}`,tar:`https://bitbucket.org/${t.repo}/get/${t.ref}.tar.gz`}},"bitbucket"),Dt=w((r,e)=>{const t=N(r);return{name:t.repo.replace("/","-"),version:t.ref,subdir:t.subdir,headers:{authorization:e.auth?`Bearer ${e.auth}`:void 0},url:`https://git.sr.ht/~${t.repo}/tree/${t.ref}/item${t.subdir}`,tar:`https://git.sr.ht/~${t.repo}/archive/${t.ref}.tar.gz`}},"sourcehut"),Ft={http:re,https:re,git:Pt,github:oe,gh:oe,gitlab:zt,bitbucket:It,sourcehut:Dt},Nt="https://raw.githubusercontent.com/unjs/giget/main/templates",Mt=w((r=Nt,e={})=>(async t=>{const n=Date.now(),o=`${r}/${t}.json`,i=await I(o,{headers:{authorization:e.auth?`Bearer ${e.auth}`:void 0}});if(i.status>=400)throw new Error(`Failed to download ${t} template info from ${o}: ${i.status} ${i.statusText}`);const c=await i.json();if(!c.tar||!c.name)throw new Error(`Invalid template info from ${o}. name or tar fields are missing!`);return C(`Fetched ${t} template info from ${o} in ${Date.now()-n}ms`),c}),"registryProvider"),Gt=/^([\w+-.]+):/;async function Ht(r,e={}){e.registry=process.env.GIGET_REGISTRY??e.registry,e.auth=process.env.GIGET_AUTH??e.auth;const t=e.registry===!1?void 0:Mt(e.registry,{auth:e.auth});let n=e.provider||(t?"registry":"github"),o=r;const i=r.match(Gt);i&&(n=i[1],o=r.slice(i[0].length),(n==="http"||n==="https")&&(o=r)),n.endsWith("+git")&&(o=`${n.slice(0,-4)}:${o}`,n="git");const c=e.providers?.[n]||Ft[n]||t;if(!c)throw new Error(`Unsupported provider: ${n}`);const s=await Promise.resolve().then(()=>c(o,{auth:e.auth})).catch(m=>{throw new Error(`Failed to download template from ${n}: ${m.message}`)});if(!s)throw new Error(`Failed to resolve template from ${n}`);s.name=(s.name||"template").replace(/[^\da-z-]/gi,"-"),s.defaultDir=(s.defaultDir||s.name).replace(/[^\da-z-]/gi,"-");const a=$($(Oe(),n,s.name),(s.version||s.name)+".tar.gz");if(e.preferOffline&&x(a)&&(e.offline=!0),!e.offline){await H(fe(a),{recursive:!0});const m=Date.now();if(typeof s.tar=="function"){const g=s.tar;await(async()=>{const v=await g({auth:e.auth});await Ze(v instanceof q?v:q.fromWeb(v),se(a))})().catch(v=>{if(!x(a))throw v;C("Download error. Using cached version:",v),e.offline=!0})}else await Ce(s.tar,a,{headers:{Authorization:e.auth?`Bearer ${e.auth}`:void 0,...X(s.headers)}}).catch(g=>{if(!x(a))throw g;C("Download error. Using cached version:",g),e.offline=!0});C(`Downloaded to ${a} in ${Date.now()-m}ms`)}if(!x(a))throw new Error(`Tarball not found: ${a} (offline: ${e.offline})`);const l=$($(e.cwd||"."),e.dir||s.defaultDir);if(e.forceClean&&await M(l,{recursive:!0,force:!0}),!e.force&&x(l)&&Ge(l).length>0)throw new Error(`Destination ${l} already exists.`);await H(l,{recursive:!0});const u=Date.now(),h=s.subdir?.replace(/^\//,"")||"",{extract:d}=await import("../packem_chunks/tar.js").then(m=>m.t);if(await d({file:a,cwd:l,onReadEntry(m){m.path=m.path.split("/").splice(1).join("/"),h&&(m.path.startsWith(h+"/")?m.path=m.path.slice(h.length):m.path="")}}),C(`Extracted to ${l} in ${Date.now()-u}ms`),e.install){C("Installing dependencies...");const{installDependencies:m}=await Promise.resolve().then(()=>Ct).then(g=>g.t);await m({cwd:l,silent:e.silent,...typeof e.install=="object"?e.install:{}})}return{...s,source:o,dir:l}}f(Ht,"fe");w(Ht,"downloadTemplate");export{Ht as f,tt as p};
@@ -0,0 +1 @@
1
+ var T=Object.defineProperty;var j=(n,e)=>T(n,"name",{value:e,configurable:!0});import{createRequire as A}from"node:module";import{o as R,r as C}from"../packem_chunks/bin.js";const B=A(import.meta.url),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,q=j(n=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[e,t]=h.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return h.getBuiltinModule(n)}return B(n)},"__cjs_getBuiltinModule"),{createRequire:N}=q("node:module");var U=Object.defineProperty,z=j((n,e)=>U(n,"name",{value:e,configurable:!0}),"L"),I=Object.defineProperty,F=z((n,e)=>I(n,"name",{value:e,configurable:!0}),"F");const J=N(import.meta.url),y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,S=F(n=>{if(typeof y<"u"&&y.versions&&y.versions.node){const[e,t]=y.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return y.getBuiltinModule(n)}return J(n)},"__cjs_getBuiltinModule"),{readFileSync:Y}=S("node:fs"),{readFile:Z}=S("node:fs/promises");var K=Object.defineProperty,l=F((n,e)=>K(n,"name",{value:e,configurable:!0}),"g");const G={sha256:"sha256",sha384:"sha384",sha512:"sha512"},H=1024,Q=/^[A-Z0-9+/]+={0,2}$/i,V=/.*node_modules\/((?:@[^/]+\/)?[^/]+)$/,k=/^['"]/,v=/['"]$/,X=/^[a-z][a-zA-Z0-9]*:\s*$/m,ee=/resolution:\s*\{[^}]*integrity:\s*([^,}\s]+)/,ne=/^["']?((?:@[^/@"']+\/)?[^@"'\n]+)@[^"'\n]+["']?:?[\t\v\f\r \u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*\n((?:[\t ][^\n]*\n?)+)/gm,te=/^\s+version:?\s+"?([^"\n]+)"?/m,se=/^\s+integrity[\s:]+"?([^"\s]+)"?/m,x=l(n=>{if(n.length>H)return;const e=n.indexOf("-");if(e<=0)return;const t=G[n.slice(0,e).toLowerCase()];if(!t)return;const s=n.slice(e+1);if(Q.test(s))try{const i=Buffer.from(s,"base64");return i.length===0?void 0:{algorithm:t,hex:i.toString("hex")}}catch{return}},"decodeSriIntegrity"),w=l((n,e,t)=>{const s=`${t.name}@${t.version}`;e.has(s)||(e.add(s),n.push(t))},"pushUniqueEntry"),m=l((n,e,t)=>{t&&Object.keys(t).length>0&&(n[e]={...t})},"copyDepMap"),g=l(n=>{if(!n)return;const e={};for(const[t,s]of Object.entries(n))e[t]=[s];return Object.keys(e).length>0?e:void 0},"liftDepMap"),re=l(n=>{const e=[],t=new Set;let s;try{s=JSON.parse(n)}catch{return e}if(!s.packages)return e;for(const[i,r]of Object.entries(s.packages)){if(!i||!r.version)continue;const p=V.exec(i);if(!p?.[1])continue;const c=r.name??p[1];if(c.startsWith("."))continue;const o={name:c,version:r.version};if(r.integrity){const a=x(r.integrity);a&&(o.integrity=a)}m(o,"dependencies",g(r.dependencies)),m(o,"peerDependencies",g(r.peerDependencies)),m(o,"optionalDependencies",g(r.optionalDependencies)),w(e,t,o)}return e},"parseNpmLockFile"),_=l(n=>{let e=n.trim();e.startsWith("/")&&(e=e.slice(1)),e=e.replace(k,"").replace(v,"");const t=e.indexOf("(");t>0&&(e=e.slice(0,t));const s=e.lastIndexOf("@");if(s<=0)return;const i=e.slice(0,s),r=e.slice(s+1);if(!(!i||!r||r.startsWith("link:")||r.startsWith("workspace:")||r.startsWith("file:")))return{name:i,version:r}},"splitPnpmPackageKey"),W=l((n,e)=>{const t=new RegExp(String.raw`^${e}:\s*$`,"m").exec(n);if(!t)return;const s=t.index+t[0].length,i=X.exec(n.slice(s));return n.slice(s,i?s+i.index:n.length)},"sliceTopLevelSection"),oe=l(n=>{const e=new Map,t=W(n,"snapshots");if(!t)return e;const s=/^ {2}(['"]?[^\s:][^:\n]*?['"]?):\s*\n((?: {4}[^\n]*\n?)+)/gm;let i;for(;(i=s.exec(t)??void 0)!==void 0;){const r=_(i[1]);if(!r)continue;const p=`${r.name}@${r.version}`,c=i[2],o=e.get(p)??{};for(const a of["dependencies","peerDependencies","optionalDependencies"]){const u=b(c,a);if(!u)continue;const d=o[a]??{};for(const[f,P]of Object.entries(u)){const D=d[f]??[];for(const $ of P)D.includes($)||D.push($);d[f]=D}o[a]=d}e.set(p,o)}return e},"parsePnpmSnapshotEdges"),ie=l(n=>{const e=[],t=new Set,s=W(n,"packages");if(!s)return e;const i=oe(n),r=/^ {2}(['"]?[^\s:][^:\n]*?['"]?):\s*\n((?: {4}[^\n]*\n?)+)/gm;let p;for(;(p=r.exec(s)??void 0)!==void 0;){const c=_(p[1]);if(!c)continue;const o=p[2],a=ee.exec(o),u={name:c.name,version:c.version};if(a?.[1]){const f=x(a[1]);f&&(u.integrity=f)}const d=i.get(`${c.name}@${c.version}`);m(u,"dependencies",d?.dependencies??b(o,"dependencies")),m(u,"peerDependencies",d?.peerDependencies??b(o,"peerDependencies")),m(u,"optionalDependencies",d?.optionalDependencies??b(o,"optionalDependencies")),w(e,t,u)}return e},"parsePnpmLockFile"),b=l((n,e)=>{const t=new RegExp(String.raw`^ {4}${e}:\s*\n((?: {6,}[^\n]*\n?)+)`,"m").exec(n);if(!t?.[1])return;const s={},i=/^ {6}([^\s:]+):\s*([^\n]+)/gm;let r;for(;(r=i.exec(t[1])??void 0)!==void 0;){const p=r[1].replace(k,"").replace(v,"");let c=r[2].trim();c=c.replace(k,"").replace(v,"");const o=c.indexOf("(");if(o>0&&(c=c.slice(0,o).trim()),!p||!c)continue;const a=s[p]??[];a.includes(c)||a.push(c),s[p]=a}return Object.keys(s).length>0?s:void 0},"extractPnpmDependencyMap"),ce=l(n=>{const e=[],t=new Set,s=ne;s.lastIndex=0;let i;for(;(i=s.exec(n)??void 0)!==void 0;){const r=i[1].replace(k,"").replace(v,"");if(!r)continue;const p=i[2],c=te.exec(p);if(!c?.[1])continue;const o={name:r,version:c[1].trim()},a=se.exec(p);if(a?.[1]){const u=x(a[1]);u&&(o.integrity=u)}m(o,"dependencies",O(p,"dependencies")),m(o,"peerDependencies",O(p,"peerDependencies")),m(o,"optionalDependencies",O(p,"optionalDependencies")),w(e,t,o)}return e},"parseYarnLockFile"),O=l((n,e)=>{const t=new RegExp(String.raw`^ {2}${e}:\s*\n((?: {4,}[^\n]*\n?)+)`,"m").exec(n);if(!t?.[1])return;const s={},i=/^ {4}(['"]?[^\s:'"]+['"]?)\s*(?::\s*)?['"]([^'"\n]+)['"]/gm;let r;for(;(r=i.exec(t[1])??void 0)!==void 0;){const p=r[1].replace(k,"").replace(v,""),c=r[2];if(p&&c){const o=s[p]??[];o.includes(c)||o.push(c),s[p]=o}}return Object.keys(s).length>0?s:void 0},"extractYarnDependencyMap"),pe=/,(?=\s*[}\]])/g,ae=l(n=>{const e=[],t=new Set;let s;try{s=JSON.parse(n.replaceAll(pe,""))}catch{return e}if(!s.packages)return e;for(const i of Object.values(s.packages)){const r=i[0];if(typeof r!="string")continue;const p=r.indexOf("@",1);if(p<=0)continue;const c=r.slice(0,p),o=r.slice(p+1);if(!c||!o||o.startsWith("workspace:")||o.startsWith("link:")||o.startsWith("file:"))continue;const a={name:c,version:o},u=i[3];if(typeof u=="string"&&u.length>0){const f=x(u);f&&(a.integrity=f)}const d=i[2];if(d&&typeof d=="object"&&!Array.isArray(d)){const f=d;m(a,"dependencies",g(f.dependencies)),m(a,"peerDependencies",g(f.peerDependencies)),m(a,"optionalDependencies",g(f.optionalDependencies))}w(e,t,a)}return e},"parseBunLockFile"),E=l(n=>{if(n.endsWith("pnpm-lock.yaml"))return"pnpm";if(n.endsWith("package-lock.json"))return"npm";if(n.endsWith("yarn.lock"))return"yarn";if(n.endsWith("bun.lock"))return"bun"},"inferLockFileType"),L=l((n,e)=>{switch(e){case"bun":return ae(n);case"npm":return re(n);case"pnpm":return ie(n);case"yarn":return ce(n);default:return[]}},"parseLockFileContent"),M=["pnpm-lock.yaml","package-lock.json","yarn.lock","bun.lock"];l(async n=>{const e=await R(M,{type:"file",...n&&{cwd:n}});if(!e)throw new Error("Could not find a supported lock file (pnpm-lock.yaml, package-lock.json, yarn.lock, bun.lock)");const t=E(e);if(!t)throw new Error(`Unsupported lock file: ${e}`);const s=await Z(e,"utf8");return{entries:L(s,t),path:e,type:t}},"parseLockFile");l(n=>{const e=C(M,{type:"file",...n&&{cwd:n}});if(!e)throw new Error("Could not find a supported lock file (pnpm-lock.yaml, package-lock.json, yarn.lock, bun.lock)");const t=E(e);if(!t)throw new Error(`Unsupported lock file: ${e}`);return{entries:L(Y(e,"utf8"),t),path:e,type:t}},"parseLockFileSync");export{L as F};
@@ -0,0 +1,17 @@
1
+ var Io=Object.defineProperty;var x=(e,t)=>Io(e,"name",{value:t,configurable:!0});import{createRequire as Fo}from"node:module";import{definePlugin as Do}from"../packem_chunks/applyDefaults.js";const Wo=Fo(import.meta.url),dr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Lo=x(e=>{if(typeof dr<"u"&&dr.versions&&dr.versions.node){const[t,s]=dr.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return dr.getBuiltinModule(e)}return Wo(e)},"__cjs_getBuiltinModule"),{createRequire:Ce}=Lo("node:module");var Uo=Object.defineProperty,Ge=x((e,t)=>Uo(e,"name",{value:t,configurable:!0}),"K$2"),qo=Object.defineProperty,W=Ge((e,t)=>qo(e,"name",{value:t,configurable:!0}),"E");const Zo=Ce(import.meta.url),De=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ln=W(e=>{if(typeof De<"u"&&De.versions&&De.versions.node){const[t,s]=De.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return De.getBuiltinModule(e)}return Zo(e)},"__cjs_getBuiltinModule"),{existsSync:Ue}=Ln("node:fs"),{env:qe,cwd:Dn}=De,{createRequire:He}=Ln("node:module"),Un=0,Ze=2,qn=Symbol("findUpStop");var Vo=Object.defineProperty,Jo=W((e,t)=>Vo(e,"name",{value:t,configurable:!0}),"t$4"),Go=Object.defineProperty,Ho=Jo((e,t)=>Go(e,"name",{value:t,configurable:!0}),"t"),Ko=Object.defineProperty,Xo=Ho((e,t)=>Ko(e,"name",{value:t,configurable:!0}),"n");const Qr=Xo(e=>{if(!e||!(e instanceof URL)&&typeof e!="string")throw new TypeError("Path must be a non-empty string or URL.")},"assertValidFileOrDirectoryPath");var Yo=Object.defineProperty,Qo=W((e,t)=>Yo(e,"name",{value:t,configurable:!0}),"i$4"),es=Object.defineProperty,ts=Qo((e,t)=>es(e,"name",{value:t,configurable:!0}),"r"),rs=Object.defineProperty,ns=ts((e,t)=>rs(e,"name",{value:t,configurable:!0}),"i");const bn=ns(e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"},"getFileInfoType");var os=Object.defineProperty,ss=W((e,t)=>os(e,"name",{value:t,configurable:!0}),"i$3"),is=Object.defineProperty,Zn=ss((e,t)=>is(e,"name",{value:t,configurable:!0}),"s");const as=He(import.meta.url),gr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ls=Zn(e=>{if(typeof gr<"u"&&gr.versions&&gr.versions.node){const[t,s]=gr.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return gr.getBuiltinModule(e)}return as(e)},"__cjs_getBuiltinModule"),{lstatSync:yn,mkdirSync:cs}=ls("node:fs");var us=Object.defineProperty,fs=Zn((e,t)=>us(e,"name",{value:t,configurable:!0}),"o");const ps=fs(e=>{Qr(e);try{const t=yn(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(bn(t))}'`);return}catch(t){if(t.code!=="ENOENT")throw t}try{cs(e,{recursive:!0})}catch(t){if(t.code!=="EEXIST")throw t;const s=yn(e);if(!s.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(bn(s))}'`,{cause:t})}},"ensureDirSync");var ds=Object.defineProperty,b=W((e,t)=>ds(e,"name",{value:t,configurable:!0}),"s$6");let $n=b(()=>{var e=(()=>{var t=Object.defineProperty,s=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyNames,u=Object.prototype.hasOwnProperty,d=b((r,n)=>{for(var o in n)t(r,o,{get:n[o],enumerable:!0})},"ne"),h=b((r,n,o,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of l(n))!u.call(r,i)&&i!==o&&t(r,i,{get:b(()=>n[i],"get"),enumerable:!(a=s(n,i))||a.enumerable});return r},"ae"),m=b(r=>h(t({},"__esModule",{value:!0}),r),"oe"),j={};d(j,{zeptomatch:b(()=>Pe,"zeptomatch")});var A=b(r=>{const n=new Set,o=[r];for(let a=0;a<o.length;a++){const i=o[a];if(n.has(i))continue;n.add(i);const{children:c}=i;if(c?.length)for(let f=0,g=c.length;f<g;f++)o.push(c[f])}return Array.from(n)},"M"),P=b(r=>{let n="";const o=A(r);for(let a=0,i=o.length;a<i;a++){const c=o[a];if(!c.regex)continue;const f=c.regex.flags;if(n||(n=f),n!==f)throw new Error(`Inconsistent RegExp flags used: "${n}" and "${f}"`)}return n},"se"),O=b((r,n,o)=>{const a=o.get(r);if(a!==void 0)return a;const i=r.partial??n;let c="";if(r.regex&&(c+=i?"(?:$|":"",c+=r.regex.source),r.children?.length){const f=T(r.children.map(g=>O(g,n,o)).filter(Boolean));if(f?.length){const g=r.children.some(D=>!D.regex||!(D.partial??n)),w=f.length>1||i&&(!c.length||g);c+=w?i?"(?:$|":"(?:":"",c+=f.join("|"),c+=w?")":""}}return r.regex&&(c+=i?")":""),o.set(r,c),c},"O"),N=b((r,n)=>{const o=new Map,a=A(r);for(let i=a.length-1;i>=0;i--){const c=O(a[i],n,o);if(!(i>0))return c}return""},"ie"),T=b(r=>Array.from(new Set(r)),"ue"),E=b((r,n,o)=>E.compile(r,o).test(n),"R");E.compile=(r,n)=>{const o=n?.partial??!1,a=N(r,o),i=P(r);return new RegExp(`^(?:${a})$`,i)};var q=E,G=b((r,n)=>{const o=q.compile(r,n),a=`${o.source.slice(0,-1)}[\\\\/]?$`,i=o.flags;return new RegExp(a,i)},"le"),re=G,Me=b(r=>{const n=r.map(a=>a.source).join("|")||"$^",o=r[0]?.flags;return new RegExp(n,o)},"ve"),_e=Me,K=b(r=>Array.isArray(r),"j"),B=b(r=>typeof r=="function","_"),Te=b(r=>r.length===0,"he"),Re=(()=>{const{toString:r}=Function.prototype,n=/(?:^\(\s*(?:[^,.()]|\.(?!\.\.))*\s*\)\s*=>|^\s*[a-zA-Z$_][a-zA-Z0-9$_]*\s*=>)/;return o=>(o.length===0||o.length===1)&&n.test(r.call(o))})(),Ke=b(r=>typeof r=="number","de"),Xe=b(r=>typeof r=="object"&&r!==null,"xe"),Ye=b(r=>r instanceof RegExp,"me"),Qe=(()=>{const r=/\\\(|\((?!\?(?::|=|!|<=|<!))/;return n=>r.test(n.source)})(),et=(()=>{const r=/^[a-zA-Z0-9_-]+$/;return n=>r.test(n.source)&&!n.flags.includes("i")})(),ce=b(r=>typeof r=="string","A"),z=b(r=>r===void 0,"f"),tt=b(r=>{const n=new Map;return o=>{const a=n.get(o);if(a!==void 0)return a;const i=r(o);return n.set(o,i),i}},"ye"),ue=b((r,n,o={})=>{const a={cache:{},input:r,index:0,indexBacktrackMax:0,options:o,output:[]},i=M(n)(a),c=Math.max(a.index,a.indexBacktrackMax);if(i&&a.index===r.length)return a.output;throw new Error(`Failed to parse at index ${c}`)},"I"),p=b((r,n)=>K(r)?rt(r,n):ce(r)?fe(r,n):nt(r,n),"i"),rt=b((r,n)=>{const o={};for(const a of r){if(a.length!==1)throw new Error(`Invalid character: "${a}"`);const i=a.charCodeAt(0);o[i]=!0}return a=>{const i=a.input;let c=a.index,f=c;for(;f<i.length&&i.charCodeAt(f)in o;)f+=1;if(f>c){if(!z(n)&&!a.options.silent){const g=i.slice(c,f),w=B(n)?n(g,i,`${c}`):n;z(w)||a.output.push(w)}a.index=f}return!0}},"we"),nt=b((r,n)=>{if(et(r))return fe(r.source,n);{const o=r.source,a=r.flags.replace(/y|$/,"y"),i=new RegExp(o,a);return Qe(r)&&B(n)&&!Re(n)?ot(i,n):st(i,n)}},"$e"),ot=b((r,n)=>o=>{const a=o.index,i=o.input;r.lastIndex=a;const c=r.exec(i);if(c){const f=r.lastIndex;if(!o.options.silent){const g=n(...c,i,`${a}`);z(g)||o.output.push(g)}return o.index=f,!0}else return!1},"Ee"),st=b((r,n)=>o=>{const a=o.index,i=o.input;if(r.lastIndex=a,r.test(i)){const c=r.lastIndex;if(!z(n)&&!o.options.silent){const f=B(n)?n(i.slice(a,c),i,`${a}`):n;z(f)||o.output.push(f)}return o.index=c,!0}else return!1},"Ce"),fe=b((r,n)=>o=>{const a=o.index,i=o.input;if(i.startsWith(r,a)){if(!z(n)&&!o.options.silent){const c=B(n)?n(r,i,`${a}`):n;z(c)||o.output.push(c)}return o.index+=r.length,!0}else return!1},"F"),X=b((r,n,o,a)=>{const i=M(r),c=n>1;return Q(Y(de(f=>{let g=0;for(;g<o;){const w=f.index;if(!i(f)||(g+=1,f.index===w))break}return g>=n},c),a))},"k"),pe=b((r,n)=>X(r,0,1,n),"L"),Z=b((r,n)=>X(r,0,1/0,n),"$"),it=b((r,n)=>X(r,1,1/0,n),"Re"),C=b((r,n)=>{const o=r.map(M);return Q(Y(de(a=>{for(let i=0,c=o.length;i<c;i++)if(!o[i](a))return!1;return!0}),n))},"x"),k=b((r,n)=>{const o=r.map(M);return Q(Y(a=>{for(let i=0,c=o.length;i<c;i++)if(o[i](a))return!0;return!1},n))},"p"),de=b((r,n=!0,o=!1)=>{const a=M(r);return n?i=>{const c=i.index,f=i.output.length,g=a(i);return!g&&!o&&(i.indexBacktrackMax=Math.max(i.indexBacktrackMax,i.index)),(!g||o)&&(i.index=c,i.output.length!==f&&(i.output.length=f)),g}:a},"q"),Y=b((r,n)=>{const o=M(r);return n?a=>{if(a.options.silent)return o(a);const i=a.output.length;if(o(a)){const c=a.output.splice(i,1/0),f=n(c);return z(f)||a.output.push(f),!0}else return!1}:o},"B"),Q=(()=>{let r=0;return n=>{const o=M(n),a=r+=1;return i=>{var c;if(i.options.memoization===!1)return o(i);const f=i.index,g=(c=i.cache)[a]||(c[a]={indexMax:-1,queue:[]}),w=g.queue;if(f<=g.indexMax){const U=g.store||(g.store=new Map);if(w.length){for(let F=0,ur=w.length;F<ur;F+=2){const fr=w[F*2],pr=w[F*2+1];U.set(fr,pr)}w.length=0}const S=U.get(f);if(S===!1)return!1;if(Ke(S))return i.index=S,!0;if(S)return i.index=S.index,S.output?.length&&i.output.push(...S.output),!0}const D=i.output.length,cr=o(i);if(g.indexMax=Math.max(g.indexMax,f),cr){const U=i.index,S=i.output.length;if(S>D){const F=i.output.slice(D,S);w.push(f,{index:U,output:F})}else w.push(f,U);return!0}else return w.push(f,!1),!1}}})(),ge=b(r=>{let n;return o=>(n||(n=M(r())),n(o))},"G"),M=tt(r=>{if(B(r))return Te(r)?ge(r):r;if(ce(r)||Ye(r))return p(r);if(K(r))return C(r);if(Xe(r))return k(Object.values(r));throw new Error("Invalid rule")}),R=b(r=>r,"d"),at=b(r=>typeof r=="string","ke"),lt=b(r=>{const n=new WeakMap,o=new WeakMap;return(a,i)=>{const c=i?.partial?o:n,f=c.get(a);if(f!==void 0)return f;const g=r(a,i);return c.set(a,g),g}},"Be"),ct=b(r=>{const n={},o={};return(a,i)=>{const c=i?.partial?o:n;return c[a]??(c[a]=r(a,i))}},"Pe"),ut=p(/\\./,R),ft=p(/./,R),pt=p(/\*\*\*+/,"*"),dt=p(/([^/{[(!])\*\*/,(r,n)=>`${n}*`),gt=p(/(^|.)\*\*(?=[^*/)\]}])/,(r,n)=>`${n}*`),mt=Z(k([ut,pt,dt,gt,ft])),ht=mt,bt=b(r=>ue(r,ht,{memoization:!1}).join(""),"Ie"),yt=bt,me="abcdefghijklmnopqrstuvwxyz",$t=b(r=>{let n="";for(;r>0;){const o=(r-1)%26;n=me[o]+n,r=Math.floor((r-1)/26)}return n},"Le"),he=b(r=>{let n=0;for(let o=0,a=r.length;o<a;o++)n=n*26+me.indexOf(r[o])+1;return n},"V"),ee=b((r,n)=>{if(n<r)return ee(n,r);const o=[];for(;r<=n;)o.push(r++);return o},"b"),vt=b((r,n,o)=>ee(r,n).map(a=>String(a).padStart(o,"0")),"qe"),be=b((r,n)=>ee(he(r),he(n)).map($t),"W"),y=b(r=>({partial:!1,regex:new RegExp(r,"s"),children:[]}),"c"),L=b(r=>({children:r}),"y"),I=(()=>{const r=b((n,o,a)=>{if(a.has(n))return;a.add(n);const{children:i}=n;if(!i.length)i.push(o);else for(let c=0,f=i.length;c<f;c++)r(i[c],o,a)},"e");return n=>{if(!n.length)return L([]);for(let o=n.length-1;o>=1;o--){const a=new Set,i=n[o-1],c=n[o];r(i,c,a)}return n[0]}})(),_=b(()=>({regex:new RegExp("[\\\\/]","s"),children:[]}),"g"),xt=p(/\\./,y),wt=p(/[$.*+?^(){}[\]\|]/,r=>y(`\\${r}`)),jt=p(/[\\\/]/,_),Ot=p(/[^$.*+?^(){}[\]\|\\\/]+/,y),Pt=p(/^(?:!!)*!(.*)$/,(r,n)=>y(`(?!^${Pe.compile(n).source}$).*?`)),Et=p(/^(!!)+/),kt=k([Pt,Et]),St=p(/\/(\*\*\/)+/,()=>L([I([_(),y(".+?"),_()]),_()])),At=p(/^(\*\*\/)+/,()=>L([y("^"),I([y(".*?"),_()])])),zt=p(/\/(\*\*)$/,()=>L([I([_(),y(".*?")]),y("$")])),Mt=p(/\*\*/,()=>y(".*?")),ye=k([St,At,zt,Mt]),_t=p(/\*\/(?!\*\*\/|\*$)/,()=>I([y("[^\\\\/]*?"),_()])),Tt=p(/\*/,()=>y("[^\\\\/]*")),$e=k([_t,Tt]),ve=p("?",()=>y("[^\\\\/]")),Rt=p("[",R),Nt=p("]",R),Bt=p(/[!^]/,"^\\\\/"),Ct=p(/[a-z]-[a-z]|[0-9]-[0-9]/i,R),It=p(/\\./,R),Ft=p(/[$.*+?^(){}[\|]/,r=>`\\${r}`),Wt=p(/[\\\/]/,"\\\\/"),Lt=p(/[^$.*+?^(){}[\]\|\\\/]+/,R),Dt=k([It,Ft,Wt,Ct,Lt]),xe=C([Rt,pe(Bt),Z(Dt),Nt],r=>y(r.join(""))),Ut=p("{","(?:"),qt=p("}",")"),Zt=p(/(\d+)\.\.(\d+)/,(r,n,o)=>vt(+n,+o,Math.min(n.length,o.length)).join("|")),Vt=p(/([a-z]+)\.\.([a-z]+)/,(r,n,o)=>be(n,o).join("|")),Jt=p(/([A-Z]+)\.\.([A-Z]+)/,(r,n,o)=>be(n.toLowerCase(),o.toLowerCase()).join("|").toUpperCase()),Gt=k([Zt,Vt,Jt]),we=C([Ut,Gt,qt],r=>y(r.join(""))),Ht=p("{"),Kt=p("}"),Xt=p(","),Yt=p(/\\./,y),Qt=p(/[$.*+?^(){[\]\|]/,r=>y(`\\${r}`)),er=p(/[\\\/]/,_),tr=p(/[^$.*+?^(){}[\]\|\\\/,]+/,y),rr=ge(()=>Oe),nr=p("",()=>y("(?:)")),or=it(k([ye,$e,ve,xe,we,rr,Yt,Qt,er,tr]),I),je=k([or,nr]),Oe=C([Ht,pe(C([je,Z(C([Xt,je]))])),Kt],L),sr=Z(k([kt,ye,$e,ve,xe,we,Oe,xt,wt,jt,Ot]),I),ir=sr,ar=b(r=>ue(r,ir,{memoization:!1})[0],"kr"),lr=ar,te=b((r,n,o)=>te.compile(r,o).test(n),"N");te.compile=(()=>{const r=ct((o,a)=>re(lr(yt(o)),a)),n=lt((o,a)=>_e(o.map(i=>r(i,a))));return(o,a)=>at(o)?r(o,a):n(o,a)})();var Pe=te;return m(j)})();return e.default||e},"_lazyMatch"),Jr;const gs=b((e,t)=>(Jr||(Jr=$n(),$n=null),Jr(e,t)),"zeptomatch"),ms=/^[A-Z]:\//i,ne=b((e="")=>e&&e.replaceAll("\\","/").replace(ms,t=>t.toUpperCase()),"normalizeWindowsPath"),hs=/^[/\\]{2}/,bs=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,Vn=/^[A-Z]:$/i,vn=/^\/([A-Z]:)?$/i,ys=/.(\.[^./]+)$/,$s=/^[/\\]|^[a-z]:[/\\]/i,vs=/\/$/,xs=b(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd"),Jn=b((e,t)=>{let s="",l=0,u=-1,d=0,h;for(let m=0;m<=e.length;++m){if(m<e.length)h=e[m];else{if(h==="/")break;h="/"}if(h==="/"){if(!(u===m-1||d===1))if(d===2){if(s.length<2||l!==2||!s.endsWith(".")||s.at(-2)!=="."){if(s.length>2){const j=s.lastIndexOf("/");j===-1?(s="",l=0):(s=s.slice(0,j),l=s.length-1-s.lastIndexOf("/")),u=m,d=0;continue}else if(s.length>0){s="",l=0,u=m,d=0;continue}}t&&(s+=s.length>0?"/..":"..",l=2)}else s.length>0?s+=`/${e.slice(u+1,m)}`:s=e.slice(u+1,m),l=m-u-1;u=m,d=0}else h==="."&&d!==-1?++d:d=-1}return s},"normalizeString"),Be=b(e=>bs.test(e),"isAbsolute"),Gn=b(function(e){if(e.length===0)return".";e=ne(e);const t=hs.exec(e),s=Be(e),l=e.at(-1)==="/";return e=Jn(e,!s),e.length===0?s?"/":l?"./":".":(l&&(e+="/"),Vn.test(e)&&(e+="/"),t?s?`//${e}`:`//./${e}`:s&&!Be(e)?`/${e}`:e)},"normalize"),Hn=b((...e)=>{let t="";for(const s of e)if(s)if(t.length>0){const l=t.at(-1)==="/",u=s[0]==="/";l&&u?t+=s.slice(1):t+=l||u?s:`/${s}`}else t+=s;return Gn(t)},"join"),ie=b(function(...e){e=e.map(l=>ne(l));let t="",s=!1;for(let l=e.length-1;l>=-1&&!s;l--){const u=l>=0?e[l]:xs();!u||u.length===0||(t=`${u}/${t}`,s=Be(u))}return t=Jn(t,!s),s&&!Be(t)?`/${t}`:t.length>0?t:"."},"resolve");b(function(e){return ne(e)},"toNamespacedPath");const Kn=b(function(e){return ys.exec(ne(e))?.[1]??""},"extname");b(function(e,t){const s=ie(e).replace(vn,"$1").split("/"),l=ie(t).replace(vn,"$1").split("/");if(l[0][1]===":"&&s[0][1]===":"&&s[0]!==l[0])return l.join("/");const u=[...s];for(const d of u){if(l[0]!==d)break;s.shift(),l.shift()}return[...s.map(()=>".."),...l].join("/")},"relative");const en=b(e=>{const t=ne(e).replace(vs,"").split("/").slice(0,-1);return t.length===1&&Vn.test(t[0])&&(t[0]=`${t[0]}/`),t.join("/")||(Be(e)?"/":".")},"dirname");b(function(e){const t=[e.root,e.dir,e.base??e.name+e.ext].filter(Boolean);return ne(e.root?ie(...t):t.join("/"))},"format");const ws=b((e,t)=>{const s=ne(e).split("/").pop();return t&&s.endsWith(t)?s.slice(0,-t.length):s},"basename"),Xn=b(function(e){const t=$s.exec(e)?.[0]?.replaceAll("\\","/")??"",s=ws(e),l=Kn(s);return{base:s,dir:en(e),ext:l,name:s.slice(0,s.length-l.length),root:t}},"parse");b((e,t)=>gs(t,Gn(e)),"matchesGlob");var js=Object.defineProperty,H=W((e,t)=>js(e,"name",{value:t,configurable:!0}),"i$2");const Os=He(import.meta.url),mr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ps=H(e=>{if(typeof mr<"u"&&mr.versions&&mr.versions.node){const[t,s]=mr.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return mr.getBuiltinModule(e)}return Os(e)},"__cjs_getBuiltinModule"),{fileURLToPath:Es}=Ps("node:url");function Br(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}x(Br,"dn$1");Ge(Br,"Nr");W(Br,"w$1");H(Br,"getDefaultExportFromCjs");var xn,wn;function Cr(){return wn||(wn=1,xn=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cr3","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),xn}x(Cr,"gn$1");Ge(Cr,"Dr");W(Cr,"y$2");H(Cr,"requireBinaryExtensions");var ks=Cr();const Ss=Br(ks),As=new Set(Ss),zs=new Set(["/","\\",void 0]),jn=Symbol.for("pathe:normalizedAlias"),Ms=/(^|[/\\])([^/\\]+?)(?=(?:\.[^.]+)?$)/,_s=H((e,t)=>t.split("/").length-e.split("/").length,"compareAliases"),Tr=H((e="/")=>{const t=e.at(-1);return t==="/"||t==="\\"},"hasTrailingSlash"),Yn=H(e=>{if(e[jn])return e;const t=Object.fromEntries(Object.entries(e).toSorted(([s],[l])=>_s(s,l)));for(const s in t)for(const l in t)l===s||s.startsWith(l)||t[s].startsWith(l)&&zs.has(t[s][l.length])&&(t[s]=t[l]+t[s].slice(l.length));return Object.defineProperty(t,jn,{enumerable:!1,value:!0}),t},"normalizeAliases");H((e,t)=>{e=ne(e),t=Yn(t);for(const[s,l]of Object.entries(t)){if(!e.startsWith(s))continue;const u=Tr(s)?s.slice(0,-1):s;if(Tr(e[u.length]))return Hn(l,e.slice(s.length))}return e},"resolveAlias");H(e=>Ms.exec(e)?.[2],"filename");H((e,t)=>{e=ne(e),t=Yn(t);for(const[s,l]of Object.entries(t).toReversed()){if(!e.startsWith(l))continue;const u=Tr(l)?l.slice(0,-1):l;if(Tr(e[u.length]))return Hn(s,e.slice(l.length))}return e},"reverseResolveAlias");const Ts=/^(?:\.?\.[/\\]|\.\.\B)/,Rs=/^(?:msys|cygwin)$/;H(e=>Ts.test(e)||e==="..","isRelative");H(e=>As.has(Kn(e).slice(1).toLowerCase()),"isBinaryPath");const Ve=H(e=>ne(e instanceof URL?Es(e):e),"toPath");H(()=>{if(!globalThis.process)return!1;if(globalThis.process.platform==="win32"||globalThis.process.platform==="cygwin")return!0;const e=globalThis.process.env.OSTYPE;return typeof e!="string"?!1:Rs.test(e)},"isWindows");var Ns=Object.defineProperty,Bs=W((e,t)=>Ns(e,"name",{value:t,configurable:!0}),"p"),Cs=Object.defineProperty,Qn=Bs((e,t)=>Cs(e,"name",{value:t,configurable:!0}),"a");const Is=He(import.meta.url),hr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,eo=Qn(e=>{if(typeof hr<"u"&&hr.versions&&hr.versions.node){const[t,s]=hr.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return hr.getBuiltinModule(e)}return Is(e)},"__cjs_getBuiltinModule"),{stat:Fs,lstat:Ws}=eo("node:fs/promises"),{fileURLToPath:Ls}=eo("node:url");var Ds=Object.defineProperty,On=Qn((e,t)=>Ds(e,"name",{value:t,configurable:!0}),"n");const Us=On(async(e,t={})=>{if(typeof e!="string"&&!Array.isArray(e)&&typeof e!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const s=t.cwd?Ve(t.cwd):process.cwd();let l=ie(s);const{root:u}=Xn(l),d=Ve(t.stopAt??u),h=ie(l,d),m=t.type??"file",j=On(async function(P){return typeof e=="function"?[await e(P)]:typeof e=="string"?[e]:Array.isArray(e)?e:[e]},"getMatchers");t.allowSymlinks??=!0;const A=t.allowSymlinks?Fs:Ws;for(;l&&l!==h&&l!==u;){const P=await j(l);for(let O of P){if(O===qn)return;if(O===void 0)continue;Buffer.isBuffer(O)?O=O.toString():O instanceof URL&&(O=Ls(O));const N=Be(O)?O:ie(l,O);try{const T=await A(N);if(m==="file"&&T.isFile()||m==="directory"&&T.isDirectory())return N}catch{}}l=en(l)}},"findUp");var qs=Object.defineProperty,Zs=W((e,t)=>qs(e,"name",{value:t,configurable:!0}),"u$3"),Vs=Object.defineProperty,to=Zs((e,t)=>Vs(e,"name",{value:t,configurable:!0}),"i");const Js=He(import.meta.url),br=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ro=to(e=>{if(typeof br<"u"&&br.versions&&br.versions.node){const[t,s]=br.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return br.getBuiltinModule(e)}return Js(e)},"__cjs_getBuiltinModule"),{statSync:Gs,lstatSync:Hs}=ro("node:fs"),{fileURLToPath:Ks}=ro("node:url");var Xs=Object.defineProperty,Pn=to((e,t)=>Xs(e,"name",{value:t,configurable:!0}),"o");const Ys=Pn((e,t={})=>{if(typeof e!="string"&&!Array.isArray(e)&&typeof e!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const s=t.cwd?Ve(t.cwd):process.cwd();let l=ie(s);const{root:u}=Xn(l),d=Ve(t.stopAt??u),h=ie(l,d),m=t.type??"file",j=Pn(function(P){return typeof e=="function"?[e(P)]:typeof e=="string"?[e]:Array.isArray(e)?e:[e]},"getMatchers");t.allowSymlinks??=!0;const A=t.allowSymlinks?Gs:Hs;for(;l&&l!==h&&l!==u;){for(let P of j(l)){if(P===qn)return;if(P===void 0)continue;Buffer.isBuffer(P)?P=P.toString():P instanceof URL&&(P=Ks(P));const O=Be(P)?P:ie(l,P);try{const N=A(O);if(m==="file"&&N.isFile()||m==="directory"&&N.isDirectory())return O}catch{}}l=en(l)}},"findUpSync");var Qs=Object.defineProperty,no=W((e,t)=>Qs(e,"name",{value:t,configurable:!0}),"t$2"),ei=Object.defineProperty,tn=no((e,t)=>ei(e,"name",{value:t,configurable:!0}),"s");const ti=He(import.meta.url),yr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ri=tn(e=>{if(typeof yr<"u"&&yr.versions&&yr.versions.node){const[t,s]=yr.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return yr.getBuiltinModule(e)}return ti(e)},"__cjs_getBuiltinModule"),{access:ni}=ri("node:fs/promises");var oi=Object.defineProperty,si=tn((e,t)=>oi(e,"name",{value:t,configurable:!0}),"o");async function ke(e,t=Un){Qr(e),e=Ve(e);try{return await ni(e,t),!0}catch{return!1}}x(ke,"Q$2");Ge(ke,"se");W(ke,"i$1");no(ke,"d");tn(ke,"m");si(ke,"isAccessible");var ii=Object.defineProperty,oo=W((e,t)=>ii(e,"name",{value:t,configurable:!0}),"t$1"),ai=Object.defineProperty,rn=oo((e,t)=>ai(e,"name",{value:t,configurable:!0}),"t");const li=He(import.meta.url),$r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ci=rn(e=>{if(typeof $r<"u"&&$r.versions&&$r.versions.node){const[t,s]=$r.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return $r.getBuiltinModule(e)}return li(e)},"__cjs_getBuiltinModule"),{accessSync:ui}=ci("node:fs");var fi=Object.defineProperty,pi=rn((e,t)=>fi(e,"name",{value:t,configurable:!0}),"o");function Se(e,t=Un){Qr(e),e=Ve(e);try{return ui(e,t),!0}catch{return!1}}x(Se,"ee$1");Ge(Se,"ie");W(Se,"i");oo(Se,"d");rn(Se,"m");pi(Se,"isAccessibleSync");var di=Object.defineProperty,so=W((e,t)=>di(e,"name",{value:t,configurable:!0}),"o"),gi=Object.defineProperty,io=so((e,t)=>gi(e,"name",{value:t,configurable:!0}),"o"),mi=Object.defineProperty,hi=io((e,t)=>mi(e,"name",{value:t,configurable:!0}),"o");let ao=class extends Error{static{x(this,"Jn")}static{Ge(this,"Xr")}static{W(this,"s")}static{so(this,"u")}static{io(this,"n")}static{hi(this,"NotFoundError")}constructor(e){super(`ENOENT: ${e}`)}get code(){return"ENOENT"}set code(e){throw new Error("Cannot overwrite code ENOENT")}get name(){return"NotFoundError"}set name(e){throw new Error("Cannot overwrite name of NotFoundError")}};var bi=Object.defineProperty,yi=W((e,t)=>bi(e,"name",{value:t,configurable:!0}),"$e"),$i=Object.defineProperty,nn=yi((e,t)=>$i(e,"name",{value:t,configurable:!0}),"W"),vi=Object.defineProperty,$=nn((e,t)=>vi(e,"name",{value:t,configurable:!0}),"u$1");let En=$(()=>{var e=(()=>{var t=Object.defineProperty,s=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyNames,u=Object.prototype.hasOwnProperty,d=$((r,n)=>{for(var o in n)t(r,o,{get:n[o],enumerable:!0})},"ne"),h=$((r,n,o,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of l(n))!u.call(r,i)&&i!==o&&t(r,i,{get:$(()=>n[i],"get"),enumerable:!(a=s(n,i))||a.enumerable});return r},"ae"),m=$(r=>h(t({},"__esModule",{value:!0}),r),"oe"),j={};d(j,{zeptomatch:$(()=>Pe,"zeptomatch")});var A=$(r=>{const n=new Set,o=[r];for(let a=0;a<o.length;a++){const i=o[a];if(n.has(i))continue;n.add(i);const{children:c}=i;if(c?.length)for(let f=0,g=c.length;f<g;f++)o.push(c[f])}return Array.from(n)},"M"),P=$(r=>{let n="";const o=A(r);for(let a=0,i=o.length;a<i;a++){const c=o[a];if(!c.regex)continue;const f=c.regex.flags;if(n||(n=f),n!==f)throw new Error(`Inconsistent RegExp flags used: "${n}" and "${f}"`)}return n},"se"),O=$((r,n,o)=>{const a=o.get(r);if(a!==void 0)return a;const i=r.partial??n;let c="";if(r.regex&&(c+=i?"(?:$|":"",c+=r.regex.source),r.children?.length){const f=T(r.children.map(g=>O(g,n,o)).filter(Boolean));if(f?.length){const g=r.children.some(D=>!D.regex||!(D.partial??n)),w=f.length>1||i&&(!c.length||g);c+=w?i?"(?:$|":"(?:":"",c+=f.join("|"),c+=w?")":""}}return r.regex&&(c+=i?")":""),o.set(r,c),c},"O"),N=$((r,n)=>{const o=new Map,a=A(r);for(let i=a.length-1;i>=0;i--){const c=O(a[i],n,o);if(!(i>0))return c}return""},"ie"),T=$(r=>Array.from(new Set(r)),"ue"),E=$((r,n,o)=>E.compile(r,o).test(n),"R");E.compile=(r,n)=>{const o=n?.partial??!1,a=N(r,o),i=P(r);return new RegExp(`^(?:${a})$`,i)};var q=E,G=$((r,n)=>{const o=q.compile(r,n),a=`${o.source.slice(0,-1)}[\\\\/]?$`,i=o.flags;return new RegExp(a,i)},"le"),re=G,Me=$(r=>{const n=r.map(a=>a.source).join("|")||"$^",o=r[0]?.flags;return new RegExp(n,o)},"ve"),_e=Me,K=$(r=>Array.isArray(r),"j"),B=$(r=>typeof r=="function","_"),Te=$(r=>r.length===0,"he"),Re=(()=>{const{toString:r}=Function.prototype,n=/(?:^\(\s*(?:[^,.()]|\.(?!\.\.))*\s*\)\s*=>|^\s*[a-zA-Z$_][a-zA-Z0-9$_]*\s*=>)/;return o=>(o.length===0||o.length===1)&&n.test(r.call(o))})(),Ke=$(r=>typeof r=="number","de"),Xe=$(r=>typeof r=="object"&&r!==null,"xe"),Ye=$(r=>r instanceof RegExp,"me"),Qe=(()=>{const r=/\\\(|\((?!\?(?::|=|!|<=|<!))/;return n=>r.test(n.source)})(),et=(()=>{const r=/^[a-zA-Z0-9_-]+$/;return n=>r.test(n.source)&&!n.flags.includes("i")})(),ce=$(r=>typeof r=="string","A"),z=$(r=>r===void 0,"f"),tt=$(r=>{const n=new Map;return o=>{const a=n.get(o);if(a!==void 0)return a;const i=r(o);return n.set(o,i),i}},"ye"),ue=$((r,n,o={})=>{const a={cache:{},input:r,index:0,indexBacktrackMax:0,options:o,output:[]},i=M(n)(a),c=Math.max(a.index,a.indexBacktrackMax);if(i&&a.index===r.length)return a.output;throw new Error(`Failed to parse at index ${c}`)},"I"),p=$((r,n)=>K(r)?rt(r,n):ce(r)?fe(r,n):nt(r,n),"i"),rt=$((r,n)=>{const o={};for(const a of r){if(a.length!==1)throw new Error(`Invalid character: "${a}"`);const i=a.charCodeAt(0);o[i]=!0}return a=>{const i=a.input;let c=a.index,f=c;for(;f<i.length&&i.charCodeAt(f)in o;)f+=1;if(f>c){if(!z(n)&&!a.options.silent){const g=i.slice(c,f),w=B(n)?n(g,i,`${c}`):n;z(w)||a.output.push(w)}a.index=f}return!0}},"we"),nt=$((r,n)=>{if(et(r))return fe(r.source,n);{const o=r.source,a=r.flags.replace(/y|$/,"y"),i=new RegExp(o,a);return Qe(r)&&B(n)&&!Re(n)?ot(i,n):st(i,n)}},"$e"),ot=$((r,n)=>o=>{const a=o.index,i=o.input;r.lastIndex=a;const c=r.exec(i);if(c){const f=r.lastIndex;if(!o.options.silent){const g=n(...c,i,`${a}`);z(g)||o.output.push(g)}return o.index=f,!0}else return!1},"Ee"),st=$((r,n)=>o=>{const a=o.index,i=o.input;if(r.lastIndex=a,r.test(i)){const c=r.lastIndex;if(!z(n)&&!o.options.silent){const f=B(n)?n(i.slice(a,c),i,`${a}`):n;z(f)||o.output.push(f)}return o.index=c,!0}else return!1},"Ce"),fe=$((r,n)=>o=>{const a=o.index,i=o.input;if(i.startsWith(r,a)){if(!z(n)&&!o.options.silent){const c=B(n)?n(r,i,`${a}`):n;z(c)||o.output.push(c)}return o.index+=r.length,!0}else return!1},"F"),X=$((r,n,o,a)=>{const i=M(r),c=n>1;return Q(Y(de(f=>{let g=0;for(;g<o;){const w=f.index;if(!i(f)||(g+=1,f.index===w))break}return g>=n},c),a))},"k"),pe=$((r,n)=>X(r,0,1,n),"L"),Z=$((r,n)=>X(r,0,1/0,n),"$"),it=$((r,n)=>X(r,1,1/0,n),"Re"),C=$((r,n)=>{const o=r.map(M);return Q(Y(de(a=>{for(let i=0,c=o.length;i<c;i++)if(!o[i](a))return!1;return!0}),n))},"x"),k=$((r,n)=>{const o=r.map(M);return Q(Y(a=>{for(let i=0,c=o.length;i<c;i++)if(o[i](a))return!0;return!1},n))},"p"),de=$((r,n=!0,o=!1)=>{const a=M(r);return n?i=>{const c=i.index,f=i.output.length,g=a(i);return!g&&!o&&(i.indexBacktrackMax=Math.max(i.indexBacktrackMax,i.index)),(!g||o)&&(i.index=c,i.output.length!==f&&(i.output.length=f)),g}:a},"q"),Y=$((r,n)=>{const o=M(r);return n?a=>{if(a.options.silent)return o(a);const i=a.output.length;if(o(a)){const c=a.output.splice(i,1/0),f=n(c);return z(f)||a.output.push(f),!0}else return!1}:o},"B"),Q=(()=>{let r=0;return n=>{const o=M(n),a=r+=1;return i=>{var c;if(i.options.memoization===!1)return o(i);const f=i.index,g=(c=i.cache)[a]||(c[a]={indexMax:-1,queue:[]}),w=g.queue;if(f<=g.indexMax){const U=g.store||(g.store=new Map);if(w.length){for(let F=0,ur=w.length;F<ur;F+=2){const fr=w[F*2],pr=w[F*2+1];U.set(fr,pr)}w.length=0}const S=U.get(f);if(S===!1)return!1;if(Ke(S))return i.index=S,!0;if(S)return i.index=S.index,S.output?.length&&i.output.push(...S.output),!0}const D=i.output.length,cr=o(i);if(g.indexMax=Math.max(g.indexMax,f),cr){const U=i.index,S=i.output.length;if(S>D){const F=i.output.slice(D,S);w.push(f,{index:U,output:F})}else w.push(f,U);return!0}else return w.push(f,!1),!1}}})(),ge=$(r=>{let n;return o=>(n||(n=M(r())),n(o))},"G"),M=tt(r=>{if(B(r))return Te(r)?ge(r):r;if(ce(r)||Ye(r))return p(r);if(K(r))return C(r);if(Xe(r))return k(Object.values(r));throw new Error("Invalid rule")}),R=$(r=>r,"d"),at=$(r=>typeof r=="string","ke"),lt=$(r=>{const n=new WeakMap,o=new WeakMap;return(a,i)=>{const c=i?.partial?o:n,f=c.get(a);if(f!==void 0)return f;const g=r(a,i);return c.set(a,g),g}},"Be"),ct=$(r=>{const n={},o={};return(a,i)=>{const c=i?.partial?o:n;return c[a]??(c[a]=r(a,i))}},"Pe"),ut=p(/\\./,R),ft=p(/./,R),pt=p(/\*\*\*+/,"*"),dt=p(/([^/{[(!])\*\*/,(r,n)=>`${n}*`),gt=p(/(^|.)\*\*(?=[^*/)\]}])/,(r,n)=>`${n}*`),mt=Z(k([ut,pt,dt,gt,ft])),ht=mt,bt=$(r=>ue(r,ht,{memoization:!1}).join(""),"Ie"),yt=bt,me="abcdefghijklmnopqrstuvwxyz",$t=$(r=>{let n="";for(;r>0;){const o=(r-1)%26;n=me[o]+n,r=Math.floor((r-1)/26)}return n},"Le"),he=$(r=>{let n=0;for(let o=0,a=r.length;o<a;o++)n=n*26+me.indexOf(r[o])+1;return n},"V"),ee=$((r,n)=>{if(n<r)return ee(n,r);const o=[];for(;r<=n;)o.push(r++);return o},"b"),vt=$((r,n,o)=>ee(r,n).map(a=>String(a).padStart(o,"0")),"qe"),be=$((r,n)=>ee(he(r),he(n)).map($t),"W"),y=$(r=>({partial:!1,regex:new RegExp(r,"s"),children:[]}),"c"),L=$(r=>({children:r}),"y"),I=(()=>{const r=$((n,o,a)=>{if(a.has(n))return;a.add(n);const{children:i}=n;if(!i.length)i.push(o);else for(let c=0,f=i.length;c<f;c++)r(i[c],o,a)},"e");return n=>{if(!n.length)return L([]);for(let o=n.length-1;o>=1;o--){const a=new Set,i=n[o-1],c=n[o];r(i,c,a)}return n[0]}})(),_=$(()=>({regex:new RegExp("[\\\\/]","s"),children:[]}),"g"),xt=p(/\\./,y),wt=p(/[$.*+?^(){}[\]\|]/,r=>y(`\\${r}`)),jt=p(/[\\\/]/,_),Ot=p(/[^$.*+?^(){}[\]\|\\\/]+/,y),Pt=p(/^(?:!!)*!(.*)$/,(r,n)=>y(`(?!^${Pe.compile(n).source}$).*?`)),Et=p(/^(!!)+/),kt=k([Pt,Et]),St=p(/\/(\*\*\/)+/,()=>L([I([_(),y(".+?"),_()]),_()])),At=p(/^(\*\*\/)+/,()=>L([y("^"),I([y(".*?"),_()])])),zt=p(/\/(\*\*)$/,()=>L([I([_(),y(".*?")]),y("$")])),Mt=p(/\*\*/,()=>y(".*?")),ye=k([St,At,zt,Mt]),_t=p(/\*\/(?!\*\*\/|\*$)/,()=>I([y("[^\\\\/]*?"),_()])),Tt=p(/\*/,()=>y("[^\\\\/]*")),$e=k([_t,Tt]),ve=p("?",()=>y("[^\\\\/]")),Rt=p("[",R),Nt=p("]",R),Bt=p(/[!^]/,"^\\\\/"),Ct=p(/[a-z]-[a-z]|[0-9]-[0-9]/i,R),It=p(/\\./,R),Ft=p(/[$.*+?^(){}[\|]/,r=>`\\${r}`),Wt=p(/[\\\/]/,"\\\\/"),Lt=p(/[^$.*+?^(){}[\]\|\\\/]+/,R),Dt=k([It,Ft,Wt,Ct,Lt]),xe=C([Rt,pe(Bt),Z(Dt),Nt],r=>y(r.join(""))),Ut=p("{","(?:"),qt=p("}",")"),Zt=p(/(\d+)\.\.(\d+)/,(r,n,o)=>vt(+n,+o,Math.min(n.length,o.length)).join("|")),Vt=p(/([a-z]+)\.\.([a-z]+)/,(r,n,o)=>be(n,o).join("|")),Jt=p(/([A-Z]+)\.\.([A-Z]+)/,(r,n,o)=>be(n.toLowerCase(),o.toLowerCase()).join("|").toUpperCase()),Gt=k([Zt,Vt,Jt]),we=C([Ut,Gt,qt],r=>y(r.join(""))),Ht=p("{"),Kt=p("}"),Xt=p(","),Yt=p(/\\./,y),Qt=p(/[$.*+?^(){[\]\|]/,r=>y(`\\${r}`)),er=p(/[\\\/]/,_),tr=p(/[^$.*+?^(){}[\]\|\\\/,]+/,y),rr=ge(()=>Oe),nr=p("",()=>y("(?:)")),or=it(k([ye,$e,ve,xe,we,rr,Yt,Qt,er,tr]),I),je=k([or,nr]),Oe=C([Ht,pe(C([je,Z(C([Xt,je]))])),Kt],L),sr=Z(k([kt,ye,$e,ve,xe,we,Oe,xt,wt,jt,Ot]),I),ir=sr,ar=$(r=>ue(r,ir,{memoization:!1})[0],"kr"),lr=ar,te=$((r,n,o)=>te.compile(r,o).test(n),"N");te.compile=(()=>{const r=ct((o,a)=>re(lr(yt(o)),a)),n=lt((o,a)=>_e(o.map(i=>r(i,a))));return(o,a)=>at(o)?r(o,a):n(o,a)})();var Pe=te;return m(j)})();return e.default||e},"_lazyMatch"),Gr;const xi=$((e,t)=>(Gr||(Gr=En(),En=null),Gr(e,t)),"default");var wi=Object.defineProperty,ji=nn((e,t)=>wi(e,"name",{value:t,configurable:!0}),"t$1");const Oi=/^[A-Z]:\//i,Ie=ji((e="")=>e&&e.replaceAll("\\","/").replace(Oi,t=>t.toUpperCase()),"normalizeWindowsPath");var Pi=Object.defineProperty,V=nn((e,t)=>Pi(e,"name",{value:t,configurable:!0}),"r");const Ei=/^[/\\]{2}/,ki=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,lo=/^[A-Z]:$/i,kn=/^\/([A-Z]:)?$/i,Si=/.(\.[^./]+)$/,Ai=/^[/\\]|^[a-z]:[/\\]/i,zi=/\/$/,Mi=V(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd"),co=V((e,t)=>{let s="",l=0,u=-1,d=0,h;for(let m=0;m<=e.length;++m){if(m<e.length)h=e[m];else{if(h==="/")break;h="/"}if(h==="/"){if(!(u===m-1||d===1))if(d===2){if(s.length<2||l!==2||!s.endsWith(".")||s.at(-2)!=="."){if(s.length>2){const j=s.lastIndexOf("/");j===-1?(s="",l=0):(s=s.slice(0,j),l=s.length-1-s.lastIndexOf("/")),u=m,d=0;continue}else if(s.length>0){s="",l=0,u=m,d=0;continue}}t&&(s+=s.length>0?"/..":"..",l=2)}else s.length>0?s+=`/${e.slice(u+1,m)}`:s=e.slice(u+1,m),l=m-u-1;u=m,d=0}else h==="."&&d!==-1?++d:d=-1}return s},"normalizeString"),Er=V(e=>ki.test(e),"isAbsolute"),uo=V(function(e){if(e.length===0)return".";e=Ie(e);const t=Ei.exec(e),s=Er(e),l=e.at(-1)==="/";return e=co(e,!s),e.length===0?s?"/":l?"./":".":(l&&(e+="/"),lo.test(e)&&(e+="/"),t?s?`//${e}`:`//./${e}`:s&&!Er(e)?`/${e}`:e)},"normalize"),Ee=V((...e)=>{let t="";for(const s of e)if(s)if(t.length>0){const l=t.at(-1)==="/",u=s[0]==="/";l&&u?t+=s.slice(1):t+=l||u?s:`/${s}`}else t+=s;return uo(t)},"join"),Kr=V(function(...e){e=e.map(l=>Ie(l));let t="",s=!1;for(let l=e.length-1;l>=-1&&!s;l--){const u=l>=0?e[l]:Mi();!u||u.length===0||(t=`${u}/${t}`,s=Er(u))}return t=co(t,!s),s&&!Er(t)?`/${t}`:t.length>0?t:"."},"resolve");V(function(e){return Ie(e)},"toNamespacedPath");const _i=V(function(e){return Si.exec(Ie(e))?.[1]??""},"extname");V(function(e,t){const s=Kr(e).replace(kn,"$1").split("/"),l=Kr(t).replace(kn,"$1").split("/");if(l[0][1]===":"&&s[0][1]===":"&&s[0]!==l[0])return l.join("/");const u=[...s];for(const d of u){if(l[0]!==d)break;s.shift(),l.shift()}return[...s.map(()=>".."),...l].join("/")},"relative");const on=V(e=>{const t=Ie(e).replace(zi,"").split("/").slice(0,-1);return t.length===1&&lo.test(t[0])&&(t[0]=`${t[0]}/`),t.join("/")||(Er(e)?"/":".")},"dirname");V(function(e){const t=[e.root,e.dir,e.base??e.name+e.ext].filter(Boolean);return Ie(e.root?Kr(...t):t.join("/"))},"format");const Ti=V((e,t)=>{const s=Ie(e).split("/").pop();return t&&s.endsWith(t)?s.slice(0,-t.length):s},"basename");V(function(e){const t=Ai.exec(e)?.[0]?.replaceAll("\\","/")??"",s=Ti(e),l=_i(s);return{base:s,dir:on(e),ext:l,name:s.slice(0,s.length-l.length),root:t}},"parse");V((e,t)=>xi(t,uo(e)),"matchesGlob");var Ri=Object.defineProperty,sn=W((e,t)=>Ri(e,"name",{value:t,configurable:!0}),"u");const Rr=sn((e,t)=>(t?.create&&ps(e),e),"useDirectory");sn(async(e,t)=>{if(qe.CACHE_DIR&&!["0","1","false","true"].includes(qe.CACHE_DIR))return Rr(Ee(qe.CACHE_DIR,e),t);const s=await Us("package.json",{cwd:t?.cwd??Dn(),type:"file"});if(!s){if(t?.throwError)throw new ao("No such file or directory found.");return}const l=Ee(on(s),"node_modules"),u=Ee(l,".cache"),d=Ee(u,e);if(!(Ue(d)&&!await ke(d,Ze))&&!(Ue(u)&&!await ke(u,Ze))&&!(Ue(l)&&!await ke(l,Ze)))return Rr(d,t)},"findCacheDirectory");const Ni=sn((e,t)=>{if(qe.CACHE_DIR&&!["0","1","false","true"].includes(qe.CACHE_DIR))return Rr(Ee(qe.CACHE_DIR,e),t);const s=Ys("package.json",{cwd:t?.cwd??Dn(),type:"file"});if(!s){if(t?.throwError)throw new ao("No such file or directory found.");return}const l=Ee(on(s),"node_modules"),u=Ee(l,".cache"),d=Ee(u,e);if(!(Ue(d)&&!Se(d,Ze))&&!(Ue(u)&&!Se(u,Ze))&&!(Ue(l)&&!Se(l,Ze)))return Rr(d,t)},"findCacheDirectorySync"),Zc=Ni,Xr=0,fo=4,Vc=Symbol("findUpStop"),Jc=/"(?:[^"\\]|\\.)*"|\/\/[^\r\n]*|\/\*[\s\S]*?\*\//g;var Bi=Object.defineProperty,Ci=x((e,t)=>Bi(e,"name",{value:t,configurable:!0}),"t$a"),Ii=Object.defineProperty,Fi=Ci((e,t)=>Ii(e,"name",{value:t,configurable:!0}),"t"),Wi=Object.defineProperty,Li=Fi((e,t)=>Wi(e,"name",{value:t,configurable:!0}),"n");const Ir=Li(e=>{if(!e||!(e instanceof URL)&&typeof e!="string")throw new TypeError("Path must be a non-empty string or URL.")},"assertValidFileOrDirectoryPath");var Di=Object.defineProperty,Ui=x((e,t)=>Di(e,"name",{value:t,configurable:!0}),"i$a"),qi=Object.defineProperty,Zi=Ui((e,t)=>qi(e,"name",{value:t,configurable:!0}),"r"),Vi=Object.defineProperty,Ji=Zi((e,t)=>Vi(e,"name",{value:t,configurable:!0}),"i");const Sn=Ji(e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"},"getFileInfoType");var Gi=Object.defineProperty,Hi=x((e,t)=>Gi(e,"name",{value:t,configurable:!0}),"i$9"),Ki=Object.defineProperty,po=Hi((e,t)=>Ki(e,"name",{value:t,configurable:!0}),"s");const Xi=Ce(import.meta.url),vr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Yi=po(e=>{if(typeof vr<"u"&&vr.versions&&vr.versions.node){const[t,s]=vr.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return vr.getBuiltinModule(e)}return Xi(e)},"__cjs_getBuiltinModule"),{lstatSync:An,mkdirSync:Qi}=Yi("node:fs");var ea=Object.defineProperty,ta=po((e,t)=>ea(e,"name",{value:t,configurable:!0}),"o");const Gc=ta(e=>{Ir(e);try{const t=An(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(Sn(t))}'`);return}catch(t){if(t.code!=="ENOENT")throw t}try{Qi(e,{recursive:!0})}catch(t){if(t.code!=="EEXIST")throw t;const s=An(e);if(!s.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(Sn(s))}'`,{cause:t})}},"ensureDirSync");var ra=Object.defineProperty,na=x((e,t)=>ra(e,"name",{value:t,configurable:!0}),"$e"),oa=Object.defineProperty,an=na((e,t)=>oa(e,"name",{value:t,configurable:!0}),"W"),sa=Object.defineProperty,v=an((e,t)=>sa(e,"name",{value:t,configurable:!0}),"u$1");let zn=v(()=>{var e=(()=>{var t=Object.defineProperty,s=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyNames,u=Object.prototype.hasOwnProperty,d=v((r,n)=>{for(var o in n)t(r,o,{get:n[o],enumerable:!0})},"ne"),h=v((r,n,o,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of l(n))!u.call(r,i)&&i!==o&&t(r,i,{get:v(()=>n[i],"get"),enumerable:!(a=s(n,i))||a.enumerable});return r},"ae"),m=v(r=>h(t({},"__esModule",{value:!0}),r),"oe"),j={};d(j,{zeptomatch:v(()=>Pe,"zeptomatch")});var A=v(r=>{const n=new Set,o=[r];for(let a=0;a<o.length;a++){const i=o[a];if(n.has(i))continue;n.add(i);const{children:c}=i;if(c?.length)for(let f=0,g=c.length;f<g;f++)o.push(c[f])}return Array.from(n)},"M"),P=v(r=>{let n="";const o=A(r);for(let a=0,i=o.length;a<i;a++){const c=o[a];if(!c.regex)continue;const f=c.regex.flags;if(n||(n=f),n!==f)throw new Error(`Inconsistent RegExp flags used: "${n}" and "${f}"`)}return n},"se"),O=v((r,n,o)=>{const a=o.get(r);if(a!==void 0)return a;const i=r.partial??n;let c="";if(r.regex&&(c+=i?"(?:$|":"",c+=r.regex.source),r.children?.length){const f=T(r.children.map(g=>O(g,n,o)).filter(Boolean));if(f?.length){const g=r.children.some(D=>!D.regex||!(D.partial??n)),w=f.length>1||i&&(!c.length||g);c+=w?i?"(?:$|":"(?:":"",c+=f.join("|"),c+=w?")":""}}return r.regex&&(c+=i?")":""),o.set(r,c),c},"O"),N=v((r,n)=>{const o=new Map,a=A(r);for(let i=a.length-1;i>=0;i--){const c=O(a[i],n,o);if(!(i>0))return c}return""},"ie"),T=v(r=>Array.from(new Set(r)),"ue"),E=v((r,n,o)=>E.compile(r,o).test(n),"R");E.compile=(r,n)=>{const o=n?.partial??!1,a=N(r,o),i=P(r);return new RegExp(`^(?:${a})$`,i)};var q=E,G=v((r,n)=>{const o=q.compile(r,n),a=`${o.source.slice(0,-1)}[\\\\/]?$`,i=o.flags;return new RegExp(a,i)},"le"),re=G,Me=v(r=>{const n=r.map(a=>a.source).join("|")||"$^",o=r[0]?.flags;return new RegExp(n,o)},"ve"),_e=Me,K=v(r=>Array.isArray(r),"j"),B=v(r=>typeof r=="function","_"),Te=v(r=>r.length===0,"he"),Re=(()=>{const{toString:r}=Function.prototype,n=/(?:^\(\s*(?:[^,.()]|\.(?!\.\.))*\s*\)\s*=>|^\s*[a-zA-Z$_][a-zA-Z0-9$_]*\s*=>)/;return o=>(o.length===0||o.length===1)&&n.test(r.call(o))})(),Ke=v(r=>typeof r=="number","de"),Xe=v(r=>typeof r=="object"&&r!==null,"xe"),Ye=v(r=>r instanceof RegExp,"me"),Qe=(()=>{const r=/\\\(|\((?!\?(?::|=|!|<=|<!))/;return n=>r.test(n.source)})(),et=(()=>{const r=/^[a-zA-Z0-9_-]+$/;return n=>r.test(n.source)&&!n.flags.includes("i")})(),ce=v(r=>typeof r=="string","A"),z=v(r=>r===void 0,"f"),tt=v(r=>{const n=new Map;return o=>{const a=n.get(o);if(a!==void 0)return a;const i=r(o);return n.set(o,i),i}},"ye"),ue=v((r,n,o={})=>{const a={cache:{},input:r,index:0,indexBacktrackMax:0,options:o,output:[]},i=M(n)(a),c=Math.max(a.index,a.indexBacktrackMax);if(i&&a.index===r.length)return a.output;throw new Error(`Failed to parse at index ${c}`)},"I"),p=v((r,n)=>K(r)?rt(r,n):ce(r)?fe(r,n):nt(r,n),"i"),rt=v((r,n)=>{const o={};for(const a of r){if(a.length!==1)throw new Error(`Invalid character: "${a}"`);const i=a.charCodeAt(0);o[i]=!0}return a=>{const i=a.input;let c=a.index,f=c;for(;f<i.length&&i.charCodeAt(f)in o;)f+=1;if(f>c){if(!z(n)&&!a.options.silent){const g=i.slice(c,f),w=B(n)?n(g,i,`${c}`):n;z(w)||a.output.push(w)}a.index=f}return!0}},"we"),nt=v((r,n)=>{if(et(r))return fe(r.source,n);{const o=r.source,a=r.flags.replace(/y|$/,"y"),i=new RegExp(o,a);return Qe(r)&&B(n)&&!Re(n)?ot(i,n):st(i,n)}},"$e"),ot=v((r,n)=>o=>{const a=o.index,i=o.input;r.lastIndex=a;const c=r.exec(i);if(c){const f=r.lastIndex;if(!o.options.silent){const g=n(...c,i,`${a}`);z(g)||o.output.push(g)}return o.index=f,!0}else return!1},"Ee"),st=v((r,n)=>o=>{const a=o.index,i=o.input;if(r.lastIndex=a,r.test(i)){const c=r.lastIndex;if(!z(n)&&!o.options.silent){const f=B(n)?n(i.slice(a,c),i,`${a}`):n;z(f)||o.output.push(f)}return o.index=c,!0}else return!1},"Ce"),fe=v((r,n)=>o=>{const a=o.index,i=o.input;if(i.startsWith(r,a)){if(!z(n)&&!o.options.silent){const c=B(n)?n(r,i,`${a}`):n;z(c)||o.output.push(c)}return o.index+=r.length,!0}else return!1},"F"),X=v((r,n,o,a)=>{const i=M(r),c=n>1;return Q(Y(de(f=>{let g=0;for(;g<o;){const w=f.index;if(!i(f)||(g+=1,f.index===w))break}return g>=n},c),a))},"k"),pe=v((r,n)=>X(r,0,1,n),"L"),Z=v((r,n)=>X(r,0,1/0,n),"$"),it=v((r,n)=>X(r,1,1/0,n),"Re"),C=v((r,n)=>{const o=r.map(M);return Q(Y(de(a=>{for(let i=0,c=o.length;i<c;i++)if(!o[i](a))return!1;return!0}),n))},"x"),k=v((r,n)=>{const o=r.map(M);return Q(Y(a=>{for(let i=0,c=o.length;i<c;i++)if(o[i](a))return!0;return!1},n))},"p"),de=v((r,n=!0,o=!1)=>{const a=M(r);return n?i=>{const c=i.index,f=i.output.length,g=a(i);return!g&&!o&&(i.indexBacktrackMax=Math.max(i.indexBacktrackMax,i.index)),(!g||o)&&(i.index=c,i.output.length!==f&&(i.output.length=f)),g}:a},"q"),Y=v((r,n)=>{const o=M(r);return n?a=>{if(a.options.silent)return o(a);const i=a.output.length;if(o(a)){const c=a.output.splice(i,1/0),f=n(c);return z(f)||a.output.push(f),!0}else return!1}:o},"B"),Q=(()=>{let r=0;return n=>{const o=M(n),a=r+=1;return i=>{var c;if(i.options.memoization===!1)return o(i);const f=i.index,g=(c=i.cache)[a]||(c[a]={indexMax:-1,queue:[]}),w=g.queue;if(f<=g.indexMax){const U=g.store||(g.store=new Map);if(w.length){for(let F=0,ur=w.length;F<ur;F+=2){const fr=w[F*2],pr=w[F*2+1];U.set(fr,pr)}w.length=0}const S=U.get(f);if(S===!1)return!1;if(Ke(S))return i.index=S,!0;if(S)return i.index=S.index,S.output?.length&&i.output.push(...S.output),!0}const D=i.output.length,cr=o(i);if(g.indexMax=Math.max(g.indexMax,f),cr){const U=i.index,S=i.output.length;if(S>D){const F=i.output.slice(D,S);w.push(f,{index:U,output:F})}else w.push(f,U);return!0}else return w.push(f,!1),!1}}})(),ge=v(r=>{let n;return o=>(n||(n=M(r())),n(o))},"G"),M=tt(r=>{if(B(r))return Te(r)?ge(r):r;if(ce(r)||Ye(r))return p(r);if(K(r))return C(r);if(Xe(r))return k(Object.values(r));throw new Error("Invalid rule")}),R=v(r=>r,"d"),at=v(r=>typeof r=="string","ke"),lt=v(r=>{const n=new WeakMap,o=new WeakMap;return(a,i)=>{const c=i?.partial?o:n,f=c.get(a);if(f!==void 0)return f;const g=r(a,i);return c.set(a,g),g}},"Be"),ct=v(r=>{const n={},o={};return(a,i)=>{const c=i?.partial?o:n;return c[a]??(c[a]=r(a,i))}},"Pe"),ut=p(/\\./,R),ft=p(/./,R),pt=p(/\*\*\*+/,"*"),dt=p(/([^/{[(!])\*\*/,(r,n)=>`${n}*`),gt=p(/(^|.)\*\*(?=[^*/)\]}])/,(r,n)=>`${n}*`),mt=Z(k([ut,pt,dt,gt,ft])),ht=mt,bt=v(r=>ue(r,ht,{memoization:!1}).join(""),"Ie"),yt=bt,me="abcdefghijklmnopqrstuvwxyz",$t=v(r=>{let n="";for(;r>0;){const o=(r-1)%26;n=me[o]+n,r=Math.floor((r-1)/26)}return n},"Le"),he=v(r=>{let n=0;for(let o=0,a=r.length;o<a;o++)n=n*26+me.indexOf(r[o])+1;return n},"V"),ee=v((r,n)=>{if(n<r)return ee(n,r);const o=[];for(;r<=n;)o.push(r++);return o},"b"),vt=v((r,n,o)=>ee(r,n).map(a=>String(a).padStart(o,"0")),"qe"),be=v((r,n)=>ee(he(r),he(n)).map($t),"W"),y=v(r=>({partial:!1,regex:new RegExp(r,"s"),children:[]}),"c"),L=v(r=>({children:r}),"y"),I=(()=>{const r=v((n,o,a)=>{if(a.has(n))return;a.add(n);const{children:i}=n;if(!i.length)i.push(o);else for(let c=0,f=i.length;c<f;c++)r(i[c],o,a)},"e");return n=>{if(!n.length)return L([]);for(let o=n.length-1;o>=1;o--){const a=new Set,i=n[o-1],c=n[o];r(i,c,a)}return n[0]}})(),_=v(()=>({regex:new RegExp("[\\\\/]","s"),children:[]}),"g"),xt=p(/\\./,y),wt=p(/[$.*+?^(){}[\]\|]/,r=>y(`\\${r}`)),jt=p(/[\\\/]/,_),Ot=p(/[^$.*+?^(){}[\]\|\\\/]+/,y),Pt=p(/^(?:!!)*!(.*)$/,(r,n)=>y(`(?!^${Pe.compile(n).source}$).*?`)),Et=p(/^(!!)+/),kt=k([Pt,Et]),St=p(/\/(\*\*\/)+/,()=>L([I([_(),y(".+?"),_()]),_()])),At=p(/^(\*\*\/)+/,()=>L([y("^"),I([y(".*?"),_()])])),zt=p(/\/(\*\*)$/,()=>L([I([_(),y(".*?")]),y("$")])),Mt=p(/\*\*/,()=>y(".*?")),ye=k([St,At,zt,Mt]),_t=p(/\*\/(?!\*\*\/|\*$)/,()=>I([y("[^\\\\/]*?"),_()])),Tt=p(/\*/,()=>y("[^\\\\/]*")),$e=k([_t,Tt]),ve=p("?",()=>y("[^\\\\/]")),Rt=p("[",R),Nt=p("]",R),Bt=p(/[!^]/,"^\\\\/"),Ct=p(/[a-z]-[a-z]|[0-9]-[0-9]/i,R),It=p(/\\./,R),Ft=p(/[$.*+?^(){}[\|]/,r=>`\\${r}`),Wt=p(/[\\\/]/,"\\\\/"),Lt=p(/[^$.*+?^(){}[\]\|\\\/]+/,R),Dt=k([It,Ft,Wt,Ct,Lt]),xe=C([Rt,pe(Bt),Z(Dt),Nt],r=>y(r.join(""))),Ut=p("{","(?:"),qt=p("}",")"),Zt=p(/(\d+)\.\.(\d+)/,(r,n,o)=>vt(+n,+o,Math.min(n.length,o.length)).join("|")),Vt=p(/([a-z]+)\.\.([a-z]+)/,(r,n,o)=>be(n,o).join("|")),Jt=p(/([A-Z]+)\.\.([A-Z]+)/,(r,n,o)=>be(n.toLowerCase(),o.toLowerCase()).join("|").toUpperCase()),Gt=k([Zt,Vt,Jt]),we=C([Ut,Gt,qt],r=>y(r.join(""))),Ht=p("{"),Kt=p("}"),Xt=p(","),Yt=p(/\\./,y),Qt=p(/[$.*+?^(){[\]\|]/,r=>y(`\\${r}`)),er=p(/[\\\/]/,_),tr=p(/[^$.*+?^(){}[\]\|\\\/,]+/,y),rr=ge(()=>Oe),nr=p("",()=>y("(?:)")),or=it(k([ye,$e,ve,xe,we,rr,Yt,Qt,er,tr]),I),je=k([or,nr]),Oe=C([Ht,pe(C([je,Z(C([Xt,je]))])),Kt],L),sr=Z(k([kt,ye,$e,ve,xe,we,Oe,xt,wt,jt,Ot]),I),ir=sr,ar=v(r=>ue(r,ir,{memoization:!1})[0],"kr"),lr=ar,te=v((r,n,o)=>te.compile(r,o).test(n),"N");te.compile=(()=>{const r=ct((o,a)=>re(lr(yt(o)),a)),n=lt((o,a)=>_e(o.map(i=>r(i,a))));return(o,a)=>at(o)?r(o,a):n(o,a)})();var Pe=te;return m(j)})();return e.default||e},"_lazyMatch"),Hr;const ia=v((e,t)=>(Hr||(Hr=zn(),zn=null),Hr(e,t)),"default");var aa=Object.defineProperty,la=an((e,t)=>aa(e,"name",{value:t,configurable:!0}),"t$1");const ca=/^[A-Z]:\//i,oe=la((e="")=>e&&e.replaceAll("\\","/").replace(ca,t=>t.toUpperCase()),"normalizeWindowsPath");var ua=Object.defineProperty,J=an((e,t)=>ua(e,"name",{value:t,configurable:!0}),"r");const fa=/^[/\\]{2}/,pa=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,go=/^[A-Z]:$/i,Mn=/^\/([A-Z]:)?$/i,da=/.(\.[^./]+)$/,ga=/^[/\\]|^[a-z]:[/\\]/i,ma=/\/$/,ha=/^win/i,ba=J(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd"),Hc="/",Kc=ha.test(globalThis.process?.platform??"")?";":":",mo=J((e,t)=>{let s="",l=0,u=-1,d=0,h;for(let m=0;m<=e.length;++m){if(m<e.length)h=e[m];else{if(h==="/")break;h="/"}if(h==="/"){if(!(u===m-1||d===1))if(d===2){if(s.length<2||l!==2||!s.endsWith(".")||s.at(-2)!=="."){if(s.length>2){const j=s.lastIndexOf("/");j===-1?(s="",l=0):(s=s.slice(0,j),l=s.length-1-s.lastIndexOf("/")),u=m,d=0;continue}else if(s.length>0){s="",l=0,u=m,d=0;continue}}t&&(s+=s.length>0?"/..":"..",l=2)}else s.length>0?s+=`/${e.slice(u+1,m)}`:s=e.slice(u+1,m),l=m-u-1;u=m,d=0}else h==="."&&d!==-1?++d:d=-1}return s},"normalizeString"),kr=J(e=>pa.test(e),"isAbsolute"),ho=J(function(e){if(e.length===0)return".";e=oe(e);const t=fa.exec(e),s=kr(e),l=e.at(-1)==="/";return e=mo(e,!s),e.length===0?s?"/":l?"./":".":(l&&(e+="/"),go.test(e)&&(e+="/"),t?s?`//${e}`:`//./${e}`:s&&!kr(e)?`/${e}`:e)},"normalize"),bo=J((...e)=>{let t="";for(const s of e)if(s)if(t.length>0){const l=t.at(-1)==="/",u=s[0]==="/";l&&u?t+=s.slice(1):t+=l||u?s:`/${s}`}else t+=s;return ho(t)},"join"),Yr=J(function(...e){e=e.map(l=>oe(l));let t="",s=!1;for(let l=e.length-1;l>=-1&&!s;l--){const u=l>=0?e[l]:ba();!u||u.length===0||(t=`${u}/${t}`,s=kr(u))}return t=mo(t,!s),s&&!kr(t)?`/${t}`:t.length>0?t:"."},"resolve");J(function(e){return oe(e)},"toNamespacedPath");const yo=J(function(e){return da.exec(oe(e))?.[1]??""},"extname"),Xc=J(function(e,t){const s=Yr(e).replace(Mn,"$1").split("/"),l=Yr(t).replace(Mn,"$1").split("/");if(l[0][1]===":"&&s[0][1]===":"&&s[0]!==l[0])return l.join("/");const u=[...s];for(const d of u){if(l[0]!==d)break;s.shift(),l.shift()}return[...s.map(()=>".."),...l].join("/")},"relative"),$o=J(e=>{const t=oe(e).replace(ma,"").split("/").slice(0,-1);return t.length===1&&go.test(t[0])&&(t[0]=`${t[0]}/`),t.join("/")||(kr(e)?"/":".")},"dirname");J(function(e){const t=[e.root,e.dir,e.base??e.name+e.ext].filter(Boolean);return oe(e.root?Yr(...t):t.join("/"))},"format");const ya=J((e,t)=>{const s=oe(e).split("/").pop();return t&&s.endsWith(t)?s.slice(0,-t.length):s},"basename"),Yc=J(function(e){const t=ga.exec(e)?.[0]?.replaceAll("\\","/")??"",s=ya(e),l=yo(s);return{base:s,dir:$o(e),ext:l,name:s.slice(0,s.length-l.length),root:t}},"parse");J((e,t)=>ia(t,ho(e)),"matchesGlob");var $a=Object.defineProperty,Fe=x((e,t)=>$a(e,"name",{value:t,configurable:!0}),"n$5"),va=Object.defineProperty,le=Fe((e,t)=>va(e,"name",{value:t,configurable:!0}),"a");const xa=Ce(import.meta.url),xr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,wa=le(e=>{if(typeof xr<"u"&&xr.versions&&xr.versions.node){const[t,s]=xr.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return xr.getBuiltinModule(e)}return xa(e)},"__cjs_getBuiltinModule"),{fileURLToPath:ja}=wa("node:url");var Oa=Object.defineProperty,Je=le((e,t)=>Oa(e,"name",{value:t,configurable:!0}),"t$1");function Fr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}x(Fr,"m$4");Fe(Fr,"d");le(Fr,"getDefaultExportFromCjs");Je(Fr,"getDefaultExportFromCjs");function ln(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}x(ln,"h$2");Fe(ln,"O");le(ln,"getDefaultExportFromNamespaceIfPresent");Je(ln,"getDefaultExportFromNamespaceIfPresent");function cn(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")&&Object.keys(e).length===1?e.default:e}x(cn,"x$3");Fe(cn,"P");le(cn,"getDefaultExportFromNamespaceIfNotNamed");Je(cn,"getDefaultExportFromNamespaceIfNotNamed");function un(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var s=Je(le(Fe(x(function l(){var u=!1;try{u=this instanceof l}catch{}return u?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)},"a"),"s"),"a"),"a");s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach(function(l){var u=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(s,l,u.get?u:{enumerable:!0,get:Je(function(){return e[l]},"get")})}),s}x(un,"y$3");Fe(un,"_");le(un,"getAugmentedNamespace");Je(un,"getAugmentedNamespace");var _n,Tn;function fn(){return Tn||(Tn=1,_n=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cr3","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),_n}x(fn,"w$2");Fe(fn,"k");le(fn,"requireBinaryExtensions");var Pa=fn();const Ea=Fr(Pa);var ka=Object.defineProperty,se=le((e,t)=>ka(e,"name",{value:t,configurable:!0}),"r");const Sa=new Set(Ea),Aa=new Set(["/","\\",void 0]),Rn=Symbol.for("pathe:normalizedAlias"),za=/(^|[/\\])([^/\\]+?)(?=(?:\.[^.]+)?$)/,Ma=se((e,t)=>t.split("/").length-e.split("/").length,"compareAliases"),Nr=se((e="/")=>{const t=e.at(-1);return t==="/"||t==="\\"},"hasTrailingSlash"),vo=se(e=>{if(e[Rn])return e;const t=Object.fromEntries(Object.entries(e).toSorted(([s],[l])=>Ma(s,l)));for(const s in t)for(const l in t)l===s||s.startsWith(l)||t[s].startsWith(l)&&Aa.has(t[s][l.length])&&(t[s]=t[l]+t[s].slice(l.length));return Object.defineProperty(t,Rn,{enumerable:!1,value:!0}),t},"normalizeAliases");se((e,t)=>{e=oe(e),t=vo(t);for(const[s,l]of Object.entries(t)){if(!e.startsWith(s))continue;const u=Nr(s)?s.slice(0,-1):s;if(Nr(e[u.length]))return bo(l,e.slice(s.length))}return e},"resolveAlias");se(e=>za.exec(e)?.[2],"filename");se((e,t)=>{e=oe(e),t=vo(t);for(const[s,l]of Object.entries(t).toReversed()){if(!e.startsWith(l))continue;const u=Nr(l)?l.slice(0,-1):l;if(Nr(e[u.length]))return bo(s,e.slice(l.length))}return e},"reverseResolveAlias");const _a=/^(?:\.?\.[/\\]|\.\.\B)/,Ta=/^(?:msys|cygwin)$/;se(e=>_a.test(e)||e==="..","isRelative");se(e=>Sa.has(yo(e).slice(1).toLowerCase()),"isBinaryPath");const Wr=se(e=>oe(e instanceof URL?ja(e):e),"toPath");se(()=>{if(!globalThis.process)return!1;if(globalThis.process.platform==="win32"||globalThis.process.platform==="cygwin")return!0;const e=globalThis.process.env.OSTYPE;return typeof e!="string"?!1:Ta.test(e)},"isWindows");var Ra=Object.defineProperty,xo=x((e,t)=>Ra(e,"name",{value:t,configurable:!0}),"t$8"),Na=Object.defineProperty,pn=xo((e,t)=>Na(e,"name",{value:t,configurable:!0}),"t");const Ba=Ce(import.meta.url),wr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ca=pn(e=>{if(typeof wr<"u"&&wr.versions&&wr.versions.node){const[t,s]=wr.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return wr.getBuiltinModule(e)}return Ba(e)},"__cjs_getBuiltinModule"),{accessSync:Ia}=Ca("node:fs");var Fa=Object.defineProperty,Wa=pn((e,t)=>Fa(e,"name",{value:t,configurable:!0}),"o");function ae(e,t=Xr){Ir(e),e=Wr(e);try{return Ia(e,t),!0}catch{return!1}}x(ae,"i$7");xo(ae,"d");pn(ae,"m");Wa(ae,"isAccessibleSync");var La=Object.defineProperty,wo=x((e,t)=>La(e,"name",{value:t,configurable:!0}),"t$7"),Da=Object.defineProperty,jo=wo((e,t)=>Da(e,"name",{value:t,configurable:!0}),"t"),Ua=Object.defineProperty,qa=jo((e,t)=>Ua(e,"name",{value:t,configurable:!0}),"o");let Nn=class extends Error{static{x(this,"c")}static{wo(this,"i")}static{jo(this,"n")}static{qa(this,"PermissionError")}constructor(t){super(`EPERM: Operation not permitted, ${t}`)}get code(){return"EPERM"}set code(t){throw new Error("Cannot overwrite code EPERM")}get name(){return"PermissionError"}set name(t){throw new Error("Cannot overwrite name of PermissionError")}};var Za=Object.defineProperty,Va=x((e,t)=>Za(e,"name",{value:t,configurable:!0}),"a$5"),Ja=Object.defineProperty,Oo=Va((e,t)=>Ja(e,"name",{value:t,configurable:!0}),"i");const Ga=Ce(import.meta.url),jr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Po=Oo(e=>{if(typeof jr<"u"&&jr.versions&&jr.versions.node){const[t,s]=jr.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return jr.getBuiltinModule(e)}return Ga(e)},"__cjs_getBuiltinModule"),{readFileSync:Ha}=Po("node:fs"),{unzipSync:Ka,brotliDecompressSync:Xa}=Po("node:zlib");var Ya=Object.defineProperty,Eo=Oo((e,t)=>Ya(e,"name",{value:t,configurable:!0}),"r");const Qa={brotli:Xa,gzip:Ka,none:Eo(e=>e,"none")},el=Eo((e,t)=>{if(Ir(e),e=Wr(e),!ae(e))throw new Nn(`unable to read the non-accessible file: ${e}`);if(!ae(e,fo))throw new Nn(`invalid access to read file at: ${e}`);const{buffer:s,compression:l,encoding:u,flag:d}=t??{},h=Ha(e,d?{encoding:u,flag:d}:{encoding:u}),m=Qa[l??"none"],j=m(h);return s?j:j.toString()},"readFileSync");var tl=Object.defineProperty,rl=x((e,t)=>tl(e,"name",{value:t,configurable:!0}),"x$2"),nl=Object.defineProperty,ko=rl((e,t)=>nl(e,"name",{value:t,configurable:!0}),"$"),ol=Object.defineProperty,sl=ko((e,t)=>ol(e,"name",{value:t,configurable:!0}),"A"),il=Object.defineProperty,dn=sl((e,t)=>il(e,"name",{value:t,configurable:!0}),"$"),al=Object.defineProperty,ll=dn((e,t)=>al(e,"name",{value:t,configurable:!0}),"r$1");const cl=ll(e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
2
+ `),"normalizeLF"),ul=globalThis.process??Object.create(null),Bn={versions:{}},Cn=new Proxy(ul,{get(e,t){if(t in e)return e[t];if(t in Bn)return Bn[t]}});var fl=Object.defineProperty,pl=dn((e,t)=>fl(e,"name",{value:t,configurable:!0}),"b");const dl=pl((e,t,s,l)=>{const u={column:0,line:-1,...e.start},d={...u,...e.end},h=u.line,m=u.column,j=d.line,A=d.column;let P=Math.max(h-(s+1),0),O=Math.min(t.length,j+l);h===-1&&(P=0),j===-1&&(O=t.length);const N=j-h,T={};if(N)for(let E=0;E<=N;E++){const q=E+h;if(!m)T[q]=!0;else if(E===0){const G=t[q-1]?.length;T[q]=[m,(G??0)-m+1]}else if(E===N)T[q]=[0,A];else{const G=t[q-E]?.length;T[q]=[0,G]}}else m===A?T[h]=m?[m,0]:!0:T[h]=[m,(A??0)-(m??0)];return{end:O,markerLines:T,start:P}},"getMarkerLines");var gl=Object.defineProperty,_r=dn((e,t)=>gl(e,"name",{value:t,configurable:!0}),"t");const ml=Cn.platform==="win32"&&!Cn.env?.WT_SESSION?">":"❯",hl=_r((e,t,s)=>{const l={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...s,color:{gutter:_r(E=>E,"gutter"),marker:_r(E=>E,"marker"),message:_r(E=>E,"message"),...s?.color}},u=typeof t.start.column=="number";let d=cl(e).split(`
3
+ `);typeof l.tabWidth=="number"&&(d=d.map(E=>E.replaceAll(" "," ".repeat(l.tabWidth))));const{end:h,markerLines:m,start:j}=dl(t,d,l.linesAbove,l.linesBelow),A=String(h).length,{gutter:P,marker:O,message:N}=l.color;let T=d.slice(j,h).map((E,q)=>{const G=j+1+q,re=m[G],Me=` ${String(G)}`.slice(-A),_e=!m[G+1],K=` ${Me}${l.showGutter?" |":""}`;if(re){let B="";if(Array.isArray(re)){const Te=E.replaceAll(/[^\t]/g," ").slice(0,Math.max(re[0]-1,0)),Re=re[1]||1;B=[`
4
+ `,l.prefix+P(K.replaceAll(/\d/g," "))," ",Te,O("^").repeat(Re)].join(""),_e&&l.message&&(B+=` ${N(l.message)}`)}return[l.prefix+O(ml),P(K),E.length>0?` ${E}`:"",B].join("")}return`${l.prefix} ${P(K)}${E.length>0?` ${E}`:""}`}).join(`
5
+ `);return l.message&&!u&&(T=`${l.prefix+" ".repeat(A+1)+l.message}
6
+ ${T}`),T},"codeFrame");var bl=Object.defineProperty,yl=ko((e,t)=>bl(e,"name",{value:t,configurable:!0}),"s"),$l=Object.defineProperty,vl=yl((e,t)=>$l(e,"name",{value:t,configurable:!0}),"o"),xl=Object.defineProperty,gn=vl((e,t)=>xl(e,"name",{value:t,configurable:!0}),"l");const In=gn((e,t)=>{let s=0,l=t.length-2;for(;s<l;){const u=s+(l-s>>1);if(e<t[u])l=u-1;else if(e>=t[u+1])s=u+1;else{s=u;break}}return s},"binarySearch"),wl=/\n|\r(?!\n)/,jl=gn(e=>e.split(wl).reduce((t,s)=>(t.push(t.at(-1)+s.length+1),t),[0]),"getLineStartIndexes"),Ol=gn((e,t,s)=>{const l=s?.skipChecks??!1;if(!l&&(!Array.isArray(e)&&typeof e!="string"||(typeof e=="string"||Array.isArray(e))&&e.length===0))return{column:0,line:0};if(!l&&(typeof t!="number"||typeof e=="string"&&t>=e.length||Array.isArray(e)&&t+1>=e.at(-1)))return{column:0,line:0};if(typeof e=="string"){const d=jl(e),h=In(t,d);return{column:t-d[h]+1,line:h+1}}const u=In(t,e);return{column:t-e[u]+1,line:u+1}},"indexToLineColumn");var Pl=Object.defineProperty,So=x((e,t)=>Pl(e,"name",{value:t,configurable:!0}),"t$6"),El=Object.defineProperty,Ao=So((e,t)=>El(e,"name",{value:t,configurable:!0}),"t"),kl=Object.defineProperty,Sl=Ao((e,t)=>kl(e,"name",{value:t,configurable:!0}),"i");let Al=class extends Error{static{x(this,"m")}static{So(this,"m")}static{Ao(this,"t")}static{Sl(this,"JSONError")}fileName;codeFrame;name="JSONError";#e;constructor(t){super(),this.#e=t}get message(){return`${this.#e}${this.fileName?` in ${this.fileName}`:""}${this.codeFrame?`
7
+
8
+ ${this.codeFrame}
9
+ `:""}`}set message(t){this.#e=t}};var zl=Object.defineProperty,zo=x((e,t)=>zl(e,"name",{value:t,configurable:!0}),"u$3"),Ml=Object.defineProperty,Mo=zo((e,t)=>Ml(e,"name",{value:t,configurable:!0}),"s"),_l=Object.defineProperty,zr=Mo((e,t)=>_l(e,"name",{value:t,configurable:!0}),"a");const Tl=zr(e=>String.raw`\u{${e.codePointAt(0).toString(16)}}`,"getCodePoint"),Rl=zr((e,t,s)=>hl(e,{start:t},{tabWidth:!1,...s}),"generateCodeFrame"),Nl=/in JSON at position (\d+)(?: \(line (\d+) column (\d+)\))?$/,Bl=zr((e,t)=>{const s=Nl.exec(t);if(!s)return;const[,l,u,d]=s;if(u&&d)return{column:Number(d),line:Number(u)};let h=Number(l);return h===e.length&&(h=e.length-1),Ol(e,h)},"getErrorLocation"),Cl=/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,Il=zr(e=>e.replace(Cl,(t,s,l)=>`"${l}"(${Tl(l)})`),"addCodePointToUnexpectedToken");function Lr(e,t,s,l){typeof t=="string"&&(typeof s=="object"&&(l=s),s=t,t=void 0);let u;try{return JSON.parse(e,t)}catch(m){u=m.message}let d;e?(d=Bl(e,u),u=Il(u)):u+=" while parsing empty string";const h=new Al(u);throw h.fileName=s,d&&(h.codeFrame=Rl(e,d,l)),h}x(Lr,"d$3");zo(Lr,"w");Mo(Lr,"E");zr(Lr,"parseJson");var Fl=Object.defineProperty,_o=x((e,t)=>Fl(e,"name",{value:t,configurable:!0}),"t$5"),Wl=Object.defineProperty,To=_o((e,t)=>Wl(e,"name",{value:t,configurable:!0}),"t"),Ll=Object.defineProperty,Dl=To((e,t)=>Ll(e,"name",{value:t,configurable:!0}),"r");function mn(e,t,s){typeof t=="object"&&(s=t,t=void 0);const l=el(e,{buffer:!0,encoding:void 0});let u=new TextDecoder().decode(l);const{beforeParse:d,color:h}=s??{};return typeof d=="function"&&(u=d(u)),Lr(u,t,Wr(e),{color:h})}x(mn,"n$3");_o(mn,"s");To(mn,"J");Dl(mn,"readJsonSync");var Ul=Object.defineProperty,ql=x((e,t)=>Ul(e,"name",{value:t,configurable:!0}),"a$3"),Zl=Object.defineProperty,Vl=ql((e,t)=>Zl(e,"name",{value:t,configurable:!0}),"t"),Jl=Object.defineProperty,Gl=Vl((e,t)=>Jl(e,"name",{value:t,configurable:!0}),"e");const Hl=Gl(e=>{if(typeof e!="string"&&!(e instanceof ArrayBuffer)&&!ArrayBuffer.isView(e))throw new TypeError("File contents must be a string, ArrayBuffer, or ArrayBuffer view.")},"assertValidFileContents");var Kl=Object.defineProperty,Xl=x((e,t)=>Kl(e,"name",{value:t,configurable:!0}),"t$3"),Yl=Object.defineProperty,Ql=Xl((e,t)=>Yl(e,"name",{value:t,configurable:!0}),"r"),ec=Object.defineProperty,tc=Ql((e,t)=>ec(e,"name",{value:t,configurable:!0}),"f");const rc=new TextEncoder,nc=tc(e=>{if(e instanceof Uint8Array)return e;if(typeof e=="string")return rc.encode(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e)){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(t)}throw new TypeError("Invalid contents type. Expected string or ArrayBuffer.")},"toUint8Array");var oc=Object.defineProperty,sc=x((e,t)=>oc(e,"name",{value:t,configurable:!0}),"m"),ic=Object.defineProperty,Ro=sc((e,t)=>ic(e,"name",{value:t,configurable:!0}),"s");const ac=Ce(import.meta.url),Or=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,lc=Ro(e=>{if(typeof Or<"u"&&Or.versions&&Or.versions.node){const[t,s]=Or.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return Or.getBuiltinModule(e)}return ac(e)},"__cjs_getBuiltinModule"),{mkdirSync:cc,writeFileSync:uc,statSync:fc,renameSync:Fn,chownSync:pc,chmodSync:dc,unlinkSync:gc}=lc("node:fs");var mc=Object.defineProperty,hc=Ro((e,t)=>mc(e,"name",{value:t,configurable:!0}),"f");const bc=hc((e,t,s)=>{s={encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...s},Ir(e),Hl(t),e=Wr(e);const l=`${e}.tmp`;try{const u=ae(e,Xr);if(!u&&s.recursive){const h=$o(e);ae(h,Xr)||cc(h,{recursive:!0})}let d;if(uc(l,nc(t),{encoding:s.encoding,flag:s.flag}),u&&!s.overwrite&&(d=fc(e),s.chown??={gid:d.gid,uid:d.uid},Fn(e,`${e}.bak`)),s.chown)try{pc(l,s.chown.uid,s.chown.gid)}catch{}dc(l,d&&!s.mode?d.mode:s.mode??438),Fn(l,e)}catch(u){throw new Error(`Failed to write file at: ${e} - ${u.message}`,{cause:u})}finally{ae(l)&&gc(`${e}.tmp`)}},"writeFileSync");var yc=Object.defineProperty,Ae=x((e,t)=>yc(e,"name",{value:t,configurable:!0}),"i$2"),$c=Object.defineProperty,ze=Ae((e,t)=>$c(e,"name",{value:t,configurable:!0}),"s"),vc=Object.defineProperty,We=ze((e,t)=>vc(e,"name",{value:t,configurable:!0}),"i");const xc=/^(?:( )+|\t+)/,Mr="space";function Sr(e,t,s){return e&&t===Mr&&s===1}x(Sr,"d$1");Ae(Sr,"g");ze(Sr,"I");We(Sr,"shouldIgnoreSingleSpace");function Ar(e,t){const s=new Map;let l=0,u,d;for(const h of e.split(/\n/g)){if(!h)continue;const m=h.match(xc);if(m===null)l=0,u="";else{const j=m[0].length,A=m[1]?Mr:"tab";if(Sr(t,A,j))continue;A!==u&&(l=0),u=A;let P=1,O=0;const N=j-l;if(l=j,N===0)P=0,O=1;else{const E=Math.abs(N);if(Sr(t,A,E))continue;d=Dr(A,E)}const T=s.get(d);s.set(d,T===void 0?[1,0]:[T[0]+P,T[1]+O])}}return s}x(Ar,"p$1");Ae(Ar,"y");ze(Ar,"h");We(Ar,"makeIndentsMap");function Dr(e,t){return(e===Mr?"s":"t")+String(t)}x(Dr,"b$1");Ae(Dr,"v");ze(Dr,"m");We(Dr,"encodeIndentsKey");function Ur(e){const t=e[0]==="s"?Mr:"tab",s=Number(e.slice(1));return{type:t,amount:s}}x(Ur,"v");Ae(Ur,"M");ze(Ur,"_");We(Ur,"decodeIndentsKey");function qr(e){let t,s=0,l=0;for(const[u,[d,h]]of e)(d>s||d===s&&h>l)&&(s=d,l=h,t=u);return t}x(qr,"I");Ae(qr,"S");ze(qr,"k");We(qr,"getMostUsedKey");function Zr(e,t){return(e===Mr?" ":" ").repeat(t)}x(Zr,"h");Ae(Zr,"k");ze(Zr,"D");We(Zr,"makeIndentString");function Vr(e){if(typeof e!="string")throw new TypeError("Expected a string");let t=Ar(e,!0);t.size===0&&(t=Ar(e,!1));const s=qr(t);let l,u=0,d="";return s!==void 0&&({type:l,amount:u}=Ur(s),d=Zr(l,u)),{amount:u,type:l,indent:d}}x(Vr,"M");Ae(Vr,"x");ze(Vr,"C");We(Vr,"detectIndent");var wc=Object.defineProperty,jc=x((e,t)=>wc(e,"name",{value:t,configurable:!0}),"a$1"),Oc=Object.defineProperty,No=jc((e,t)=>Oc(e,"name",{value:t,configurable:!0}),"i");const Pc=Ce(import.meta.url),Pr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ec=No(e=>{if(typeof Pr<"u"&&Pr.versions&&Pr.versions.node){const[t,s]=Pr.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return Pr.getBuiltinModule(e)}return Pc(e)},"__cjs_getBuiltinModule"),{readFileSync:kc}=Ec("node:fs");var Sc=Object.defineProperty,Ac=No((e,t)=>Sc(e,"name",{value:t,configurable:!0}),"r");const tu=Ac((e,t,s={})=>{const{detectIndent:l,indent:u,replacer:d,stringify:h=JSON.stringify,...m}={indent:" ",...s};let j=u,A=`
10
+ `;if(ae(e,fo))try{const O=kc(e,"utf8");if(l){const{indent:N}=Vr(O);j=N}A=O.endsWith(`
11
+ `)?`
12
+ `:""}catch(O){if(O.code!=="ENOENT")throw O}const P=h(t,d,j);bc(e,`${P}${A}`,m)},"writeJsonSync");var zc=Object.defineProperty,Mc=x((e,t)=>zc(e,"name",{value:t,configurable:!0}),"s");class hn extends Error{static{x(this,"VisConfigError")}static{Mc(this,"VisConfigError")}chain;constructor(t,s,l){super(t,l),this.name=this.constructor.name,this.chain=s}}var _c=Object.defineProperty,Tc=x((e,t)=>_c(e,"name",{value:t,configurable:!0}),"e");class ru extends hn{static{x(this,"VisConfigCycleError")}static{Tc(this,"VisConfigCycleError")}constructor(t,s){const l=[...s,`${t} (re-enters)`].join(" → ");super(`Config cycle: ${l}`,s)}}var Rc=Object.defineProperty,Nc=x((e,t)=>Rc(e,"name",{value:t,configurable:!0}),"t$1");class nu extends hn{static{x(this,"VisConfigLoadError")}static{Nc(this,"VisConfigLoadError")}constructor(t,s,l){const u=l instanceof Error?l.message:String(l),d=s.length>0?`
13
+ Chain: ${s.join(" → ")}`:"";super(`Failed to load ${t}: ${u}${d}`,s,{cause:l})}}var Bc=Object.defineProperty,Bo=x((e,t)=>Bc(e,"name",{value:t,configurable:!0}),"t");const Cc=Bo(e=>e.join(" → "),"formatChain");class ou extends hn{static{x(this,"VisConfigNotFoundError")}static{Bo(this,"VisConfigNotFoundError")}constructor(t,s,l){const u=s.length>0?s[s.length-1]:"<unknown>",d=l.length>0?`
14
+ Tried:
15
+ ${l.join(`
16
+ `)}`:"";super(`Cannot resolve "${t}" extended from ${u}.${d}
17
+ Chain: ${Cc(s)}`,s)}}var Ic=Object.defineProperty,Co=x((e,t)=>Ic(e,"name",{value:t,configurable:!0}),"i$1");const Wn="@inherit",Fc=["aliases","dependsOn","inputs","outputs"],Wc=Co((e,t)=>{if(t===void 0)return e===void 0?void 0:[...e];if(!t.includes(Wn))return[...t];const s=[];for(const l of t){if(l===Wn){e!==void 0&&s.push(...e);continue}s.push(l)}return s},"mergeArrayWithInherit"),su=Co((e,t)=>{const s={...e,...t};for(const l of Fc){const u=e?.[l],d=t?.[l],h=Wc(u,d);h===void 0?delete s[l]:s[l]=h}return s},"mergeTargetWithInherit");var Ne;(function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"})(Ne||(Ne={}));var Lc=Object.defineProperty,Le=x((e,t)=>Lc(e,"name",{value:t,configurable:!0}),"i");const iu=Le(e=>{const{renameSpan:t,tracer:s}=e;let l;const u=new Map;return Do({hooks:{"run:after":Le(d=>{if(!l)return;const h=[...d.values()].filter(m=>m.status==="failure").length;l.setAttribute("vis.run.tasks_total",d.size),l.setAttribute("vis.run.tasks_failed",h),h>0?l.setStatus({code:Ne.ERROR,message:`${String(h)} task(s) failed`}):l.setStatus({code:Ne.OK}),l.end(),l=void 0;for(const m of u.values())m.end();u.clear()},"run:after"),"run:before":Le(d=>{l&&(l.setStatus({code:Ne.ERROR,message:"run:before fired while previous run was still active"}),l.end());for(const h of u.values())h.end();u.clear(),l=s.startSpan("vis.run",{attributes:{"vis.run.task_count":d.tasks.length,"vis.workspace_root":d.workspaceRoot}})},"run:before"),"task:after":Le((d,h)=>{const m=u.get(d.id);m&&(m.setAttribute("vis.task.exit_code",h.code??0),m.setAttribute("vis.task.cache_status",h.status),m.end(),u.delete(d.id))},"task:after"),"task:before":Le(d=>{const h=u.get(d.id);h&&(h.setStatus({code:Ne.ERROR,message:"retried — superseded by new attempt"}),h.end());const m=s.startSpan(t?t(d):d.id,{attributes:{"vis.task.id":d.id,"vis.task.project":d.target.project,"vis.task.target":d.target.target}});u.set(d.id,m)},"task:before"),"task:failure":Le((d,h)=>{const m=u.get(d.id);m&&m.setStatus({code:Ne.ERROR,message:`Task failed with exit code ${String(h.code??-1)}`})},"task:failure")},name:"otel"})},"otelPlugin");export{el as $,bc as B,Yr as C,Zc as K,ho as L,bo as M,kr as O,ya as Q,Wr as U,ru as V,Xr as _,$o as a,nu as b,ou as c,Yc as d,Jc as e,Ir as f,Vc as g,Gc as h,ae as i,Kc as j,Nn as k,Sn as l,su as m,mn as n,iu as o,Lr as p,Hl as q,nc as r,fo as s,Vr as t,tu as w,Hc as y,Xc as z};
@@ -0,0 +1 @@
1
+ import"../packem_chunks/applyDefaults.js";import{o as e}from"./otel-CO8UEfTa.js";export{e as otelPlugin};
@@ -0,0 +1,109 @@
1
+ var X=Object.defineProperty;var s=(e,t)=>X(e,"name",{value:t,configurable:!0});import{$ as Y}from"./otel-CO8UEfTa.js";var ee=Object.defineProperty,A=s((e,t)=>ee(e,"name",{value:t,configurable:!0}),"i");/*!
2
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
3
+ * SPDX-License-Identifier: BSD-3-Clause
4
+ *
5
+ * Redistribution and use in source and binary forms, with or without
6
+ * modification, are permitted provided that the following conditions are met:
7
+ *
8
+ * 1. Redistributions of source code must retain the above copyright notice, this
9
+ * list of conditions and the following disclaimer.
10
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
11
+ * this list of conditions and the following disclaimer in the
12
+ * documentation and/or other materials provided with the distribution.
13
+ * 3. Neither the name of the copyright holder nor the names of its contributors
14
+ * may be used to endorse or promote products derived from this software without
15
+ * specific prior written permission.
16
+ *
17
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ */function C(e,t){let r=e.slice(0,t).split(/\r\n|\n|\r/g);return[r.length,r.pop().length+1]}s(C,"d$2");A(C,"getLineColFromPtr");function D(e,t,r){let n=e.split(/\r\n|\n|\r/g),o="",l=(Math.log10(t+1)|0)+1;for(let i=t-1;i<=t+1;i++){let a=n[i-1];a&&(o+=i.toString().padEnd(l," "),o+=": ",o+=a,o+=`
28
+ `,i===t&&(o+=" ".repeat(l+r+2),o+=`^
29
+ `))}return o}s(D,"m$3");A(D,"makeCodeBlock");class c extends Error{static{s(this,"TomlError")}static{A(this,"TomlError")}line;column;codeblock;constructor(t,r){const[n,o]=C(r.toml,r.ptr),l=D(r.toml,n,o);super(`Invalid TOML document: ${t}
30
+
31
+ ${l}`,r),this.line=n,this.column=o,this.codeblock=l}}var te=Object.defineProperty,g=s((e,t)=>te(e,"name",{value:t,configurable:!0}),"e");function V(e,t){let r=0;for(;e[t-++r]==="\\";);return--r&&r%2}s(V,"h$4");g(V,"isEscaped");function x(e,t=0,r=e.length){let n=e.indexOf(`
32
+ `,t);return e[n-1]==="\r"&&n--,n<=r?n:-1}s(x,"indexOfNewline");g(x,"indexOfNewline");function v(e,t){for(let r=t;r<e.length;r++){let n=e[r];if(n===`
33
+ `)return r;if(n==="\r"&&e[r+1]===`
34
+ `)return r+1;if(n<" "&&n!==" "||n==="")throw new c("control characters are not allowed in comments",{toml:e,ptr:t})}return e.length}s(v,"skipComment");g(v,"skipComment");function h(e,t,r,n){let o;for(;;){for(;(o=e[t])===" "||o===" "||!r&&(o===`
35
+ `||o==="\r"&&e[t+1]===`
36
+ `);)t++;if(n||o!=="#")break;t=v(e,t)}return t}s(h,"skipVoid");g(h,"skipVoid");function z(e,t,r,n,o=!1){if(!n)return t=x(e,t),t<0?e.length:t;for(let l=t;l<e.length;l++){let i=e[l];if(i==="#")l=x(e,l);else{if(i===r)return l+1;if(i===n||o&&(i===`
37
+ `||i==="\r"&&e[l+1]===`
38
+ `))return l}}throw new c("cannot find end of structure",{toml:e,ptr:t})}s(z,"skipUntil");g(z,"skipUntil");function P(e,t){let r=e[t],n=r===e[t+1]&&e[t+1]===e[t+2]?e.slice(t,t+3):r;t+=n.length-1;do t=e.indexOf(n,++t);while(t>-1&&r!=="'"&&V(e,t));return t>-1&&(t+=n.length,n.length>1&&(e[t]===r&&t++,e[t]===r&&t++)),t}s(P,"getStringEnd");g(P,"getStringEnd");var re=Object.defineProperty,ne=s((e,t)=>re(e,"name",{value:t,configurable:!0}),"l$1");/*!
39
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
40
+ * SPDX-License-Identifier: BSD-3-Clause
41
+ *
42
+ * Redistribution and use in source and binary forms, with or without
43
+ * modification, are permitted provided that the following conditions are met:
44
+ *
45
+ * 1. Redistributions of source code must retain the above copyright notice, this
46
+ * list of conditions and the following disclaimer.
47
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
48
+ * this list of conditions and the following disclaimer in the
49
+ * documentation and/or other materials provided with the distribution.
50
+ * 3. Neither the name of the copyright holder nor the names of its contributors
51
+ * may be used to endorse or promote products derived from this software without
52
+ * specific prior written permission.
53
+ *
54
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
55
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
56
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
57
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
58
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
59
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
60
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
61
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
62
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
63
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
64
+ */let ie=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;class w extends Date{static{s(this,"TomlDate")}static{ne(this,"TomlDate")}#t=!1;#r=!1;#e=null;constructor(t){let r=!0,n=!0,o="Z";if(typeof t=="string"){let l=t.match(ie);l?(l[1]||(r=!1,t=`0000-01-01T${t}`),n=!!l[2],n&&t[10]===" "&&(t=t.replace(" ","T")),l[2]&&+l[2]>23?t="":(o=l[3]||null,t=t.toUpperCase(),!o&&n&&(t+="Z"))):t=""}super(t),isNaN(this.getTime())||(this.#t=r,this.#r=n,this.#e=o)}isDateTime(){return this.#t&&this.#r}isLocal(){return!this.#t||!this.#r||!this.#e}isDate(){return this.#t&&!this.#r}isTime(){return this.#r&&!this.#t}isValid(){return this.#t||this.#r}toISOString(){let t=super.toISOString();if(this.isDate())return t.slice(0,10);if(this.isTime())return t.slice(11,23);if(this.#e===null)return t.slice(0,-1);if(this.#e==="Z")return t;let r=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return r=this.#e[0]==="-"?r:-r,new Date(this.getTime()-r*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(t,r="Z"){let n=new w(t);return n.#e=r,n}static wrapAsLocalDateTime(t){let r=new w(t);return r.#e=null,r}static wrapAsLocalDate(t){let r=new w(t);return r.#r=!1,r.#e=null,r}static wrapAsLocalTime(t){let r=new w(t);return r.#t=!1,r.#e=null,r}}var le=Object.defineProperty,L=s((e,t)=>le(e,"name",{value:t,configurable:!0}),"w$1");let oe=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,ae=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,fe=/^[+-]?0[0-9_]/,ue=/^[0-9a-f]{2,8}$/i,I={b:"\b",t:" ",n:`
65
+ `,f:"\f",r:"\r",e:"\x1B",'"':'"',"\\":"\\"};function N(e,t=0,r=e.length){let n=e[t]==="'",o=e[t++]===e[t]&&e[t]===e[t+1];o&&(r-=2,e[t+=2]==="\r"&&t++,e[t]===`
66
+ `&&t++);let l=0,i,a="",u=t;for(;t<r-1;){let f=e[t++];if(f===`
67
+ `||f==="\r"&&e[t]===`
68
+ `){if(!o)throw new c("newlines are not allowed in strings",{toml:e,ptr:t-1})}else if(f<" "&&f!==" "||f==="")throw new c("control characters are not allowed in strings",{toml:e,ptr:t-1});if(i){if(i=!1,f==="x"||f==="u"||f==="U"){let d=e.slice(t,t+=f==="x"?2:f==="u"?4:8);if(!ue.test(d))throw new c("invalid unicode escape",{toml:e,ptr:l});try{a+=String.fromCodePoint(parseInt(d,16))}catch{throw new c("invalid unicode escape",{toml:e,ptr:l})}}else if(o&&(f===`
69
+ `||f===" "||f===" "||f==="\r")){if(t=h(e,t-1,!0),e[t]!==`
70
+ `&&e[t]!=="\r")throw new c("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:l});t=h(e,t)}else if(f in I)a+=I[f];else throw new c("unrecognized escape sequence",{toml:e,ptr:l});u=t}else!n&&f==="\\"&&(l=t-1,i=!0,a+=e.slice(u,l))}return a+e.slice(u,r-1)}s(N,"parseString");L(N,"parseString");function Z(e,t,r,n){if(e==="true")return!0;if(e==="false")return!1;if(e==="-inf")return-1/0;if(e==="inf"||e==="+inf")return 1/0;if(e==="nan"||e==="+nan"||e==="-nan")return NaN;if(e==="-0")return n?0n:0;let o=oe.test(e);if(o||ae.test(e)){if(fe.test(e))throw new c("leading zeroes are not allowed",{toml:t,ptr:r});e=e.replace(/_/g,"");let i=+e;if(isNaN(i))throw new c("invalid number",{toml:t,ptr:r});if(o){if((o=!Number.isSafeInteger(i))&&!n)throw new c("integer value cannot be represented losslessly",{toml:t,ptr:r});(o||n===!0)&&(i=BigInt(e))}return i}const l=new w(e);if(!l.isValid())throw new c("invalid value",{toml:t,ptr:r});return l}s(Z,"parseValue");L(Z,"parseValue");var se=Object.defineProperty,F=s((e,t)=>se(e,"name",{value:t,configurable:!0}),"t$1");function B(e,t,r){let n=e.slice(t,r),o=n.indexOf("#");return o>-1&&(v(e,o),n=n.slice(0,o)),[n.trimEnd(),o]}s(B,"T$1");F(B,"sliceAndTrimEndOf");function j(e,t,r,n,o){if(n===0)throw new c("document contains excessively nested structures. aborting.",{toml:e,ptr:t});let l=e[t];if(l==="["||l==="{"){let[u,f]=l==="["?K(e,t,n,o):U(e,t,n,o);if(r){if(f=h(e,f),e[f]===",")f++;else if(e[f]!==r)throw new c("expected comma or end of structure",{toml:e,ptr:f})}return[u,f]}let i;if(l==='"'||l==="'"){i=P(e,t);let u=N(e,t,i);if(r){if(i=h(e,i),e[i]&&e[i]!==","&&e[i]!==r&&e[i]!==`
71
+ `&&e[i]!=="\r")throw new c("unexpected character encountered",{toml:e,ptr:i});i+=+(e[i]===",")}return[u,i]}i=z(e,t,",",r);let a=B(e,t,i-+(e[i-1]===","));if(!a[0])throw new c("incomplete key-value declaration: no value specified",{toml:e,ptr:t});return r&&a[1]>-1&&(i=h(e,t+a[1]),i+=+(e[i]===",")),[Z(a[0],e,t,o),i]}s(j,"extractValue");F(j,"extractValue");var ce=Object.defineProperty,_=s((e,t)=>ce(e,"name",{value:t,configurable:!0}),"m$2");let de=/^[a-zA-Z0-9-_]+[ \t]*$/;function O(e,t,r="="){let n=t-1,o=[],l=e.indexOf(r,t);if(l<0)throw new c("incomplete key-value: cannot find end of key",{toml:e,ptr:t});do{let i=e[t=++n];if(i!==" "&&i!==" ")if(i==='"'||i==="'"){if(i===e[t+1]&&i===e[t+2])throw new c("multiline strings are not allowed in keys",{toml:e,ptr:t});let a=P(e,t);if(a<0)throw new c("unfinished string encountered",{toml:e,ptr:t});n=e.indexOf(".",a);let u=e.slice(a,n<0||n>l?l:n),f=x(u);if(f>-1)throw new c("newlines are not allowed in keys",{toml:e,ptr:t+n+f});if(u.trimStart())throw new c("found extra tokens after the string part",{toml:e,ptr:a});if(l<a&&(l=e.indexOf(r,a),l<0))throw new c("incomplete key-value: cannot find end of key",{toml:e,ptr:t});o.push(N(e,t,a))}else{n=e.indexOf(".",t);let a=e.slice(t,n<0||n>l?l:n);if(!de.test(a))throw new c("only letter, numbers, dashes and underscores are allowed in keys",{toml:e,ptr:t});o.push(a.trimEnd())}}while(n+1&&n<l);return[o,h(e,l+1,!0,!0)]}s(O,"parseKey");_(O,"parseKey");function U(e,t,r,n){let o={},l=new Set,i;for(t++;(i=e[t++])!=="}"&&i;){if(i===",")throw new c("expected value, found comma",{toml:e,ptr:t-1});if(i==="#")t=v(e,t);else if(i!==" "&&i!==" "&&i!==`
72
+ `&&i!=="\r"){let a,u=o,f=!1,[d,m]=O(e,t-1);for(let $=0;$<d.length;$++){if($&&(u=f?u[a]:u[a]={}),a=d[$],(f=Object.hasOwn(u,a))&&(typeof u[a]!="object"||l.has(u[a])))throw new c("trying to redefine an already defined value",{toml:e,ptr:t});!f&&a==="__proto__"&&Object.defineProperty(u,a,{enumerable:!0,configurable:!0,writable:!0})}if(f)throw new c("trying to redefine an already defined value",{toml:e,ptr:t});let[y,W]=j(e,m,"}",r-1,n);l.add(y),u[a]=y,t=W}}if(!i)throw new c("unfinished table encountered",{toml:e,ptr:t});return[o,t]}s(U,"parseInlineTable");_(U,"parseInlineTable");function K(e,t,r,n){let o=[],l;for(t++;(l=e[t++])!=="]"&&l;){if(l===",")throw new c("expected value, found comma",{toml:e,ptr:t-1});if(l==="#")t=v(e,t);else if(l!==" "&&l!==" "&&l!==`
73
+ `&&l!=="\r"){let i=j(e,t-1,"]",r-1,n);o.push(i[0]),t=i[1]}}if(!l)throw new c("unfinished array encountered",{toml:e,ptr:t});return[o,t]}s(K,"parseArray");_(K,"parseArray");var he=Object.defineProperty,M=s((e,t)=>he(e,"name",{value:t,configurable:!0}),"b$1");function E(e,t,r,n){let o=t,l=r,i,a=!1,u;for(let f=0;f<e.length;f++){if(f){if(o=a?o[i]:o[i]={},l=(u=l[i]).c,n===0&&(u.t===1||u.t===2))return null;if(u.t===2){let d=o.length-1;o=o[d],l=l[d].c}}if(i=e[f],(a=Object.hasOwn(o,i))&&l[i]?.t===0&&l[i]?.d)return null;a||(i==="__proto__"&&(Object.defineProperty(o,i,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(l,i,{enumerable:!0,configurable:!0,writable:!0})),l[i]={t:f<e.length-1&&n===2?3:n,d:!1,i:0,c:{}})}if(u=l[i],u.t!==n&&!(n===1&&u.t===3)||(n===2&&(u.d||(u.d=!0,o[i]=[]),o[i].push(o={}),u.c[u.i++]=u={t:1,d:!1,i:0,c:{}}),u.d))return null;if(u.d=!0,n===1)o=a?o[i]:o[i]={};else if(n===0&&a)return null;return[i,o,u.c]}s(E,"w");M(E,"peekTable");function q(e,{maxDepth:t=1e3,integersAsBigInt:r}={}){let n={},o={},l=n,i=o;for(let a=h(e,0);a<e.length;){if(e[a]==="["){let u=e[++a]==="[",f=O(e,a+=+u,"]");if(u){if(e[f[1]-1]!=="]")throw new c("expected end of table declaration",{toml:e,ptr:f[1]-1});f[1]++}let d=E(f[0],n,o,u?2:1);if(!d)throw new c("trying to redefine an already defined table or value",{toml:e,ptr:a});i=d[2],l=d[1],a=f[1]}else{let u=O(e,a),f=E(u[0],l,i,0);if(!f)throw new c("trying to redefine an already defined table or value",{toml:e,ptr:a});let d=j(e,u[1],void 0,t,r);f[1][f[0]]=d[0],a=d[1]}if(a=h(e,a,!0),e[a]&&e[a]!==`
74
+ `&&e[a]!=="\r")throw new c("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:a});a=h(e,a)}return n}s(q,"parse");M(q,"parse");var pe=Object.defineProperty,p=s((e,t)=>pe(e,"name",{value:t,configurable:!0}),"l");/*!
75
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
76
+ * SPDX-License-Identifier: BSD-3-Clause
77
+ *
78
+ * Redistribution and use in source and binary forms, with or without
79
+ * modification, are permitted provided that the following conditions are met:
80
+ *
81
+ * 1. Redistributions of source code must retain the above copyright notice, this
82
+ * list of conditions and the following disclaimer.
83
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
84
+ * this list of conditions and the following disclaimer in the
85
+ * documentation and/or other materials provided with the distribution.
86
+ * 3. Neither the name of the copyright holder nor the names of its contributors
87
+ * may be used to endorse or promote products derived from this software without
88
+ * specific prior written permission.
89
+ *
90
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
91
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
92
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
93
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
94
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
95
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
96
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
97
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
98
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
99
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
100
+ */let J=/^[a-z0-9-_]+$/i;function b(e){let t=typeof e;if(t==="object"){if(Array.isArray(e))return"array";if(e instanceof Date)return"date"}return t}s(b,"g");p(b,"extendedTypeOf");function G(e){for(let t=0;t<e.length;t++)if(b(e[t])!=="object")return!1;return e.length!=0}s(G,"E");p(G,"isArrayOfTables");function T(e){return JSON.stringify(e).replace(/\x7f/g,"\\u007f")}s(T,"a$1");p(T,"formatString");function k(e,t,r,n){if(r===0)throw new Error("Could not stringify the object: maximum object depth exceeded");if(t==="number")return isNaN(e)?"nan":e===1/0?"inf":e===-1/0?"-inf":n&&Number.isInteger(e)?e.toFixed(1):e.toString();if(t==="bigint"||t==="boolean")return e.toString();if(t==="string")return T(e);if(t==="date"){if(isNaN(e.getTime()))throw new TypeError("cannot serialize invalid date");return e.toISOString()}if(t==="object")return H(e,r,n);if(t==="array")return Q(e,r,n)}s(k,"d$1");p(k,"stringifyValue");function H(e,t,r){let n=Object.keys(e);if(n.length===0)return"{}";let o="{ ";for(let l=0;l<n.length;l++){let i=n[l];l&&(o+=", "),o+=J.test(i)?i:T(i),o+=" = ",o+=k(e[i],b(e[i]),t-1,r)}return o+" }"}s(H,"b");p(H,"stringifyInlineTable");function Q(e,t,r){if(e.length===0)return"[]";let n="[ ";for(let o=0;o<e.length;o++){if(o&&(n+=", "),e[o]===null||e[o]===void 0)throw new TypeError("arrays cannot contain null or undefined values");n+=k(e[o],b(e[o]),t-1,r)}return n+" ]"}s(Q,"x");p(Q,"stringifyArray");function R(e,t,r,n){if(r===0)throw new Error("Could not stringify the object: maximum object depth exceeded");let o="";for(let l=0;l<e.length;l++)o+=`${o&&`
101
+ `}[[${t}]]
102
+ `,o+=S(0,e[l],t,r,n);return o}s(R,"k");p(R,"stringifyArrayTable");function S(e,t,r,n,o){if(n===0)throw new Error("Could not stringify the object: maximum object depth exceeded");let l="",i="",a=Object.keys(t);for(let u=0;u<a.length;u++){let f=a[u];if(t[f]!==null&&t[f]!==void 0){let d=b(t[f]);if(d==="symbol"||d==="function")throw new TypeError(`cannot serialize values of type '${d}'`);let m=J.test(f)?f:T(f);if(d==="array"&&G(t[f]))i+=(i&&`
103
+ `)+R(t[f],r?`${r}.${m}`:m,n-1,o);else if(d==="object"){let y=r?`${r}.${m}`:m;i+=(i&&`
104
+ `)+S(y,t[f],y,n-1,o)}else l+=m,l+=" = ",l+=k(t[f],d,n,o),l+=`
105
+ `}}return e&&(l||!i)&&(l=l?`[${e}]
106
+ ${l}`:`[${e}]`),l&&i?`${l}
107
+ ${i}`:l||i}s(S,"h");p(S,"stringifyTable");function me(e,{maxDepth:t=1e3,numbersAsFloat:r=!1}={}){if(b(e)!=="object")throw new TypeError("stringify can only be called with an object");let n=S(0,e,"",t,r);return n[n.length-1]!==`
108
+ `?n+`
109
+ `:n}s(me,"stringify");p(me,"stringify");var we=Object.defineProperty,ge=s((e,t)=>we(e,"name",{value:t,configurable:!0}),"a"),be=Object.defineProperty,ye=ge((e,t)=>be(e,"name",{value:t,configurable:!0}),"t"),ve=Object.defineProperty,$e=ye((e,t)=>ve(e,"name",{value:t,configurable:!0}),"n");const je=$e((e,t)=>{const r=Y(e,{encoding:"utf8",...t});return q(r)},"readTomlSync");export{je as d};
@@ -0,0 +1,2 @@
1
+ var R=Object.defineProperty;var n=(t,e)=>R(t,"name",{value:e,configurable:!0});import{createRequire as M}from"node:module";import{f as q,l as m,M as d}from"./otel-CO8UEfTa.js";import{ax as B,ay as C,az as E}from"../packem_chunks/bin.js";const j=M(import.meta.url),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,w=n(t=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[e,r]=u.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return u.getBuiltinModule(t)}return j(t)},"__cjs_getBuiltinModule"),{Socket:k}=w("node:net"),{randomBytes:P}=w("node:crypto"),{readdir:x,writeFile:O,rename:F,rm:f,open:N,readFile:A,stat:L,unlink:h}=w("node:fs/promises"),{createRequire:I}=w("node:module");var W=Object.defineProperty,X=n((t,e)=>W(t,"name",{value:e,configurable:!0}),"i"),z=Object.defineProperty,b=X((t,e)=>z(t,"name",{value:e,configurable:!0}),"s");const G=I(import.meta.url),l=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,J=b(t=>{if(typeof l<"u"&&l.versions&&l.versions.node){const[e,r]=l.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return l.getBuiltinModule(t)}return G(t)},"__cjs_getBuiltinModule"),{lstat:v,mkdir:V}=J("node:fs/promises");var Y=Object.defineProperty,H=b((t,e)=>Y(t,"name",{value:e,configurable:!0}),"o");const K=H(async t=>{q(t);try{const e=await v(t);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(m(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{await V(t,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const r=await v(t);if(!r.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(m(r))}'`,{cause:e})}},"ensureDir");var Q=Object.defineProperty,c=n((t,e)=>Q(t,"name",{value:e,configurable:!0}),"s");const U=3e4,$=100;class Z extends Error{static{n(this,"ServiceReadinessError")}constructor(e,r){super(e),this.elapsedMs=r,this.name="ServiceReadinessError"}elapsedMs;static{c(this,"ServiceReadinessError")}}const ee=c(async t=>{const e=t.host??"127.0.0.1",{port:r}=t,o=t.timeoutMs??U,i=Date.now();for(;Date.now()-i<o;){if(await te(e,r))return;await re($)}throw new Z(`Timed out waiting for ${e}:${String(r)} to accept TCP connections (${String(o)}ms)`,Date.now()-i)},"waitForTcp"),te=c((t,e)=>new Promise(r=>{const o=new k,i=c(a=>{o.removeAllListeners(),o.destroy(),r(a)},"onDone");o.once("connect",()=>{i(!0)}),o.once("error",()=>{i(!1)}),o.setTimeout($,()=>{i(!1)});try{o.connect(e,t)}catch{i(!1)}}),"tryConnect"),re=c(t=>new Promise(e=>{setTimeout(e,t)}),"delay"),he=c(async(t,e)=>{const r=t.readiness??(t.port===void 0?void 0:{tcp:{port:t.port}});r&&await ee({host:r.tcp.host,port:r.tcp.port,timeoutMs:e?.timeoutMs??r.tcp.timeoutMs})},"runReadiness");var ie=Object.defineProperty,s=n((t,e)=>ie(t,"name",{value:e,configurable:!0}),"o");const _=384,g=5e3,oe=50,se=3e4,p=s(async t=>{const e=d(B(t),"services");try{await K(e)}catch(r){throw r.code==="ENOTDIR"?new Error(`Service registry path ${e} exists but is not a directory. Remove it or move the conflicting file before running \`vis service\`.`,{cause:r}):r}return e},"getRegistryDir"),S=s(t=>t.replaceAll("/","_").replaceAll(":","__"),"slugify"),y=s((t,e)=>d(t,`${S(e)}.json`),"entryPath"),ae=s((t,e)=>d(t,`${S(e)}.lock`),"lockPath"),T=s(async(t,e)=>{const r=await p(t),o=y(r,e);if(await C(o))try{return await E(o)}catch{return}},"readEntry"),ne=s(async t=>{const e=await p(t);let r;try{r=await x(e)}catch{return[]}const o=[];for(const i of r)if(i.endsWith(".json"))try{const a=await E(d(e,i));o.push(a)}catch{}return o},"readAllEntries"),me=s(async(t,e)=>{const r=await p(t),o=y(r,e.id),i=d(r,`.${P(8).toString("hex")}.tmp`);await O(i,`${JSON.stringify(e,void 0,2)}
2
+ `,{mode:_});try{await F(i,o)}catch(a){throw await f(i,{force:!0}).catch(()=>{}),a}},"writeEntry"),ce=s(async(t,e,r)=>{const o=await p(t),i=r??await T(t,e);await f(y(o,e),{force:!0}),i&&await f(i.logFile,{force:!0}).catch(()=>{})},"deleteEntry"),D=s(t=>{try{return process.kill(t,0),!0}catch{return!1}},"isAlive"),ve=s(async t=>{const e=await ne(t),r=[],o=[];for(const i of e){if(D(i.pid)){o.push(i);continue}const a=await T(t,i.id);if(a&&a.pid!==i.pid){o.push(a);continue}await ce(t,i.id,i).catch(()=>{}),r.push(i.id)}return{pruned:r,surviving:o}},"pruneDead"),ue=s(t=>new Promise(e=>{setTimeout(e,t)}),"sleep"),le=s(async t=>{try{const e=await N(t,"wx",_);try{await e.writeFile(String(process.pid))}finally{await e.close().catch(()=>{})}return!0}catch(e){if(e.code==="EEXIST")return!1;throw e}},"tryClaimLock"),de=s(async t=>{let e;try{const r=await A(t,"utf8"),o=Number.parseInt(r.trim(),10);e=Number.isFinite(o)?o:void 0}catch{return!0}if(e!==void 0&&!D(e))return!0;try{const r=await L(t);return Date.now()-r.mtimeMs>se}catch{return!0}},"isLockStale"),ge=s(async(t,e,r)=>{const o=await p(t),i=ae(o,e),a=Date.now();for(;!await le(i);){if(await de(i)){await h(i).catch(()=>{});continue}if(Date.now()-a>=g)throw new Error(`Could not acquire service lock for ${e} within ${String(g)}ms — another \`vis service\` invocation appears to be holding it.`);await ue(oe)}try{return await r()}finally{await h(i).catch(()=>{})}},"withServiceLock");export{_ as R,Z as S,me as a,he as b,ne as c,ce as d,p as g,D as i,ve as p,T as r,S as s,ge as w};
@@ -0,0 +1 @@
1
+ var y=Object.defineProperty;var d=(e,s)=>y(e,"name",{value:s,configurable:!0});import{createRequire as j}from"node:module";import{M as m}from"./otel-CO8UEfTa.js";const M=j(import.meta.url),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_=d(e=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[s,t]=u.versions.node.split(".").map(Number);if(s>22||s===22&&t>=3||s===20&&t>=16)return u.getBuiltinModule(e)}return M(e)},"__cjs_getBuiltinModule"),{readdir:p,stat:l,readFile:h}=_("node:fs/promises");var k=Object.defineProperty,c=d((e,s)=>k(e,"name",{value:s,configurable:!0}),"m");const b=c((e,s)=>e.tasks.find(t=>t.taskId===s),"findTaskInSummary"),f=c((e,s)=>{const t=e??{},i=s??{},n=[],r=[],a=[];for(const o of Object.keys(t))o in i?t[o]!==i[o]&&a.push(o):n.push(o);for(const o of Object.keys(i))o in t||r.push(o);return n.sort(),r.sort(),a.sort(),{added:n,changed:a,removed:r}},"diffHashBuckets"),R=c((e,s)=>({commandChanged:(e?.command??"")!==(s?.command??""),implicitDeps:f(e?.implicitDeps,s?.implicitDeps),nodes:f(e?.nodes,s?.nodes),runtime:f(e?.runtime,s?.runtime)}),"diffHashDetails"),w=c(async(e,s)=>{const t=m(e,".task-runner","runs",`${s}.json`);try{const i=await h(t,"utf8");return JSON.parse(i)}catch{return}},"readRunSummaryById"),B=c(async(e,s)=>{const t=m(e,".task-runner","runs");let i;try{i=await p(t)}catch{return}const n=[];for(const r of i){if(!r.endsWith(".json")||s!==void 0&&r===`${s}.json`)continue;const a=m(t,r);try{const o=await l(a);o.isFile()&&n.push({mtimeMs:o.mtimeMs,path:a})}catch{}}if(n.length!==0){n.sort((r,a)=>a.mtimeMs-r.mtimeMs);try{const r=await h(n[0].path,"utf8");return JSON.parse(r)}catch{return}}},"readPreviousRunSummary"),D=c(async e=>{const s=m(e,".task-runner","runs");let t;try{t=await p(s)}catch{return[]}const i=[];for(const n of t){if(!n.endsWith(".json"))continue;const r=m(s,n);try{const a=await l(r);a.isFile()&&i.push({id:n.slice(0,-5),mtimeMs:a.mtimeMs,path:r})}catch{}}return i.sort((n,r)=>r.mtimeMs-n.mtimeMs),i},"listRunSummaries");export{B as a,R as d,b as f,D as l,w as r};