npm-check-updates 22.2.6 → 22.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.cjs CHANGED
@@ -38,7 +38,7 @@ Instructions:
38
38
  `:``}renderCurrentInput(){return`
39
39
  Filtered results for: ${this.inputValue?this.inputValue:n.gray(`Enter something to filter`)}\n`}renderOption(e,t,r,i){let a=(t.selected?n.green(s.radioOn):s.radioOff)+` `+i+` `,o;return o=t.disabled?e===r?n.gray().underline(t.title):n.strikethrough().gray(t.title):e===r?n.cyan().underline(t.title):t.title,a+o}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(`, `);let e=[n.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(n.yellow(this.warn)),e.join(` `)}render(){if(this.closed)return;this.firstRender&&this.out.write(r.hide),super.render();let e=[o.symbol(this.done,this.aborted),n.bold(this.msg),o.delimiter(!1),this.renderDoneOrInstructions()].join(` `);this.showMinError&&=(e+=n.red(`You must select a minimum of ${this.minSelected} choices.`),!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=a(e,this.out.columns)}}})),de=s(((e,t)=>{var n=O(),r=R(),{style:i,clear:a}=L(),{erase:o,cursor:s}=j();t.exports=class extends r{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||`yes`,this.yesOption=e.yesOption||`(Y/n)`,this.noMsg=e.no||`no`,this.noOption=e.noOption||`(y/N)`,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
40
40
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
41
- `),this.close()}_(e,t){return e.toLowerCase()===`y`?(this.value=!0,this.submit()):e.toLowerCase()===`n`?(this.value=!1,this.submit()):this.bell()}render(){if(this.closed)return;this.firstRender?this.out.write(s.hide):this.out.write(a(this.outputText,this.out.columns)),super.render();let e=this.aborted||this.done&&!this.value;this.outputText=[i.symbol(this.done,e),n.bold(this.msg),i.delimiter(this.done),this.done?this.value&&!this.aborted?this.yesMsg:this.noMsg:n.gray(this.initialValue?this.yesOption:this.noOption)].join(` `),this.out.write(o.line+s.to(0)+this.outputText)}}})),fe=s(((e,t)=>{t.exports={TextPrompt:te(),SelectPrompt:z(),TogglePrompt:B(),DatePrompt:K(),NumberPrompt:se(),MultiselectPrompt:ce(),AutocompletePrompt:le(),AutocompleteMultiselectPrompt:ue(),ConfirmPrompt:de()}})),pe=s((e=>{var t=e,n=fe(),r=e=>e;function i(e,t,i={}){return new Promise((a,o)=>{let s=new n[e](t),c=i.onAbort||r,l=i.onSubmit||r,u=i.onExit||r;s.on(`state`,t.onState||r),s.on(`submit`,e=>a(l(e))),s.on(`exit`,e=>a(u(e))),s.on(`abort`,e=>o(c(e)))})}t.text=e=>i(`TextPrompt`,e),t.password=e=>(e.style=`password`,t.text(e)),t.invisible=e=>(e.style=`invisible`,t.text(e)),t.number=e=>i(`NumberPrompt`,e),t.date=e=>i(`DatePrompt`,e),t.confirm=e=>i(`ConfirmPrompt`,e),t.list=e=>{let t=e.separator||`,`;return i(`TextPrompt`,e,{onSubmit:e=>e.split(t).map(e=>e.trim())})},t.toggle=e=>i(`TogglePrompt`,e),t.select=e=>i(`SelectPrompt`,e),t.multiselect=e=>{e.choices=[].concat(e.choices||[]);let t=e=>e.filter(e=>e.selected).map(e=>e.value);return i(`MultiselectPrompt`,e,{onAbort:t,onSubmit:t})},t.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);let t=e=>e.filter(e=>e.selected).map(e=>e.value);return i(`AutocompleteMultiselectPrompt`,e,{onAbort:t,onSubmit:t})};var a=(e,t)=>Promise.resolve(t.filter(t=>t.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));t.autocomplete=e=>(e.suggest=e.suggest||a,e.choices=[].concat(e.choices||[]),i(`AutocompletePrompt`,e))})),me=s(((e,t)=>{var n=pe(),r=[`suggest`,`format`,`onState`,`validate`,`onRender`,`type`],i=()=>{};async function a(e=[],{onSubmit:t=i,onCancel:s=i}={}){let c={},l=a._override||{};e=[].concat(e);let u,d,f,p,m,h,g=async(e,t,n=!1)=>{if(!(!n&&e.validate&&e.validate(t)!==!0))return e.format?await e.format(t,c):t};for(d of e)if({name:p,type:m}=d,typeof m==`function`&&(m=await m(u,{...c},d),d.type=m),m){for(let e in d){if(r.includes(e))continue;let t=d[e];d[e]=typeof t==`function`?await t(u,{...c},h):t}if(h=d,typeof d.message!=`string`)throw Error(`prompt message is required`);if({name:p,type:m}=d,n[m]===void 0)throw Error(`prompt type (${m}) is not defined`);if(l[d.name]!==void 0&&(u=await g(d,l[d.name]),u!==void 0)){c[p]=u;continue}try{u=a._injected?o(a._injected,d.initial):await n[m](d),c[p]=u=await g(d,u,!0),f=await t(d,u,c)}catch{f=!await s(d,c)}if(f)return c}return c}function o(e,t){let n=e.shift();if(n instanceof Error)throw n;return n===void 0?t:n}function s(e){a._injected=(a._injected||[]).concat(e)}function c(e){a._override=Object.assign({},e)}t.exports=Object.assign(a,{prompt:a,prompts:n,inject:s,override:c})})),he=u(s(((e,t)=>{t.exports=me()}))(),1),ge={name:`npm-check-updates`,version:`22.2.6`,author:`Tomas Junnonen <tomas1@gmail.com>`,license:`Apache-2.0`,contributors:[`Raine Revere (https://github.com/raineorshine)`,`Imamuzzaki Abu Salam <imamuzzaki@gmail.com>`],description:`Find newer versions of dependencies than what your package.json allows`,keywords:[`dependencies`,`npm`,`package.json`,`update`,`upgrade`,`versions`],engines:{node:`^20.19.0 || ^22.12.0 || >=24.0.0`,npm:`>=10.0.0`},type:`module`,main:`build/index.cjs`,module:`build/index.js`,types:`build/index.d.ts`,bin:{"npm-check-updates":`build/cli.js`,ncu:`build/cli.js`},exports:{".":{types:`./build/index.d.ts`,import:`./build/index.js`,require:`./build/index.cjs`},"./package.json":`./package.json`},scripts:{build:`vite build`,"build:options":`tsx scripts/build-options.ts`,"build:analyze":`cross-env ANALYZER=true vite build`,lint:`cross-env FORCE_COLOR=1 npm-run-all --parallel --aggregate-output lint:*`,"lint:lockfile":`lockfile-lint`,"lint:types":`tsc --noEmit`,"lint:markdown":`markdownlint "**/*.md" --ignore "**/node_modules/**/*.md" --ignore build --config .markdownlint.json`,"lint:src":`eslint --cache --cache-location node_modules/.cache/.eslintcache --report-unused-disable-directives`,prepare:`git config core.hooksPath .hooks`,prepublishOnly:`npm run build`,prettier:`prettier . --check`,"prettier:fix":`prettier . --write`,test:`tsc --noEmit && npm run test:unit && npm run test:e2e`,"test:bun":`mocha test/bun`,"test:unit":`mocha test --ignore "test/bun/*"`,"test:e2e":`./test/e2e.sh`,typecheck:`tsc --noEmit`,ncu:`node build/cli.js`},repository:{type:`git`,url:`git+https://github.com/raineorshine/npm-check-updates.git`},homepage:`https://github.com/raineorshine/npm-check-updates`,bugs:{url:`https://github.com/raineorshine/npm-check-updates/issues`},overrides:{typescript:`$typescript`,eslint:`$eslint`,"eslint-config-standard":{"eslint-plugin-n":`$eslint-plugin-n`,"eslint-plugin-promise":`$eslint-plugin-promise`},"@verdaccio/core":`>=8.0.0-next-8.33`,"chai-string":{chai:`$chai`},diff:`>=8.0.3`,"ip-address":`>=10.1.1`,"serialize-javascript":`>=7.0.3`,uuid:`>=14.0.0`},devDependencies:{"@eslint/compat":`^2.1.0`,"@eslint/js":`^10.0.1`,"@microsoft/api-extractor":`^7.58.7`,"@streamparser/json":`^0.0.22`,"@trivago/prettier-plugin-sort-imports":`^6.0.2`,"@types/bun":`^1.3.14`,"@types/chai":`^5.2.3`,"@types/chai-as-promised":`^8.0.2`,"@types/chai-string":`^1.4.5`,"@types/hosted-git-info":`^3.0.5`,"@types/ini":`^4.1.1`,"@types/jsonlines":`^0.1.5`,"@types/mocha":`^10.0.10`,"@types/node":`^25.9.2`,"@types/npm-registry-fetch":`^8.0.9`,"@types/parse-github-url":`^1.0.3`,"@types/picomatch":`^4.0.3`,"@types/progress":`^2.0.7`,"@types/semver":`^7.7.1`,"@types/semver-utils":`^1.1.3`,"@types/sinon":`^21.0.1`,"@types/update-notifier":`^6.0.8`,"@typescript-eslint/eslint-plugin":`^8.60.1`,"@typescript-eslint/parser":`^8.60.1`,camelcase:`^9.0.0`,chai:`^6.2.2`,"chai-as-promised":`^8.0.2`,"chai-string":`^1.6.0`,chalk:`^5.6.2`,"cli-table3":`^0.6.5`,commander:`^14.0.3`,"cross-env":`^10.1.0`,eslint:`^10.4.1`,"eslint-config-prettier":`^10.1.8`,"eslint-config-raine":`^0.5.0`,"eslint-config-standard":`^17.1.0`,"eslint-import-resolver-typescript":`^4.4.5`,"eslint-plugin-import-x":`^4.16.2`,"eslint-plugin-jsdoc":`^62.9.0`,"eslint-plugin-n":`^18.0.1`,"eslint-plugin-promise":`^7.3.0`,"fast-glob":`^3.3.3`,"fast-memoize":`^2.5.2`,"find-up":`^8.0.0`,"fp-and-or":`^1.0.2`,globals:`^17.6.0`,"hosted-git-info":`^9.0.3`,ini:`^7.0.0`,"jsonc-parser":`^3.3.1`,jsonlines:`^0.1.1`,lilconfig:`^3.1.3`,"lockfile-lint":`^5.0.0`,"markdownlint-cli":`^0.48.0`,mocha:`^11.7.6`,"npm-registry-fetch":`^19.1.1`,"npm-run-all2":`^8.0.4`,"p-map":`^7.0.4`,"parse-github-url":`^1.0.4`,picomatch:`^4.0.4`,prettier:`^3.8.3`,progress:`^2.0.3`,"prompts-ncu":`^3.0.2`,semver:`^7.8.2`,"semver-utils":`^1.1.4`,sinon:`^22.0.0`,"spawn-please":`^3.0.0`,"timeago.js":`^4.0.2`,"ts-json-schema-generator":`^2.9.0`,tsx:`^4.22.4`,typescript:`^6.0.3`,"unplugin-dts":`^1.0.2`,untildify:`^6.0.0`,"update-notifier":`^7.3.1`,verdaccio:`^6.7.2`,vite:`^8.0.16`,"vite-bundle-analyzer":`^1.3.8`,yaml:`^2.9.0`,yarn:`^1.22.22`,zod:`^4.4.3`},files:[`build`,`!**/test/**`],"lockfile-lint":{"allowed-schemes":[`https:`,`git+ssh:`],"allowed-hosts":[`npm`,`github.com`],"empty-hostname":!1,type:`npm `,path:`package-lock.json`},mocha:{"check-leaks":!0,extension:[`test.ts`],"node-option":[`import=tsx`,`enable-source-maps`,`trace-deprecation`,`trace-warnings`,`no-warnings=TimeoutNaNWarning`],timeout:6e4,recursive:!0,exit:!0}},_e=s(((e,t)=>{var n=[],r=0,i=(e,t)=>{r>=t&&n.push(e)};i.WARN=1,i.INFO=2,i.DEBUG=3,i.reset=()=>{n=[]},i.setDebugLevel=e=>{r=e},i.warn=e=>i(e,i.WARN),i.info=e=>i(e,i.INFO),i.debug=e=>i(e,i.DEBUG),i.debugMessages=()=>n,t.exports=i})),ve=s(((e,t)=>{t.exports=({onlyFirst:e=!1}={})=>{let t=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)`,`(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))`].join(`|`);return new RegExp(t,e?void 0:`g`)}})),ye=s(((e,t)=>{var n=ve();t.exports=e=>typeof e==`string`?e.replace(n(),``):e})),be=s(((e,t)=>{var n=e=>Number.isNaN(e)?!1:e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141);t.exports=n,t.exports.default=n})),xe=s(((e,t)=>{t.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}})),Se=s(((e,t)=>{var n=ye(),r=be(),i=xe(),a=e=>{if(typeof e!=`string`||e.length===0||(e=n(e),e.length===0))return 0;e=e.replace(i(),` `);let t=0;for(let n=0;n<e.length;n++){let i=e.codePointAt(n);i<=31||i>=127&&i<=159||i>=768&&i<=879||(i>65535&&n++,t+=r(i)?2:1)}return t};t.exports=a,t.exports.default=a})),Ce=s(((e,t)=>{var n=Se();function r(e){return e?/\u001b\[((?:\d*;){0,5}\d*)m/g:/\u001b\[(?:\d*;){0,5}\d*m/g}function i(e){let t=r();return(``+e).replace(t,``).split(`
41
+ `),this.close()}_(e,t){return e.toLowerCase()===`y`?(this.value=!0,this.submit()):e.toLowerCase()===`n`?(this.value=!1,this.submit()):this.bell()}render(){if(this.closed)return;this.firstRender?this.out.write(s.hide):this.out.write(a(this.outputText,this.out.columns)),super.render();let e=this.aborted||this.done&&!this.value;this.outputText=[i.symbol(this.done,e),n.bold(this.msg),i.delimiter(this.done),this.done?this.value&&!this.aborted?this.yesMsg:this.noMsg:n.gray(this.initialValue?this.yesOption:this.noOption)].join(` `),this.out.write(o.line+s.to(0)+this.outputText)}}})),fe=s(((e,t)=>{t.exports={TextPrompt:te(),SelectPrompt:z(),TogglePrompt:B(),DatePrompt:K(),NumberPrompt:se(),MultiselectPrompt:ce(),AutocompletePrompt:le(),AutocompleteMultiselectPrompt:ue(),ConfirmPrompt:de()}})),pe=s((e=>{var t=e,n=fe(),r=e=>e;function i(e,t,i={}){return new Promise((a,o)=>{let s=new n[e](t),c=i.onAbort||r,l=i.onSubmit||r,u=i.onExit||r;s.on(`state`,t.onState||r),s.on(`submit`,e=>a(l(e))),s.on(`exit`,e=>a(u(e))),s.on(`abort`,e=>o(c(e)))})}t.text=e=>i(`TextPrompt`,e),t.password=e=>(e.style=`password`,t.text(e)),t.invisible=e=>(e.style=`invisible`,t.text(e)),t.number=e=>i(`NumberPrompt`,e),t.date=e=>i(`DatePrompt`,e),t.confirm=e=>i(`ConfirmPrompt`,e),t.list=e=>{let t=e.separator||`,`;return i(`TextPrompt`,e,{onSubmit:e=>e.split(t).map(e=>e.trim())})},t.toggle=e=>i(`TogglePrompt`,e),t.select=e=>i(`SelectPrompt`,e),t.multiselect=e=>{e.choices=[].concat(e.choices||[]);let t=e=>e.filter(e=>e.selected).map(e=>e.value);return i(`MultiselectPrompt`,e,{onAbort:t,onSubmit:t})},t.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);let t=e=>e.filter(e=>e.selected).map(e=>e.value);return i(`AutocompleteMultiselectPrompt`,e,{onAbort:t,onSubmit:t})};var a=(e,t)=>Promise.resolve(t.filter(t=>t.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));t.autocomplete=e=>(e.suggest=e.suggest||a,e.choices=[].concat(e.choices||[]),i(`AutocompletePrompt`,e))})),me=s(((e,t)=>{var n=pe(),r=[`suggest`,`format`,`onState`,`validate`,`onRender`,`type`],i=()=>{};async function a(e=[],{onSubmit:t=i,onCancel:s=i}={}){let c={},l=a._override||{};e=[].concat(e);let u,d,f,p,m,h,g=async(e,t,n=!1)=>{if(!(!n&&e.validate&&e.validate(t)!==!0))return e.format?await e.format(t,c):t};for(d of e)if({name:p,type:m}=d,typeof m==`function`&&(m=await m(u,{...c},d),d.type=m),m){for(let e in d){if(r.includes(e))continue;let t=d[e];d[e]=typeof t==`function`?await t(u,{...c},h):t}if(h=d,typeof d.message!=`string`)throw Error(`prompt message is required`);if({name:p,type:m}=d,n[m]===void 0)throw Error(`prompt type (${m}) is not defined`);if(l[d.name]!==void 0&&(u=await g(d,l[d.name]),u!==void 0)){c[p]=u;continue}try{u=a._injected?o(a._injected,d.initial):await n[m](d),c[p]=u=await g(d,u,!0),f=await t(d,u,c)}catch{f=!await s(d,c)}if(f)return c}return c}function o(e,t){let n=e.shift();if(n instanceof Error)throw n;return n===void 0?t:n}function s(e){a._injected=(a._injected||[]).concat(e)}function c(e){a._override=Object.assign({},e)}t.exports=Object.assign(a,{prompt:a,prompts:n,inject:s,override:c})})),he=u(s(((e,t)=>{t.exports=me()}))(),1),ge={name:`npm-check-updates`,version:`22.2.7`,author:`Tomas Junnonen <tomas1@gmail.com>`,license:`Apache-2.0`,contributors:[`Raine Revere (https://github.com/raineorshine)`,`Imamuzzaki Abu Salam <imamuzzaki@gmail.com>`],description:`Find newer versions of dependencies than what your package.json allows`,keywords:[`dependencies`,`npm`,`package.json`,`update`,`upgrade`,`versions`],engines:{node:`^20.19.0 || ^22.12.0 || >=24.0.0`,npm:`>=10.0.0`},type:`module`,main:`build/index.cjs`,module:`build/index.js`,types:`build/index.d.ts`,bin:{"npm-check-updates":`build/cli.js`,ncu:`build/cli.js`},exports:{".":{types:`./build/index.d.ts`,import:`./build/index.js`,require:`./build/index.cjs`},"./package.json":`./package.json`},scripts:{build:`vite build`,"build:options":`tsx scripts/build-options.ts`,"build:analyze":`cross-env ANALYZER=true vite build`,lint:`cross-env FORCE_COLOR=1 npm-run-all --parallel --aggregate-output lint:*`,"lint:lockfile":`lockfile-lint`,"lint:types":`tsc --noEmit`,"lint:markdown":`markdownlint "**/*.md" --ignore "**/node_modules/**/*.md" --ignore build --config .markdownlint.json`,"lint:src":`eslint --cache --cache-location node_modules/.cache/.eslintcache --report-unused-disable-directives`,prepare:`git config core.hooksPath .hooks`,prepublishOnly:`npm run build`,prettier:`prettier . --check`,"prettier:fix":`prettier . --write`,test:`tsc --noEmit && npm run test:unit && npm run test:e2e`,"test:bun":`mocha test/bun`,"test:unit":`mocha test --ignore "test/bun/*"`,"test:e2e":`./test/e2e.sh`,typecheck:`tsc --noEmit`,ncu:`node build/cli.js`},repository:{type:`git`,url:`git+https://github.com/raineorshine/npm-check-updates.git`},homepage:`https://github.com/raineorshine/npm-check-updates`,bugs:{url:`https://github.com/raineorshine/npm-check-updates/issues`},overrides:{typescript:`$typescript`,eslint:`$eslint`,"eslint-config-standard":{"eslint-plugin-n":`$eslint-plugin-n`,"eslint-plugin-promise":`$eslint-plugin-promise`},"@verdaccio/core":`>=8.0.0-next-8.33`,"chai-string":{chai:`$chai`},diff:`>=8.0.3`,"ip-address":`>=10.1.1`,"serialize-javascript":`>=7.0.3`,uuid:`>=14.0.0`},devDependencies:{"@eslint/compat":`^2.1.0`,"@eslint/js":`^10.0.1`,"@microsoft/api-extractor":`^7.58.7`,"@streamparser/json":`^0.0.22`,"@trivago/prettier-plugin-sort-imports":`^6.0.2`,"@types/bun":`^1.3.14`,"@types/chai":`^5.2.3`,"@types/chai-as-promised":`^8.0.2`,"@types/chai-string":`^1.4.5`,"@types/hosted-git-info":`^3.0.5`,"@types/ini":`^4.1.1`,"@types/jsonlines":`^0.1.5`,"@types/mocha":`^10.0.10`,"@types/node":`^25.9.2`,"@types/npm-registry-fetch":`^8.0.9`,"@types/parse-github-url":`^1.0.3`,"@types/picomatch":`^4.0.3`,"@types/progress":`^2.0.7`,"@types/semver":`^7.7.1`,"@types/semver-utils":`^1.1.3`,"@types/sinon":`^21.0.1`,"@types/update-notifier":`^6.0.8`,"@typescript-eslint/eslint-plugin":`^8.60.1`,"@typescript-eslint/parser":`^8.60.1`,camelcase:`^9.0.0`,chai:`^6.2.2`,"chai-as-promised":`^8.0.2`,"chai-string":`^1.6.0`,chalk:`^5.6.2`,"cli-table3":`^0.6.5`,commander:`^14.0.3`,"cross-env":`^10.1.0`,eslint:`^10.4.1`,"eslint-config-prettier":`^10.1.8`,"eslint-config-raine":`^0.5.0`,"eslint-config-standard":`^17.1.0`,"eslint-import-resolver-typescript":`^4.4.5`,"eslint-plugin-import-x":`^4.16.2`,"eslint-plugin-jsdoc":`^62.9.0`,"eslint-plugin-n":`^18.0.1`,"eslint-plugin-promise":`^7.3.0`,"fast-glob":`^3.3.3`,"fast-memoize":`^2.5.2`,"find-up":`^8.0.0`,"fp-and-or":`^1.0.2`,globals:`^17.6.0`,"hosted-git-info":`^9.0.3`,ini:`^6.0.0`,"jsonc-parser":`^3.3.1`,jsonlines:`^0.1.1`,lilconfig:`^3.1.3`,"lockfile-lint":`^5.0.0`,"markdownlint-cli":`^0.48.0`,mocha:`^11.7.6`,"npm-registry-fetch":`^19.1.1`,"npm-run-all2":`^8.0.4`,"p-map":`^7.0.4`,"parse-github-url":`^1.0.4`,picomatch:`^4.0.4`,prettier:`^3.8.3`,progress:`^2.0.3`,"prompts-ncu":`^3.0.2`,semver:`^7.8.2`,"semver-utils":`^1.1.4`,sinon:`^22.0.0`,"spawn-please":`^3.0.0`,"timeago.js":`^4.0.2`,"ts-json-schema-generator":`^2.9.0`,tsx:`^4.22.4`,typescript:`^6.0.3`,"unplugin-dts":`^1.0.2`,untildify:`^6.0.0`,"update-notifier":`^7.3.1`,verdaccio:`^6.7.2`,vite:`^8.0.16`,"vite-bundle-analyzer":`^1.3.8`,yaml:`^2.9.0`,yarn:`^1.22.22`,zod:`^4.4.3`},files:[`build`,`!**/test/**`]},_e=s(((e,t)=>{var n=[],r=0,i=(e,t)=>{r>=t&&n.push(e)};i.WARN=1,i.INFO=2,i.DEBUG=3,i.reset=()=>{n=[]},i.setDebugLevel=e=>{r=e},i.warn=e=>i(e,i.WARN),i.info=e=>i(e,i.INFO),i.debug=e=>i(e,i.DEBUG),i.debugMessages=()=>n,t.exports=i})),ve=s(((e,t)=>{t.exports=({onlyFirst:e=!1}={})=>{let t=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)`,`(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))`].join(`|`);return new RegExp(t,e?void 0:`g`)}})),ye=s(((e,t)=>{var n=ve();t.exports=e=>typeof e==`string`?e.replace(n(),``):e})),be=s(((e,t)=>{var n=e=>Number.isNaN(e)?!1:e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141);t.exports=n,t.exports.default=n})),xe=s(((e,t)=>{t.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}})),Se=s(((e,t)=>{var n=ye(),r=be(),i=xe(),a=e=>{if(typeof e!=`string`||e.length===0||(e=n(e),e.length===0))return 0;e=e.replace(i(),` `);let t=0;for(let n=0;n<e.length;n++){let i=e.codePointAt(n);i<=31||i>=127&&i<=159||i>=768&&i<=879||(i>65535&&n++,t+=r(i)?2:1)}return t};t.exports=a,t.exports.default=a})),Ce=s(((e,t)=>{var n=Se();function r(e){return e?/\u001b\[((?:\d*;){0,5}\d*)m/g:/\u001b\[(?:\d*;){0,5}\d*m/g}function i(e){let t=r();return(``+e).replace(t,``).split(`
42
42
  `).reduce(function(e,t){return n(t)>e?n(t):e},0)}function a(e,t){return Array(t+1).join(e)}function o(e,t,n,r){let o=i(e);if(t+1>=o){let i=t-o;switch(r){case`right`:e=a(n,i)+e;break;case`center`:{let t=Math.ceil(i/2);e=a(n,i-t)+e+a(n,t);break}default:e+=a(n,i);break}}return e}var s={};function c(e,t,n){t=`\x1B[`+t+`m`,n=`\x1B[`+n+`m`,s[t]={set:e,to:!0},s[n]={set:e,to:!1},s[e]={on:t,off:n}}c(`bold`,1,22),c(`italics`,3,23),c(`underline`,4,24),c(`inverse`,7,27),c(`strikethrough`,9,29);function l(e,t){let n=t[1]?parseInt(t[1].split(`;`)[0]):0;if(n>=30&&n<=39||n>=90&&n<=97){e.lastForegroundAdded=t[0];return}if(n>=40&&n<=49||n>=100&&n<=107){e.lastBackgroundAdded=t[0];return}if(n===0){for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&delete e[t];return}let r=s[t[0]];r&&(e[r.set]=r.to)}function u(e){let t=r(!0),n=t.exec(e),i={};for(;n!==null;)l(i,n),n=t.exec(e);return i}function d(e,t){let n=e.lastBackgroundAdded,r=e.lastForegroundAdded;return delete e.lastBackgroundAdded,delete e.lastForegroundAdded,Object.keys(e).forEach(function(n){e[n]&&(t+=s[n].off)}),n&&n!=`\x1B[49m`&&(t+=`\x1B[49m`),r&&r!=`\x1B[39m`&&(t+=`\x1B[39m`),t}function f(e,t){let n=e.lastBackgroundAdded,r=e.lastForegroundAdded;return delete e.lastBackgroundAdded,delete e.lastForegroundAdded,Object.keys(e).forEach(function(n){e[n]&&(t=s[n].on+t)}),n&&n!=`\x1B[49m`&&(t=n+t),r&&r!=`\x1B[39m`&&(t=r+t),t}function p(e,t){if(e.length===i(e))return e.substr(0,t);for(;i(e)>t;)e=e.slice(0,-1);return e}function m(e,t){let n=r(!0),a=e.split(r()),o=0,s=0,c=``,u,f={};for(;s<t;){u=n.exec(e);let r=a[o];if(o++,s+i(r)>t&&(r=p(r,t-s)),c+=r,s+=i(r),s<t){if(!u)break;c+=u[0],l(f,u)}}return d(f,c)}function h(e,t,n){if(n||=`…`,i(e)<=t)return e;t-=i(n);let r=m(e,t);r+=n;let a=`\x1B]8;;\x07`;return e.includes(a)&&!r.includes(a)&&(r+=a),r}function g(){return{chars:{top:`─`,"top-mid":`┬`,"top-left":`┌`,"top-right":`┐`,bottom:`─`,"bottom-mid":`┴`,"bottom-left":`└`,"bottom-right":`┘`,left:`│`,"left-mid":`├`,mid:`─`,"mid-mid":`┼`,right:`│`,"right-mid":`┤`,middle:`│`},truncate:`…`,colWidths:[],rowHeights:[],colAligns:[],rowAligns:[],style:{"padding-left":1,"padding-right":1,head:[`red`],border:[`grey`],compact:!1},head:[]}}function _(e,t){e||={},t||=g();let n=Object.assign({},t,e);return n.chars=Object.assign({},t.chars,e.chars),n.style=Object.assign({},t.style,e.style),n}function v(e,t){let n=[],r=t.split(/(\s+)/g),a=[],o=0,s;for(let t=0;t<r.length;t+=2){let c=r[t],l=o+i(c);o>0&&s&&(l+=s.length),l>e?(o!==0&&n.push(a.join(``)),a=[c],o=i(c)):(a.push(s||``,c),o=l),s=r[t+1]}return o&&n.push(a.join(``)),n}function y(e,t){let n=[],r=``;function i(t,i){for(r.length&&i&&(r+=i),r+=t;r.length>e;)n.push(r.slice(0,e)),r=r.slice(e)}let a=t.split(/(\s+)/g);for(let e=0;e<a.length;e+=2)i(a[e],e&&a[e-1]);return r.length&&n.push(r),n}function b(e,t,n=!0){let r=[];t=t.split(`
43
43
  `);let i=n?v:y;for(let n=0;n<t.length;n++)r.push.apply(r,i(e,t[n]));return r}function x(e){let t={},n=[];for(let r=0;r<e.length;r++){let i=f(t,e[r]);t=u(i);let a=Object.assign({},t);n.push(d(a,i))}return n}function S(e,t){return[`\x1B]`,`8`,`;`,`;`,e||t,`\x07`,t,`\x1B]`,`8`,`;`,`;`,`\x07`].join(``)}t.exports={strlen:i,repeat:a,pad:o,truncate:h,mergeOptions:_,wordWrap:b,colorizeLines:x,hyperlink:S}})),we=s(((e,t)=>{var n={};t.exports=n;var r={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(r).forEach(function(e){var t=r[e],i=n[e]=[];i.open=`\x1B[`+t[0]+`m`,i.close=`\x1B[`+t[1]+`m`})})),Te=s(((e,t)=>{t.exports=function(e,t){t||=process.argv;var n=t.indexOf(`--`),r=/^-{1,2}/.test(e)?``:`--`,i=t.indexOf(r+e);return i!==-1&&(n===-1?!0:i<n)}})),Ee=s(((e,t)=>{var n=require("os"),r=Te(),i=process.env,a=void 0;r(`no-color`)||r(`no-colors`)||r(`color=false`)?a=!1:(r(`color`)||r(`colors`)||r(`color=true`)||r(`color=always`))&&(a=!0),`FORCE_COLOR`in i&&(a=i.FORCE_COLOR.length===0||parseInt(i.FORCE_COLOR,10)!==0);function o(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function s(e){if(a===!1)return 0;if(r(`color=16m`)||r(`color=full`)||r(`color=truecolor`))return 3;if(r(`color=256`))return 2;if(e&&!e.isTTY&&a!==!0)return 0;var t=+!!a;if(process.platform===`win32`){var o=n.release().split(`.`);return Number(process.versions.node.split(`.`)[0])>=8&&Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if(`CI`in i)return[`TRAVIS`,`CIRCLECI`,`APPVEYOR`,`GITLAB_CI`].some(function(e){return e in i})||i.CI_NAME===`codeship`?1:t;if(`TEAMCITY_VERSION`in i)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(i.TEAMCITY_VERSION);if(`TERM_PROGRAM`in i){var s=parseInt((i.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(i.TERM_PROGRAM){case`iTerm.app`:return s>=3?3:2;case`Hyper`:return 3;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(i.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(i.TERM)||`COLORTERM`in i?1:(i.TERM,t)}function c(e){return o(s(e))}t.exports={supportsColor:c,stdout:c(process.stdout),stderr:c(process.stderr)}})),De=s(((e,t)=>{t.exports=function(e,t){var n=``;e||=`Run the trap, drop the bass`,e=e.split(``);var r={a:[`@`,`Ą`,`Ⱥ`,`Ʌ`,`Δ`,`Λ`,`Д`],b:[`ß`,`Ɓ`,`Ƀ`,`ɮ`,`β`,`฿`],c:[`©`,`Ȼ`,`Ͼ`],d:[`Ð`,`Ɗ`,`Ԁ`,`ԁ`,`Ԃ`,`ԃ`],e:[`Ë`,`ĕ`,`Ǝ`,`ɘ`,`Σ`,`ξ`,`Ҽ`,`੬`],f:[`Ӻ`],g:[`ɢ`],h:[`Ħ`,`ƕ`,`Ң`,`Һ`,`Ӈ`,`Ԋ`],i:[`༏`],j:[`Ĵ`],k:[`ĸ`,`Ҡ`,`Ӄ`,`Ԟ`],l:[`Ĺ`],m:[`ʍ`,`Ӎ`,`ӎ`,`Ԡ`,`ԡ`,`൩`],n:[`Ñ`,`ŋ`,`Ɲ`,`Ͷ`,`Π`,`Ҋ`],o:[`Ø`,`õ`,`ø`,`Ǿ`,`ʘ`,`Ѻ`,`ם`,`۝`,`๏`],p:[`Ƿ`,`Ҏ`],q:[`্`],r:[`®`,`Ʀ`,`Ȑ`,`Ɍ`,`ʀ`,`Я`],s:[`§`,`Ϟ`,`ϟ`,`Ϩ`],t:[`Ł`,`Ŧ`,`ͳ`],u:[`Ʊ`,`Ս`],v:[`ט`],w:[`Ш`,`Ѡ`,`Ѽ`,`൰`],x:[`Ҳ`,`Ӿ`,`Ӽ`,`ӽ`],y:[`¥`,`Ұ`,`Ӌ`],z:[`Ƶ`,`ɀ`]};return e.forEach(function(e){e=e.toLowerCase();var t=r[e]||[` `],i=Math.floor(Math.random()*t.length);r[e]===void 0?n+=e:n+=r[e][i]}),n}})),Oe=s(((e,t)=>{t.exports=function(e,t){e||=` he is here `;var n={up:`̍.̎.̄.̅.̿.̑.̆.̐.͒.͗.͑.̇.̈.̊.͂.̓.̈.͊.͋.͌.̃.̂.̌.͐.̀.́.̋.̏.̒.̓.̔.̽.̉.ͣ.ͤ.ͥ.ͦ.ͧ.ͨ.ͩ.ͪ.ͫ.ͬ.ͭ.ͮ.ͯ.̾.͛.͆.̚`.split(`.`),down:`̖.̗.̘.̙.̜.̝.̞.̟.̠.̤.̥.̦.̩.̪.̫.̬.̭.̮.̯.̰.̱.̲.̳.̹.̺.̻.̼.ͅ.͇.͈.͉.͍.͎.͓.͔.͕.͖.͙.͚.̣`.split(`.`),mid:[`̕`,`̛`,`̀`,`́`,`͘`,`̡`,`̢`,`̧`,`̨`,`̴`,`̵`,`̶`,`͜`,`͝`,`͞`,`͟`,`͠`,`͢`,`̸`,`̷`,`͡`,` ҉`]},r=[].concat(n.up,n.down,n.mid);function i(e){return Math.floor(Math.random()*e)}function a(e){var t=!1;return r.filter(function(n){t=n===e}),t}function o(e,t){var r=``,o,s;for(s in t||={},t.up=t.up===void 0?!0:t.up,t.mid=t.mid===void 0?!0:t.mid,t.down=t.down===void 0?!0:t.down,t.size=t.size===void 0?`maxi`:t.size,e=e.split(``),e)if(!a(s)){switch(r+=e[s],o={up:0,down:0,mid:0},t.size){case`mini`:o.up=i(8),o.mid=i(2),o.down=i(8);break;case`maxi`:o.up=i(16)+3,o.mid=i(4)+1,o.down=i(64)+3;break;default:o.up=i(8)+1,o.mid=i(6)/2,o.down=i(8)+1;break}var c=[`up`,`mid`,`down`];for(var l in c)for(var u=c[l],d=0;d<=o[u];d++)t[u]&&(r+=n[u][i(n[u].length)])}return r}return o(e,t)}})),ke=s(((e,t)=>{t.exports=function(e){return function(t,n,r){if(t===` `)return t;switch(n%3){case 0:return e.red(t);case 1:return e.white(t);case 2:return e.blue(t)}}}})),Ae=s(((e,t)=>{t.exports=function(e){return function(t,n,r){return n%2==0?t:e.inverse(t)}}})),je=s(((e,t)=>{t.exports=function(e){var t=[`red`,`yellow`,`green`,`blue`,`magenta`];return function(n,r,i){return n===` `?n:e[t[r++%t.length]](n)}}})),Me=s(((e,t)=>{t.exports=function(e){var t=[`underline`,`inverse`,`grey`,`yellow`,`red`,`green`,`blue`,`white`,`cyan`,`magenta`,`brightYellow`,`brightRed`,`brightGreen`,`brightBlue`,`brightWhite`,`brightCyan`,`brightMagenta`];return function(n,r,i){return n===` `?n:e[t[Math.round(Math.random()*(t.length-2))]](n)}}})),Ne=s(((e,t)=>{var n={};t.exports=n,n.themes={};var r=require("util"),i=n.styles=we(),a=Object.defineProperties,o=new RegExp(/[\r\n]+/g);n.supportsColor=Ee().supportsColor,n.enabled===void 0&&(n.enabled=n.supportsColor()!==!1),n.enable=function(){n.enabled=!0},n.disable=function(){n.enabled=!1},n.stripColors=n.strip=function(e){return(``+e).replace(/\x1B\[\d+m/g,``)},n.stylize=function(e,t){if(!n.enabled)return e+``;var r=i[t];return!r&&t in n?n[t](e):r.open+e+r.close};var s=/[|\\{}()[\]^$+*?.]/g,c=function(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(s,`\\$&`)};function l(e){var t=function e(){return f.apply(e,arguments)};return t._styles=e,t.__proto__=d,t}var u=(function(){var e={};return i.grey=i.gray,Object.keys(i).forEach(function(t){i[t].closeRe=new RegExp(c(i[t].close),`g`),e[t]={get:function(){return l(this._styles.concat(t))}}}),e})(),d=a(function(){},u);function f(){var e=Array.prototype.slice.call(arguments).map(function(e){return e!=null&&e.constructor===String?e:r.inspect(e)}).join(` `);if(!n.enabled||!e)return e;for(var t=e.indexOf(`
44
44
  `)!=-1,a=this._styles,s=a.length;s--;){var c=i[a[s]];e=c.open+e.replace(c.closeRe,c.open)+c.close,t&&(e=e.replace(o,function(e){return c.close+e+c.open}))}return e}n.setTheme=function(e){if(typeof e==`string`){console.log(`colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));`);return}for(var t in e)(function(t){n[t]=function(r){if(typeof e[t]==`object`){var i=r;for(var a in e[t])i=n[e[t][a]](i);return i}return n[e[t]](r)}})(t)};function p(){var e={};return Object.keys(u).forEach(function(t){e[t]={get:function(){return l([t])}}}),e}var m=function(e,t){var n=t.split(``);return n=n.map(e),n.join(``)};for(var h in n.trap=De(),n.zalgo=Oe(),n.maps={},n.maps.america=ke()(n),n.maps.zebra=Ae()(n),n.maps.rainbow=je()(n),n.maps.random=Me()(n),n.maps)(function(e){n[e]=function(t){return m(n.maps[e],t)}})(h);a(n,p())})),Pe=s(((e,t)=>{t.exports=Ne()})),Fe=s(((e,t)=>{var{info:n,debug:r}=_e(),i=Ce(),a=class e{constructor(e){this.setOptions(e),this.x=null,this.y=null}setOptions(e){[`boolean`,`number`,`bigint`,`string`].indexOf(typeof e)!==-1&&(e={content:``+e}),e||={},this.options=e;let t=e.content;if([`boolean`,`number`,`bigint`,`string`].indexOf(typeof t)!==-1)this.content=String(t);else if(!t)this.content=this.options.href||``;else throw Error(`Content needs to be a primitive, got: `+typeof t);this.colSpan=e.colSpan||1,this.rowSpan=e.rowSpan||1,this.options.href&&Object.defineProperty(this,"href",{get(){return this.options.href}})}mergeTableOptions(e,t){this.cells=t;let n=this.options.chars||{},r=e.chars,a=this.chars={};f.forEach(function(e){l(n,r,e,a)}),this.truncate=this.options.truncate||e.truncate;let o=this.options.style=this.options.style||{},s=e.style;l(o,s,`padding-left`,this),l(o,s,`padding-right`,this),this.head=o.head||s.head,this.border=o.border||s.border,this.fixedWidth=e.colWidths[this.x],this.lines=this.computeLines(e),this.desiredWidth=i.strlen(this.content)+this.paddingLeft+this.paddingRight,this.desiredHeight=this.lines.length}computeLines(e){let t=e.wordWrap||e.textWrap,{wordWrap:n=t}=this.options;if(this.fixedWidth&&n){if(this.fixedWidth-=this.paddingLeft+this.paddingRight,this.colSpan){let t=1;for(;t<this.colSpan;)this.fixedWidth+=e.colWidths[this.x+t],t++}let{wrapOnWordBoundary:t=!0}=e,{wrapOnWordBoundary:n=t}=this.options;return this.wrapLines(i.wordWrap(this.fixedWidth,this.content,n))}return this.wrapLines(this.content.split(`
@@ -50,7 +50,7 @@ Filtered results for: ${this.inputValue?this.inputValue:n.gray(`Enter something
50
50
  `,i)}while(r!==-1);return a+=e.slice(i),a}var{stdout:un,stderr:dn}=sn,fn=Symbol(`GENERATOR`),pn=Symbol(`STYLER`),mn=Symbol(`IS_EMPTY`),hn=[`ansi`,`ansi`,`ansi256`,`ansi16m`],gn=Object.create(null),_n=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let n=un?un.level:0;e.level=t.level===void 0?n:t.level},vn=class{constructor(e){return yn(e)}},yn=e=>{let t=(...e)=>e.join(` `);return _n(t,e),Object.setPrototypeOf(t,bn.prototype),t};function bn(e){return yn(e)}Object.setPrototypeOf(bn.prototype,Function.prototype);for(let[e,t]of Object.entries(Qt))gn[e]={get(){let n=wn(this,Cn(t.open,t.close,this[pn]),this[mn]);return Object.defineProperty(this,e,{value:n}),n}};gn.visible={get(){let e=wn(this,this[pn],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var xn=(e,t,n,...r)=>e===`rgb`?t===`ansi16m`?Qt[n].ansi16m(...r):t===`ansi256`?Qt[n].ansi256(Qt.rgbToAnsi256(...r)):Qt[n].ansi(Qt.rgbToAnsi(...r)):e===`hex`?xn(`rgb`,t,n,...Qt.hexToRgb(...r)):Qt[n][e](...r);for(let e of[`rgb`,`hex`,`ansi256`]){gn[e]={get(){let{level:t}=this;return function(...n){let r=Cn(xn(e,hn[t],`color`,...n),Qt.color.close,this[pn]);return wn(this,r,this[mn])}}};let t=`bg`+e[0].toUpperCase()+e.slice(1);gn[t]={get(){let{level:t}=this;return function(...n){let r=Cn(xn(e,hn[t],`bgColor`,...n),Qt.bgColor.close,this[pn]);return wn(this,r,this[mn])}}}}var Sn=Object.defineProperties(()=>{},{...gn,level:{enumerable:!0,get(){return this[fn].level},set(e){this[fn].level=e}}}),Cn=(e,t,n)=>{let r,i;return n===void 0?(r=e,i=t):(r=n.openAll+e,i=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:i,parent:n}},wn=(e,t,n)=>{let r=(...e)=>Tn(r,e.length===1?``+e[0]:e.join(` `));return Object.setPrototypeOf(r,Sn),r[fn]=e,r[pn]=t,r[mn]=n,r},Tn=(e,t)=>{if(e.level<=0||!t)return e[mn]?``:t;let n=e[pn];if(n===void 0)return t;let{openAll:r,closeAll:i}=n;if(t.includes(`\x1B`))for(;n!==void 0;)t=cn(t,n.close,n.open),n=n.parent;let a=t.indexOf(`
51
51
  `);return a!==-1&&(t=ln(t,i,r,a)),r+t+i};Object.defineProperties(bn.prototype,gn);var En=bn();bn({level:dn?dn.level:0});function Dn(e,t,n={}){let r=Array.isArray(e);return t||=(e=>({[e]:!0})),Object.entries(e||{}).forEach(([e,i],a)=>{let o=r?t(i,a,n):t(e,i,n);for(let[e,t]of Object.entries(o||{}))n[e]=t}),n}var On={blue:!0,bold:!0,cyan:!0,dim:!0,gray:!0,green:!0,magenta:!0,red:!0,reset:!0,underline:!0,yellow:!0},kn=Dn(On,e=>({[e]:Object.assign(e=>e.toString(),{bold:e=>e.toString(),underline:e=>e.toString()})})),An,jn=e=>e===!0?new vn({level:1}):e===null?kn:En,Mn=e=>{An=jn(e)},Nn=()=>{if(!An)throw Error(`Chalk has not been imported yet.`)},J=Dn(On,e=>{let t=t=>(Nn(),An[e](t));return t.bold=t=>(Nn(),An[e].bold(t)),t.underline=t=>(Nn(),An[e].underline(t)),{[e]:t}}),Pn=(e,t)=>Dn(e,(e,n)=>t(e,n)?{[e]:n}:null),Fn=async e=>{try{return await g.default.stat(e),!0}catch{return!1}},In=(0,b.createRequire)(require("url").pathToFileURL(__filename).href);async function Ln(e,{pkgFile:t}={}){let n=In.resolve.paths(e)||[],r=t?[f.default.join(f.default.dirname(t),`node_modules`)]:[],i=[f.default.join(process.cwd(),`node_modules`)],a=[...r,...i,...n];for(let t of a){let n=f.default.join(t,e,`package.json`);if(await Fn(n))try{return JSON.parse(await g.default.readFile(n,`utf-8`))}catch{}}return null}async function Rn(e,t,{pkgFile:n}={}){return t?t.version:(await Ln(e,{pkgFile:n}))?.version??null}var zn=s((e=>{var t=((e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports))(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tracing=e.metrics=void 0;var t=require("node:diagnostics_channel");e.metrics=(0,t.channel)(`lru-cache:metrics`),e.tracing=(0,t.tracingChannel)(`lru-cache`)});Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=void 0;var n=t(),r=()=>n.metrics.hasSubscribers||n.tracing.hasSubscribers,i=typeof performance==`object`&&performance&&typeof performance.now==`function`?performance:Date,a=new Set,o=typeof process==`object`&&process?process:{},s=(e,t,n,r)=>{typeof o.emitWarning==`function`?o.emitWarning(e,t,n,r):console.error(`[${n}] ${t}: ${e}`)},c=e=>!a.has(e),l=e=>!!e&&e===Math.floor(e)&&e>0&&isFinite(e),u=e=>l(e)?e<=2**8?Uint8Array:e<=2**16?Uint16Array:e<=2**32?Uint32Array:e<=2**53-1?d:null:null,d=class extends Array{constructor(e){super(e),this.fill(0)}},f=class e{heap;length;static#e=!1;static create(t){let n=u(t);if(!n)return[];e.#e=!0;let r=new e(t,n);return e.#e=!1,r}constructor(t,n){if(!e.#e)throw TypeError(`instantiate Stack using Stack.create(n)`);this.heap=new n(t),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};e.LRUCache=class e{#e;#t;#n;#r;#i;#a;#o;#s;get perf(){return this.#s}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;#C;#w;#T;#E;static unsafeExposeInternals(e){return{starts:e.#b,ttls:e.#x,autopurgeTimers:e.#S,sizes:e.#y,keyMap:e.#u,keyList:e.#d,valList:e.#f,next:e.#p,prev:e.#m,get head(){return e.#h},get tail(){return e.#g},free:e.#_,isBackgroundFetch:t=>e.#W(t),backgroundFetch:(t,n,r,i)=>e.#U(t,n,r,i),moveToTail:t=>e.#X(t),indexes:t=>e.#I(t),rindexes:t=>e.#L(t),isStale:t=>e.#j(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#l}get size(){return this.#c}get fetchMethod(){return this.#a}get memoMethod(){return this.#o}get dispose(){return this.#n}get onInsert(){return this.#r}get disposeAfter(){return this.#i}constructor(t){let{max:n=0,ttl:r,ttlResolution:o=1,ttlAutopurge:d,updateAgeOnGet:p,updateAgeOnHas:m,allowStale:h,dispose:g,onInsert:_,disposeAfter:v,noDisposeOnSet:y,noUpdateTTL:b,maxSize:x=0,maxEntrySize:S=0,sizeCalculation:C,fetchMethod:w,memoMethod:T,noDeleteOnFetchRejection:E,noDeleteOnStaleGet:D,allowStaleOnFetchRejection:O,allowStaleOnFetchAbort:k,ignoreFetchAbort:A,perf:j}=t;if(j!==void 0&&typeof j?.now!=`function`)throw TypeError(`perf option must have a now() method if specified`);if(this.#s=j??i,n!==0&&!l(n))throw TypeError(`max option must be a nonnegative integer`);let M=n?u(n):Array;if(!M)throw Error(`invalid max value: `+n);if(this.#e=n,this.#t=x,this.maxEntrySize=S||this.#t,this.sizeCalculation=C,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw TypeError(`cannot set sizeCalculation without setting maxSize or maxEntrySize`);if(typeof this.sizeCalculation!=`function`)throw TypeError(`sizeCalculation set to non-function`)}if(T!==void 0&&typeof T!=`function`)throw TypeError(`memoMethod must be a function if defined`);if(this.#o=T,w!==void 0&&typeof w!=`function`)throw TypeError(`fetchMethod must be a function if specified`);if(this.#a=w,this.#w=!!w,this.#u=new Map,this.#d=Array.from({length:n}).fill(void 0),this.#f=Array.from({length:n}).fill(void 0),this.#p=new M(n),this.#m=new M(n),this.#h=0,this.#g=0,this.#_=f.create(n),this.#c=0,this.#l=0,typeof g==`function`&&(this.#n=g),typeof _==`function`&&(this.#r=_),typeof v==`function`?(this.#i=v,this.#v=[]):(this.#i=void 0,this.#v=void 0),this.#C=!!this.#n,this.#E=!!this.#r,this.#T=!!this.#i,this.noDisposeOnSet=!!y,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!E,this.allowStaleOnFetchRejection=!!O,this.allowStaleOnFetchAbort=!!k,this.ignoreFetchAbort=!!A,this.maxEntrySize!==0){if(this.#t!==0&&!l(this.#t))throw TypeError(`maxSize must be a positive integer if specified`);if(!l(this.maxEntrySize))throw TypeError(`maxEntrySize must be a positive integer if specified`);this.#M()}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!D,this.updateAgeOnGet=!!p,this.updateAgeOnHas=!!m,this.ttlResolution=l(o)||o===0?o:1,this.ttlAutopurge=!!d,this.ttl=r||0,this.ttl){if(!l(this.ttl))throw TypeError(`ttl must be a positive integer if specified`);this.#D()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw TypeError(`At least one of max, maxSize, or ttl is required`);if(!this.ttlAutopurge&&!this.#e&&!this.#t){let t=`LRU_CACHE_UNBOUNDED`;c(t)&&(a.add(t),s(`TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.`,`UnboundedCacheWarning`,t,e))}}getRemainingTTL(e){return this.#u.has(e)?1/0:0}#D(){let e=new d(this.#e),t=new d(this.#e);this.#x=e,this.#b=t;let n=this.ttlAutopurge?Array.from({length:this.#e}):void 0;this.#S=n,this.#A=(n,i,a=this.#s.now())=>{t[n]=i===0?0:a,e[n]=i,r(n,i)},this.#O=n=>{t[n]=e[n]===0?0:this.#s.now(),r(n,e[n])};let r=this.ttlAutopurge?(e,t)=>{if(n?.[e]&&(clearTimeout(n[e]),n[e]=void 0),t&&t!==0&&n){let r=setTimeout(()=>{this.#j(e)&&this.#Z(this.#d[e],`expire`)},t+1);r.unref&&r.unref(),n[e]=r}}:()=>{};this.#k=(n,r)=>{if(e[r]){let o=e[r],s=t[r];if(!o||!s)return;n.ttl=o,n.start=s,n.now=i||a(),n.remainingTTL=o-(n.now-s)}};let i=0,a=()=>{let e=this.#s.now();if(this.ttlResolution>0){i=e;let t=setTimeout(()=>i=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=n=>{let r=this.#u.get(n);if(r===void 0)return 0;let o=e[r],s=t[r];return!o||!s?1/0:o-((i||a())-s)},this.#j=n=>{let r=t[n],o=e[n];return!!o&&!!r&&(i||a())-r>o}}#O=()=>{};#k=()=>{};#A=()=>{};#j=()=>!1;#M(){let e=new d(this.#e);this.#l=0,this.#y=e,this.#N=t=>{this.#l-=e[t],e[t]=0},this.#F=(e,t,n,r)=>{if(this.#W(t))return 0;if(!l(n))if(r){if(typeof r!=`function`)throw TypeError(`sizeCalculation must be a function`);if(n=r(t,e),!l(n))throw TypeError(`sizeCalculation return invalid (expect positive integer)`)}else throw TypeError(`invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.`);return n},this.#P=(t,n,r)=>{if(e[t]=n,this.#t){let n=this.#t-e[t];for(;this.#l>n;)this.#B(!0)}this.#l+=e[t],r&&(r.entrySize=n,r.totalCalculatedSize=this.#l)}}#N=e=>{};#P=(e,t,n)=>{};#F=(e,t,n,r)=>{if(n||r)throw TypeError(`cannot set size without setting maxSize or maxEntrySize on cache`);return 0};*#I({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#g;this.#R(t)&&((e||!this.#j(t))&&(yield t),t!==this.#h);)t=this.#m[t]}*#L({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#h;this.#R(t)&&((e||!this.#j(t))&&(yield t),t!==this.#g);)t=this.#p[t]}#R(e){return e!==void 0&&this.#u.get(this.#d[e])===e}*entries(){for(let e of this.#I())this.#f[e]!==void 0&&this.#d[e]!==void 0&&!this.#W(this.#f[e])&&(yield[this.#d[e],this.#f[e]])}*rentries(){for(let e of this.#L())this.#f[e]!==void 0&&this.#d[e]!==void 0&&!this.#W(this.#f[e])&&(yield[this.#d[e],this.#f[e]])}*keys(){for(let e of this.#I()){let t=this.#d[e];t!==void 0&&!this.#W(this.#f[e])&&(yield t)}}*rkeys(){for(let e of this.#L()){let t=this.#d[e];t!==void 0&&!this.#W(this.#f[e])&&(yield t)}}*values(){for(let e of this.#I())this.#f[e]!==void 0&&!this.#W(this.#f[e])&&(yield this.#f[e])}*rvalues(){for(let e of this.#L())this.#f[e]!==void 0&&!this.#W(this.#f[e])&&(yield this.#f[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]=`LRUCache`;find(e,t={}){for(let n of this.#I()){let r=this.#f[n],i=this.#W(r)?r.__staleWhileFetching:r;if(i!==void 0&&e(i,this.#d[n],this))return this.#J(this.#d[n],t)}}forEach(e,t=this){for(let n of this.#I()){let r=this.#f[n],i=this.#W(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#d[n],this)}}rforEach(e,t=this){for(let n of this.#L()){let r=this.#f[n],i=this.#W(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#d[n],this)}}purgeStale(){let e=!1;for(let t of this.#L({allowStale:!0}))this.#j(t)&&(this.#Z(this.#d[t],`expire`),e=!0);return e}info(e){let t=this.#u.get(e);if(t===void 0)return;let n=this.#f[t],r=this.#W(n)?n.__staleWhileFetching:n;if(r===void 0)return;let i={value:r};if(this.#x&&this.#b){let e=this.#x[t],n=this.#b[t];e&&n&&(i.ttl=e-(this.#s.now()-n),i.start=Date.now())}return this.#y&&(i.size=this.#y[t]),i}dump(){let e=[];for(let t of this.#I({allowStale:!0})){let n=this.#d[t],r=this.#f[t],i=this.#W(r)?r.__staleWhileFetching:r;if(i===void 0||n===void 0)continue;let a={value:i};if(this.#x&&this.#b){a.ttl=this.#x[t];let e=this.#s.now()-this.#b[t];a.start=Math.floor(Date.now()-e)}this.#y&&(a.size=this.#y[t]),e.unshift([n,a])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let e=Date.now()-n.start;n.start=this.#s.now()-e}this.#z(t,n.value,n)}}set(e,t,r={}){let{status:i=n.metrics.hasSubscribers?{}:void 0}=r;r.status=i,i&&(i.op=`set`,i.key=e,t!==void 0&&(i.value=t));let a=this.#z(e,t,r);return i&&n.metrics.hasSubscribers&&n.metrics.publish(i),a}#z(e,t,n={}){let{ttl:r=this.ttl,start:i,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:s}=n;if(t===void 0)return s&&(s.set=`deleted`),this.delete(e),this;let{noUpdateTTL:c=this.noUpdateTTL}=n;s&&!this.#W(t)&&(s.value=t);let l=this.#F(e,t,n.size||0,o,s);if(this.maxEntrySize&&l>this.maxEntrySize)return this.#Z(e,`set`),s&&(s.set=`miss`,s.maxEntrySizeExceeded=!0),this;let u=this.#c===0?void 0:this.#u.get(e);if(u===void 0)u=this.#c===0?this.#g:this.#_.length===0?this.#c===this.#e?this.#B(!1):this.#c:this.#_.pop(),this.#d[u]=e,this.#f[u]=t,this.#u.set(e,u),this.#p[this.#g]=u,this.#m[u]=this.#g,this.#g=u,this.#c++,this.#P(u,l,s),s&&(s.set=`add`),c=!1,this.#E&&this.#r?.(t,e,`add`);else{this.#X(u);let n=this.#f[u];if(t!==n){if(this.#w&&this.#W(n)){n.__abortController.abort(Error(`replaced`));let{__staleWhileFetching:t}=n;t!==void 0&&!a&&(this.#C&&this.#n?.(t,e,`set`),this.#T&&this.#v?.push([t,e,`set`]))}else a||(this.#C&&this.#n?.(n,e,`set`),this.#T&&this.#v?.push([n,e,`set`]));if(this.#N(u),this.#P(u,l,s),this.#f[u]=t,s){s.set=`replace`;let e=n&&this.#W(n)?n.__staleWhileFetching:n;e!==void 0&&(s.oldValue=e)}}else s&&(s.set=`update`);this.#E&&this.onInsert?.(t,e,t===n?`update`:`replace`)}if(r!==0&&!this.#x&&this.#D(),this.#x&&(c||this.#A(u,r,i),s&&this.#k(s,u)),!a&&this.#T&&this.#v){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}return this}pop(){try{for(;this.#c;){let e=this.#f[this.#h];if(this.#B(!0),this.#W(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#T&&this.#v){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}}}#B(e){let t=this.#h,n=this.#d[t],r=this.#f[t];return this.#w&&this.#W(r)?r.__abortController.abort(Error(`evicted`)):(this.#C||this.#T)&&(this.#C&&this.#n?.(r,n,`evict`),this.#T&&this.#v?.push([r,n,`evict`])),this.#N(t),this.#S?.[t]&&(clearTimeout(this.#S[t]),this.#S[t]=void 0),e&&(this.#d[t]=void 0,this.#f[t]=void 0,this.#_.push(t)),this.#c===1?(this.#h=this.#g=0,this.#_.length=0):this.#h=this.#p[t],this.#u.delete(n),this.#c--,t}has(e,t={}){let{status:r=n.metrics.hasSubscribers?{}:void 0}=t;t.status=r,r&&(r.op=`has`,r.key=e);let i=this.#V(e,t);return n.metrics.hasSubscribers&&n.metrics.publish(r),i}#V(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:r}=t,i=this.#u.get(e);if(i!==void 0){let e=this.#f[i];if(this.#W(e)&&e.__staleWhileFetching===void 0)return!1;if(this.#j(i))r&&(r.has=`stale`,this.#k(r,i));else return n&&this.#O(i),r&&(r.has=`hit`,this.#k(r,i)),!0}else r&&(r.has=`miss`);return!1}peek(e,t={}){let{status:i=r()?{}:void 0}=t;i&&(i.op=`peek`,i.key=e),t.status=i;let a=this.#H(e,t);return n.metrics.hasSubscribers&&n.metrics.publish(i),a}#H(e,t){let{status:n,allowStale:r=this.allowStale}=t,i=this.#u.get(e);if(i===void 0||!r&&this.#j(i)){n&&(n.peek=i===void 0?`miss`:`stale`);return}let a=this.#f[i],o=this.#W(a)?a.__staleWhileFetching:a;return n&&(o===void 0?n.peek=`miss`:(n.peek=`hit`,n.value=o)),o}#U(e,t,n,r){let i=t===void 0?void 0:this.#f[t];if(this.#W(i))return i;let a=new AbortController,{signal:o}=n;o?.addEventListener(`abort`,()=>a.abort(o.reason),{signal:a.signal});let s={signal:a.signal,options:n,context:r},c=(r,i=!1)=>{let{aborted:o}=a.signal,c=n.ignoreFetchAbort&&r!==void 0,l=n.ignoreFetchAbort||!!(n.allowStaleOnFetchAbort&&r!==void 0);if(n.status&&(o&&!i?(n.status.fetchAborted=!0,n.status.fetchError=a.signal.reason,c&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),o&&!c&&!i)return u(a.signal.reason,l);let d=f,p=this.#f[t];return(p===f||p===void 0&&c&&i)&&(r===void 0?d.__staleWhileFetching===void 0?this.#Z(e,`fetch`):this.#f[t]=d.__staleWhileFetching:(n.status&&(n.status.fetchUpdated=!0),this.#z(e,r,s.options))),r},l=e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),u(e,!1)),u=(r,i)=>{let{aborted:o}=a.signal,s=o&&n.allowStaleOnFetchAbort,c=s||n.allowStaleOnFetchRejection,l=c||n.noDeleteOnFetchRejection,u=f;if(this.#f[t]===f&&(!l||!i&&u.__staleWhileFetching===void 0?this.#Z(e,`fetch`):s||(this.#f[t]=u.__staleWhileFetching)),c)return n.status&&u.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),u.__staleWhileFetching;if(u.__returned===u)throw r},d=(t,r)=>{let o=this.#a?.(e,i,s);o&&o instanceof Promise&&o.then(e=>t(e===void 0?void 0:e),r),a.signal.addEventListener(`abort`,()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(t(void 0),n.allowStaleOnFetchAbort&&(t=e=>c(e,!0)))})};n.status&&(n.status.fetchDispatched=!0);let f=new Promise(d).then(c,l),p=Object.assign(f,{__abortController:a,__staleWhileFetching:i,__returned:void 0});return t===void 0?(this.#z(e,p,{...s.options,status:void 0}),t=this.#u.get(e)):this.#f[t]=p,p}#W(e){if(!this.#w)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty(`__staleWhileFetching`)&&t.__abortController instanceof AbortController}fetch(e,t={}){let i=n.tracing.hasSubscribers,{status:a=r()?{}:void 0}=t;t.status=a,a&&t.context&&(a.context=t.context);let o=this.#G(e,t);return a&&r()&&i&&(a.trace=!0,n.tracing.tracePromise(()=>o,a).catch(()=>{})),o}async#G(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:s=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:h=!1,status:g,signal:_}=t;if(g&&(g.op=`fetch`,g.key=e,h&&(g.forceRefresh=!0)),!this.#w)return g&&(g.fetch=`get`),this.#J(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:g});let v={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:a,noDisposeOnSet:o,size:s,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:g,signal:_},y=this.#u.get(e);if(y===void 0){g&&(g.fetch=`miss`);let t=this.#U(e,y,v,m);return t.__returned=t}else{let t=this.#f[y];if(this.#W(t)){let e=n&&t.__staleWhileFetching!==void 0;return g&&(g.fetch=`inflight`,e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let i=this.#j(y);if(!h&&!i)return g&&(g.fetch=`hit`),this.#X(y),r&&this.#O(y),g&&this.#k(g,y),t;let a=this.#U(e,y,v,m),o=a.__staleWhileFetching!==void 0&&n;return g&&(g.fetch=i?`stale`:`refresh`,o&&i&&(g.returnedStale=!0)),o?a.__staleWhileFetching:a.__returned=a}}forceFetch(e,t={}){let i=n.tracing.hasSubscribers,{status:a=r()?{}:void 0}=t;t.status=a,a&&t.context&&(a.context=t.context);let o=this.#K(e,t);return a&&r()&&i&&(a.trace=!0,n.tracing.tracePromise(()=>o,a).catch(()=>{})),o}async#K(e,t={}){let n=await this.#G(e,t);if(n===void 0)throw Error(`fetch() returned undefined`);return n}memo(e,t={}){let{status:r=n.metrics.hasSubscribers?{}:void 0}=t;t.status=r,r&&(r.op=`memo`,r.key=e,t.context&&(r.context=t.context));let i=this.#q(e,t);return r&&(r.value=i),n.metrics.hasSubscribers&&n.metrics.publish(r),i}#q(e,t={}){let n=this.#o;if(!n)throw Error(`no memoMethod provided to constructor`);let{context:r,status:i,forceRefresh:a,...o}=t;i&&a&&(i.forceRefresh=!0);let s=this.#J(e,o),c=a||s===void 0;if(i&&(i.memo=c?`miss`:`hit`,c||(i.value=s)),!c)return s;let l=n(e,s,{options:o,context:r});return i&&(i.value=l),this.#z(e,l,o),l}get(e,t={}){let{status:r=n.metrics.hasSubscribers?{}:void 0}=t;t.status=r,r&&(r.op=`get`,r.key=e);let i=this.#J(e,t);return r&&(i!==void 0&&(r.value=i),n.metrics.hasSubscribers&&n.metrics.publish(r)),i}#J(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:a}=t,o=this.#u.get(e);if(o===void 0){a&&(a.get=`miss`);return}let s=this.#f[o],c=this.#W(s);return a&&this.#k(a,o),this.#j(o)?c?(a&&(a.get=`stale-fetching`),n&&s.__staleWhileFetching!==void 0?(a&&(a.returnedStale=!0),s.__staleWhileFetching):void 0):(i||this.#Z(e,`expire`),a&&(a.get=`stale`),n?(a&&(a.returnedStale=!0),s):void 0):(a&&(a.get=c?`fetching`:`hit`),this.#X(o),r&&this.#O(o),c?s.__staleWhileFetching:s)}#Y(e,t){this.#m[t]=e,this.#p[e]=t}#X(e){e!==this.#g&&(e===this.#h?this.#h=this.#p[e]:this.#Y(this.#m[e],this.#p[e]),this.#Y(this.#g,e),this.#g=e)}delete(e){return this.#Z(e,`delete`)}#Z(e,t){n.metrics.hasSubscribers&&n.metrics.publish({op:`delete`,delete:t,key:e});let r=!1;if(this.#c!==0){let n=this.#u.get(e);if(n!==void 0)if(this.#S?.[n]&&(clearTimeout(this.#S?.[n]),this.#S[n]=void 0),r=!0,this.#c===1)this.#Q(t);else{this.#N(n);let r=this.#f[n];if(this.#W(r)?r.__abortController.abort(Error(`deleted`)):(this.#C||this.#T)&&(this.#C&&this.#n?.(r,e,t),this.#T&&this.#v?.push([r,e,t])),this.#u.delete(e),this.#d[n]=void 0,this.#f[n]=void 0,n===this.#g)this.#g=this.#m[n];else if(n===this.#h)this.#h=this.#p[n];else{let e=this.#m[n];this.#p[e]=this.#p[n];let t=this.#p[n];this.#m[t]=this.#m[n]}this.#c--,this.#_.push(n)}}if(this.#T&&this.#v?.length){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}return r}clear(){return this.#Q(`delete`)}#Q(e){for(let t of this.#L({allowStale:!0})){let n=this.#f[t];if(this.#W(n))n.__abortController.abort(Error(`deleted`));else{let r=this.#d[t];this.#C&&this.#n?.(n,r,e),this.#T&&this.#v?.push([n,r,e])}}if(this.#u.clear(),this.#f.fill(void 0),this.#d.fill(void 0),this.#x&&this.#b){this.#x.fill(0),this.#b.fill(0);for(let e of this.#S??[])e!==void 0&&clearTimeout(e);this.#S?.fill(void 0)}if(this.#y&&this.#y.fill(0),this.#h=0,this.#g=0,this.#_.length=0,this.#l=0,this.#c=0,this.#T&&this.#v){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}}}})),Bn=s(((e,t)=>{var n=(...e)=>e.every(e=>e)?e.join(``):``,r=e=>e?encodeURIComponent(e):``,i=e=>e.toLowerCase().replace(/^\W+/g,``).replace(/(?<!\W)\W+$/,``).replace(/\//g,``).replace(/\W+/g,`-`),a={sshtemplate:({domain:e,user:t,project:r,committish:i})=>`git@${e}:${t}/${r}.git${n(`#`,i)}`,sshurltemplate:({domain:e,user:t,project:r,committish:i})=>`git+ssh://git@${e}/${t}/${r}.git${n(`#`,i)}`,edittemplate:({domain:e,user:t,project:i,committish:a,editpath:o,path:s})=>`https://${e}/${t}/${i}${n(`/`,o,`/`,r(a||`HEAD`),`/`,s)}`,browsetemplate:({domain:e,user:t,project:i,committish:a,treepath:o})=>`https://${e}/${t}/${i}${n(`/`,o,`/`,r(a))}`,browsetreetemplate:({domain:e,user:t,project:i,committish:a,treepath:o,path:s,fragment:c,hashformat:l})=>`https://${e}/${t}/${i}/${o}/${r(a||`HEAD`)}/${s}${n(`#`,l(c||``))}`,browseblobtemplate:({domain:e,user:t,project:i,committish:a,blobpath:o,path:s,fragment:c,hashformat:l})=>`https://${e}/${t}/${i}/${o}/${r(a||`HEAD`)}/${s}${n(`#`,l(c||``))}`,docstemplate:({domain:e,user:t,project:i,treepath:a,committish:o})=>`https://${e}/${t}/${i}${n(`/`,a,`/`,r(o))}#readme`,httpstemplate:({auth:e,domain:t,user:r,project:i,committish:a})=>`git+https://${n(e,`@`)}${t}/${r}/${i}.git${n(`#`,a)}`,filetemplate:({domain:e,user:t,project:n,committish:i,path:a})=>`https://${e}/${t}/${n}/raw/${r(i||`HEAD`)}/${a}`,shortcuttemplate:({type:e,user:t,project:r,committish:i})=>`${e}:${t}/${r}${n(`#`,i)}`,pathtemplate:({user:e,project:t,committish:r})=>`${e}/${t}${n(`#`,r)}`,bugstemplate:({domain:e,user:t,project:n})=>`https://${e}/${t}/${n}/issues`,hashformat:i},o={};o.github={protocols:[`git:`,`http:`,`git+ssh:`,`git+https:`,`ssh:`,`https:`],domain:`github.com`,treepath:`tree`,blobpath:`blob`,editpath:`edit`,filetemplate:({auth:e,user:t,project:i,committish:a,path:o})=>`https://${n(e,`@`)}raw.githubusercontent.com/${t}/${i}/${r(a||`HEAD`)}/${o}`,gittemplate:({auth:e,domain:t,user:r,project:i,committish:a})=>`git://${n(e,`@`)}${t}/${r}/${i}.git${n(`#`,a)}`,tarballtemplate:({domain:e,user:t,project:n,committish:i})=>`https://codeload.${e}/${t}/${n}/tar.gz/${r(i||`HEAD`)}`,extract:e=>{let[,t,n,r,i]=e.pathname.split(`/`,5);if(!(r&&r!==`tree`)&&(r||(i=e.hash.slice(1)),n&&n.endsWith(`.git`)&&(n=n.slice(0,-4)),!(!t||!n)))return{user:t,project:n,committish:i}}},o.bitbucket={protocols:[`git+ssh:`,`git+https:`,`ssh:`,`https:`],domain:`bitbucket.org`,treepath:`src`,blobpath:`src`,editpath:`?mode=edit`,edittemplate:({domain:e,user:t,project:i,committish:a,treepath:o,path:s,editpath:c})=>`https://${e}/${t}/${i}${n(`/`,o,`/`,r(a||`HEAD`),`/`,s,c)}`,tarballtemplate:({domain:e,user:t,project:n,committish:i})=>`https://${e}/${t}/${n}/get/${r(i||`HEAD`)}.tar.gz`,extract:e=>{let[,t,n,r]=e.pathname.split(`/`,4);if(![`get`].includes(r)&&(n&&n.endsWith(`.git`)&&(n=n.slice(0,-4)),!(!t||!n)))return{user:t,project:n,committish:e.hash.slice(1)}}},o.gitlab={protocols:[`git+ssh:`,`git+https:`,`ssh:`,`https:`],domain:`gitlab.com`,treepath:`tree`,blobpath:`tree`,editpath:`-/edit`,tarballtemplate:({domain:e,user:t,project:n,committish:i})=>`https://${e}/api/v4/projects/${r(t+`/`+n)}/repository/archive.tar.gz?sha=${r(i||`HEAD`)}`,extract:e=>{let t=e.pathname.slice(1);if(t.includes(`/-/`)||t.includes(`/archive.tar.gz`))return;let n=t.split(`/`),r=n.pop();r.endsWith(`.git`)&&(r=r.slice(0,-4));let i=n.join(`/`);if(!(!i||!r))return{user:i,project:r,committish:e.hash.slice(1)}}},o.gist={protocols:[`git:`,`git+ssh:`,`git+https:`,`ssh:`,`https:`],domain:`gist.github.com`,editpath:`edit`,sshtemplate:({domain:e,project:t,committish:r})=>`git@${e}:${t}.git${n(`#`,r)}`,sshurltemplate:({domain:e,project:t,committish:r})=>`git+ssh://git@${e}/${t}.git${n(`#`,r)}`,edittemplate:({domain:e,user:t,project:i,committish:a,editpath:o})=>`https://${e}/${t}/${i}${n(`/`,r(a))}/${o}`,browsetemplate:({domain:e,project:t,committish:i})=>`https://${e}/${t}${n(`/`,r(i))}`,browsetreetemplate:({domain:e,project:t,committish:i,path:a,hashformat:o})=>`https://${e}/${t}${n(`/`,r(i))}${n(`#`,o(a))}`,browseblobtemplate:({domain:e,project:t,committish:i,path:a,hashformat:o})=>`https://${e}/${t}${n(`/`,r(i))}${n(`#`,o(a))}`,docstemplate:({domain:e,project:t,committish:i})=>`https://${e}/${t}${n(`/`,r(i))}`,httpstemplate:({domain:e,project:t,committish:r})=>`git+https://${e}/${t}.git${n(`#`,r)}`,filetemplate:({user:e,project:t,committish:i,path:a})=>`https://gist.githubusercontent.com/${e}/${t}/raw${n(`/`,r(i))}/${a}`,shortcuttemplate:({type:e,project:t,committish:r})=>`${e}:${t}${n(`#`,r)}`,pathtemplate:({project:e,committish:t})=>`${e}${n(`#`,t)}`,bugstemplate:({domain:e,project:t})=>`https://${e}/${t}`,gittemplate:({domain:e,project:t,committish:r})=>`git://${e}/${t}.git${n(`#`,r)}`,tarballtemplate:({project:e,committish:t})=>`https://codeload.github.com/gist/${e}/tar.gz/${r(t||`HEAD`)}`,extract:e=>{let[,t,n,r]=e.pathname.split(`/`,4);if(r!==`raw`){if(!n){if(!t)return;n=t,t=null}return n.endsWith(`.git`)&&(n=n.slice(0,-4)),{user:t,project:n,committish:e.hash.slice(1)}}},hashformat:function(e){return e&&`file-`+i(e)}},o.sourcehut={protocols:[`git+ssh:`,`https:`],domain:`git.sr.ht`,treepath:`tree`,blobpath:`tree`,filetemplate:({domain:e,user:t,project:n,committish:i,path:a})=>`https://${e}/${t}/${n}/blob/${r(i)||`HEAD`}/${a}`,httpstemplate:({domain:e,user:t,project:r,committish:i})=>`https://${e}/${t}/${r}${n(`#`,i)}`,tarballtemplate:({domain:e,user:t,project:n,committish:i})=>`https://${e}/${t}/${n}/archive/${r(i)||`HEAD`}.tar.gz`,bugstemplate:()=>null,extract:e=>{let[,t,n,r]=e.pathname.split(`/`,4);if(![`archive`].includes(r)&&(n&&n.endsWith(`.git`)&&(n=n.slice(0,-4)),!(!t||!n)))return{user:t,project:n,committish:e.hash.slice(1)}}};for(let[e,t]of Object.entries(o))o[e]=Object.assign({},a,t);t.exports=o})),Vn=s(((e,t)=>{var n=require("url"),r=(e,t,n)=>{let r=e.indexOf(n);return e.lastIndexOf(t,r>-1?r:1/0)},i=e=>{try{return new n.URL(e)}catch{}},a=(e,t)=>{let n=e.indexOf(`:`),r=e.slice(0,n+1);if(Object.prototype.hasOwnProperty.call(t,r)||e.substr(n,3)===`://`)return e;let i=e.indexOf(`@`);return i>-1?i>n?`git+ssh://${e}`:e:`${e.slice(0,n+1)}//${e.slice(n+1)}`},o=e=>{let t=r(e,`@`,`#`),n=r(e,`:`,`#`);return n>t&&(e=e.slice(0,n)+`/`+e.slice(n+1)),r(e,`:`,`#`)===-1&&e.indexOf(`//`)===-1&&(e=`git+ssh://${e}`),e};t.exports=(e,t)=>{let n=t?a(e,t):e;return i(n)||i(o(n))}})),Hn=s(((e,t)=>{var n=Vn(),r=e=>{let t=e.indexOf(`#`),n=e.indexOf(`/`),r=e.indexOf(`/`,n+1),i=e.indexOf(`:`),a=/\s/.exec(e),o=e.indexOf(`@`),s=!a||t>-1&&a.index>t,c=o===-1||t>-1&&o>t,l=i===-1||t>-1&&i>t,u=r===-1||t>-1&&r>t,d=n>0,f=t>-1?e[t-1]!==`/`:!e.endsWith(`/`),p=!e.startsWith(`.`);return s&&d&&f&&p&&c&&l&&u};t.exports=(e,t,{gitHosts:i,protocols:a})=>{if(!e)return;let o=n(r(e)?`github:${e}`:e,a);if(!o)return;let s=i.byShortcut[o.protocol],c=i.byDomain[o.hostname.startsWith(`www.`)?o.hostname.slice(4):o.hostname],l=s||c;if(!l)return;let u=i[s||c],d=null;a[o.protocol]?.auth&&(o.username||o.password)&&(d=`${o.username}${o.password?`:`+o.password:``}`);let f=null,p=null,m=null,h=null;try{if(s){let e=o.pathname.startsWith(`/`)?o.pathname.slice(1):o.pathname,t=e.indexOf(`@`);t>-1&&(e=e.slice(t+1));let n=e.lastIndexOf(`/`);n>-1?(p=decodeURIComponent(e.slice(0,n)),p||=null,m=decodeURIComponent(e.slice(n+1))):m=decodeURIComponent(e),m.endsWith(`.git`)&&(m=m.slice(0,-4)),o.hash&&(f=decodeURIComponent(o.hash.slice(1))),h=`shortcut`}else{if(!u.protocols.includes(o.protocol))return;let e=u.extract(o);if(!e)return;p=e.user&&decodeURIComponent(e.user),m=decodeURIComponent(e.project),f=decodeURIComponent(e.committish),h=a[o.protocol]?.name||o.protocol.slice(0,-1)}}catch(e){if(e instanceof URIError)return;throw e}return[l,p,d,m,f,h,t]}})),Un=s(((e,t)=>{var{LRUCache:n}=zn(),r=Bn(),i=Hn(),a=Vn(),o=new n({max:1e3});function s(e){try{let{protocol:t,hostname:n,pathname:r}=new URL(e);return n?`${/(?:git\+)http:$/.test(t)?`http:`:`https:`}//${n}${r.replace(/\.git$/,``)}`:null}catch{return null}}var c=class e{constructor(t,n,r,i,a,o,s={}){Object.assign(this,e.#e[t],{type:t,user:n,auth:r,project:i,committish:a,default:o,opts:s})}static#e={byShortcut:{},byDomain:{}};static#t={"git+ssh:":{name:`sshurl`},"ssh:":{name:`sshurl`},"git+https:":{name:`https`,auth:!0},"git:":{auth:!0},"http:":{auth:!0},"https:":{auth:!0},"git+http:":{auth:!0}};static addHost(t,n){e.#e[t]=n,e.#e.byDomain[n.domain]=t,e.#e.byShortcut[`${t}:`]=t,e.#t[`${t}:`]={name:t}}static fromUrl(t,n){if(typeof t!=`string`)return;let r=t+JSON.stringify(n||{});if(!o.has(r)){let a=i(t,n,{gitHosts:e.#e,protocols:e.#t});o.set(r,a?new e(...a):void 0)}return o.get(r)}static fromManifest(t,n={}){if(!t||typeof t!=`object`)return;let r=t.repository,i=r&&(typeof r==`string`?r:typeof r==`object`&&typeof r.url==`string`?r.url:null);if(!i)throw Error(`no repository`);let a=i&&e.fromUrl(i.replace(/^git\+/,``),n)||null;if(a)return a;let o=s(i);return e.fromUrl(o,n)||o}static parseUrl(e){return a(e)}#n(e,t){if(typeof e!=`function`)return null;let n={...this,...this.opts,...t};n.path||=``,n.path.startsWith(`/`)&&(n.path=n.path.slice(1)),n.noCommittish&&(n.committish=null);let r=e(n);return n.noGitPlus&&r.startsWith(`git+`)?r.slice(4):r}hash(){return this.committish?`#${this.committish}`:``}ssh(e){return this.#n(this.sshtemplate,e)}sshurl(e){return this.#n(this.sshurltemplate,e)}browse(e,...t){return typeof e==`string`?typeof t[0]==`string`?this.#n(this.browsetreetemplate,{...t[1],fragment:t[0],path:e}):this.#n(this.browsetreetemplate,{...t[0],path:e}):this.#n(this.browsetemplate,e)}browseFile(e,...t){return typeof t[0]==`string`?this.#n(this.browseblobtemplate,{...t[1],fragment:t[0],path:e}):this.#n(this.browseblobtemplate,{...t[0],path:e})}docs(e){return this.#n(this.docstemplate,e)}bugs(e){return this.#n(this.bugstemplate,e)}https(e){return this.#n(this.httpstemplate,e)}git(e){return this.#n(this.gittemplate,e)}shortcut(e){return this.#n(this.shortcuttemplate,e)}path(e){return this.#n(this.pathtemplate,e)}tarball(e){return this.#n(this.tarballtemplate,{...e,noCommittish:!1})}file(e,t){return this.#n(this.filetemplate,{...t,path:e})}edit(e,t){return this.#n(this.edittemplate,{...t,path:e})}getDefaultRepresentation(){return this.default}toString(e){return this.default&&typeof this[this.default]==`function`?this[this.default](e):this.sshurl(e)}};for(let[e,t]of Object.entries(r))c.addHost(e,t);t.exports=c})),Wn=u(Un(),1);async function Gn(e,{pkgFile:t}={}){return(await Ln(e,{pkgFile:t}))?.repository??null}async function Kn(e,t,{pkgFile:n}={}){let r=t?t.repository?t.repository:null:await Gn(e,{pkgFile:n});if(!r)return null;let i,a=``;if(typeof r==`string`){i=r;try{let e=new x.URL(i);if(e.protocol===`https:`||e.protocol===`http:`)return i}catch{}}else typeof r.url==`string`&&(i=r.url,typeof r.directory==`string`&&(a=r.directory));if(typeof i==`string`&&typeof a==`string`){let e=Wn.default.fromUrl(i)?.browse(a);return e===void 0?i:e.replace(/\/$/,``).replace(/\/tree\/HEAD$/,``)}return null}function qn(e){return e.startsWith(`file:`)||e.startsWith(`link:`)||e.startsWith(`workspace:`)||e.startsWith(`catalog:`)||e.startsWith(`portal:`)}function Jn(e){return!qn(e)&&!/^[^/:@]+\/\w+/.test(e)}var Yn=s(((e,t)=>{var n=require("url"),r=typeof URL>`u`?n.URL||null:URL,i=r?null:n.parse;function a(e){try{var t=new r(e),n=null;t.username&&(n=t.password?t.username+`:`+t.password:t.username);var i=t.host||null,a=t.hostname||null,o=t.pathname||null,s=t.pathname+(t.search||``)||null;if(!i&&o&&e.indexOf(`//`)===-1){var c=o.indexOf(`/`);c===-1?(i=o,a=o,o=null,s=null):(i=o.slice(0,c),a=i,o=o.slice(c),s=o+(t.search||``))}return{auth:n,hash:t.hash||null,host:i,hostname:a,href:t.href,path:s,pathname:o,port:t.port||null,protocol:t.protocol||null,query:t.search?t.search.slice(1):null,search:t.search||null,slashes:e.indexOf(`//`)===-1?null:!0}}catch{var l=e.indexOf(`#`),u=l===-1?null:e.slice(l),d=l===-1?e:e.slice(0,l),f=d.indexOf(`?`),p=f===-1?null:d.slice(f),m=f===-1?d:d.slice(0,f);return{auth:null,hash:u,host:null,hostname:null,href:e,path:d||null,pathname:m||null,port:null,protocol:null,query:p?p.slice(1):null,search:p,slashes:null}}}t.exports=r?a:i})),Xn=s(((e,t)=>{var n=Yn(),r={__proto__:null};function i(e){return/^[a-f0-9]{40}$/i.test(e)}function a(e,t){var n=e.split(`#`),r;return n.length>1&&(r=n[n.length-1]),!r&&t.hash&&t.hash.charAt(0)===`#`&&(r=t.hash.slice(1)),r||`master`}function o(e){return e.charAt(0)===`/`?e.slice(1):e}function s(e){return e?e.replace(/\.git$/,``):null}function c(e){if(!e)return null;var t=e.indexOf(`:`);return t>-1?e.slice(t+1):e}function l(e){return n(`http://`+e.replace(/git@([^:]+):/,`$1/`)).host||null}function u(e){if(typeof e!=`string`||!e.length||e.indexOf(`git@gist`)!==-1||e.indexOf(`//gist`)!==-1)return null;var t=n(e);if(typeof t.path!=`string`||!t.path.length||typeof t.pathname!=`string`||!t.pathname.length)return null;!t.host&&/^git@/.test(e)===!0&&(t.host=l(e)),t.path=o(t.path),t.pathname=o(t.pathname),t.filepath=null,t.path.indexOf(`repos`)===0&&(t.path=t.path.slice(6));var r=t.path.split(`/`).filter(Boolean),u=r[2]===`blob`;u&&!i(r[3])&&(t.branch=r[3],r.length>4&&(t.filepath=r.slice(4).join(`/`)));var d=e.indexOf(`blob`);u&&d!==-1&&(t.blob=e.slice(d+5));var f=r[2]===`tree`,p=e.indexOf(`tree`);if(f&&p!==-1){var m=p+5,h=e.slice(m),g=h.indexOf(`/`);g!==-1&&(h=h.slice(0,g)),t.branch=h}if(t.owner=c(r[0]),t.name=s(r[1]),r.length>1&&t.owner&&t.name)t.repo=t.owner+`/`+t.name;else{var _=t.href.split(`:`);if(_.length===2&&t.href.indexOf(`//`)===-1){t.repo=t.repo||_[_.length-1];var v=t.repo.split(`/`);t.owner=v[0],t.name=v[1]}else{var y=t.href.match(/\/([^/]*)$/);t.owner=y?y[1]:null,t.repo=null}if(t.repo&&(!t.owner||!t.name)){var b=t.repo.split(`/`);b.length===2&&(t.owner=b[0],t.name=b[1])}}return t.branch||(t.branch=r[2]||a(t.path,t),r.length>3&&(t.filepath=r.slice(3).join(`/`))),t.host=t.host||`github.com`,t.owner=t.owner||null,t.name=t.name||null,t.repository=t.repo,t}t.exports=function(e){return r[e]||(r[e]=u(e)),r[e]}})),Zn=s(((e,t)=>{(function(){"use strict";var e=/^v?((\d+)\.(\d+)\.(\d+))(?:-([\dA-Za-z\-]+(?:\.[\dA-Za-z\-]+)*))?(?:\+([\dA-Za-z\-]+(?:\.[\dA-Za-z\-]+)*))?$/,n=/\s*((\|\||\-)|(((?:(?:~?[<>]?)|\^?)=?)\s*(v)?([0-9]+)(\.(x|\*|[0-9]+))?(\.(x|\*|[0-9]+))?(([\-+])([a-zA-Z0-9\.-]+))?))\s*/g;function r(e){var t={};for(var n in e)e[n]!==void 0&&(t[n]=e[n]);return t}function i(e){var t=``;return t+=e.major||`0`,t+=`.`,t+=e.minor||`0`,t+=`.`,t+=e.patch||`0`,e.release&&(t+=`-`+e.release),e.build&&(t+=`+`+e.build),t}function a(e){var t=``;function n(e){e.operator&&(t+=e.operator+` `),e.major&&(t+=e.toString()+` `)}return e.forEach(n),t.trim()}function o(e){if(e){var t=this;Object.keys(e).forEach(function(n){t[n]=e[n]})}}o.prototype.toString=function(){return i(this)};function s(t){var n=e.exec(t)||[],i=new o(r({semver:n[0],version:n[1],major:n[2],minor:n[3],patch:n[4],release:n[5],build:n[6]}));return n.length===0&&(i=null),i}function c(e){for(var t,i=[],a;t=n.exec(e);)a={semver:t[3],operator:t[4]||t[2],major:t[6],minor:t[8],patch:t[10]},t[12]===`+`&&(a.build=t[13]),t[12]===`-`&&(a.release=t[13]),i.push(new o(r(a)));return i}t.exports.parse=s,t.exports.stringify=i,t.exports.parseRange=c,t.exports.stringifyRange=a})()})),Qn=u(Xn(),1),$n=u(Zn(),1);function er(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function tr(e,t){return e?e.map(e=>({item:e,key:t(e)})).sort((e,t)=>e.key>t.key?1:e.key<t.key?-1:0).map(({item:e})=>e):[]}var nr=[`major`,`minor`,`patch`],rr=[`release`,`build`],ir=[...nr,...rr],ar={major:``,minor:`.`,patch:`.`,release:`-`,build:`+`},or=[`^`,`~`,`.*`,`.x`],sr=RegExp(`^(${[`^`,`~`,`^*`,`*`,`x`,`x.x`,`x.x.x`].map(er).join(`|`)})$`),cr=/^npm:(.*)@(.*)/;function lr(e){let[t]=$n.default.parseRange(e);if(!t)throw Error(h.default.format(`semverutils.parseRange returned null when trying to parse "%s". This is probably a problem with the "semver-utils" dependency. Please report an issue at https://github.com/raineorshine/npm-check-updates/issues.`,e));return ir.reduce((e,n)=>t[n]?e+1:e,0)}function ur(e,t){return(t?ir.slice(0,ir.indexOf(t)+1):ir).filter(n=>t&&nr.includes(t)||e[n]).map(t=>ar[t]+(e[t]||`0`)).join(``)}function dr(e){let[t]=$n.default.parseRange(e);return ir.slice().reverse().find(e=>t?.[e])}function fr(e,t){let[n]=$n.default.parseRange(e);return ur(n,t)}function pr(e,t){return t===`^`||t===`~`?t+e:fr(e,`major`)+t}function mr(e){return sr.test(e)}function hr(e){return e===`*`||e===`x`}function gr(e,t){if(e===t)return`none`;/^[~^]/.test(t)&&t[0]===e[0]&&(t=t.slice(1),e=e.slice(1));let n=t.split(`.`),r=e.split(`.`),i=n.findIndex((e,t)=>e!==r[t]);return i=i>=0?i:n.length,n[0]===`0`?`majorVersionZero`:i===0?`major`:i===1?`minor`:`patch`}function _r(e,t,n){let r=Dn(e,(r,i,a)=>{let o=t[r],s=gr(o,i),c=n.groupFunction?.(r,s,(0,$n.parseRange)(o),(0,$n.parseRange)(i),(0,$n.parse)(e[r]))??s;return c===`none`?a:{...a,[c]:{...a[c],[r]:i}}}),i={patch:J.green(J.bold(`Patch`)+` Backwards-compatible bug fixes`),minor:J.cyan(J.bold(`Minor`)+` Backwards-compatible features`),major:J.red(J.bold(`Major`)+` Potentially breaking API changes`),majorVersionZero:J.magenta(J.bold(`Major version zero`)+` Anything may change`)};return Array.from(new Set([`patch`,`minor`,`major`,`majorVersionZero`,...Object.keys(r).sort()])).filter(e=>e in r).map(e=>({groupName:e,heading:e in i?i[e]:e,packages:r[e]}))}function vr(e,t){let n=``;/^[~^]/.test(t)&&t[0]===e[0]&&(n=t[0],t=t.slice(1),e=e.slice(1));let r=t.split(`.`),i=e.split(`.`),a=r.findIndex((e,t)=>e!==i[t]);a=a>=0?a:r.length;let o=a===0||r[0]===`0`?`red`:a===1?`cyan`:`green`,s=a>0&&a<r.length?`.`:``;return n+r.slice(0,a).join(`.`)+s+J[o](r.slice(a).join(`.`))}var yr=e=>{let t=q.default.prerelease(e);return t&&t.slice(0,-1).join(`.`)};function br(e,t){let n=yr(e),r=yr(t);return typeof n!=`string`||typeof r!=`string`||n===r}function xr(e,t){return(q.default.valid(e)&&q.default.valid(t)?q.default.gt(e,t):e>t)?1:e===t?0:-1}function Sr(e,t,n){if(!q.default.validRange(t))return null;let r=q.default.minVersion(t);return[...e].sort(xr).filter(e=>{let t=q.default.parse(e);return t&&(n===`major`||t.major===r?.major)&&(n===`major`||n===`minor`||t.minor===r?.minor)}).at(-1)||null}function Cr(e,t){if(!q.default.validRange(e))return()=>!1;let n=q.default.minVersion(e);return e=>{let r=q.default.parse(e);return r&&(t===`major`||r.major===n?.major)&&(t===`major`||t===`minor`||r.minor===n?.minor)}}function wr(e){return t=>q.default.satisfies(t,e)}function Tr(e){return dr(e)===`release`}var Er=e=>/^[vV]?\d+$/.test(e),Dr=e=>/^[vV]?\d+\.\d+$/.test(e),Or=e=>e.replace(/^[vV]/,``),kr=e=>Er(e)?e+`.0.0`:e,Ar=e=>Dr(e)?e+`.0`:e,jr=e=>Ar(kr(Or(e)));function Mr(e){return e&&(e[0]===`v`||e[1]===`v`)?`v`:``}var Nr=(e,t)=>`npm:${e}@${t}`,Pr=e=>{let t=e&&e.match&&e.match(cr);return t&&t.slice(1)},Fr=e=>e&&!!e.match(cr),Ir=(e,t)=>{let n=Pr(e);return n?Nr(n[0],t):null},Lr=e=>{if(!e)return!1;let t=null;try{t=(0,Qn.default)(e)}catch{}if(!t||!t.branch)return!1;let n=decodeURIComponent(t.branch).replace(/^semver:/,``);return!!q.default.validRange(n)},Rr=e=>{if(!e)return null;let t=(0,Qn.default)(e);if(!t||!t.branch)return null;let n=decodeURIComponent(t.branch).replace(/^semver:/,``);return t&&t.branch&&q.default.validRange(n)?n:null};function zr(e,t,n={}){if(n.wildcard=n.wildcard||`^`,!t)return e;let[r]=$n.default.parseRange(t);if(!r)return e;if(n.removeRange)return t;if(mr(e))return e;let i=tr($n.default.parseRange(e).filter(e=>e.operator!==`||`&&e.operator!==`-`),e=>lr(ur(e))),[a]=i;function o(e){return(hr(a[e])?a[e]:nr.includes(e)&&a[e]||rr.includes(e)?r[e]:null)||null}let s=ur(Dn(ir,e=>({[e]:o(e)}))),c=Mr(a.semver)+s,l=Array.from(new Set(i.map(e=>e.operator))),u=l[0]||``,d=or.some(e=>s.includes(e)),f=l[0]===`<`||l[0]===`<=`,p=l[0]===`>`,m=l.length>1;return!d&&(f||m)?pr(c,n.wildcard):(p?`>=`:u)+c}var Br=(e,t)=>{let n=Mr(e),r=n?n+t:t;return r=Er(e)?r.slice(0,r.length-4):r,r=Dr(e)?r.slice(0,r.length-2):r,r},Vr=(e,t)=>{let n=jr(t),r=(0,Qn.default)(e);if(!r)return e;let i=decodeURIComponent(r.branch).replace(/^semver:/,``);return e.replace(i,zr(i,Br(i,n)))},Hr=e=>e.replace(/^[~^<>=]+/,``),Ur={silent:0,error:1,minimal:2,warn:3,info:4,verbose:5,silly:6};function Y(e,t,n=null,r=`log`){!e.json&&e.loglevel!==`silent`&&(n==null||Ur[e.loglevel??`warn`]>=Ur[n])&&console[r](t)}function Wr(e,t){e.loglevel!==`silent`&&console.log(JSON.stringify(t,null,2))}function Gr(e,t){console.log(Object.keys(e).map(t=>t+`@`+e[t]).join(t))}function Kr(e,t,n){Y(e,Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}),n)}function qr(e){let t=new jt.default({colAligns:[`left`,`right`,`right`,`right`,`left`,`left`],chars:{top:``,"top-mid":``,"top-left":``,"top-right":``,bottom:``,"bottom-mid":``,"bottom-left":``,"bottom-right":``,left:``,"left-mid":``,mid:``,"mid-mid":``,right:``,"right-mid":``,middle:``}});return t.push(...e),t.toString().split(`
52
52
  `).map(e=>e.trimEnd()).join(`
53
- `)}function Jr(e){return Lr(e)?Rr(e):Fr(e)?Pr(e)[1]:e}function Yr(e){if(e===void 0||typeof e==`function`)return`cooldown`;let t=String(e).trim().toLowerCase(),n=t.match(/^(\d+(?:\.\d+)?)(d|h|m)$/);if(n){let e=Number(n[1]),t=n[2];return`${+e.toFixed(1)}-${{d:`day`,h:`hour`,m:`minute`}[t]} cooldown`}let r=Number(t);return isNaN(r)?`cooldown`:`${+r.toFixed(1)}-day cooldown`}async function Xr({from:e,to:t,skippedByCooldown:n,format:r,ownersChangedDeps:i,pkgFile:a,time:o}){let s=r?.includes(`dep`)&&a?JSON.parse(await g.default.readFile(a,`utf-8`)):null,c=Object.keys(n||{}).length>0;return qr(await Promise.all(Object.keys(t).sort().map(async l=>{let u=(r?.includes(`installedVersion`)?await Rn(l,void 0,{pkgFile:a}):e[l])||``,d=l in(s?.devDependencies??{})?`dev`:l in(s?.peerDependencies??{})?`peer`:l in(s?.optionalDependencies??{})?`optional`:``,f=Jr(t[l]||``),p=i?l in i?i[l]?`*owner changed*`:``:`*unknown*`:``,m=vr(Jr(u),f),h=r?.includes(`homepage`)&&(await Ln(l,{pkgFile:a}))?.homepage||``,g=r?.includes(`repo`)&&await Kn(l,void 0,{pkgFile:a})||``,_=r?.includes(`diff`)?`${process.env.NCU_DIFF||`https://npmdiff.dev`}/${encodeURIComponent(l)}/${u.replace(/^\W+/,``)}/${f.replace(/^\W+/,``)}`:``,v=r?.includes(`cooldown`),y=r?.includes(`time`),b=(y||v)&&!o?.[l]?`[missing time]`:``,x=y&&o?.[l]?o[l]:null,S=x?Ut(x,`en_US`):y||!c?b:``,C=n?.[l]?.version,w=``;if(C){let e=or.includes(f[0])?f[0]:``,t=q.default.coerce(C);w=`[cooldown] ${vr(f,e+Jr(t&&!C.endsWith(t.version)?`${t.version}-+`:C)).replace(e,``)}`}else v&&!y&&(w=b);return[l,...r?.includes(`dep`)?[d?J.gray(d):``]:[],u,`→`,m,...c?[w]:[],p,...[h,g,_,S].filter(e=>e)]})))}async function Zr({skippedByCooldown:e,pkgFile:t,options:n}){let r=n.format;if(!e||!r?.includes(`cooldown`)||r?.includes(`lines`))return;let i={},a={},o={};for(let t of Object.values(e)){let{name:e,version:n,currentVersion:r,fallbackVersion:s,time:c}=t;if(!Jn(r)||!n)continue;let l=or.includes(r[0])?r[0]:``,u=l+Hr(s??r),d=l+Hr(n||``);i[e]=u,a[e]=vr(u,d),o[e]=c||``}if(!Object.keys(i).length)return!1;let s=await Xr({from:i,to:a,format:r.includes(`time`)?r:[...r,`time`],pkgFile:t||void 0,time:o}),c=n.raw?.cooldown??n.cooldown;return Y(n,`
53
+ `)}function Jr(e){return Lr(e)?Rr(e):Fr(e)?Pr(e)[1]:e}function Yr(e){if(e===void 0||typeof e==`function`)return`cooldown`;let t=String(e).trim().toLowerCase(),n=t.match(/^(\d+(?:\.\d+)?)(d|h|m)$/);if(n){let e=Number(n[1]),t=n[2];return`${+e.toFixed(1)}-${{d:`day`,h:`hour`,m:`minute`}[t]} cooldown`}let r=Number(t);return isNaN(r)?`cooldown`:`${+r.toFixed(1)}-day cooldown`}async function Xr({from:e,to:t,skippedByCooldown:n,format:r,ownersChangedDeps:i,pkgFile:a,time:o}){let s=r?.includes(`dep`)&&a?JSON.parse(await g.default.readFile(a,`utf-8`)):null,c=Object.keys(n||{}).length>0;return qr(await Promise.all(Object.keys(t).sort().map(async l=>{let u=(r?.includes(`installedVersion`)?await Rn(l,void 0,{pkgFile:a}):e[l])||``,d=l in(s?.devDependencies??{})?`dev`:l in(s?.peerDependencies??{})?`peer`:l in(s?.optionalDependencies??{})?`optional`:``,f=Jr(t[l]||``),p=i?l in i?i[l]?`*owner changed*`:``:`*unknown*`:``,m=vr(Jr(u),f),h=r?.includes(`homepage`)&&(await Ln(l,{pkgFile:a}))?.homepage||``,g=r?.includes(`repo`)&&await Kn(l,void 0,{pkgFile:a})||``,_=r?.includes(`diff`)?`${process.env.NCU_DIFF||`https://npmdiff.dev`}/${encodeURIComponent(l)}/${u.replace(/^\W+/,``)}/${f.replace(/^\W+/,``)}`:``,v=r?.includes(`cooldown`),y=r?.includes(`time`),b=(y||v)&&!o?.[l]?`[missing time]`:``,x=y&&o?.[l]?o[l]:null,S=x?Ut(x,`en_US`):y||!c?b:``,C=n?.[l]?.version,w=``;if(C){let e=or.includes(f[0])?f[0]:``,t=q.default.coerce(C);w=`[cooldown] ${vr(f,e+Jr(t&&!C.endsWith(t.version)?`${t.version}-+`:C)).replace(e,``)}`}else v&&!y&&(w=b);return[l,...r?.includes(`dep`)?[d?J.gray(d):``]:[],u,`→`,m,...c?[w]:[],p,...[h,g,_,S].filter(e=>e)]})))}async function Zr({skippedByCooldown:e,pkgFile:t,options:n}){let r=n.format;if(!e||!r?.includes(`cooldown`)||r?.includes(`lines`))return;let i={},a={},o={};for(let t of Object.values(e)){let{name:e,version:n,currentVersion:r,fallbackVersion:s,time:c}=t;if(!Jn(r)||!n)continue;let l=or.includes(r[0])?r[0]:``,u=l+Hr(s??r),d=l+Hr(n);i[e]=u,a[e]=vr(u,d),o[e]=c||``}if(!Object.keys(i).length)return!1;let s=await Xr({from:i,to:a,format:r.includes(`time`)?r:[...r,`time`],pkgFile:t||void 0,time:o}),c=n.raw?.cooldown??n.cooldown;return Y(n,`
54
54
  `+J.yellow(J.bold(`Skipped due to ${Yr(c)}`))),Y(n,s),!0}async function Qr({current:e,upgraded:t,skippedByCooldown:n,ownersChangedDeps:r,pkgFile:i,time:a},o){if(o.format?.includes(`group`)){let s=_r(t,e,o);for(let{heading:t,packages:c}of s)Y(o,`
55
55
  `+t),Y(o,await Xr({from:e,to:c,skippedByCooldown:n,format:o.format,ownersChangedDeps:r,pkgFile:i,time:a}))}else o.format?.includes(`lines`)?Gr(t,`
56
56
  `):Y(o,await Xr({from:e,to:t,skippedByCooldown:n,format:o.format,ownersChangedDeps:r,pkgFile:i,time:a}))}function $r(e,t){if(t&&Object.keys(t).length>0){let n=new jt.default({colAligns:[`left`,`right`,`right`,`right`,`left`,`left`],chars:{top:``,"top-mid":``,"top-left":``,"top-right":``,bottom:``,"bottom-mid":``,"bottom-left":``,"bottom-right":``,left:``,"left-mid":``,mid:``,"mid-mid":``,right:``,"right-mid":``,middle:``}});n.push(...Object.entries(t).map(([e,t])=>[e,J.yellow(t)])),Y(e,`
@@ -433,12 +433,12 @@ Scoped Registry Key: ${u.scopeAuthKey}
433
433
  More info here: ${s}`),l(e,n,o,d)):(n.body.on(`end`,()=>c(e,n,o,d)),d.ignoreBody?(n.body.resume(),new r(null,n)):n));function c(e,t,n){let r=Date.now()-n,i=t.headers.get(`x-fetch-attempts`),s=i&&i>1?` attempt #${i}`:``,c=t.headers.get(`x-local-cache-status`),l=c?` (cache ${c})`:``,u=o(t.url);c===`hit`?a.http(`cache`,`${u} ${r}ms${s}${l}`):a.http(`fetch`,`${e.toUpperCase()} ${t.status} ${u} ${r}ms${s}${l}`)}function l(e,t,r,i){return t.buffer().catch(()=>null).then(r=>{let a=r;try{a=JSON.parse(r.toString(`utf8`))}catch{}if(t.status===401&&t.headers.get(`www-authenticate`)){let r=t.headers.get(`www-authenticate`).split(/,\s*/).map(e=>e.toLowerCase());throw r.indexOf(`ipaddress`)===-1?r.indexOf(`otp`)===-1?new n.HttpErrorAuthUnknown(e,t,a,i.spec):new n.HttpErrorAuthOTP(e,t,a,i.spec):new n.HttpErrorAuthIPAddress(e,t,a,i.spec)}else if(t.status===401&&r!=null&&/one-time pass/.test(r.toString(`utf8`)))throw new n.HttpErrorAuthOTP(e,t,a,i.spec);else throw new n.HttpErrorGeneral(e,t,a,i.spec)})}})),ls=c({default:()=>us}),us,ds=o((()=>{us=`_http_agent._http_client._http_common._http_incoming._http_outgoing._http_server._stream_duplex._stream_passthrough._stream_readable._stream_transform._stream_wrap._stream_writable._tls_common._tls_wrap.assert.assert/strict.async_hooks.buffer.child_process.cluster.console.constants.crypto.dgram.diagnostics_channel.dns.dns/promises.domain.events.fs.fs/promises.http.http2.https.inspector.inspector/promises.module.net.os.path.path/posix.path/win32.perf_hooks.process.punycode.querystring.readline.readline/promises.repl.stream.stream/consumers.stream/promises.stream/web.string_decoder.sys.timers.timers/promises.tls.trace_events.tty.url.util.util/types.v8.vm.wasi.worker_threads.zlib.node:sea.node:sqlite.node:test.node:test/reporters`.split(`.`)})),fs=s(((e,t)=>{var n=(ds(),d(ls).default),r=RegExp(`^(?:@([^/]+?)[/])?([^/]+?)$`),i=[`node_modules`,`favicon.ico`];function a(e){var t=[],a=[];if(e===null)return a.push(`name cannot be null`),o(t,a);if(e===void 0)return a.push(`name cannot be undefined`),o(t,a);if(typeof e!=`string`)return a.push(`name must be a string`),o(t,a);if(e.length||a.push(`name length must be greater than zero`),e.startsWith(`.`)&&a.push(`name cannot start with a period`),e.startsWith(`-`)&&a.push(`name cannot start with a hyphen`),e.match(/^_/)&&a.push(`name cannot start with an underscore`),e.trim()!==e&&a.push(`name cannot contain leading or trailing spaces`),i.forEach(function(t){e.toLowerCase()===t&&a.push(t+` is not a valid package name`)}),n.includes(e.toLowerCase())&&t.push(e+` is a core module name`),e.length>214&&t.push(`name can no longer contain more than 214 characters`),e.toLowerCase()!==e&&t.push(`name can no longer contain capital letters`),/[~'!()*]/.test(e.split(`/`).slice(-1)[0])&&t.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(e)!==e){var s=e.match(r);if(s){var c=s[1],l=s[2];if(l.startsWith(`.`)&&a.push(`name cannot start with a period`),encodeURIComponent(c)===c&&encodeURIComponent(l)===l)return o(t,a)}a.push(`name can only contain URL-friendly characters`)}return o(t,a)}var o=function(e,t){var n={validForNewPackages:t.length===0&&e.length===0,validForOldPackages:t.length===0,warnings:e,errors:t};return n.warnings.length||delete n.warnings,n.errors.length||delete n.errors,n};t.exports=a})),ps=s(((e,t)=>{var n=process.platform===`win32`,{URL:r}=require("node:url"),i=n?require("node:path/win32"):require("node:path"),{homedir:a}=require("node:os"),o=Un(),s=At(),c=fs(),{log:l}=is(),u=n?/\\|[/]/:/[/]/,d=/^(?:git[+])?[a-z]+:/i,f=/^[^@]+@[^:.]+\.[^:]+:.+$/i,p=/[.](?:tgz|tar\.gz|tar)$/i,m=/:[0-9]+(\/|$)/i,h=/^(?:[.]|~[/]|[/\\]|[a-zA-Z]:)/,g=/^(?:[.]|~[/]|[/]|[a-zA-Z]:)/,_=`https://registry.npmjs.org`;function v(e,t){let n,r;if(typeof e==`object`)return e instanceof E&&(!t||t===e.where)?e:e.name&&e.rawSpec?v.resolve(e.name,e.rawSpec,t||e.where):v(e.raw,t||e.where);let i=e.indexOf(`@`,1),a=i>0?e.slice(0,i):e;return d.test(e)?r=e:f.test(e)?r=`git+ssh://${e}`:!a.startsWith(`@`)&&(u.test(a)||p.test(a))?r=e:i>0?(n=a,r=e.slice(i+1)||`*`):c(e).validForOldPackages?(n=e,r=`*`):r=e,x(n,r,t,e)}function y(e){return e?e.toLowerCase().startsWith(`file:`)?!0:n?h.test(e):g.test(e):!1}function b(e){return e?e.toLowerCase().startsWith(`npm:`):!1}function x(e,t,n,r){let i=new E({raw:r,name:e,rawSpec:t,fromArgument:r!=null});if(e&&(i.name=e),n||=process.cwd(),y(t))return A(i,n);if(b(t))return N(i,n);let a=o.fromUrl(t,{noGitPlus:!0,noCommittish:!0});return a?j(i,a):t&&d.test(t)?ee(i):t&&(u.test(t)||p.test(t))?A(i,n):P(i)}function S(e,t=_){let n=v(e);if(n.type!==`version`)throw T(n.type,n.raw);let r=`pkg:npm/`+n.name.replace(/^@/,`%40`)+`@`+n.rawSpec;return t!==_&&(r+=`?repository_url=`+t),r}function C(e,t,n){let r=Error(`Invalid package name "${e}" of package "${n}": ${t.errors.join(`; `)}.`);return r.code=`EINVALIDPACKAGENAME`,r}function w(e,t){let n=Error(`Invalid tag name "${e}" of package "${t}": Tags may not have any characters that encodeURIComponent encodes.`);return n.code=`EINVALIDTAGNAME`,n}function T(e,t){let n=Error(`Invalid type "${e}" of package "${t}": Purl can only be generated for "version" types.`);return n.code=`EINVALIDPURLTYPE`,n}var E=class{constructor(e){this.type=e.type,this.registry=e.registry,this.where=e.where,e.raw==null?this.raw=e.name?`${e.name}@${e.rawSpec}`:e.rawSpec:this.raw=e.raw,this.name=void 0,this.escapedName=void 0,this.scope=void 0,this.rawSpec=e.rawSpec||``,this.saveSpec=e.saveSpec,this.fetchSpec=e.fetchSpec,e.name&&this.setName(e.name),this.gitRange=e.gitRange,this.gitCommittish=e.gitCommittish,this.gitSubdir=e.gitSubdir,this.hosted=e.hosted}setName(e){let t=c(e);if(!t.validForOldPackages)throw C(e,t,this.raw);return this.name=e,this.scope=e[0]===`@`?e.slice(0,e.indexOf(`/`)):void 0,this.escapedName=e.replace(`/`,`%2f`),this}toString(){let e=[];this.name!=null&&this.name!==``&&e.push(this.name);let t=this.saveSpec||this.fetchSpec||this.rawSpec;return t!=null&&t!==``&&e.push(t),e.length?e.join(`@`):this.raw}toJSON(){let e=Object.assign({},this);return delete e.hosted,e}};function D(e,t){if(!t){e.gitCommittish=null;return}for(let n of t.split(`::`)){if(!n.includes(`:`)){if(e.gitRange)throw Error(`cannot override existing semver range with a committish`);if(e.gitCommittish)throw Error(`cannot override existing committish with a second committish`);e.gitCommittish=n;continue}let[t,r]=n.split(`:`);if(t===`semver`){if(e.gitCommittish)throw Error(`cannot override existing committish with a semver range`);if(e.gitRange)throw Error(`cannot override existing semver range with a second semver range`);e.gitRange=decodeURIComponent(r);continue}if(t===`path`){if(e.gitSubdir)throw Error(`cannot override existing path with a second path`);e.gitSubdir=`/${r}`;continue}l.warn(`npm-package-arg`,`ignoring unknown key "${t}"`)}}var O=new Map([[`\0`,`%00`],[` `,`%09`],[`
434
434
  `,`%0A`],[`\r`,`%0D`],[` `,`%20`],[`"`,`%22`],[`#`,`%23`],[`%`,`%25`],[`?`,`%3F`],[`[`,`%5B`],[`\\`,n?`/`:`%5C`],[`]`,`%5D`],[`^`,`%5E`],[`|`,`%7C`],[`~`,`%7E`]]);function k(e){let t=``;for(let n=0;n<e.length;n++)t=`${t}${O.get(e[n])??e[n]}`;return t.startsWith(`file:`)?t:`file:${t}`}function A(e,t){e.type=p.test(e.rawSpec)?`file`:`directory`,e.where=t;let o=k(e.rawSpec);o.startsWith(`file:/`)&&(/^file:\/\/[^/]/.test(o)&&(o=`file:/${o.slice(5)}`),/^\/{1,3}\.\.?(\/|$)/.test(o.slice(5))&&(o=o.replace(/^file:\/{1,3}/,`file:`)));let s,c;try{s=new r(o,`${k(i.resolve(t))}/`),c=new r(o)}catch(n){throw Object.assign(Error(`Invalid file: URL, must comply with RFC 8089`),{raw:e.rawSpec,spec:e,where:t,originalError:n})}let l=decodeURIComponent(c.pathname),u=decodeURIComponent(s.pathname);return n&&(l=l.replace(/^\/+([a-z]:\/)/i,`$1`),u=u.replace(/^\/+([a-z]:\/)/i,`$1`)),/^\/~(\/|$)/.test(l)?(e.saveSpec=`file:${l.substr(1)}`,u=i.resolve(a(),l.substr(3))):i.isAbsolute(o.slice(5))?e.saveSpec=`file:${i.resolve(u)}`:e.saveSpec=`file:${i.relative(t,u)}`,e.fetchSpec=i.resolve(t,u),e.saveSpec=e.saveSpec.split(`\\`).join(`/`),e.saveSpec.startsWith(`file://`)&&(e.saveSpec=`file:/${e.saveSpec.slice(7)}`),e}function j(e,t){return e.type=`git`,e.hosted=t,e.saveSpec=t.toString({noGitPlus:!1,noCommittish:!1}),e.fetchSpec=t.getDefaultRepresentation()===`shortcut`?null:t.toString(),D(e,t.committish),e}function M(e,t){let n=Error(`Unsupported URL Type "${e}": ${t}`);return n.code=`EUNSUPPORTEDPROTOCOL`,n}function ee(e){let t=e.rawSpec;if(e.saveSpec=t,t.startsWith(`git+ssh:`)){let n=t.match(/^git\+ssh:\/\/([^:#]+:[^#]+(?:\.git)?)(?:#(.*))?$/i);if(n&&!n[1].match(m))return e.type=`git`,D(e,n[2]),e.fetchSpec=n[1],e}else t.startsWith(`git+file://`)&&(t=t.replace(/\\/g,`/`));let n=new r(t);switch(n.protocol){case`git:`:case`git+http:`:case`git+https:`:case`git+rsync:`:case`git+ftp:`:case`git+file:`:case`git+ssh:`:e.type=`git`,D(e,n.hash.slice(1)),n.protocol===`git+file:`&&/^git\+file:\/\/[a-z]:/i.test(t)?e.fetchSpec=`git+file://${n.host.toLowerCase()}:${n.pathname}`:(n.hash=``,e.fetchSpec=n.toString()),e.fetchSpec.startsWith(`git+`)&&(e.fetchSpec=e.fetchSpec.slice(4));break;case`http:`:case`https:`:e.type=`remote`,e.fetchSpec=e.saveSpec;break;default:throw M(n.protocol,t)}return e}function N(e,t){let n=v(e.rawSpec.substr(4),t);if(n.type===`alias`)throw Error(`nested aliases not supported`);if(!n.registry)throw Error(`aliases only work for registry deps`);if(!n.name)throw Error(`aliases must have a name`);return e.subSpec=n,e.registry=!0,e.type=`alias`,e.saveSpec=null,e.fetchSpec=null,e}function P(e){e.registry=!0;let t=e.rawSpec.trim();e.saveSpec=null,e.fetchSpec=t;let n=s.valid(t,!0),r=s.validRange(t,!0);if(n)e.type=`version`;else if(r)e.type=`range`;else{if(encodeURIComponent(t)!==t)throw w(t,e.raw);e.type=`tag`}return e}t.exports=v,t.exports.resolve=x,t.exports.toPurl=S,t.exports.Result=E})),ms=s(((e,t)=>{var n=require("fs"),r=ps(),{URL:i}=require("url"),a=(e,t)=>{let n=new i(e),r=`//${n.host}${n.pathname}`;for(;r.length>2;){let e=o(r,t);if(e)return{regKey:r,authKey:e};r=r.replace(/([^/]+|\/)$/,``)}return{regKey:!1,authKey:null}},o=(e,t)=>t[`${e}:_authToken`]?`_authToken`:t[`${e}:_auth`]?`_auth`:t[`${e}:username`]&&t[`${e}:_password`]?`username`:t[`${e}:certfile`]&&t[`${e}:keyfile`]?`certfile`:!1,s=(e,t)=>{let n=new i(e),r=new i(t);return n.host===r.host},c=e=>{let{spec:t}=e,{scope:n,subSpec:i}=t?r(t):{},a=i&&i.scope,o=i?a:n;return o&&e[`${o}:registry`]||e.registry},l=e=>{try{return n.readFileSync(e,`utf8`)}catch(e){if(e.code!==`ENOENT`)throw e;return null}},u=(e,t={})=>{let{forceAuth:n}=t;if(!e)throw Error(`URI is required`);let{regKey:r,authKey:i}=a(e,n||t);if(n&&!r)return new d({regKey:!1,authKey:null,scopeAuthKey:null,token:n._authToken||n.token,username:n.username,password:n._password||n.password,auth:n._auth||n.auth,certfile:n.certfile,keyfile:n.keyfile});if(!r){let n=c(t);if(n&&e!==n&&s(e,n))return u(n,t);if(n!==t.registry){let{regKey:e,authKey:r}=a(n,t);return new d({scopeAuthKey:e,regKey:e,authKey:r})}}let{[`${r}:_authToken`]:o,[`${r}:username`]:l,[`${r}:_password`]:f,[`${r}:_auth`]:p,[`${r}:certfile`]:m,[`${r}:keyfile`]:h}=t;return new d({scopeAuthKey:null,regKey:r,authKey:i,token:o,auth:p,username:l,password:f,certfile:m,keyfile:h})},d=class{constructor({token:e,auth:t,username:n,password:r,scopeAuthKey:i,certfile:a,keyfile:o,regKey:s,authKey:c}){if(this.scopeAuthKey=i,this.regKey=s,this.authKey=c,this.token=null,this.auth=null,this.isBasicAuth=!1,this.cert=null,this.key=null,e)this.token=e;else if(t)this.auth=t;else if(n&&r){let e=Buffer.from(r,`base64`).toString(`utf8`);this.auth=Buffer.from(`${n}:${e}`,`utf8`).toString(`base64`),this.isBasicAuth=!0}if(a&&o){let e=l(a,`utf-8`),t=l(o,`utf-8`);e&&t&&(this.cert=e,this.key=t)}}};t.exports=u})),hs=s(((e,t)=>{var n=require("dns"),r=[`if-modified-since`,`if-none-match`,`if-unmodified-since`,`if-match`,`if-range`];t.exports=e=>{let{strictSSL:t,...i}={...e};if(i.method=i.method?i.method.toUpperCase():`GET`,t==null?i.rejectUnauthorized=process.env.NODE_TLS_REJECT_UNAUTHORIZED!==`0`:i.rejectUnauthorized=t!==!1,!i.retry)i.retry={retries:0};else if(typeof i.retry==`string`){let e=parseInt(i.retry,10);isFinite(e)?i.retry={retries:e}:i.retry={retries:0}}else typeof i.retry==`number`?i.retry={retries:i.retry}:i.retry={retries:0,...i.retry};return i.dns={ttl:300*1e3,lookup:n.lookup,...i.dns},i.cache=i.cache||`default`,i.cache==="default"&&Object.keys(i.headers||{}).some(e=>r.includes(e.toLowerCase()))&&(i.cache=`no-store`),i.cacheAdditionalHeaders=i.cacheAdditionalHeaders||[],i.cacheManager&&!i.cachePath&&(i.cachePath=i.cacheManager),i}})),gs=s(((e,t)=>{var n=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),r=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),i=new Set([500,502,503,504]),a={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},o={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function s(e){let t=parseInt(e,10);return isFinite(t)?t:0}function c(e){return e?i.has(e.status):!0}function l(e){let t={};if(!e)return t;let n=e.trim().split(/,/);for(let e of n){let[n,r]=e.split(/=/,2);t[n.trim()]=r===void 0?!0:r.trim().replace(/^"|"$/g,``)}return t}function u(e){let t=[];for(let n in e){let r=e[n];t.push(r===!0?n:n+`=`+r)}if(t.length)return t.join(`, `)}t.exports=class{constructor(e,t,{shared:n,cacheHeuristic:r,immutableMinTimeToLive:i,ignoreCargoCult:a,_fromObject:o}={}){if(o){this._fromObject(o);return}if(!t||!t.headers)throw Error(`Response headers missing`);this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=n!==!1,this._ignoreCargoCult=!!a,this._cacheHeuristic=r===void 0?.1:r,this._immutableMinTtl=i===void 0?24*3600*1e3:i,this._status=`status`in t?t.status:200,this._resHeaders=t.headers,this._rescc=l(t.headers[`cache-control`]),this._method=`method`in e?e.method:`GET`,this._url=e.url,this._host=e.headers.host,this._noAuthorization=!e.headers.authorization,this._reqHeaders=t.headers.vary?e.headers:null,this._reqcc=l(e.headers[`cache-control`]),this._ignoreCargoCult&&`pre-check`in this._rescc&&`post-check`in this._rescc&&(delete this._rescc[`pre-check`],delete this._rescc[`post-check`],delete this._rescc[`no-cache`],delete this._rescc[`no-store`],delete this._rescc[`must-revalidate`],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":u(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),t.headers[`cache-control`]==null&&/no-cache/.test(t.headers.pragma)&&(this._rescc[`no-cache`]=!0)}now(){return Date.now()}storable(){return!!(!this._reqcc[`no-store`]&&(this._method===`GET`||this._method===`HEAD`||this._method===`POST`&&this._hasExplicitExpiration())&&r.has(this._status)&&!this._rescc[`no-store`]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc[`max-age`]||this._isShared&&this._rescc[`s-maxage`]||this._rescc.public||n.has(this._status)))}_hasExplicitExpiration(){return!!(this._isShared&&this._rescc[`s-maxage`]||this._rescc[`max-age`]||this._resHeaders.expires)}_assertRequestHasHeaders(e){if(!e||!e.headers)throw Error(`Request headers missing`)}satisfiesWithoutRevalidation(e){return!this.evaluateRequest(e).revalidation}_evaluateRequestHitResult(e){return{response:{headers:this.responseHeaders()},revalidation:e}}_evaluateRequestRevalidation(e,t){return{synchronous:t,headers:this.revalidationHeaders(e)}}_evaluateRequestMissResult(e){return{response:void 0,revalidation:this._evaluateRequestRevalidation(e,!0)}}evaluateRequest(e){if(this._assertRequestHasHeaders(e),this._rescc[`must-revalidate`]||!this._requestMatches(e,!1))return this._evaluateRequestMissResult(e);let t=l(e.headers[`cache-control`]);return t[`no-cache`]||/no-cache/.test(e.headers.pragma)||t[`max-age`]&&this.age()>s(t[`max-age`])||t[`min-fresh`]&&this.maxAge()-this.age()<s(t[`min-fresh`])?this._evaluateRequestMissResult(e):this.stale()?`max-stale`in t&&(!0===t[`max-stale`]||t[`max-stale`]>this.age()-this.maxAge())?this._evaluateRequestHitResult(void 0):this.useStaleWhileRevalidate()?this._evaluateRequestHitResult(this._evaluateRequestRevalidation(e,!1)):this._evaluateRequestMissResult(e):this._evaluateRequestHitResult(void 0)}_requestMatches(e,t){return!!((!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||t&&e.method===`HEAD`)&&this._varyMatches(e))}_allowsStoringAuthenticated(){return!!(this._rescc[`must-revalidate`]||this._rescc.public||this._rescc[`s-maxage`])}_varyMatches(e){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary===`*`)return!1;let t=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let n of t)if(e.headers[n]!==this._reqHeaders[n])return!1;return!0}_copyWithoutHopByHopHeaders(e){let t={};for(let n in e)a[n]||(t[n]=e[n]);if(e.connection){let n=e.connection.trim().split(/\s*,\s*/);for(let e of n)delete t[e]}if(t.warning){let e=t.warning.split(/,/).filter(e=>!/^\s*1[0-9][0-9]/.test(e));e.length?t.warning=e.join(`,`).trim():delete t.warning}return t}responseHeaders(){let e=this._copyWithoutHopByHopHeaders(this._resHeaders),t=this.age();return t>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(e.warning=(e.warning?`${e.warning}, `:``)+`113 - "rfc7234 5.5.4"`),e.age=`${Math.round(t)}`,e.date=new Date(this.now()).toUTCString(),e}date(){let e=Date.parse(this._resHeaders.date);return isFinite(e)?e:this._responseTime}age(){return this._ageValue()+(this.now()-this._responseTime)/1e3}_ageValue(){return s(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc[`no-cache`]||this._isShared&&this._resHeaders[`set-cookie`]&&!this._rescc.public&&!this._rescc.immutable||this._resHeaders.vary===`*`)return 0;if(this._isShared){if(this._rescc[`proxy-revalidate`])return 0;if(this._rescc[`s-maxage`])return s(this._rescc[`s-maxage`])}if(this._rescc[`max-age`])return s(this._rescc[`max-age`]);let e=this._rescc.immutable?this._immutableMinTtl:0,t=this.date();if(this._resHeaders.expires){let n=Date.parse(this._resHeaders.expires);return Number.isNaN(n)||n<t?0:Math.max(e,(n-t)/1e3)}if(this._resHeaders[`last-modified`]){let n=Date.parse(this._resHeaders[`last-modified`]);if(isFinite(n)&&t>n)return Math.max(e,(t-n)/1e3*this._cacheHeuristic)}return e}timeToLive(){let e=this.maxAge()-this.age(),t=e+s(this._rescc[`stale-if-error`]),n=e+s(this._rescc[`stale-while-revalidate`]);return Math.round(Math.max(0,e,t,n)*1e3)}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+s(this._rescc[`stale-if-error`])>this.age()}useStaleWhileRevalidate(){let e=s(this._rescc[`stale-while-revalidate`]);return e>0&&this.maxAge()+e>this.age()}static fromObject(e){return new this(void 0,void 0,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error(`Reinitialized`);if(!e||e.v!==1)throw Error(`Invalid serialization`);this._responseTime=e.t,this._isShared=e.sh,this._cacheHeuristic=e.ch,this._immutableMinTtl=e.imm===void 0?24*3600*1e3:e.imm,this._ignoreCargoCult=!!e.icc,this._status=e.st,this._resHeaders=e.resh,this._rescc=e.rescc,this._method=e.m,this._url=e.u,this._host=e.h,this._noAuthorization=e.a,this._reqHeaders=e.reqh,this._reqcc=e.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,icc:this._ignoreCargoCult,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(e){this._assertRequestHasHeaders(e);let t=this._copyWithoutHopByHopHeaders(e.headers);if(delete t[`if-range`],!this._requestMatches(e,!0)||!this.storable())return delete t[`if-none-match`],delete t[`if-modified-since`],t;if(this._resHeaders.etag&&(t[`if-none-match`]=t[`if-none-match`]?`${t[`if-none-match`]}, ${this._resHeaders.etag}`:this._resHeaders.etag),t[`accept-ranges`]||t[`if-match`]||t[`if-unmodified-since`]||this._method&&this._method!=`GET`){if(delete t[`if-modified-since`],t[`if-none-match`]){let e=t[`if-none-match`].split(/,/).filter(e=>!/^\s*W\//.test(e));e.length?t[`if-none-match`]=e.join(`,`).trim():delete t[`if-none-match`]}}else this._resHeaders[`last-modified`]&&!t[`if-modified-since`]&&(t[`if-modified-since`]=this._resHeaders[`last-modified`]);return t}revalidatedPolicy(e,t){if(this._assertRequestHasHeaders(e),this._useStaleIfError()&&c(t))return{policy:this,modified:!1,matches:!0};if(!t||!t.headers)throw Error(`Response headers missing`);let n=!1;t.status!==void 0&&t.status!=304?n=!1:t.headers.etag&&!/^\s*W\//.test(t.headers.etag)?n=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,``)===t.headers.etag:this._resHeaders.etag&&t.headers.etag?n=this._resHeaders.etag.replace(/^\s*W\//,``)===t.headers.etag.replace(/^\s*W\//,``):this._resHeaders[`last-modified`]?n=this._resHeaders[`last-modified`]===t.headers[`last-modified`]:!this._resHeaders.etag&&!this._resHeaders[`last-modified`]&&!t.headers.etag&&!t.headers[`last-modified`]&&(n=!0);let r={shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl,ignoreCargoCult:this._ignoreCargoCult};if(!n)return{policy:new this.constructor(e,t,r),modified:t.status!=304,matches:!1};let i={};for(let e in this._resHeaders)i[e]=e in t.headers&&!o[e]?t.headers[e]:this._resHeaders[e];let a=Object.assign({},t,{status:this._status,method:this._method,headers:i});return{policy:new this.constructor(e,a,r),modified:!1,matches:!0}}}})),_s=s(((e,t)=>{t.exports=s,t.exports.preferredCharsets=s;var n=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function r(e){for(var t=e.split(`,`),n=0,r=0;n<t.length;n++){var a=i(t[n].trim(),n);a&&(t[r++]=a)}return t.length=r,t}function i(e,t){var r=n.exec(e);if(!r)return null;var i=r[1],a=1;if(r[2])for(var o=r[2].split(`;`),s=0;s<o.length;s++){var c=o[s].trim().split(`=`);if(c[0]===`q`){a=parseFloat(c[1]);break}}return{charset:i,q:a,i:t}}function a(e,t,n){for(var r={o:-1,q:0,s:0},i=0;i<t.length;i++){var a=o(e,t[i],n);a&&(r.s-a.s||r.q-a.q||r.o-a.o)<0&&(r=a)}return r}function o(e,t,n){var r=0;if(t.charset.toLowerCase()===e.toLowerCase())r|=1;else if(t.charset!==`*`)return null;return{i:n,o:t.i,q:t.q,s:r}}function s(e,t){var n=r(e===void 0?`*`:e||``);if(!t)return n.filter(u).sort(c).map(l);var i=t.map(function(e,t){return a(e,n,t)});return i.filter(u).sort(c).map(function(e){return t[i.indexOf(e)]})}function c(e,t){return t.q-e.q||t.s-e.s||e.o-t.o||e.i-t.i||0}function l(e){return e.charset}function u(e){return e.q>0}})),vs=s(((e,t)=>{t.exports=s,t.exports.preferredEncodings=s;var n=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function r(e){for(var t=e.split(`,`),n=!1,r=1,a=0,s=0;a<t.length;a++){var c=i(t[a].trim(),a);c&&(t[s++]=c,n||=o(`identity`,c),r=Math.min(r,c.q||1))}return n||(t[s++]={encoding:`identity`,q:r,i:a}),t.length=s,t}function i(e,t){var r=n.exec(e);if(!r)return null;var i=r[1],a=1;if(r[2])for(var o=r[2].split(`;`),s=0;s<o.length;s++){var c=o[s].trim().split(`=`);if(c[0]===`q`){a=parseFloat(c[1]);break}}return{encoding:i,q:a,i:t}}function a(e,t,n){for(var r={encoding:e,o:-1,q:0,s:0},i=0;i<t.length;i++){var a=o(e,t[i],n);a&&(r.s-a.s||r.q-a.q||r.o-a.o)<0&&(r=a)}return r}function o(e,t,n){var r=0;if(t.encoding.toLowerCase()===e.toLowerCase())r|=1;else if(t.encoding!==`*`)return null;return{encoding:e,i:n,o:t.i,q:t.q,s:r}}function s(e,t,n){var i=r(e||``),o=n?function(e,t){if(e.q!==t.q)return t.q-e.q;var r=n.indexOf(e.encoding),i=n.indexOf(t.encoding);return r===-1&&i===-1?t.s-e.s||e.o-t.o||e.i-t.i:r!==-1&&i!==-1?r-i:r===-1?1:-1}:c;if(!t)return i.filter(u).sort(o).map(l);var s=t.map(function(e,t){return a(e,i,t)});return s.filter(u).sort(o).map(function(e){return t[s.indexOf(e)]})}function c(e,t){return t.q-e.q||t.s-e.s||e.o-t.o||e.i-t.i}function l(e){return e.encoding}function u(e){return e.q>0}})),ys=s(((e,t)=>{t.exports=s,t.exports.preferredLanguages=s;var n=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function r(e){for(var t=e.split(`,`),n=0,r=0;n<t.length;n++){var a=i(t[n].trim(),n);a&&(t[r++]=a)}return t.length=r,t}function i(e,t){var r=n.exec(e);if(!r)return null;var i=r[1],a=r[2],o=i;a&&(o+=`-`+a);var s=1;if(r[3])for(var c=r[3].split(`;`),l=0;l<c.length;l++){var u=c[l].split(`=`);u[0]===`q`&&(s=parseFloat(u[1]))}return{prefix:i,suffix:a,q:s,i:t,full:o}}function a(e,t,n){for(var r={o:-1,q:0,s:0},i=0;i<t.length;i++){var a=o(e,t[i],n);a&&(r.s-a.s||r.q-a.q||r.o-a.o)<0&&(r=a)}return r}function o(e,t,n){var r=i(e);if(!r)return null;var a=0;if(t.full.toLowerCase()===r.full.toLowerCase())a|=4;else if(t.prefix.toLowerCase()===r.full.toLowerCase())a|=2;else if(t.full.toLowerCase()===r.prefix.toLowerCase())a|=1;else if(t.full!==`*`)return null;return{i:n,o:t.i,q:t.q,s:a}}function s(e,t){var n=r(e===void 0?`*`:e||``);if(!t)return n.filter(u).sort(c).map(l);var i=t.map(function(e,t){return a(e,n,t)});return i.filter(u).sort(c).map(function(e){return t[i.indexOf(e)]})}function c(e,t){return t.q-e.q||t.s-e.s||e.o-t.o||e.i-t.i||0}function l(e){return e.full}function u(e){return e.q>0}})),bs=s(((e,t)=>{t.exports=s,t.exports.preferredMediaTypes=s;var n=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function r(e){for(var t=p(e),n=0,r=0;n<t.length;n++){var a=i(t[n].trim(),n);a&&(t[r++]=a)}return t.length=r,t}function i(e,t){var r=n.exec(e);if(!r)return null;var i=Object.create(null),a=1,o=r[2],s=r[1];if(r[3])for(var c=m(r[3]).map(f),l=0;l<c.length;l++){var u=c[l],d=u[0].toLowerCase(),p=u[1],h=p&&p[0]===`"`&&p[p.length-1]===`"`?p.slice(1,-1):p;if(d===`q`){a=parseFloat(h);break}i[d]=h}return{type:s,subtype:o,params:i,q:a,i:t}}function a(e,t,n){for(var r={o:-1,q:0,s:0},i=0;i<t.length;i++){var a=o(e,t[i],n);a&&(r.s-a.s||r.q-a.q||r.o-a.o)<0&&(r=a)}return r}function o(e,t,n){var r=i(e),a=0;if(!r)return null;if(t.type.toLowerCase()==r.type.toLowerCase())a|=4;else if(t.type!=`*`)return null;if(t.subtype.toLowerCase()==r.subtype.toLowerCase())a|=2;else if(t.subtype!=`*`)return null;var o=Object.keys(t.params);if(o.length>0)if(o.every(function(e){return t.params[e]==`*`||(t.params[e]||``).toLowerCase()==(r.params[e]||``).toLowerCase()}))a|=1;else return null;return{i:n,o:t.i,q:t.q,s:a}}function s(e,t){var n=r(e===void 0?`*/*`:e||``);if(!t)return n.filter(u).sort(c).map(l);var i=t.map(function(e,t){return a(e,n,t)});return i.filter(u).sort(c).map(function(e){return t[i.indexOf(e)]})}function c(e,t){return t.q-e.q||t.s-e.s||e.o-t.o||e.i-t.i||0}function l(e){return e.type+`/`+e.subtype}function u(e){return e.q>0}function d(e){for(var t=0,n=0;(n=e.indexOf(`"`,n))!==-1;)t++,n++;return t}function f(e){var t=e.indexOf(`=`),n,r;return t===-1?n=e:(n=e.slice(0,t),r=e.slice(t+1)),[n,r]}function p(e){for(var t=e.split(`,`),n=1,r=0;n<t.length;n++)d(t[r])%2==0?t[++r]=t[n]:t[r]+=`,`+t[n];return t.length=r+1,t}function m(e){for(var t=e.split(`;`),n=1,r=0;n<t.length;n++)d(t[r])%2==0?t[++r]=t[n]:t[r]+=`;`+t[n];t.length=r+1;for(var n=0;n<t.length;n++)t[n]=t[n].trim();return t}})),xs=s(((e,t)=>{var n=_s(),r=vs(),i=ys(),a=bs();t.exports=o,t.exports.Negotiator=o;function o(e){if(!(this instanceof o))return new o(e);this.request=e}o.prototype.charset=function(e){var t=this.charsets(e);return t&&t[0]},o.prototype.charsets=function(e){return n(this.request.headers[`accept-charset`],e)},o.prototype.encoding=function(e,t){var n=this.encodings(e,t);return n&&n[0]},o.prototype.encodings=function(e,t){var n=t||{};return r(this.request.headers[`accept-encoding`],e,n.preferred)},o.prototype.language=function(e){var t=this.languages(e);return t&&t[0]},o.prototype.languages=function(e){return i(this.request.headers[`accept-language`],e)},o.prototype.mediaType=function(e){var t=this.mediaTypes(e);return t&&t[0]},o.prototype.mediaTypes=function(e){return a(this.request.headers.accept,e)},o.prototype.preferredCharset=o.prototype.charset,o.prototype.preferredCharsets=o.prototype.charsets,o.prototype.preferredEncoding=o.prototype.encoding,o.prototype.preferredEncodings=o.prototype.encodings,o.prototype.preferredLanguage=o.prototype.language,o.prototype.preferredLanguages=o.prototype.languages,o.prototype.preferredMediaType=o.prototype.mediaType,o.prototype.preferredMediaTypes=o.prototype.mediaTypes})),Ss=s(((e,t)=>{var n=require("crypto"),{Minipass:r}=Ca(),i=[`sha512`,`sha384`,`sha256`],a=[`sha512`],o=n.getHashes(),s=/^[a-z0-9+/]+(?:=?=?)$/i,c=/^([a-z0-9]+)-([^?]+)(\?[?\S*]*)?$/,l=/^([a-z0-9]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)?$/,u=/^[\x21-\x7E]+$/,d=[`md5`,`whirlpool`,`sha1`,`sha224`,`sha256`,`sha384`,`sha512`,`sha3`,`sha3-256`,`sha3-384`,`sha3-512`,`sha3_256`,`sha3_384`,`sha3_512`].filter(e=>o.includes(e)),f=e=>e?.length?`?${e.join(`?`)}`:``,p=class extends r{#e;#t;#n;constructor(e){super(),this.size=0,this.opts=e,this.#r(),e?.algorithms?this.algorithms=[...e.algorithms]:this.algorithms=[...a],this.algorithm!==null&&!this.algorithms.includes(this.algorithm)&&this.algorithms.push(this.algorithm),this.hashes=this.algorithms.map(n.createHash)}#r(){this.sri=this.opts?.integrity?_(this.opts?.integrity,this.opts):null,this.expectedSize=this.opts?.size,this.sri?this.sri.isHash?(this.goodSri=!0,this.algorithm=this.sri.algorithm):(this.goodSri=!this.sri.isEmpty(),this.algorithm=this.sri.pickAlgorithm(this.opts)):this.algorithm=null,this.digests=this.goodSri?this.sri[this.algorithm]:null,this.optString=f(this.opts?.options)}on(e,t){return e===`size`&&this.#t?t(this.#t):e===`integrity`&&this.#e?t(this.#e):e===`verified`&&this.#n?t(this.#n):super.on(e,t)}emit(e,t){return e===`end`&&this.#i(),super.emit(e,t)}write(e){return this.size+=e.length,this.hashes.forEach(t=>t.update(e)),super.write(e)}#i(){this.goodSri||this.#r();let e=_(this.hashes.map((e,t)=>`${this.algorithms[t]}-${e.digest(`base64`)}${this.optString}`).join(` `),this.opts),t=this.goodSri&&e.match(this.sri,this.opts);if(typeof this.expectedSize==`number`&&this.size!==this.expectedSize){let e=Error(`stream size mismatch when checking ${this.sri}.\n Wanted: ${this.expectedSize}\n Found: ${this.size}`);e.code=`EBADSIZE`,e.found=this.size,e.expected=this.expectedSize,e.sri=this.sri,this.emit(`error`,e)}else if(this.sri&&!t){let t=Error(`${this.sri} integrity checksum failed when using ${this.algorithm}: wanted ${this.digests} but got ${e}. (${this.size} bytes)`);t.code=`EINTEGRITY`,t.found=e,t.expected=this.digests,t.algorithm=this.algorithm,t.sri=this.sri,this.emit(`error`,t)}else this.#t=this.size,this.emit(`size`,this.size),this.#e=e,this.emit(`integrity`,e),t&&(this.#n=t,this.emit(`verified`,t))}},m=class{get isHash(){return!0}constructor(e,t){let n=t?.strict;this.source=e.trim(),this.digest=``,this.algorithm=``,this.options=[];let r=this.source.match(n?l:c);if(!r||n&&!i.includes(r[1])||!o.includes(r[1]))return;this.algorithm=r[1],this.digest=r[2];let a=r[3];a&&(this.options=a.slice(1).split(`?`))}hexDigest(){return this.digest&&Buffer.from(this.digest,`base64`).toString(`hex`)}toJSON(){return this.toString()}match(e,t){let n=_(e,t);if(!n)return!1;if(n.isIntegrity){let e=n.pickAlgorithm(t,[this.algorithm]);return e&&n[e].find(e=>e.digest===this.digest)||!1}return n.digest===this.digest?n:!1}toString(e){return e?.strict&&!(i.includes(this.algorithm)&&this.digest.match(s)&&this.options.every(e=>e.match(u)))?``:`${this.algorithm}-${this.digest}${f(this.options)}`}};function h(e,t,n,r){let i=e!==``,a=!1,o=``,s=r.length-1;for(let e=0;e<s;e++){let i=m.prototype.toString.call(r[e],n);i&&(a=!0,o+=i,o+=t)}let c=m.prototype.toString.call(r[s],n);return c&&(a=!0,o+=c),i&&a?e+t+o:e+o}var g=class{get isIntegrity(){return!0}toJSON(){return this.toString()}isEmpty(){return Object.keys(this).length===0}toString(e){let t=e?.sep||` `,n=``;if(e?.strict){t=t.replace(/\S+/g,` `);for(let r of i)this[r]&&(n=h(n,t,e,this[r]))}else for(let r of Object.keys(this))n=h(n,t,e,this[r]);return n}concat(e,t){let n=typeof e==`string`?e:y(e,t);return _(`${this.toString(t)} ${n}`,t)}hexDigest(){return _(this,{single:!0}).hexDigest()}merge(e,t){let n=_(e,t);for(let e in n)if(this[e]){if(!this[e].find(t=>n[e].find(e=>t.digest===e.digest)))throw Error(`hashes do not match, cannot update integrity`)}else this[e]=n[e]}match(e,t){let n=_(e,t);if(!n)return!1;let r=n.pickAlgorithm(t,Object.keys(this));return!!r&&this[r].find(e=>n[r].find(t=>e.digest===t.digest))||!1}pickAlgorithm(e,t){let n=e?.pickAlgorithm||D,r=Object.keys(this);return t?.length&&(r=r.filter(e=>t.includes(e))),r.length?r.reduce((e,t)=>n(e,t)||e):null}};t.exports.parse=_;function _(e,t){if(!e)return null;if(typeof e==`string`)return v(e,t);if(e.algorithm&&e.digest){let n=new g;return n[e.algorithm]=[e],v(y(n,t),t)}else return v(y(e,t),t)}function v(e,t){if(t?.single)return new m(e,t);let n=e.trim().split(/\s+/).reduce((e,n)=>{let r=new m(n,t);if(r.algorithm&&r.digest){let t=r.algorithm;Object.keys(e).includes(t)||(e[t]=[]),e[t].push(r)}return e},new g);return n.isEmpty()?null:n}t.exports.stringify=y;function y(e,t){return e.algorithm&&e.digest?m.prototype.toString.call(e,t):typeof e==`string`?y(_(e,t),t):g.prototype.toString.call(e,t)}t.exports.fromHex=b;function b(e,t,n){let r=f(n?.options);return _(`${t}-${Buffer.from(e,`hex`).toString(`base64`)}${r}`,n)}t.exports.fromData=x;function x(e,t){let r=t?.algorithms||[...a],i=f(t?.options);return r.reduce((r,a)=>{let o=new m(`${a}-${n.createHash(a).update(e).digest(`base64`)}${i}`,t);if(o.algorithm&&o.digest){let e=o.algorithm;r[e]||(r[e]=[]),r[e].push(o)}return r},new g)}t.exports.fromStream=S;function S(e,t){let n=T(t);return new Promise((t,r)=>{e.pipe(n),e.on(`error`,r),n.on(`error`,r);let i;n.on(`integrity`,e=>{i=e}),n.on(`end`,()=>t(i)),n.resume()})}t.exports.checkData=C;function C(e,t,r){if(t=_(t,r),!t||!Object.keys(t).length){if(r?.error)throw Object.assign(Error(`No valid integrity hashes to check against`),{code:`EINTEGRITY`});return!1}let i=t.pickAlgorithm(r),a=_({algorithm:i,digest:n.createHash(i).update(e).digest(`base64`)}),o=a.match(t,r);if(r||={},o||!r.error)return o;if(typeof r.size==`number`&&e.length!==r.size){let n=Error(`data size mismatch when checking ${t}.\n Wanted: ${r.size}\n Found: ${e.length}`);throw n.code=`EBADSIZE`,n.found=e.length,n.expected=r.size,n.sri=t,n}else{let n=Error(`Integrity checksum failed when using ${i}: Wanted ${t}, but got ${a}. (${e.length} bytes)`);throw n.code=`EINTEGRITY`,n.found=a,n.expected=t,n.algorithm=i,n.sri=t,n}}t.exports.checkStream=w;function w(e,t,n){if(n||=Object.create(null),n.integrity=t,t=_(t,n),!t||!Object.keys(t).length)return Promise.reject(Object.assign(Error(`No valid integrity hashes to check against`),{code:`EINTEGRITY`}));let r=T(n);return new Promise((t,n)=>{e.pipe(r),e.on(`error`,n),r.on(`error`,n);let i;r.on(`verified`,e=>{i=e}),r.on(`end`,()=>t(i)),r.resume()})}t.exports.integrityStream=T;function T(e=Object.create(null)){return new p(e)}t.exports.create=E;function E(e){let t=e?.algorithms||[...a],r=f(e?.options),i=t.map(n.createHash);return{update:function(e,t){return i.forEach(n=>n.update(e,t)),this},digest:function(){return t.reduce((t,n)=>{let a=new m(`${n}-${i.shift().digest(`base64`)}${r}`,e);return t[a.algorithm]||(t[a.algorithm]=[]),t[a.algorithm].push(a),t},new g)}}}function D(e,t){return d.indexOf(e.toLowerCase())>=d.indexOf(t.toLowerCase())?e:t}})),Cs=s(((e,t)=>{var n=gs(),r=xs(),i=Ss(),a={shared:!1,ignoreCargoCult:!0},o={status:200,headers:{}},s=e=>{let t={method:e.method,url:e.url,headers:{},compress:e.compress};return e.headers.forEach((e,n)=>{t.headers[n]=e}),t},c=e=>{let t={status:e.status,headers:{}};return e.headers.forEach((e,n)=>{t.headers[n]=e}),t};t.exports=class{constructor({entry:e,request:t,response:r,options:i}){this.entry=e,this.request=s(t),this.response=c(r),this.options=i,this.policy=new n(this.request,this.response,a),this.entry&&(this.policy._responseTime=this.entry.metadata.time)}static storable(e,t){return!t.cachePath||t.cache===`no-store`||![`GET`,`HEAD`].includes(e.method)?!1:new n(s(e),o,a).storable()}satisfies(e){let t=s(e);if(this.request.headers.host!==t.headers.host||this.request.compress!==t.compress)return!1;let n=new r(this.request),a=new r(t);return JSON.stringify(n.mediaTypes())!==JSON.stringify(a.mediaTypes())||JSON.stringify(n.languages())!==JSON.stringify(a.languages())||JSON.stringify(n.encodings())!==JSON.stringify(a.encodings())?!1:this.options.integrity?i.parse(this.options.integrity).match(this.entry.integrity):!0}storable(){return this.policy.storable()}get mustRevalidate(){return!!this.policy._rescc[`must-revalidate`]}needsRevalidation(e){let t=s(e);return t.method=`GET`,!this.policy.satisfiesWithoutRevalidation(t)}responseHeaders(){return this.policy.responseHeaders()}revalidationHeaders(e){let t=s(e);return this.policy.revalidationHeaders(t)}revalidated(e,t){let n=s(e),r=c(t);return!this.policy.revalidatedPolicy(n,r).modified}}})),ws=s(((e,t)=>{t.exports={NotCachedError:class extends Error{constructor(e){super(`request to ${e} failed: cache mode is 'only-if-cached' but no cached response is available.`),this.code=`ENOTCACHED`}}}})),Ts=s(((e,t)=>{var n=typeof process==`object`&&process?process:{stdout:null,stderr:null},r=require("events"),i=require("stream"),a=require("string_decoder").StringDecoder,o=Symbol(`EOF`),s=Symbol(`maybeEmitEnd`),c=Symbol(`emittedEnd`),l=Symbol(`emittingEnd`),u=Symbol(`emittedError`),d=Symbol(`closed`),f=Symbol(`read`),p=Symbol(`flush`),m=Symbol(`flushChunk`),h=Symbol(`encoding`),g=Symbol(`decoder`),_=Symbol(`flowing`),v=Symbol(`paused`),y=Symbol(`resume`),b=Symbol(`bufferLength`),x=Symbol(`bufferPush`),S=Symbol(`bufferShift`),C=Symbol(`objectMode`),w=Symbol(`destroyed`),T=Symbol(`emitData`),E=Symbol(`emitEnd`),D=Symbol(`emitEnd2`),O=Symbol(`async`),k=e=>Promise.resolve().then(e),A=global._MP_NO_ITERATOR_SYMBOLS_!==`1`,j=A&&Symbol.asyncIterator||Symbol(`asyncIterator not implemented`),M=A&&Symbol.iterator||Symbol(`iterator not implemented`),ee=e=>e===`end`||e===`finish`||e===`prefinish`,N=e=>e instanceof ArrayBuffer||typeof e==`object`&&e.constructor&&e.constructor.name===`ArrayBuffer`&&e.byteLength>=0,P=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e),F=class{constructor(e,t,n){this.src=e,this.dest=t,this.opts=n,this.ondrain=()=>e[y](),t.on(`drain`,this.ondrain)}unpipe(){this.dest.removeListener(`drain`,this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},I=class extends F{unpipe(){this.src.removeListener(`error`,this.proxyErrors),super.unpipe()}constructor(e,t,n){super(e,t,n),this.proxyErrors=e=>t.emit(`error`,e),e.on(`error`,this.proxyErrors)}};t.exports=class e extends i{constructor(e){super(),this[_]=!1,this[v]=!1,this.pipes=[],this.buffer=[],this[C]=e&&e.objectMode||!1,this[C]?this[h]=null:this[h]=e&&e.encoding||null,this[h]===`buffer`&&(this[h]=null),this[O]=e&&!!e.async||!1,this[g]=this[h]?new a(this[h]):null,this[o]=!1,this[c]=!1,this[l]=!1,this[d]=!1,this[u]=null,this.writable=!0,this.readable=!0,this[b]=0,this[w]=!1}get bufferLength(){return this[b]}get encoding(){return this[h]}set encoding(e){if(this[C])throw Error(`cannot set encoding in objectMode`);if(this[h]&&e!==this[h]&&(this[g]&&this[g].lastNeed||this[b]))throw Error(`cannot change encoding`);this[h]!==e&&(this[g]=e?new a(e):null,this.buffer.length&&(this.buffer=this.buffer.map(e=>this[g].write(e)))),this[h]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[C]}set objectMode(e){this[C]=this[C]||!!e}get async(){return this[O]}set async(e){this[O]=this[O]||!!e}write(e,t,n){if(this[o])throw Error(`write after end`);if(this[w])return this.emit(`error`,Object.assign(Error(`Cannot call write after a stream was destroyed`),{code:`ERR_STREAM_DESTROYED`})),!0;typeof t==`function`&&(n=t,t=`utf8`),t||=`utf8`;let r=this[O]?k:e=>e();return!this[C]&&!Buffer.isBuffer(e)&&(P(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):N(e)?e=Buffer.from(e):typeof e!=`string`&&(this.objectMode=!0)),this[C]?(this.flowing&&this[b]!==0&&this[p](!0),this.flowing?this.emit(`data`,e):this[x](e),this[b]!==0&&this.emit(`readable`),n&&r(n),this.flowing):e.length?(typeof e==`string`&&!(t===this[h]&&!this[g].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[h]&&(e=this[g].write(e)),this.flowing&&this[b]!==0&&this[p](!0),this.flowing?this.emit(`data`,e):this[x](e),this[b]!==0&&this.emit(`readable`),n&&r(n),this.flowing):(this[b]!==0&&this.emit(`readable`),n&&r(n),this.flowing)}read(e){if(this[w])return null;if(this[b]===0||e===0||e>this[b])return this[s](),null;this[C]&&(e=null),this.buffer.length>1&&!this[C]&&(this.encoding?this.buffer=[this.buffer.join(``)]:this.buffer=[Buffer.concat(this.buffer,this[b])]);let t=this[f](e||null,this.buffer[0]);return this[s](),t}[f](e,t){return e===t.length||e===null?this[S]():(this.buffer[0]=t.slice(e),t=t.slice(0,e),this[b]-=e),this.emit(`data`,t),!this.buffer.length&&!this[o]&&this.emit(`drain`),t}end(e,t,n){return typeof e==`function`&&(n=e,e=null),typeof t==`function`&&(n=t,t=`utf8`),e&&this.write(e,t),n&&this.once(`end`,n),this[o]=!0,this.writable=!1,(this.flowing||!this[v])&&this[s](),this}[y](){this[w]||(this[v]=!1,this[_]=!0,this.emit(`resume`),this.buffer.length?this[p]():this[o]?this[s]():this.emit(`drain`))}resume(){return this[y]()}pause(){this[_]=!1,this[v]=!0}get destroyed(){return this[w]}get flowing(){return this[_]}get paused(){return this[v]}[x](e){this[C]?this[b]+=1:this[b]+=e.length,this.buffer.push(e)}[S](){return this.buffer.length&&(this[C]?--this[b]:this[b]-=this.buffer[0].length),this.buffer.shift()}[p](e){do;while(this[m](this[S]()));!e&&!this.buffer.length&&!this[o]&&this.emit(`drain`)}[m](e){return e?(this.emit(`data`,e),this.flowing):!1}pipe(e,t){if(this[w])return;let r=this[c];return t||={},e===n.stdout||e===n.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this.pipes.push(t.proxyErrors?new I(this,e,t):new F(this,e,t)),this[O]?k(()=>this[y]()):this[y]()),e}unpipe(e){let t=this.pipes.find(t=>t.dest===e);t&&(this.pipes.splice(this.pipes.indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let n=super.on(e,t);return e===`data`&&!this.pipes.length&&!this.flowing?this[y]():e===`readable`&&this[b]!==0?super.emit(`readable`):ee(e)&&this[c]?(super.emit(e),this.removeAllListeners(e)):e===`error`&&this[u]&&(this[O]?k(()=>t.call(this,this[u])):t.call(this,this[u])),n}get emittedEnd(){return this[c]}[s](){!this[l]&&!this[c]&&!this[w]&&this.buffer.length===0&&this[o]&&(this[l]=!0,this.emit(`end`),this.emit(`prefinish`),this.emit(`finish`),this[d]&&this.emit(`close`),this[l]=!1)}emit(e,t,...n){if(e!==`error`&&e!==`close`&&e!==w&&this[w])return;if(e===`data`)return t?this[O]?k(()=>this[T](t)):this[T](t):!1;if(e===`end`)return this[E]();if(e===`close`){if(this[d]=!0,!this[c]&&!this[w])return;let e=super.emit(`close`);return this.removeAllListeners(`close`),e}else if(e===`error`){this[u]=t;let e=super.emit(`error`,t);return this[s](),e}else if(e===`resume`){let e=super.emit(`resume`);return this[s](),e}else if(e===`finish`||e===`prefinish`){let t=super.emit(e);return this.removeAllListeners(e),t}let r=super.emit(e,t,...n);return this[s](),r}[T](e){for(let t of this.pipes)t.dest.write(e)===!1&&this.pause();let t=super.emit(`data`,e);return this[s](),t}[E](){this[c]||(this[c]=!0,this.readable=!1,this[O]?k(()=>this[D]()):this[D]())}[D](){if(this[g]){let e=this[g].end();if(e){for(let t of this.pipes)t.dest.write(e);super.emit(`data`,e)}}for(let e of this.pipes)e.end();let e=super.emit(`end`);return this.removeAllListeners(`end`),e}collect(){let e=[];this[C]||(e.dataLength=0);let t=this.promise();return this.on(`data`,t=>{e.push(t),this[C]||(e.dataLength+=t.length)}),t.then(()=>e)}concat(){return this[C]?Promise.reject(Error(`cannot concat in objectMode`)):this.collect().then(e=>this[C]?Promise.reject(Error(`cannot concat in objectMode`)):this[h]?e.join(``):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on(w,()=>t(Error(`stream destroyed`))),this.on(`error`,e=>t(e)),this.on(`end`,()=>e())})}[j](){return{next:()=>{let e=this.read();if(e!==null)return Promise.resolve({done:!1,value:e});if(this[o])return Promise.resolve({done:!0});let t=null,n=null,r=e=>{this.removeListener(`data`,i),this.removeListener(`end`,a),n(e)},i=e=>{this.removeListener(`error`,r),this.removeListener(`end`,a),this.pause(),t({value:e,done:!!this[o]})},a=()=>{this.removeListener(`error`,r),this.removeListener(`data`,i),t({done:!0})},s=()=>r(Error(`stream destroyed`));return new Promise((e,o)=>{n=o,t=e,this.once(w,s),this.once(`error`,r),this.once(`end`,a),this.once(`data`,i)})}}}[M](){return{next:()=>{let e=this.read();return{value:e,done:e===null}}}}destroy(e){return this[w]?(e?this.emit(`error`,e):this.emit(w),this):(this[w]=!0,this.buffer.length=0,this[b]=0,typeof this.close==`function`&&!this[d]&&this.close(),e?this.emit(`error`,e):this.emit(w),this)}static isStream(t){return!!t&&(t instanceof e||t instanceof i||t instanceof r&&(typeof t.pipe==`function`||typeof t.write==`function`&&typeof t.end==`function`))}}})),Es=s(((e,t)=>{var n=Ts(),r=Symbol(`_flush`),i=Symbol(`_flushed`),a=Symbol(`_flushing`);t.exports=class extends n{constructor(e={}){if(typeof e==`function`&&(e={flush:e}),super(e),typeof e.flush!=`function`&&typeof this.flush!=`function`)throw TypeError(`must provide flush function in options`);this[r]=e.flush||this.flush}emit(e,...t){if(e!==`end`&&e!==`finish`||this[i])return super.emit(e,...t);if(this[a])return;this[a]=!0;let n=e=>{this[i]=!0,e?super.emit(`error`,e):super.emit(`end`)},o=this[r](n);o&&o.then&&o.then(()=>n(),e=>n(e))}}})),Ds=s(((e,t)=>{var{Minipass:n}=Ca(),r=Symbol(`_data`),i=Symbol(`_length`);t.exports=class extends n{constructor(e){super(e),this[r]=[],this[i]=0}write(e,t,n){typeof t==`function`&&(n=t,t=`utf8`),t||=`utf8`;let a=Buffer.isBuffer(e)?e:Buffer.from(e,t);return this[r].push(a),this[i]+=a.length,n&&n(),!0}end(e,t,n){typeof e==`function`&&(n=e,e=null),typeof t==`function`&&(n=t,t=`utf8`),e&&this.write(e,t);let a=Buffer.concat(this[r],this[i]);return super.write(a),super.end(n)}};var a=class extends n{constructor(e){super(e),this[r]=[],this[i]=0}write(e,t,n){typeof t==`function`&&(n=t,t=`utf8`),t||=`utf8`;let a=Buffer.isBuffer(e)?e:Buffer.from(e,t);return this[r].push(a),this[i]+=a.length,super.write(e,t,n)}end(e,t,n){typeof e==`function`&&(n=e,e=null),typeof t==`function`&&(n=t,t=`utf8`),e&&this.write(e,t);let a=Buffer.concat(this[r],this[i]);return this.emit(`collect`,a),super.end(n)}};t.exports.PassThrough=a})),Os=s(((e,t)=>{var n=typeof process==`object`&&process?process:{stdout:null,stderr:null},r=require("events"),i=require("stream"),a=require("string_decoder").StringDecoder,o=Symbol(`EOF`),s=Symbol(`maybeEmitEnd`),c=Symbol(`emittedEnd`),l=Symbol(`emittingEnd`),u=Symbol(`emittedError`),d=Symbol(`closed`),f=Symbol(`read`),p=Symbol(`flush`),m=Symbol(`flushChunk`),h=Symbol(`encoding`),g=Symbol(`decoder`),_=Symbol(`flowing`),v=Symbol(`paused`),y=Symbol(`resume`),b=Symbol(`bufferLength`),x=Symbol(`bufferPush`),S=Symbol(`bufferShift`),C=Symbol(`objectMode`),w=Symbol(`destroyed`),T=Symbol(`emitData`),E=Symbol(`emitEnd`),D=Symbol(`emitEnd2`),O=Symbol(`async`),k=e=>Promise.resolve().then(e),A=global._MP_NO_ITERATOR_SYMBOLS_!==`1`,j=A&&Symbol.asyncIterator||Symbol(`asyncIterator not implemented`),M=A&&Symbol.iterator||Symbol(`iterator not implemented`),ee=e=>e===`end`||e===`finish`||e===`prefinish`,N=e=>e instanceof ArrayBuffer||typeof e==`object`&&e.constructor&&e.constructor.name===`ArrayBuffer`&&e.byteLength>=0,P=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e),F=class{constructor(e,t,n){this.src=e,this.dest=t,this.opts=n,this.ondrain=()=>e[y](),t.on(`drain`,this.ondrain)}unpipe(){this.dest.removeListener(`drain`,this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},I=class extends F{unpipe(){this.src.removeListener(`error`,this.proxyErrors),super.unpipe()}constructor(e,t,n){super(e,t,n),this.proxyErrors=e=>t.emit(`error`,e),e.on(`error`,this.proxyErrors)}};t.exports=class e extends i{constructor(e){super(),this[_]=!1,this[v]=!1,this.pipes=[],this.buffer=[],this[C]=e&&e.objectMode||!1,this[C]?this[h]=null:this[h]=e&&e.encoding||null,this[h]===`buffer`&&(this[h]=null),this[O]=e&&!!e.async||!1,this[g]=this[h]?new a(this[h]):null,this[o]=!1,this[c]=!1,this[l]=!1,this[d]=!1,this[u]=null,this.writable=!0,this.readable=!0,this[b]=0,this[w]=!1}get bufferLength(){return this[b]}get encoding(){return this[h]}set encoding(e){if(this[C])throw Error(`cannot set encoding in objectMode`);if(this[h]&&e!==this[h]&&(this[g]&&this[g].lastNeed||this[b]))throw Error(`cannot change encoding`);this[h]!==e&&(this[g]=e?new a(e):null,this.buffer.length&&(this.buffer=this.buffer.map(e=>this[g].write(e)))),this[h]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[C]}set objectMode(e){this[C]=this[C]||!!e}get async(){return this[O]}set async(e){this[O]=this[O]||!!e}write(e,t,n){if(this[o])throw Error(`write after end`);if(this[w])return this.emit(`error`,Object.assign(Error(`Cannot call write after a stream was destroyed`),{code:`ERR_STREAM_DESTROYED`})),!0;typeof t==`function`&&(n=t,t=`utf8`),t||=`utf8`;let r=this[O]?k:e=>e();return!this[C]&&!Buffer.isBuffer(e)&&(P(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):N(e)?e=Buffer.from(e):typeof e!=`string`&&(this.objectMode=!0)),this[C]?(this.flowing&&this[b]!==0&&this[p](!0),this.flowing?this.emit(`data`,e):this[x](e),this[b]!==0&&this.emit(`readable`),n&&r(n),this.flowing):e.length?(typeof e==`string`&&!(t===this[h]&&!this[g].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[h]&&(e=this[g].write(e)),this.flowing&&this[b]!==0&&this[p](!0),this.flowing?this.emit(`data`,e):this[x](e),this[b]!==0&&this.emit(`readable`),n&&r(n),this.flowing):(this[b]!==0&&this.emit(`readable`),n&&r(n),this.flowing)}read(e){if(this[w])return null;if(this[b]===0||e===0||e>this[b])return this[s](),null;this[C]&&(e=null),this.buffer.length>1&&!this[C]&&(this.encoding?this.buffer=[this.buffer.join(``)]:this.buffer=[Buffer.concat(this.buffer,this[b])]);let t=this[f](e||null,this.buffer[0]);return this[s](),t}[f](e,t){return e===t.length||e===null?this[S]():(this.buffer[0]=t.slice(e),t=t.slice(0,e),this[b]-=e),this.emit(`data`,t),!this.buffer.length&&!this[o]&&this.emit(`drain`),t}end(e,t,n){return typeof e==`function`&&(n=e,e=null),typeof t==`function`&&(n=t,t=`utf8`),e&&this.write(e,t),n&&this.once(`end`,n),this[o]=!0,this.writable=!1,(this.flowing||!this[v])&&this[s](),this}[y](){this[w]||(this[v]=!1,this[_]=!0,this.emit(`resume`),this.buffer.length?this[p]():this[o]?this[s]():this.emit(`drain`))}resume(){return this[y]()}pause(){this[_]=!1,this[v]=!0}get destroyed(){return this[w]}get flowing(){return this[_]}get paused(){return this[v]}[x](e){this[C]?this[b]+=1:this[b]+=e.length,this.buffer.push(e)}[S](){return this.buffer.length&&(this[C]?--this[b]:this[b]-=this.buffer[0].length),this.buffer.shift()}[p](e){do;while(this[m](this[S]()));!e&&!this.buffer.length&&!this[o]&&this.emit(`drain`)}[m](e){return e?(this.emit(`data`,e),this.flowing):!1}pipe(e,t){if(this[w])return;let r=this[c];return t||={},e===n.stdout||e===n.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this.pipes.push(t.proxyErrors?new I(this,e,t):new F(this,e,t)),this[O]?k(()=>this[y]()):this[y]()),e}unpipe(e){let t=this.pipes.find(t=>t.dest===e);t&&(this.pipes.splice(this.pipes.indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let n=super.on(e,t);return e===`data`&&!this.pipes.length&&!this.flowing?this[y]():e===`readable`&&this[b]!==0?super.emit(`readable`):ee(e)&&this[c]?(super.emit(e),this.removeAllListeners(e)):e===`error`&&this[u]&&(this[O]?k(()=>t.call(this,this[u])):t.call(this,this[u])),n}get emittedEnd(){return this[c]}[s](){!this[l]&&!this[c]&&!this[w]&&this.buffer.length===0&&this[o]&&(this[l]=!0,this.emit(`end`),this.emit(`prefinish`),this.emit(`finish`),this[d]&&this.emit(`close`),this[l]=!1)}emit(e,t,...n){if(e!==`error`&&e!==`close`&&e!==w&&this[w])return;if(e===`data`)return t?this[O]?k(()=>this[T](t)):this[T](t):!1;if(e===`end`)return this[E]();if(e===`close`){if(this[d]=!0,!this[c]&&!this[w])return;let e=super.emit(`close`);return this.removeAllListeners(`close`),e}else if(e===`error`){this[u]=t;let e=super.emit(`error`,t);return this[s](),e}else if(e===`resume`){let e=super.emit(`resume`);return this[s](),e}else if(e===`finish`||e===`prefinish`){let t=super.emit(e);return this.removeAllListeners(e),t}let r=super.emit(e,t,...n);return this[s](),r}[T](e){for(let t of this.pipes)t.dest.write(e)===!1&&this.pause();let t=super.emit(`data`,e);return this[s](),t}[E](){this[c]||(this[c]=!0,this.readable=!1,this[O]?k(()=>this[D]()):this[D]())}[D](){if(this[g]){let e=this[g].end();if(e){for(let t of this.pipes)t.dest.write(e);super.emit(`data`,e)}}for(let e of this.pipes)e.end();let e=super.emit(`end`);return this.removeAllListeners(`end`),e}collect(){let e=[];this[C]||(e.dataLength=0);let t=this.promise();return this.on(`data`,t=>{e.push(t),this[C]||(e.dataLength+=t.length)}),t.then(()=>e)}concat(){return this[C]?Promise.reject(Error(`cannot concat in objectMode`)):this.collect().then(e=>this[C]?Promise.reject(Error(`cannot concat in objectMode`)):this[h]?e.join(``):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on(w,()=>t(Error(`stream destroyed`))),this.on(`error`,e=>t(e)),this.on(`end`,()=>e())})}[j](){return{next:()=>{let e=this.read();if(e!==null)return Promise.resolve({done:!1,value:e});if(this[o])return Promise.resolve({done:!0});let t=null,n=null,r=e=>{this.removeListener(`data`,i),this.removeListener(`end`,a),n(e)},i=e=>{this.removeListener(`error`,r),this.removeListener(`end`,a),this.pause(),t({value:e,done:!!this[o]})},a=()=>{this.removeListener(`error`,r),this.removeListener(`data`,i),t({done:!0})},s=()=>r(Error(`stream destroyed`));return new Promise((e,o)=>{n=o,t=e,this.once(w,s),this.once(`error`,r),this.once(`end`,a),this.once(`data`,i)})}}}[M](){return{next:()=>{let e=this.read();return{value:e,done:e===null}}}}destroy(e){return this[w]?(e?this.emit(`error`,e):this.emit(w),this):(this[w]=!0,this.buffer.length=0,this[b]=0,typeof this.close==`function`&&!this[d]&&this.close(),e?this.emit(`error`,e):this.emit(w),this)}static isStream(t){return!!t&&(t instanceof e||t instanceof i||t instanceof r&&(typeof t.pipe==`function`||typeof t.write==`function`&&typeof t.end==`function`))}}})),ks=s(((e,t)=>{var n=Os(),r=require("events"),i=e=>e&&e instanceof r&&(typeof e.pipe==`function`||typeof e.write==`function`&&typeof e.end==`function`),a=Symbol(`_head`),o=Symbol(`_tail`),s=Symbol(`_linkStreams`),c=Symbol(`_setHead`),l=Symbol(`_setTail`),u=Symbol(`_onError`),d=Symbol(`_onData`),f=Symbol(`_onEnd`),p=Symbol(`_onDrain`),m=Symbol(`_streams`);t.exports=class extends n{constructor(e,...t){i(e)&&(t.unshift(e),e={}),super(e),this[m]=[],t.length&&this.push(...t)}[s](e){return e.reduce((e,t)=>(e.on(`error`,e=>t.emit(`error`,e)),e.pipe(t),t))}push(...e){this[m].push(...e),this[o]&&e.unshift(this[o]);let t=this[s](e);this[l](t),this[a]||this[c](e[0])}unshift(...e){this[m].unshift(...e),this[a]&&e.push(this[a]);let t=this[s](e);this[c](e[0]),this[o]||this[l](t)}destroy(e){return this[m].forEach(e=>typeof e.destroy==`function`&&e.destroy()),super.destroy(e)}[l](e){this[o]=e,e.on(`error`,t=>this[u](e,t)),e.on(`data`,t=>this[d](e,t)),e.on(`end`,()=>this[f](e)),e.on(`finish`,()=>this[f](e))}[u](e,t){e===this[o]&&this.emit(`error`,t)}[d](e,t){e===this[o]&&super.write(t)}[f](e){e===this[o]&&super.end()}pause(){return super.pause(),this[o]&&this[o].pause&&this[o].pause()}emit(e,...t){return e===`resume`&&this[o]&&this[o].resume&&this[o].resume(),super.emit(e,...t)}[c](e){this[a]=e,e.on(`drain`,()=>this[p](e))}[p](e){e===this[a]&&this.emit(`drain`)}write(e,t,n){return this[a].write(e,t,n)&&(this.flowing||this.buffer.length===0)}end(e,t,n){return this[a].end(e,t,n),this}}})),As=s(((e,t)=>{t.exports=(e,{copy:t,wrap:n})=>{let r={};if(e&&typeof e==`object`)for(let n of t)e[n]!==void 0&&(r[n]=e[n]);else r[n]=e;return r}})),js=s(((e,t)=>{var n=At();t.exports={satisfies:e=>n.satisfies(process.version,e,{includePrerelease:!0})}})),Ms=s(((e,t)=>{var{inspect:n}=require("util"),r=class{constructor(e,t,n){let r=`${t}: ${n.syscall} returned ${n.code} (${n.message})`;n.path!==void 0&&(r+=` ${n.path}`),n.dest!==void 0&&(r+=` => ${n.dest}`),this.code=e,Object.defineProperties(this,{name:{value:`SystemError`,enumerable:!1,writable:!0,configurable:!0},message:{value:r,enumerable:!1,writable:!0,configurable:!0},info:{value:n,enumerable:!0,configurable:!0,writable:!1},errno:{get(){return n.errno},set(e){n.errno=e},enumerable:!0,configurable:!0},syscall:{get(){return n.syscall},set(e){n.syscall=e},enumerable:!0,configurable:!0}}),n.path!==void 0&&Object.defineProperty(this,"path",{get(){return n.path},set(e){n.path=e},enumerable:!0,configurable:!0}),n.dest!==void 0&&Object.defineProperty(this,"dest",{get(){return n.dest},set(e){n.dest=e},enumerable:!0,configurable:!0})}toString(){return`${this.name} [${this.code}]: ${this.message}`}[Symbol.for(`nodejs.util.inspect.custom`)](e,t){return n(this,{...t,getters:!0,customInspect:!1})}};function i(e,n){t.exports[e]=class extends r{constructor(t){super(e,n,t)}}}i(`ERR_FS_CP_DIR_TO_NON_DIR`,`Cannot overwrite directory with non-directory`),i(`ERR_FS_CP_EEXIST`,`Target already exists`),i(`ERR_FS_CP_EINVAL`,`Invalid src or dest`),i(`ERR_FS_CP_FIFO_PIPE`,`Cannot copy a FIFO pipe`),i(`ERR_FS_CP_NON_DIR_TO_DIR`,`Cannot overwrite non-directory with directory`),i(`ERR_FS_CP_SOCKET`,`Cannot copy a socket file`),i(`ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY`,`Cannot overwrite symlink in subdirectory of self`),i(`ERR_FS_CP_UNKNOWN`,`Cannot copy an unknown file type`),i(`ERR_FS_EISDIR`,`Path is a directory`),t.exports.ERR_INVALID_ARG_TYPE=class extends Error{constructor(e,t,n){super(),this.code=`ERR_INVALID_ARG_TYPE`,this.message=`The ${e} argument must be ${t}. Received ${typeof n}`}}})),Ns=s(((e,t)=>{var{ERR_FS_CP_DIR_TO_NON_DIR:n,ERR_FS_CP_EEXIST:r,ERR_FS_CP_EINVAL:i,ERR_FS_CP_FIFO_PIPE:a,ERR_FS_CP_NON_DIR_TO_DIR:o,ERR_FS_CP_SOCKET:s,ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY:c,ERR_FS_CP_UNKNOWN:l,ERR_FS_EISDIR:u,ERR_INVALID_ARG_TYPE:d}=Ms(),{constants:{errno:{EEXIST:f,EISDIR:p,EINVAL:m,ENOTDIR:h}}}=require("os"),{chmod:g,copyFile:_,lstat:v,mkdir:y,readdir:b,readlink:x,stat:S,symlink:C,unlink:w,utimes:T}=require("fs/promises"),{dirname:E,isAbsolute:D,join:O,parse:k,resolve:A,sep:j,toNamespacedPath:M}=require("path"),{fileURLToPath:ee}=require("url"),N={dereference:!1,errorOnExist:!1,filter:void 0,force:!0,preserveTimestamps:!1,recursive:!1};async function P(e,t,n){if(n!=null&&typeof n!=`object`)throw new d(`options`,[`Object`],n);return I(M(F(e)),M(F(t)),{...N,...n})}function F(e){return e!=null&&e.href&&e.origin?ee(e):e}async function I(e,t,n){n.preserveTimestamps&&process.arch===`ia32`&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended`,`TimestampPrecisionWarning`);let{srcStat:r,destStat:i}=await L(e,t,n);return await V(e,r,t),n.filter?U(z,i,e,t,n):z(i,e,t,n)}async function L(e,t,r){let{0:a,1:s}=await te(e,t,r);if(s){if(R(a,s))throw new i({message:`src and dest cannot be the same`,path:t,syscall:`cp`,errno:m});if(a.isDirectory()&&!s.isDirectory())throw new n({message:`cannot overwrite directory ${e} with non-directory ${t}`,path:t,syscall:`cp`,errno:p});if(!a.isDirectory()&&s.isDirectory())throw new o({message:`cannot overwrite non-directory ${e} with directory ${t}`,path:t,syscall:`cp`,errno:h})}if(a.isDirectory()&&H(e,t))throw new i({message:`cannot copy ${e} to a subdirectory of self ${t}`,path:t,syscall:`cp`,errno:m});return{srcStat:a,destStat:s}}function R(e,t){return t.ino&&t.dev&&t.ino===e.ino&&t.dev===e.dev}function te(e,t,n){let r=n.dereference?e=>S(e,{bigint:!0}):e=>v(e,{bigint:!0});return Promise.all([r(e),r(t).catch(e=>{if(e.code===`ENOENT`)return null;throw e})])}async function z(e,t,n,r){let i=E(n);return await B(i)||await y(i,{recursive:!0}),re(e,t,n,r)}function B(e){return S(e).then(()=>!0,e=>e.code===`ENOENT`?!1:Promise.reject(e))}async function V(e,t,n){let r=A(E(e)),a=A(E(n));if(a===r||a===k(a).root)return;let o;try{o=await S(a,{bigint:!0})}catch(e){if(e.code===`ENOENT`)return;throw e}if(R(t,o))throw new i({message:`cannot copy ${e} to a subdirectory of self ${n}`,path:n,syscall:`cp`,errno:m});return V(e,t,a)}var ne=e=>A(e).split(j).filter(Boolean);function H(e,t){let n=ne(e),r=ne(t);return n.every((e,t)=>r[t]===e)}async function U(e,t,n,r,i,a){if(await i.filter(n,r))return e(t,n,r,i,a)}function W(e,t,n,r){return r.filter?U(re,e,t,n,r):re(e,t,n,r)}async function re(e,t,n,r){let i=await(r.dereference?S:v)(t);if(i.isDirectory()&&r.recursive)return de(i,e,t,n,r);if(i.isDirectory())throw new u({message:`${t} is a directory (not copied)`,path:t,syscall:`cp`,errno:m});if(i.isFile()||i.isCharacterDevice()||i.isBlockDevice())return ie(i,e,t,n,r);if(i.isSymbolicLink())return me(e,t,n);throw i.isSocket()?new s({message:`cannot copy a socket file: ${n}`,path:n,syscall:`cp`,errno:m}):i.isFIFO()?new a({message:`cannot copy a FIFO pipe: ${n}`,path:n,syscall:`cp`,errno:m}):new l({message:`cannot copy an unknown file type: ${n}`,path:n,syscall:`cp`,errno:m})}function ie(e,t,n,r,i){return t?ae(e,n,r,i):oe(e,n,r,i)}async function ae(e,t,n,i){if(i.force)return await w(n),oe(e,t,n,i);if(i.errorOnExist)throw new r({message:`${n} already exists`,path:n,syscall:`cp`,errno:f})}async function oe(e,t,n,r){return await _(t,n),r.preserveTimestamps?G(e.mode,t,n):le(n,e.mode)}async function G(e,t,n){return K(e)&&await se(n,e),ce(e,t,n)}function K(e){return(e&128)==0}function se(e,t){return le(e,t|128)}async function ce(e,t,n){return await ue(t,n),le(n,e)}function le(e,t){return g(e,t)}async function ue(e,t){let n=await S(e);return T(t,n.atime,n.mtime)}function de(e,t,n,r,i){return t?pe(n,r,i):fe(e.mode,n,r,i)}async function fe(e,t,n,r){return await y(n),await pe(t,n,r),le(n,e)}async function pe(e,t,n){let r=await b(e);for(let i=0;i<r.length;i++){let a=r[i],o=O(e,a),s=O(t,a),{destStat:c}=await L(o,s,n);await W(c,o,s,n)}}async function me(e,t,n){let r=await x(t);if(D(r)||(r=A(E(t),r)),!e)return C(r,n);let a;try{a=await x(n)}catch(e){if(e.code===`EINVAL`||e.code===`UNKNOWN`)return C(r,n);throw e}if(D(a)||(a=A(E(n),a)),H(r,a))throw new i({message:`cannot copy ${r} to a subdirectory of self ${a}`,path:n,syscall:`cp`,errno:m});if((await S(t)).isDirectory()&&H(a,r))throw new c({message:`cannot overwrite ${a} with ${r}`,path:n,syscall:`cp`,errno:m});return he(r,n)}async function he(e,t){return await w(t),C(e,t)}t.exports=P})),Ps=s(((e,t)=>{var n=require("fs/promises"),r=As(),i=js(),a=Ns(),o=i.satisfies(`>=16.7.0`);t.exports=async(e,t,i)=>{let s=r(i,{copy:[`dereference`,`errorOnExist`,`filter`,`force`,`preserveTimestamps`,`recursive`]});return o?n.cp(e,t,s):a(e,t,s)}})),Fs=s(((e,t)=>{var{join:n,sep:r}=require("path"),i=As(),{mkdir:a,mkdtemp:o,rm:s}=require("fs/promises");t.exports=async(e,t,c)=>{let l=i(c,{copy:[`tmpPrefix`]});await a(e,{recursive:!0});let u=await o(n(`${e}${r}`,l.tmpPrefix||``)),d,f;try{f=await t(u)}catch(e){d=e}try{await s(u,{force:!0,recursive:!0})}catch{}if(d)throw d;return f}})),Is=s(((e,t)=>{var{readdir:n}=require("fs/promises"),{join:r}=require("path");t.exports=async e=>{let t=[];for(let i of await n(e))if(i.startsWith(`@`))for(let a of await n(r(e,i)))t.push(r(i,a));else t.push(i);return t}})),Ls=s(((e,t)=>{var{dirname:n,join:r,resolve:i,relative:a,isAbsolute:o}=require("path"),s=require("fs/promises"),c=async e=>{try{return await s.access(e),!0}catch(e){return e.code!==`ENOENT`}},l=async(e,t,u={},d=!0,f=[])=>{if(!e||!t)throw TypeError("`source` and `destination` file required");if(u={overwrite:!0,...u},!u.overwrite&&await c(t))throw Error(`The destination file exists: ${t}`);await s.mkdir(n(t),{recursive:!0});try{await s.rename(e,t)}catch(n){if(n.code===`EXDEV`||n.code===`EPERM`){let n=await s.lstat(e);if(n.isDirectory()){let n=await s.readdir(e);await Promise.all(n.map(n=>l(r(e,n),r(t,n),u,!1,f)))}else n.isSymbolicLink()?f.push({source:e,destination:t}):await s.copyFile(e,t)}else throw n}d&&(await Promise.all(f.map(async({source:e,destination:t})=>{let r=await s.readlink(e);o(r)&&(r=i(t,a(e,r)));let c=`file`;try{c=await s.stat(i(n(e),r)),c.isDirectory()&&(c=`junction`)}catch{}await s.symlink(r,t,c)})),await s.rm(e,{recursive:!0,force:!0}))};t.exports=l})),Rs=s(((e,t)=>{t.exports={cp:Ps(),withTempDir:Fs(),readdirScoped:Is(),moveFile:Ls()}})),zs=s(((e,t)=>{var n=require("crypto"),{withTempDir:r}=Rs(),i=require("fs/promises"),a=require("path");t.exports.mkdir=o,t.exports.tmpName=function(e,t){let r=n.randomUUID();return a.join(e,`tmp`,t?`${t}-${r}`:r)};async function o(e,t={}){let{tmpPrefix:n}=t,r=a.join(e,`tmp`);await i.mkdir(r,{recursive:!0,owner:`inherit`});let o=`${r}${a.sep}${n||``}`;return i.mkdtemp(o,{owner:`inherit`})}t.exports.withTmp=s;function s(e,t,n){return n||(n=t,t={}),r(a.join(e,`tmp`),n,t)}})),Bs=c({author:()=>$s,default:()=>tc,dependencies:()=>Ys,description:()=>Us,devDependencies:()=>Xs,engines:()=>Zs,files:()=>Gs,keywords:()=>Js,license:()=>`ISC`,main:()=>Ws,name:()=>Vs,repository:()=>qs,scripts:()=>Ks,tap:()=>ec,templateOSS:()=>Qs,version:()=>Hs}),Vs,Hs,Us,Ws,Gs,Ks,qs,Js,Ys,Xs,Zs,Qs,$s,ec,tc,nc=o((()=>{Vs=`cacache`,Hs=`20.0.4`,Us=`Fast, fault-tolerant, cross-platform, disk-based, data-agnostic, content-addressable cache.`,Ws=`lib/index.js`,Gs=[`bin/`,`lib/`],Ks={test:`tap`,snap:`tap`,coverage:`tap`,"test-docker":`docker run -it --rm --name pacotest -v "$PWD":/tmp -w /tmp node:latest npm test`,lint:`npm run eslint`,npmclilint:`npmcli-lint`,lintfix:`npm run eslint -- --fix`,postsnap:`npm run lintfix --`,postlint:`template-oss-check`,posttest:`npm run lint`,"template-oss-apply":`template-oss-apply --force`,eslint:`eslint "**/*.{js,cjs,ts,mjs,jsx,tsx}"`},qs={type:`git`,url:`git+https://github.com/npm/cacache.git`},Js=[`cache`,`caching`,`content-addressable`,`sri`,`sri hash`,`subresource integrity`,`cache`,`storage`,`store`,`file store`,`filesystem`,`disk cache`,`disk storage`],Ys={"@npmcli/fs":`^5.0.0`,"fs-minipass":`^3.0.0`,glob:`^13.0.0`,"lru-cache":`^11.1.0`,minipass:`^7.0.3`,"minipass-collect":`^2.0.1`,"minipass-flush":`^1.0.5`,"minipass-pipeline":`^1.2.4`,"p-map":`^7.0.2`,ssri:`^13.0.0`},Xs={"@npmcli/eslint-config":`^6.0.1`,"@npmcli/template-oss":`4.29.0`,tap:`^16.0.0`},Zs={node:`^20.17.0 || >=22.9.0`},Qs={"//@npmcli/template-oss":`This file is partially managed by @npmcli/template-oss. Edits may be overwritten.`,windowsCI:!1,version:`4.29.0`,publish:`true`},$s=`GitHub Inc.`,ec={"nyc-arg":[`--exclude`,`tap-snapshots/**`]},tc={name:Vs,version:Hs,"cache-version":{content:`2`,index:`5`},description:Us,main:Ws,files:Gs,scripts:Ks,repository:qs,keywords:Js,license:`ISC`,dependencies:Ys,devDependencies:Xs,engines:Zs,templateOSS:Qs,author:$s,tap:ec}})),rc=s(((e,t)=>{t.exports=n;function n(e){return[e.slice(0,2),e.slice(2,4),e.slice(4)]}})),ic=s(((e,t)=>{var n=(nc(),d(Bs).default)[`cache-version`].content,r=rc(),i=require("path"),a=Ss();t.exports=o;function o(e,t){let n=a.parse(t,{single:!0});return i.join(s(e),n.algorithm,...r(n.hexDigest()))}t.exports.contentDir=s;function s(e){return i.join(e,`content-v${n}`)}})),ac=s(((e,t)=>{var n=require("crypto"),{appendFile:r,mkdir:i,readFile:a,readdir:o,rm:s,writeFile:c}=require("fs/promises"),{Minipass:l}=Ca(),u=require("path"),f=Ss(),{tmpName:p}=zs(),m=ic(),h=rc(),g=(nc(),d(Bs).default)[`cache-version`].index,{moveFile:_}=Rs(),v=5;t.exports.NotFoundError=class extends Error{constructor(e,t){super(`No cache entry for ${t} found in ${e}`),this.code=`ENOENT`,this.cache=e,this.key=t}},t.exports.compact=y;async function y(e,t,n,r={}){let a=O(e,t),o=await T(a),l=[];for(let e=o.length-1;e>=0;--e){let t=o[e];if(t.integrity===null&&!r.validateEntry)break;(!r.validateEntry||r.validateEntry(t)===!0)&&(l.length===0||!l.find(e=>n(e,t)))&&l.unshift(t)}let d=`
435
435
  `+l.map(e=>{let t=JSON.stringify(e);return`${A(t)}\t${t}`}).join(`
436
- `),f=async()=>{let t=p(e,r.tmpPrefix);return await i(u.dirname(t),{recursive:!0}),{target:t,moved:!1}},m=async e=>{if(!e.moved)return s(e.target,{recursive:!0,force:!0})},h=async e=>{await c(e.target,d,{flag:`wx`}),await i(u.dirname(a),{recursive:!0}),await _(e.target,a),e.moved=!0},g=await f();try{await h(g)}finally{await m(g)}return l.reverse().map(t=>M(e,t,!0))}t.exports.insert=b;async function b(e,t,n,a={}){let{metadata:o,size:s,time:c}=a,l=O(e,t),d={key:t,integrity:n&&f.stringify(n),time:c||Date.now(),size:s,metadata:o};try{await i(u.dirname(l),{recursive:!0});let e=JSON.stringify(d);await r(l,`\n${A(e)}\t${e}`)}catch(e){if(e.code===`ENOENT`)return;throw e}return M(e,d)}t.exports.find=x;async function x(e,t){let n=O(e,t);try{return(await T(n)).reduce((n,r)=>r&&r.key===t?M(e,r):n,null)}catch(e){if(e.code===`ENOENT`)return null;throw e}}t.exports.delete=S;function S(e,t,n={}){return n.removeFully?s(O(e,t),{recursive:!0,force:!0}):b(e,t,null,n)}t.exports.lsStream=C;function C(e){let t=D(e),n=new l({objectMode:!0});return Promise.resolve().then(async()=>{let{default:r}=await Promise.resolve().then(()=>(Ux(),Bx));return await r(await ee(t),async i=>{let a=u.join(t,i);await r(await ee(a),async t=>{let i=u.join(a,t);await r(await ee(i),async t=>{let r=u.join(i,t);try{let t=(await T(r)).reduce((e,t)=>(e.set(t.key,t),e),new Map);for(let r of t.values()){let t=M(e,r);t&&n.write(t)}}catch(e){if(e.code===`ENOENT`)return;throw e}},{concurrency:v})},{concurrency:v})},{concurrency:v}),n.end(),n}).catch(e=>n.emit(`error`,e)),n}t.exports.ls=w;async function w(e){return(await C(e).collect()).reduce((e,t)=>(e[t.key]=t,e),{})}t.exports.bucketEntries=T;async function T(e,t){return E(await a(e,`utf8`),t)}function E(e){let t=[];return e.split(`
436
+ `),f=async()=>{let t=p(e,r.tmpPrefix);return await i(u.dirname(t),{recursive:!0}),{target:t,moved:!1}},m=async e=>{if(!e.moved)return s(e.target,{recursive:!0,force:!0})},h=async e=>{await c(e.target,d,{flag:`wx`}),await i(u.dirname(a),{recursive:!0}),await _(e.target,a),e.moved=!0},g=await f();try{await h(g)}finally{await m(g)}return l.reverse().map(t=>M(e,t,!0))}t.exports.insert=b;async function b(e,t,n,a={}){let{metadata:o,size:s,time:c}=a,l=O(e,t),d={key:t,integrity:n&&f.stringify(n),time:c||Date.now(),size:s,metadata:o};try{await i(u.dirname(l),{recursive:!0});let e=JSON.stringify(d);await r(l,`\n${A(e)}\t${e}`)}catch(e){if(e.code===`ENOENT`)return;throw e}return M(e,d)}t.exports.find=x;async function x(e,t){let n=O(e,t);try{return(await T(n)).reduce((n,r)=>r&&r.key===t?M(e,r):n,null)}catch(e){if(e.code===`ENOENT`)return null;throw e}}t.exports.delete=S;function S(e,t,n={}){return n.removeFully?s(O(e,t),{recursive:!0,force:!0}):b(e,t,null,n)}t.exports.lsStream=C;function C(e){let t=D(e),n=new l({objectMode:!0});return Promise.resolve().then(async()=>{let{default:r}=await Promise.resolve().then(()=>(Vx(),Rx));return await r(await ee(t),async i=>{let a=u.join(t,i);await r(await ee(a),async t=>{let i=u.join(a,t);await r(await ee(i),async t=>{let r=u.join(i,t);try{let t=(await T(r)).reduce((e,t)=>(e.set(t.key,t),e),new Map);for(let r of t.values()){let t=M(e,r);t&&n.write(t)}}catch(e){if(e.code===`ENOENT`)return;throw e}},{concurrency:v})},{concurrency:v})},{concurrency:v}),n.end(),n}).catch(e=>n.emit(`error`,e)),n}t.exports.ls=w;async function w(e){return(await C(e).collect()).reduce((e,t)=>(e[t.key]=t,e),{})}t.exports.bucketEntries=T;async function T(e,t){return E(await a(e,`utf8`),t)}function E(e){let t=[];return e.split(`
437
437
  `).forEach(e=>{if(!e)return;let n=e.split(` `);if(!n[1]||A(n[1])!==n[0])return;let r;try{r=JSON.parse(n[1])}catch{}r&&t.push(r)}),t}t.exports.bucketDir=D;function D(e){return u.join(e,`index-v${g}`)}t.exports.bucketPath=O;function O(e,t){let n=k(t);return u.join.apply(u,[D(e)].concat(h(n)))}t.exports.hashKey=k;function k(e){return j(e,`sha256`)}t.exports.hashEntry=A;function A(e){return j(e,`sha1`)}function j(e,t){return n.createHash(t).update(e).digest(`hex`)}function M(e,t,n){return!t.integrity&&!n?null:{key:t.key,integrity:t.integrity,path:t.integrity?m(e,t.integrity):void 0,size:t.size,time:t.time,metadata:t.metadata}}function ee(e){return o(e).catch(e=>{if(e.code===`ENOENT`||e.code===`ENOTDIR`)return[];throw e})}})),oc=s(((e,t)=>{var{LRUCache:n}=zn(),r=new n({max:500,maxSize:50*1024*1024,ttl:180*1e3,sizeCalculation:(e,t)=>t.startsWith(`key:`)?e.data.length:e.length});t.exports.clearMemoized=i;function i(){let e={};return r.forEach((t,n)=>{e[n]=t}),r.clear(),e}t.exports.put=a;function a(e,t,n,r){u(r).set(`key:${e}:${t.key}`,{entry:t,data:n}),o(e,t.integrity,n,r)}t.exports.put.byDigest=o;function o(e,t,n,r){u(r).set(`digest:${e}:${t}`,n)}t.exports.get=s;function s(e,t,n){return u(n).get(`key:${e}:${t}`)}t.exports.get.byDigest=c;function c(e,t,n){return u(n).get(`digest:${e}:${t}`)}var l=class{constructor(e){this.obj=e}get(e){return this.obj[e]}set(e,t){this.obj[e]=t}};function u(e){return!e||!e.memoize?r:e.memoize.get&&e.memoize.set?e.memoize:typeof e.memoize==`object`?new l(e.memoize):r}})),sc=s((e=>{var{Minipass:t}=Ca(),n=require("events").EventEmitter,r=require("fs"),i=r.writev,a=Symbol(`_autoClose`),o=Symbol(`_close`),s=Symbol(`_ended`),c=Symbol(`_fd`),l=Symbol(`_finished`),u=Symbol(`_flags`),d=Symbol(`_flush`),f=Symbol(`_handleChunk`),p=Symbol(`_makeBuf`),m=Symbol(`_mode`),h=Symbol(`_needDrain`),g=Symbol(`_onerror`),_=Symbol(`_onopen`),v=Symbol(`_onread`),y=Symbol(`_onwrite`),b=Symbol(`_open`),x=Symbol(`_path`),S=Symbol(`_pos`),C=Symbol(`_queue`),w=Symbol(`_read`),T=Symbol(`_readSize`),E=Symbol(`_reading`),D=Symbol(`_remain`),O=Symbol(`_size`),k=Symbol(`_write`),A=Symbol(`_writing`),j=Symbol(`_defaultFlag`),M=Symbol(`_errored`),ee=class extends t{constructor(e,t){if(t||={},super(t),this.readable=!0,this.writable=!1,typeof e!=`string`)throw TypeError(`path must be a string`);this[M]=!1,this[c]=typeof t.fd==`number`?t.fd:null,this[x]=e,this[T]=t.readSize||16*1024*1024,this[E]=!1,this[O]=typeof t.size==`number`?t.size:1/0,this[D]=this[O],this[a]=typeof t.autoClose==`boolean`?t.autoClose:!0,typeof this[c]==`number`?this[w]():this[b]()}get fd(){return this[c]}get path(){return this[x]}write(){throw TypeError(`this is a readable stream`)}end(){throw TypeError(`this is a readable stream`)}[b](){r.open(this[x],`r`,(e,t)=>this[_](e,t))}[_](e,t){e?this[g](e):(this[c]=t,this.emit(`open`,t),this[w]())}[p](){return Buffer.allocUnsafe(Math.min(this[T],this[D]))}[w](){if(!this[E]){this[E]=!0;let e=this[p]();if(e.length===0)return process.nextTick(()=>this[v](null,0,e));r.read(this[c],e,0,e.length,null,(e,t,n)=>this[v](e,t,n))}}[v](e,t,n){this[E]=!1,e?this[g](e):this[f](t,n)&&this[w]()}[o](){if(this[a]&&typeof this[c]==`number`){let e=this[c];this[c]=null,r.close(e,e=>e?this.emit(`error`,e):this.emit(`close`))}}[g](e){this[E]=!0,this[o](),this.emit(`error`,e)}[f](e,t){let n=!1;return this[D]-=e,e>0&&(n=super.write(e<t.length?t.slice(0,e):t)),(e===0||this[D]<=0)&&(n=!1,this[o](),super.end()),n}emit(e,t){switch(e){case`prefinish`:case`finish`:break;case`drain`:typeof this[c]==`number`&&this[w]();break;case`error`:return this[M]?void 0:(this[M]=!0,super.emit(e,t));default:return super.emit(e,t)}}},N=class extends ee{[b](){let e=!0;try{this[_](null,r.openSync(this[x],`r`)),e=!1}finally{e&&this[o]()}}[w](){let e=!0;try{if(!this[E]){this[E]=!0;do{let e=this[p](),t=e.length===0?0:r.readSync(this[c],e,0,e.length,null);if(!this[f](t,e))break}while(!0);this[E]=!1}e=!1}finally{e&&this[o]()}}[o](){if(this[a]&&typeof this[c]==`number`){let e=this[c];this[c]=null,r.closeSync(e),this.emit(`close`)}}},P=class extends n{constructor(e,t){t||={},super(t),this.readable=!1,this.writable=!0,this[M]=!1,this[A]=!1,this[s]=!1,this[h]=!1,this[C]=[],this[x]=e,this[c]=typeof t.fd==`number`?t.fd:null,this[m]=t.mode===void 0?438:t.mode,this[S]=typeof t.start==`number`?t.start:null,this[a]=typeof t.autoClose==`boolean`?t.autoClose:!0;let n=this[S]===null?`w`:`r+`;this[j]=t.flags===void 0,this[u]=this[j]?n:t.flags,this[c]===null&&this[b]()}emit(e,t){if(e===`error`){if(this[M])return;this[M]=!0}return super.emit(e,t)}get fd(){return this[c]}get path(){return this[x]}[g](e){this[o](),this[A]=!0,this.emit(`error`,e)}[b](){r.open(this[x],this[u],this[m],(e,t)=>this[_](e,t))}[_](e,t){this[j]&&this[u]===`r+`&&e&&e.code===`ENOENT`?(this[u]=`w`,this[b]()):e?this[g](e):(this[c]=t,this.emit(`open`,t),this[A]||this[d]())}end(e,t){return e&&this.write(e,t),this[s]=!0,!this[A]&&!this[C].length&&typeof this[c]==`number`&&this[y](null,0),this}write(e,t){return typeof e==`string`&&(e=Buffer.from(e,t)),this[s]?(this.emit(`error`,Error(`write() after end()`)),!1):this[c]===null||this[A]||this[C].length?(this[C].push(e),this[h]=!0,!1):(this[A]=!0,this[k](e),!0)}[k](e){r.write(this[c],e,0,e.length,this[S],(e,t)=>this[y](e,t))}[y](e,t){e?this[g](e):(this[S]!==null&&(this[S]+=t),this[C].length?this[d]():(this[A]=!1,this[s]&&!this[l]?(this[l]=!0,this[o](),this.emit(`finish`)):this[h]&&(this[h]=!1,this.emit(`drain`))))}[d](){if(this[C].length===0)this[s]&&this[y](null,0);else if(this[C].length===1)this[k](this[C].pop());else{let e=this[C];this[C]=[],i(this[c],e,this[S],(e,t)=>this[y](e,t))}}[o](){if(this[a]&&typeof this[c]==`number`){let e=this[c];this[c]=null,r.close(e,e=>e?this.emit(`error`,e):this.emit(`close`))}}},F=class extends P{[b](){let e;if(this[j]&&this[u]===`r+`)try{e=r.openSync(this[x],this[u],this[m])}catch(e){if(e.code===`ENOENT`)return this[u]=`w`,this[b]();throw e}else e=r.openSync(this[x],this[u],this[m]);this[_](null,e)}[o](){if(this[a]&&typeof this[c]==`number`){let e=this[c];this[c]=null,r.closeSync(e),this.emit(`close`)}}[k](e){let t=!0;try{this[y](null,r.writeSync(this[c],e,0,e.length,this[S])),t=!1}finally{if(t)try{this[o]()}catch{}}}};e.ReadStream=ee,e.ReadStreamSync=N,e.WriteStream=P,e.WriteStreamSync=F})),cc=s(((e,t)=>{var n=require("fs/promises"),r=sc(),i=Ss(),a=ic(),o=ks();t.exports=c;var s=64*1024*1024;async function c(e,t,r={}){let{size:a}=r,{stat:c,cpath:u,sri:d}=await p(e,t,async(e,t)=>({stat:a?{size:a}:await n.stat(e),cpath:e,sri:t}));if(c.size>s)return l(u,c.size,d,new o).concat();let f=await n.readFile(u,{encoding:null});if(c.size!==f.length)throw m(c.size,f.length);if(!i.checkData(f,d))throw h(d,u);return f}var l=(e,t,n,a)=>(a.push(new r.ReadStream(e,{size:t,readSize:s}),i.integrityStream({integrity:n,size:t})),a);t.exports.stream=u,t.exports.readStream=u;function u(e,t,r={}){let{size:i}=r,a=new o;return Promise.resolve().then(async()=>{let{stat:r,cpath:o,sri:s}=await p(e,t,async(e,t)=>({stat:i?{size:i}:await n.stat(e),cpath:e,sri:t}));return l(o,r.size,s,a)}).catch(e=>a.emit(`error`,e)),a}t.exports.copy=d;function d(e,t,r){return p(e,t,e=>n.copyFile(e,r))}t.exports.hasContent=f;async function f(e,t){if(!t)return!1;try{return await p(e,t,async(e,t)=>{let r=await n.stat(e);return{size:r.size,sri:t,stat:r}})}catch(e){if(e.code===`ENOENT`)return!1;if(e.code===`EPERM`){if(process.platform!==`win32`)throw e;return!1}}}async function p(e,t,n){let r=i.parse(t),o=r[r.pickAlgorithm()];if(o.length<=1)return n(a(e,o[0]),o[0]);{let t=await Promise.all(o.map(async t=>{try{return await p(e,t,n)}catch(e){return e.code===`ENOENT`?Object.assign(Error(`No matching content found for `+r.toString()),{code:`ENOENT`}):e}})),i=t.find(e=>!(e instanceof Error));if(i)return i;throw t.find(e=>e.code===`ENOENT`)||t.find(e=>e instanceof Error)}}function m(e,t){let n=Error(`Bad data size: expected inserted data to be ${e} bytes, but got ${t} instead`);return n.expected=e,n.found=t,n.code=`EBADSIZE`,n}function h(e,t){let n=Error(`Integrity verification failed for ${e} (${t})`);return n.code=`EINTEGRITY`,n.sri=e,n.path=t,n}})),lc=s(((e,t)=>{var n=Ds(),{Minipass:r}=Ca(),i=ks(),a=ac(),o=oc(),s=cc();async function c(e,t,n={}){let{integrity:r,memoize:i,size:c}=n,l=o.get(e,t,n);if(l&&i!==!1)return{metadata:l.entry.metadata,data:l.data,integrity:l.entry.integrity,size:l.entry.size};let u=await a.find(e,t,n);if(!u)throw new a.NotFoundError(e,t);let d=await s(e,u.integrity,{integrity:r,size:c});return i&&o.put(e,u,d,n),{data:d,metadata:u.metadata,size:u.size,integrity:u.integrity}}t.exports=c;async function l(e,t,n={}){let{integrity:r,memoize:i,size:a}=n,c=o.get.byDigest(e,t,n);if(c&&i!==!1)return c;let l=await s(e,t,{integrity:r,size:a});return i&&o.put.byDigest(e,t,l,n),l}t.exports.byDigest=l;var u=e=>{let t=new r;return t.on(`newListener`,function(t,n){t===`metadata`&&n(e.entry.metadata),t===`integrity`&&n(e.entry.integrity),t===`size`&&n(e.entry.size)}),t.end(e.data),t};function d(e,t,r={}){let{memoize:c,size:l}=r,d=o.get(e,t,r);if(d&&c!==!1)return u(d);let f=new i;return Promise.resolve().then(async()=>{let i=await a.find(e,t);if(!i)throw new a.NotFoundError(e,t);f.emit(`metadata`,i.metadata),f.emit(`integrity`,i.integrity),f.emit(`size`,i.size),f.on(`newListener`,function(e,t){e===`metadata`&&t(i.metadata),e===`integrity`&&t(i.integrity),e===`size`&&t(i.size)});let u=s.readStream(e,i.integrity,{...r,size:typeof l==`number`?l:i.size});if(c){let t=new n.PassThrough;t.on(`collect`,t=>o.put(e,i,t,r)),f.unshift(t)}return f.unshift(u),f}).catch(e=>f.emit(`error`,e)),f}t.exports.stream=d;function f(e,t,a={}){let{memoize:c}=a,l=o.get.byDigest(e,t,a);if(l&&c!==!1){let e=new r;return e.end(l),e}else{let r=s.readStream(e,t,a);if(!c)return r;let l=new n.PassThrough;return l.on(`collect`,n=>o.put.byDigest(e,t,n,a)),new i(r,l)}}t.exports.stream.byDigest=f;function p(e,t,n={}){let{memoize:r}=n,i=o.get(e,t,n);return i&&r!==!1?Promise.resolve(i.entry):a.find(e,t)}t.exports.info=p;async function m(e,t,n,r={}){let i=await a.find(e,t,r);if(!i)throw new a.NotFoundError(e,t);return await s.copy(e,i.integrity,n,r),{metadata:i.metadata,size:i.size,integrity:i.integrity}}t.exports.copy=m;async function h(e,t,n,r={}){return await s.copy(e,t,n,r),t}t.exports.copy.byDigest=h,t.exports.hasContent=s.hasContent})),uc=s(((e,t)=>{var n=require("events"),r=ic(),i=require("fs/promises"),{moveFile:a}=Rs(),{Minipass:o}=Ca(),s=ks(),c=Es(),l=require("path"),u=Ss(),{tmpName:d}=zs(),f=sc();t.exports=m;var p=new Map;async function m(e,t,n={}){let{algorithms:r,size:a,integrity:o}=n;if(typeof a==`number`&&t.length!==a)throw x(a,t.length);let s=u.fromData(t,r?{algorithms:r}:{});if(o&&!u.checkData(t,o,n))throw S(o,s);for(let r in s){let a=await y(e,n),o=s[r].toString();try{await i.writeFile(a.target,t,{flag:`wx`}),await b(a,e,o,n)}finally{a.moved||await i.rm(a.target,{recursive:!0,force:!0})}}return{integrity:s,size:t.length}}t.exports.stream=g;var h=class extends c{constructor(e,t){super(),this.opts=t,this.cache=e,this.inputStream=new o,this.inputStream.on(`error`,e=>this.emit(`error`,e)),this.inputStream.on(`drain`,()=>this.emit(`drain`)),this.handleContentP=null}write(e,t,n){return this.handleContentP||(this.handleContentP=_(this.inputStream,this.cache,this.opts),this.handleContentP.catch(e=>this.emit(`error`,e))),this.inputStream.write(e,t,n)}flush(e){this.inputStream.end(()=>{if(!this.handleContentP){let t=Error(`Cache input stream was empty`);return t.code=`ENODATA`,Promise.reject(t).catch(e)}this.handleContentP.then(t=>{t.integrity&&this.emit(`integrity`,t.integrity),t.size!==null&&this.emit(`size`,t.size),e()},t=>e(t))})}};function g(e,t={}){return new h(e,t)}async function _(e,t,n){let r=await y(t,n);try{let i=await v(e,t,r.target,n);return await b(r,t,i.integrity,n),i}finally{r.moved||await i.rm(r.target,{recursive:!0,force:!0})}}async function v(e,t,r,i){let a=new f.WriteStream(r,{flags:`wx`});if(i.integrityEmitter){let[t,r]=await Promise.all([n.once(i.integrityEmitter,`integrity`).then(e=>e[0]),n.once(i.integrityEmitter,`size`).then(e=>e[0]),new s(e,a).promise()]);return{integrity:t,size:r}}let o,c,l=u.integrityStream({integrity:i.integrity,algorithms:i.algorithms,size:i.size});return l.on(`integrity`,e=>{o=e}),l.on(`size`,e=>{c=e}),await new s(e,l,a).promise(),{integrity:o,size:c}}async function y(e,t){let n=d(e,t.tmpPrefix);return await i.mkdir(l.dirname(n),{recursive:!0}),{target:n,moved:!1}}async function b(e,t,n){let o=r(t,n),s=l.dirname(o);return p.has(o)||p.set(o,i.mkdir(s,{recursive:!0}).then(async()=>(await a(e.target,o,{overwrite:!1}),e.moved=!0,e.moved)).catch(e=>{if(!e.message.startsWith(`The destination file exists`))throw Object.assign(e,{code:`EEXIST`})}).finally(()=>{p.delete(o)})),p.get(o)}function x(e,t){let n=Error(`Bad data size: expected inserted data to be ${e} bytes, but got ${t} instead`);return n.expected=e,n.found=t,n.code=`EBADSIZE`,n}function S(e,t){let n=Error(`Integrity check failed:
438
438
  Wanted: ${e}
439
439
  Found: ${t}`);return n.code=`EINTEGRITY`,n.expected=e,n.found=t,n}})),dc=s(((e,t)=>{var n=ac(),r=oc(),i=uc(),a=Es(),{PassThrough:o}=Ds(),s=ks(),c=e=>({algorithms:[`sha512`],...e});t.exports=l;async function l(e,t,a,o={}){let{memoize:s}=o;o=c(o);let l=await i(e,a,o),u=await n.insert(e,t,l.integrity,{...o,size:l.size});return s&&r.put(e,u,a,o),l.integrity}t.exports.stream=u;function u(e,t,l={}){let{memoize:u}=l;l=c(l);let d,f,p,m,h=new s;if(u){let e=new o().on(`collect`,e=>{m=e});h.push(e)}let g=i.stream(e,l).on(`integrity`,e=>{d=e}).on(`size`,e=>{f=e}).on(`error`,e=>{p=e});return h.push(g),h.push(new a({async flush(){if(!p){let i=await n.insert(e,t,d,{...l,size:f});u&&m&&r.put(e,i,m,l),h.emit(`integrity`,d),h.emit(`size`,f)}}})),h}})),fc=s((e=>{var t=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),n=t(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.range=e.balanced=void 0,e.balanced=(n,r,i)=>{let a=n instanceof RegExp?t(n,i):n,o=r instanceof RegExp?t(r,i):r,s=a!==null&&o!=null&&(0,e.range)(a,o,i);return s&&{start:s[0],end:s[1],pre:i.slice(0,s[0]),body:i.slice(s[0]+a.length,s[1]),post:i.slice(s[1]+o.length)}};var t=(e,t)=>{let n=t.match(e);return n?n[0]:null};e.range=(e,t,n)=>{let r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;){if(u===c)r.push(u),c=n.indexOf(e,u+1);else if(r.length===1){let e=r.pop();e!==void 0&&(s=[e,l])}else i=r.pop(),i!==void 0&&i<a&&(a=i,o=l),l=n.indexOf(t,u+1);u=c<l&&c>=0?c:l}r.length&&o!==void 0&&(s=[a,o])}return s}}),r=t(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EXPANSION_MAX=void 0,e.expand=S;var t=n(),r=`\0SLASH`+Math.random()+`\0`,i=`\0OPEN`+Math.random()+`\0`,a=`\0CLOSE`+Math.random()+`\0`,o=`\0COMMA`+Math.random()+`\0`,s=`\0PERIOD`+Math.random()+`\0`,c=new RegExp(r,`g`),l=new RegExp(i,`g`),u=new RegExp(a,`g`),d=new RegExp(o,`g`),f=new RegExp(s,`g`),p=/\\\\/g,m=/\\{/g,h=/\\}/g,g=/\\,/g,_=/\\./g;e.EXPANSION_MAX=1e5;function v(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function y(e){return e.replace(p,r).replace(m,i).replace(h,a).replace(g,o).replace(_,s)}function b(e){return e.replace(c,`\\`).replace(l,`{`).replace(u,`}`).replace(d,`,`).replace(f,`.`)}function x(e){if(!e)return[``];let n=[],r=(0,t.balanced)(`{`,`}`,e);if(!r)return e.split(`,`);let{pre:i,body:a,post:o}=r,s=i.split(`,`);s[s.length-1]+=`{`+a+`}`;let c=x(o);return o.length&&(s[s.length-1]+=c.shift(),s.push.apply(s,c)),n.push.apply(n,s),n}function S(t,n={}){if(!t)return[];let{max:r=e.EXPANSION_MAX}=n;return t.slice(0,2)===`{}`&&(t=`\\{\\}`+t.slice(2)),D(y(t),r,!0).map(b)}function C(e){return`{`+e+`}`}function w(e){return/^-?0\d/.test(e)}function T(e,t){return e<=t}function E(e,t){return e>=t}function D(e,n,r){let i=[],o=(0,t.balanced)(`{`,`}`,e);if(!o)return[e];let s=o.pre,c=o.post.length?D(o.post,n,!1):[``];if(/\$$/.test(o.pre))for(let e=0;e<c.length&&e<n;e++){let t=s+`{`+o.body+`}`+c[e];i.push(t)}else{let t=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body),u=t||l,d=o.body.indexOf(`,`)>=0;if(!u&&!d)return o.post.match(/,(?!,).*\}/)?(e=o.pre+`{`+o.body+a+o.post,D(e,n,!0)):[e];let f;if(u)f=o.body.split(/\.\./);else if(f=x(o.body),f.length===1&&f[0]!==void 0&&(f=D(f[0],n,!1).map(C),f.length===1))return c.map(e=>o.pre+f[0]+e);let p;if(u&&f[0]!==void 0&&f[1]!==void 0){let e=v(f[0]),t=v(f[1]),n=Math.max(f[0].length,f[1].length),r=f.length===3&&f[2]!==void 0?Math.abs(v(f[2])):1,i=T;t<e&&(r*=-1,i=E);let a=f.some(w);p=[];for(let o=e;i(o,t);o+=r){let e;if(l)e=String.fromCharCode(o),e===`\\`&&(e=``);else if(e=String(o),a){let t=n-e.length;if(t>0){let n=Array(t+1).join(`0`);e=o<0?`-`+n+e.slice(1):n+e}}p.push(e)}}else{p=[];for(let e=0;e<f.length;e++)p.push.apply(p,D(f[e],n,!1))}for(let e=0;e<p.length;e++)for(let t=0;t<c.length&&i.length<n;t++){let n=s+p[e]+c[t];(!r||u||n)&&i.push(n)}}return i}}),i=t(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.assertValidPattern=void 0;var t=1024*64;e.assertValidPattern=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>t)throw TypeError(`pattern is too long`)}}),a=t(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseClass=void 0;var t={"[:alnum:]":[`\\p{L}\\p{Nl}\\p{Nd}`,!0],"[:alpha:]":[`\\p{L}\\p{Nl}`,!0],"[:ascii:]":[`\\x00-\\x7f`,!1],"[:blank:]":[`\\p{Zs}\\t`,!0],"[:cntrl:]":[`\\p{Cc}`,!0],"[:digit:]":[`\\p{Nd}`,!0],"[:graph:]":[`\\p{Z}\\p{C}`,!0,!0],"[:lower:]":[`\\p{Ll}`,!0],"[:print:]":[`\\p{C}`,!0],"[:punct:]":[`\\p{P}`,!0],"[:space:]":[`\\p{Z}\\t\\r\\n\\v\\f`,!0],"[:upper:]":[`\\p{Lu}`,!0],"[:word:]":[`\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}`,!0],"[:xdigit:]":[`A-Fa-f0-9`,!1]},n=e=>e.replace(/[[\]\\-]/g,`\\$&`),r=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),i=e=>e.join(``);e.parseClass=(e,a)=>{let o=a;if(e.charAt(o)!==`[`)throw Error(`not in a brace expression`);let s=[],c=[],l=o+1,u=!1,d=!1,f=!1,p=!1,m=o,h=``;t:for(;l<e.length;){let r=e.charAt(l);if((r===`!`||r===`^`)&&l===o+1){p=!0,l++;continue}if(r===`]`&&u&&!f){m=l+1;break}if(u=!0,r===`\\`&&!f){f=!0,l++;continue}if(r===`[`&&!f){for(let[n,[r,i,a]]of Object.entries(t))if(e.startsWith(n,l)){if(h)return[`$.`,!1,e.length-o,!0];l+=n.length,a?c.push(r):s.push(r),d||=i;continue t}}if(f=!1,h){r>h?s.push(n(h)+`-`+n(r)):r===h&&s.push(n(r)),h=``,l++;continue}if(e.startsWith(`-]`,l+1)){s.push(n(r+`-`)),l+=2;continue}if(e.startsWith(`-`,l+1)){h=r,l+=2;continue}s.push(n(r)),l++}if(m<l)return[``,!1,0,!1];if(!s.length&&!c.length)return[`$.`,!1,e.length-o,!0];if(c.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!p)return[r(s[0].length===2?s[0].slice(-1):s[0]),!1,m-o,!1];let g=`[`+(p?`^`:``)+i(s)+`]`,_=`[`+(p?``:`^`)+i(c)+`]`;return[s.length&&c.length?`(`+g+`|`+_+`)`:s.length?g:_,d,m-o,!0]}}),o=t(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.unescape=void 0,e.unescape=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^\/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,`$1$2`).replace(/\\([^\/])/g,`$1`):t?e.replace(/\[([^\/\\{}])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,`$1$2`).replace(/\\([^\/{}])/g,`$1`)}),s=t(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AST=void 0;var t=a(),n=o(),r=new Set([`!`,`?`,`+`,`*`,`@`]),i=e=>r.has(e),s=`(?!(?:^|/)\\.\\.?(?:$|/))`,c=`(?!\\.)`,l=new Set([`[`,`.`]),u=new Set([`..`,`.`]),d=new Set(`().*{}+?[]^$\\!`),f=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),p=`[^/]`,m=p+`*?`,h=p+`+?`;e.AST=class e{type;#e;#t;#n=!1;#r=[];#i;#a;#o;#s=!1;#c;#l;#u=!1;constructor(e,t,n={}){this.type=e,e&&(this.#t=!0),this.#i=t,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#o=this.#e===this?[]:this.#e.#o,e===`!`&&!this.#e.#s&&this.#o.push(this),this.#a=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!=`string`&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#l===void 0?this.type?this.#l=this.type+`(`+this.#r.map(e=>String(e)).join(`|`)+`)`:this.#l=this.#r.map(e=>String(e)).join(``):this.#l}#d(){if(this!==this.#e)throw Error(`should only call on root`);if(this.#s)return this;this.toString(),this.#s=!0;let e;for(;e=this.#o.pop();){if(e.type!==`!`)continue;let t=e,n=t.#i;for(;n;){for(let r=t.#a+1;!n.type&&r<n.#r.length;r++)for(let t of e.#r){if(typeof t==`string`)throw Error(`string part in extglob AST??`);t.copyIn(n.#r[r])}t=n,n=t.#i}}return this}push(...t){for(let n of t)if(n!==``){if(typeof n!=`string`&&!(n instanceof e&&n.#i===this))throw Error(`invalid part: `+n);this.#r.push(n)}}toJSON(){let e=this.type===null?this.#r.slice().map(e=>typeof e==`string`?e:e.toJSON()):[this.type,...this.#r.map(e=>e.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#s&&this.#i?.type===`!`)&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let t=this.#i;for(let n=0;n<this.#a;n++){let r=t.#r[n];if(!(r instanceof e&&r.type===`!`))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type===`!`)return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#r.length:0;return this.#a===e-1}copyIn(e){typeof e==`string`?this.push(e):this.push(e.clone(this))}clone(t){let n=new e(this.type,t);for(let e of this.#r)n.copyIn(e);return n}static#f(t,n,r,a){let o=!1,s=!1,c=-1,l=!1;if(n.type===null){let u=r,d=``;for(;u<t.length;){let r=t.charAt(u++);if(o||r===`\\`){o=!o,d+=r;continue}if(s){u===c+1?(r===`^`||r===`!`)&&(l=!0):r===`]`&&!(u===c+2&&l)&&(s=!1),d+=r;continue}else if(r===`[`){s=!0,c=u,l=!1,d+=r;continue}if(!a.noext&&i(r)&&t.charAt(u)===`(`){n.push(d),d=``;let i=new e(r,n);u=e.#f(t,i,u,a),n.push(i);continue}d+=r}return n.push(d),u}let u=r+1,d=new e(null,n),f=[],p=``;for(;u<t.length;){let r=t.charAt(u++);if(o||r===`\\`){o=!o,p+=r;continue}if(s){u===c+1?(r===`^`||r===`!`)&&(l=!0):r===`]`&&!(u===c+2&&l)&&(s=!1),p+=r;continue}else if(r===`[`){s=!0,c=u,l=!1,p+=r;continue}if(i(r)&&t.charAt(u)===`(`){d.push(p),p=``;let n=new e(r,d);d.push(n),u=e.#f(t,n,u,a);continue}if(r===`|`){d.push(p),p=``,f.push(d),d=new e(null,n);continue}if(r===`)`)return p===``&&n.#r.length===0&&(n.#u=!0),d.push(p),p=``,n.push(...f,d),u;p+=r}return n.type=null,n.#t=void 0,n.#r=[t.substring(r-1)],u}static fromGlob(t,n={}){let r=new e(null,void 0,n);return e.#f(t,r,0,n),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,n,r,i]=this.toRegExpSource();if(!(r||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#c.nocase?`i`:``)+(i?`u`:``);return Object.assign(RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(t){let r=t??!!this.#c.dot;if(this.#e===this&&this.#d(),!this.type){let i=this.isStart()&&this.isEnd()&&!this.#r.some(e=>typeof e!=`string`),a=this.#r.map(n=>{let[r,a,o,s]=typeof n==`string`?e.#m(n,this.#t,i):n.toRegExpSource(t);return this.#t=this.#t||o,this.#n=this.#n||s,r}).join(``),o=``;if(this.isStart()&&typeof this.#r[0]==`string`&&!(this.#r.length===1&&u.has(this.#r[0]))){let e=l,n=r&&e.has(a.charAt(0))||a.startsWith(`\\.`)&&e.has(a.charAt(2))||a.startsWith(`\\.\\.`)&&e.has(a.charAt(4)),i=!r&&!t&&e.has(a.charAt(0));o=n?s:i?c:``}let d=``;return this.isEnd()&&this.#e.#s&&this.#i?.type===`!`&&(d=`(?:$|\\/)`),[o+a+d,(0,n.unescape)(a),this.#t=!!this.#t,this.#n]}let i=this.type===`*`||this.type===`+`,a=this.type===`!`?`(?:(?!(?:`:`(?:`,o=this.#p(r);if(this.isStart()&&this.isEnd()&&!o&&this.type!==`!`){let e=this.toString();return this.#r=[e],this.type=null,this.#t=void 0,[e,(0,n.unescape)(this.toString()),!1,!1]}let d=!i||t||r||!c?``:this.#p(!0);d===o&&(d=``),d&&(o=`(?:${o})(?:${d})*?`);let f=``;if(this.type===`!`&&this.#u)f=(this.isStart()&&!r?c:``)+h;else{let e=this.type===`!`?`))`+(this.isStart()&&!r&&!t?c:``)+m+`)`:this.type===`@`?`)`:this.type===`?`?`)?`:this.type===`+`&&d?`)`:this.type===`*`&&d?`)?`:`)${this.type}`;f=a+o+e}return[f,(0,n.unescape)(o),this.#t=!!this.#t,this.#n]}#p(e){return this.#r.map(t=>{if(typeof t==`string`)throw Error(`string type in extglob ast??`);let[n,r,i,a]=t.toRegExpSource(e);return this.#n=this.#n||a,n}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join(`|`)}static#m(e,r,i=!1){let a=!1,o=``,s=!1,c=!1;for(let n=0;n<e.length;n++){let l=e.charAt(n);if(a){a=!1,o+=(d.has(l)?`\\`:``)+l;continue}if(l===`*`){if(c)continue;c=!0,o+=i&&/^[*]+$/.test(e)?h:m,r=!0;continue}else c=!1;if(l===`\\`){n===e.length-1?o+=`\\\\`:a=!0;continue}if(l===`[`){let[i,a,c,l]=(0,t.parseClass)(e,n);if(c){o+=i,s||=a,n+=c-1,r||=l;continue}}if(l===`?`){o+=p,r=!0;continue}o+=f(l)}return[o,(0,n.unescape)(e),!!r,s]}}}),c=t(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.escape=void 0,e.escape=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,`[$&]`):e.replace(/[?*()[\]\\{}]/g,`\\$&`):t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`)}),l=t(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.unescape=e.escape=e.AST=e.Minimatch=e.match=e.makeRe=e.braceExpand=e.defaults=e.filter=e.GLOBSTAR=e.sep=e.minimatch=void 0;var t=r(),n=i(),a=s(),l=c(),u=o();e.minimatch=(e,t,r={})=>((0,n.assertValidPattern)(t),!r.nocomment&&t.charAt(0)===`#`?!1:new R(t,r).match(e));var d=/^\*+([^+@!?\*\[\(]*)$/,f=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),p=e=>t=>t.endsWith(e),m=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),h=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),g=/^\*+\.\*+$/,_=e=>!e.startsWith(`.`)&&e.includes(`.`),v=e=>e!==`.`&&e!==`..`&&e.includes(`.`),y=/^\.\*+$/,b=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),x=/^\*+$/,S=e=>e.length!==0&&!e.startsWith(`.`),C=e=>e.length!==0&&e!==`.`&&e!==`..`,w=/^\?+([^+@!?\*\[\(]*)?$/,T=([e,t=``])=>{let n=k([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},E=([e,t=``])=>{let n=A([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},D=([e,t=``])=>{let n=A([e]);return t?e=>n(e)&&e.endsWith(t):n},O=([e,t=``])=>{let n=k([e]);return t?e=>n(e)&&e.endsWith(t):n},k=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},A=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},j=typeof process==`object`&&process?typeof process.env==`object`&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,M={win32:{sep:`\\`},posix:{sep:`/`}};e.sep=j===`win32`?M.win32.sep:M.posix.sep,e.minimatch.sep=e.sep,e.GLOBSTAR=Symbol(`globstar **`),e.minimatch.GLOBSTAR=e.GLOBSTAR;var ee=`[^/]*?`,N=`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`,P=`(?:(?!(?:\\/|^)\\.).)*?`;e.filter=(t,n={})=>r=>(0,e.minimatch)(r,t,n),e.minimatch.filter=e.filter;var F=(e,t={})=>Object.assign({},e,t);e.defaults=t=>{if(!t||typeof t!=`object`||!Object.keys(t).length)return e.minimatch;let n=e.minimatch;return Object.assign((e,r,i={})=>n(e,r,F(t,i)),{Minimatch:class extends n.Minimatch{constructor(e,n={}){super(e,F(t,n))}static defaults(e){return n.defaults(F(t,e)).Minimatch}},AST:class extends n.AST{constructor(e,n,r={}){super(e,n,F(t,r))}static fromGlob(e,r={}){return n.AST.fromGlob(e,F(t,r))}},unescape:(e,r={})=>n.unescape(e,F(t,r)),escape:(e,r={})=>n.escape(e,F(t,r)),filter:(e,r={})=>n.filter(e,F(t,r)),defaults:e=>n.defaults(F(t,e)),makeRe:(e,r={})=>n.makeRe(e,F(t,r)),braceExpand:(e,r={})=>n.braceExpand(e,F(t,r)),match:(e,r,i={})=>n.match(e,r,F(t,i)),sep:n.sep,GLOBSTAR:e.GLOBSTAR})},e.minimatch.defaults=e.defaults,e.braceExpand=(e,r={})=>((0,n.assertValidPattern)(e),r.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:(0,t.expand)(e,{max:r.braceExpandMax})),e.minimatch.braceExpand=e.braceExpand,e.makeRe=(e,t={})=>new R(e,t).makeRe(),e.minimatch.makeRe=e.makeRe,e.match=(e,t,n={})=>{let r=new R(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e},e.minimatch.match=e.match;var I=/[?*]|[+@!]\(.*?\)|\[|\]/,L=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),R=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){(0,n.assertValidPattern)(e),t||={},this.options=t,this.pattern=e,this.platform=t.platform||j,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!!(this.isWindows&&this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(e=>this.slashSplit(e));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=e[0]===``&&e[1]===``&&(e[2]===`?`||!I.test(e[2]))&&!I.test(e[3]),n=/^[a-z]:/i.test(e[0]);if(t)return[...e.slice(0,4),...e.slice(4).map(e=>this.parse(e))];if(n)return[e[0],...e.slice(1).map(e=>this.parse(e))]}return e.map(e=>this.parse(e))});if(this.debug(this.pattern,r),this.set=r.filter(e=>e.indexOf(!1)===-1),this.isWindows)for(let e=0;e<this.set.length;e++){let t=this.set[e];t[0]===``&&t[1]===``&&this.globParts[e][2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3])&&(t[2]=`?`)}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let t=0;t<e.length;t++)for(let n=0;n<e[t].length;n++)e[t][n]===`**`&&(e[t][n]=`*`);let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e})}levelOneOptimize(e){return e.map(e=>(e=e.reduce((e,t)=>{let n=e[e.length-1];return t===`**`&&n===`**`?e:t===`..`&&n&&n!==`..`&&n!==`.`&&n!==`**`?(e.pop(),e):(e.push(t),e)},[]),e.length===0?[``]:e))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let r=e[n];n===1&&r===``&&e[0]===``||(r===`.`||r===``)&&(t=!0,e.splice(n,1),n--)}e[0]===`.`&&e.length===2&&(e[1]===`.`||e[1]===``)&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf(`..`,n+1))!==-1;){let r=e[n-1];r&&r!==`.`&&r!==`..`&&r!==`**`&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[``]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let r=-1;for(;(r=n.indexOf(`**`,r+1))!==-1;){let i=r;for(;n[i+1]===`**`;)i++;i>r&&n.splice(r+1,i-r);let a=n[r+1],o=n[r+2],s=n[r+3];if(a!==`..`||!o||o===`.`||o===`..`||!s||s===`.`||s===`..`)continue;t=!0,n.splice(r,1);let c=n.slice(0);c[r]=`**`,e.push(c),r--}if(!this.preserveMultipleSlashes){for(let e=1;e<n.length-1;e++){let r=n[e];e===1&&r===``&&n[0]===``||(r===`.`||r===``)&&(t=!0,n.splice(e,1),e--)}n[0]===`.`&&n.length===2&&(n[1]===`.`||n[1]===``)&&(t=!0,n.pop())}let i=0;for(;(i=n.indexOf(`..`,i+1))!==-1;){let e=n[i-1];if(e&&e!==`.`&&e!==`..`&&e!==`**`){t=!0;let e=i===1&&n[i+1]===`**`?[`.`]:[];n.splice(i-1,2,...e),n.length===0&&n.push(``),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let r=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(r){e[t]=[],e[n]=r;break}}return e.filter(e=>e.length)}partsMatch(e,t,n=!1){let r=0,i=0,a=[],o=``;for(;r<e.length&&i<t.length;)if(e[r]===t[i])a.push(o===`b`?t[i]:e[r]),r++,i++;else if(n&&e[r]===`**`&&t[i]===e[r+1])a.push(e[r]),r++;else if(n&&t[i]===`**`&&e[r]===t[i+1])a.push(t[i]),i++;else if(e[r]===`*`&&t[i]&&(this.options.dot||!t[i].startsWith(`.`))&&t[i]!==`**`){if(o===`b`)return!1;o=`a`,a.push(e[r]),r++,i++}else if(t[i]===`*`&&e[r]&&(this.options.dot||!e[r].startsWith(`.`))&&e[r]!==`**`){if(o===`a`)return!1;o=`b`,a.push(t[i]),r++,i++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)===`!`;r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(t,n,r=!1){let i=this.options;if(this.isWindows){let e=typeof t[0]==`string`&&/^[a-z]:$/i.test(t[0]),r=!e&&t[0]===``&&t[1]===``&&t[2]===`?`&&/^[a-z]:$/i.test(t[3]),i=typeof n[0]==`string`&&/^[a-z]:$/i.test(n[0]),a=!i&&n[0]===``&&n[1]===``&&n[2]===`?`&&typeof n[3]==`string`&&/^[a-z]:$/i.test(n[3]),o=r?3:e?0:void 0,s=a?3:i?0:void 0;if(typeof o==`number`&&typeof s==`number`){let[e,r]=[t[o],n[s]];e.toLowerCase()===r.toLowerCase()&&(n[s]=e,s>o?n=n.slice(s):o>s&&(t=t.slice(o)))}}let{optimizationLevel:a=1}=this.options;a>=2&&(t=this.levelTwoFileOptimize(t)),this.debug(`matchOne`,this,{file:t,pattern:n}),this.debug(`matchOne`,t.length,n.length);for(var o=0,s=0,c=t.length,l=n.length;o<c&&s<l;o++,s++){this.debug(`matchOne loop`);var u=n[s],d=t[o];if(this.debug(n,u,d),u===!1)return!1;if(u===e.GLOBSTAR){this.debug(`GLOBSTAR`,[n,u,d]);var f=o,p=s+1;if(p===l){for(this.debug(`** at the end`);o<c;o++)if(t[o]===`.`||t[o]===`..`||!i.dot&&t[o].charAt(0)===`.`)return!1;return!0}for(;f<c;){var m=t[f];if(this.debug(`
440
440
  globstar while`,t,f,n,p,m),this.matchOne(t.slice(f),n.slice(p),r))return this.debug(`globstar found match!`,f,c,m),!0;if(m===`.`||m===`..`||!i.dot&&m.charAt(0)===`.`){this.debug(`dot detected!`,t,f,n,p);break}this.debug(`globstar swallow a segment, and continue`),f++}return!!(r&&(this.debug(`
441
- >>> no match, partial?`,t,f,n,p),f===c))}let a;if(typeof u==`string`?(a=d===u,this.debug(`string match`,u,d,a)):(a=u.test(d),this.debug(`pattern match`,u,d,a)),!a)return!1}if(o===c&&s===l)return!0;if(o===c)return r;if(s===l)return o===c-1&&t[o]===``;throw Error(`wtf?`)}braceExpand(){return(0,e.braceExpand)(this.pattern,this.options)}parse(t){(0,n.assertValidPattern)(t);let r=this.options;if(t===`**`)return e.GLOBSTAR;if(t===``)return``;let i,o=null;(i=t.match(x))?o=r.dot?C:S:(i=t.match(d))?o=(r.nocase?r.dot?h:m:r.dot?p:f)(i[1]):(i=t.match(w))?o=(r.nocase?r.dot?E:T:r.dot?D:O)(i):(i=t.match(g))?o=r.dot?v:_:(i=t.match(y))&&(o=b);let s=a.AST.fromGlob(t,this.options).toMMPattern();return o&&typeof s==`object`&&Reflect.defineProperty(s,"test",{value:o}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?ee:n.dot?N:P,i=new Set(n.nocase?[`i`]:[]),a=t.map(t=>{let n=t.map(t=>{if(t instanceof RegExp)for(let e of t.flags.split(``))i.add(e);return typeof t==`string`?L(t):t===e.GLOBSTAR?e.GLOBSTAR:t._src});n.forEach((t,i)=>{let a=n[i+1],o=n[i-1];t!==e.GLOBSTAR||o===e.GLOBSTAR||(o===void 0?a!==void 0&&a!==e.GLOBSTAR?n[i+1]=`(?:\\/|`+r+`\\/)?`+a:n[i]=r:a===void 0?n[i-1]=o+`(?:\\/|\\/`+r+`)?`:a!==e.GLOBSTAR&&(n[i-1]=o+`(?:\\/|\\/`+r+`\\/)`+a,n[i+1]=e.GLOBSTAR))});let a=n.filter(t=>t!==e.GLOBSTAR);if(this.partial&&a.length>=1){let e=[];for(let t=1;t<=a.length;t++)e.push(a.slice(0,t).join(`/`));return`(?:`+e.join(`|`)+`)`}return a.join(`/`)}).join(`|`),[o,s]=t.length>1?[`(?:`,`)`]:[``,``];a=`^`+o+a+s+`$`,this.partial&&(a=`^(?:\\/|`+o+a.slice(1,-1)+s+`)$`),this.negate&&(a=`^(?!`+a+`).+$`);try{this.regexp=new RegExp(a,[...i].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^\/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e=0;e<i.length;e++){let o=i[e],s=r;if(n.matchBase&&o.length===1&&(s=[a]),this.matchOne(s,o,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(t){return e.minimatch.defaults(t).Minimatch}};e.Minimatch=R;var te=s();Object.defineProperty(e,"AST",{enumerable:!0,get:function(){return te.AST}});var z=c();Object.defineProperty(e,"escape",{enumerable:!0,get:function(){return z.escape}});var B=o();Object.defineProperty(e,"unescape",{enumerable:!0,get:function(){return B.unescape}}),e.minimatch.AST=a.AST,e.minimatch.Minimatch=R,e.minimatch.escape=l.escape,e.minimatch.unescape=u.unescape}),u=t(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=void 0;var t=typeof performance==`object`&&performance&&typeof performance.now==`function`?performance:Date,n=new Set,r=typeof process==`object`&&process?process:{},i=(e,t,n,i)=>{typeof r.emitWarning==`function`?r.emitWarning(e,t,n,i):console.error(`[${n}] ${t}: ${e}`)},a=globalThis.AbortController,o=globalThis.AbortSignal;if(typeof a>`u`){o=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},a=class{constructor(){t()}signal=new o;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(let t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e=r.env?.LRU_CACHE_IGNORE_AC_WARNING!==`1`,t=()=>{e&&(e=!1,i("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.",`NO_ABORT_CONTROLLER`,`ENOTSUP`,t))}}var s=e=>!n.has(e),c=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),l=e=>c(e)?e<=2**8?Uint8Array:e<=2**16?Uint16Array:e<=2**32?Uint32Array:e<=2**53-1?u:null:null,u=class extends Array{constructor(e){super(e),this.fill(0)}},d=class e{heap;length;static#e=!1;static create(t){let n=l(t);if(!n)return[];e.#e=!0;let r=new e(t,n);return e.#e=!1,r}constructor(t,n){if(!e.#e)throw TypeError(`instantiate Stack using Stack.create(n)`);this.heap=new n(t),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};e.LRUCache=class e{#e;#t;#n;#r;#i;#a;#o;#s;get perf(){return this.#s}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;#C;#w;#T;#E;static unsafeExposeInternals(e){return{starts:e.#b,ttls:e.#x,autopurgeTimers:e.#S,sizes:e.#y,keyMap:e.#u,keyList:e.#d,valList:e.#f,next:e.#p,prev:e.#m,get head(){return e.#h},get tail(){return e.#g},free:e.#_,isBackgroundFetch:t=>e.#V(t),backgroundFetch:(t,n,r,i)=>e.#B(t,n,r,i),moveToTail:t=>e.#U(t),indexes:t=>e.#I(t),rindexes:t=>e.#L(t),isStale:t=>e.#j(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#l}get size(){return this.#c}get fetchMethod(){return this.#a}get memoMethod(){return this.#o}get dispose(){return this.#n}get onInsert(){return this.#r}get disposeAfter(){return this.#i}constructor(r){let{max:a=0,ttl:o,ttlResolution:u=1,ttlAutopurge:f,updateAgeOnGet:p,updateAgeOnHas:m,allowStale:h,dispose:g,onInsert:_,disposeAfter:v,noDisposeOnSet:y,noUpdateTTL:b,maxSize:x=0,maxEntrySize:S=0,sizeCalculation:C,fetchMethod:w,memoMethod:T,noDeleteOnFetchRejection:E,noDeleteOnStaleGet:D,allowStaleOnFetchRejection:O,allowStaleOnFetchAbort:k,ignoreFetchAbort:A,perf:j}=r;if(j!==void 0&&typeof j?.now!=`function`)throw TypeError(`perf option must have a now() method if specified`);if(this.#s=j??t,a!==0&&!c(a))throw TypeError(`max option must be a nonnegative integer`);let M=a?l(a):Array;if(!M)throw Error(`invalid max value: `+a);if(this.#e=a,this.#t=x,this.maxEntrySize=S||this.#t,this.sizeCalculation=C,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw TypeError(`cannot set sizeCalculation without setting maxSize or maxEntrySize`);if(typeof this.sizeCalculation!=`function`)throw TypeError(`sizeCalculation set to non-function`)}if(T!==void 0&&typeof T!=`function`)throw TypeError(`memoMethod must be a function if defined`);if(this.#o=T,w!==void 0&&typeof w!=`function`)throw TypeError(`fetchMethod must be a function if specified`);if(this.#a=w,this.#w=!!w,this.#u=new Map,this.#d=Array(a).fill(void 0),this.#f=Array(a).fill(void 0),this.#p=new M(a),this.#m=new M(a),this.#h=0,this.#g=0,this.#_=d.create(a),this.#c=0,this.#l=0,typeof g==`function`&&(this.#n=g),typeof _==`function`&&(this.#r=_),typeof v==`function`?(this.#i=v,this.#v=[]):(this.#i=void 0,this.#v=void 0),this.#C=!!this.#n,this.#E=!!this.#r,this.#T=!!this.#i,this.noDisposeOnSet=!!y,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!E,this.allowStaleOnFetchRejection=!!O,this.allowStaleOnFetchAbort=!!k,this.ignoreFetchAbort=!!A,this.maxEntrySize!==0){if(this.#t!==0&&!c(this.#t))throw TypeError(`maxSize must be a positive integer if specified`);if(!c(this.maxEntrySize))throw TypeError(`maxEntrySize must be a positive integer if specified`);this.#M()}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!D,this.updateAgeOnGet=!!p,this.updateAgeOnHas=!!m,this.ttlResolution=c(u)||u===0?u:1,this.ttlAutopurge=!!f,this.ttl=o||0,this.ttl){if(!c(this.ttl))throw TypeError(`ttl must be a positive integer if specified`);this.#D()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw TypeError(`At least one of max, maxSize, or ttl is required`);if(!this.ttlAutopurge&&!this.#e&&!this.#t){let t=`LRU_CACHE_UNBOUNDED`;s(t)&&(n.add(t),i(`TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.`,`UnboundedCacheWarning`,t,e))}}getRemainingTTL(e){return this.#u.has(e)?1/0:0}#D(){let e=new u(this.#e),t=new u(this.#e);this.#x=e,this.#b=t;let n=this.ttlAutopurge?Array(this.#e):void 0;this.#S=n,this.#A=(r,i,a=this.#s.now())=>{if(t[r]=i===0?0:a,e[r]=i,n?.[r]&&(clearTimeout(n[r]),n[r]=void 0),i!==0&&n){let e=setTimeout(()=>{this.#j(r)&&this.#W(this.#d[r],`expire`)},i+1);e.unref&&e.unref(),n[r]=e}},this.#O=n=>{t[n]=e[n]===0?0:this.#s.now()},this.#k=(n,a)=>{if(e[a]){let o=e[a],s=t[a];if(!o||!s)return;n.ttl=o,n.start=s,n.now=r||i(),n.remainingTTL=o-(n.now-s)}};let r=0,i=()=>{let e=this.#s.now();if(this.ttlResolution>0){r=e;let t=setTimeout(()=>r=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=n=>{let a=this.#u.get(n);if(a===void 0)return 0;let o=e[a],s=t[a];return!o||!s?1/0:o-((r||i())-s)},this.#j=n=>{let a=t[n],o=e[n];return!!o&&!!a&&(r||i())-a>o}}#O=()=>{};#k=()=>{};#A=()=>{};#j=()=>!1;#M(){let e=new u(this.#e);this.#l=0,this.#y=e,this.#N=t=>{this.#l-=e[t],e[t]=0},this.#F=(e,t,n,r)=>{if(this.#V(t))return 0;if(!c(n))if(r){if(typeof r!=`function`)throw TypeError(`sizeCalculation must be a function`);if(n=r(t,e),!c(n))throw TypeError(`sizeCalculation return invalid (expect positive integer)`)}else throw TypeError(`invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.`);return n},this.#P=(t,n,r)=>{if(e[t]=n,this.#t){let n=this.#t-e[t];for(;this.#l>n;)this.#z(!0)}this.#l+=e[t],r&&(r.entrySize=n,r.totalCalculatedSize=this.#l)}}#N=e=>{};#P=(e,t,n)=>{};#F=(e,t,n,r)=>{if(n||r)throw TypeError(`cannot set size without setting maxSize or maxEntrySize on cache`);return 0};*#I({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#g;!(!this.#R(t)||((e||!this.#j(t))&&(yield t),t===this.#h));)t=this.#m[t]}*#L({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#h;!(!this.#R(t)||((e||!this.#j(t))&&(yield t),t===this.#g));)t=this.#p[t]}#R(e){return e!==void 0&&this.#u.get(this.#d[e])===e}*entries(){for(let e of this.#I())this.#f[e]!==void 0&&this.#d[e]!==void 0&&!this.#V(this.#f[e])&&(yield[this.#d[e],this.#f[e]])}*rentries(){for(let e of this.#L())this.#f[e]!==void 0&&this.#d[e]!==void 0&&!this.#V(this.#f[e])&&(yield[this.#d[e],this.#f[e]])}*keys(){for(let e of this.#I()){let t=this.#d[e];t!==void 0&&!this.#V(this.#f[e])&&(yield t)}}*rkeys(){for(let e of this.#L()){let t=this.#d[e];t!==void 0&&!this.#V(this.#f[e])&&(yield t)}}*values(){for(let e of this.#I())this.#f[e]!==void 0&&!this.#V(this.#f[e])&&(yield this.#f[e])}*rvalues(){for(let e of this.#L())this.#f[e]!==void 0&&!this.#V(this.#f[e])&&(yield this.#f[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]=`LRUCache`;find(e,t={}){for(let n of this.#I()){let r=this.#f[n],i=this.#V(r)?r.__staleWhileFetching:r;if(i!==void 0&&e(i,this.#d[n],this))return this.get(this.#d[n],t)}}forEach(e,t=this){for(let n of this.#I()){let r=this.#f[n],i=this.#V(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#d[n],this)}}rforEach(e,t=this){for(let n of this.#L()){let r=this.#f[n],i=this.#V(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#d[n],this)}}purgeStale(){let e=!1;for(let t of this.#L({allowStale:!0}))this.#j(t)&&(this.#W(this.#d[t],`expire`),e=!0);return e}info(e){let t=this.#u.get(e);if(t===void 0)return;let n=this.#f[t],r=this.#V(n)?n.__staleWhileFetching:n;if(r===void 0)return;let i={value:r};if(this.#x&&this.#b){let e=this.#x[t],n=this.#b[t];e&&n&&(i.ttl=e-(this.#s.now()-n),i.start=Date.now())}return this.#y&&(i.size=this.#y[t]),i}dump(){let e=[];for(let t of this.#I({allowStale:!0})){let n=this.#d[t],r=this.#f[t],i=this.#V(r)?r.__staleWhileFetching:r;if(i===void 0||n===void 0)continue;let a={value:i};if(this.#x&&this.#b){a.ttl=this.#x[t];let e=this.#s.now()-this.#b[t];a.start=Math.floor(Date.now()-e)}this.#y&&(a.size=this.#y[t]),e.unshift([n,a])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let e=Date.now()-n.start;n.start=this.#s.now()-e}this.set(t,n.value,n)}}set(e,t,n={}){if(t===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:i,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:s}=n,{noUpdateTTL:c=this.noUpdateTTL}=n,l=this.#F(e,t,n.size||0,o);if(this.maxEntrySize&&l>this.maxEntrySize)return s&&(s.set=`miss`,s.maxEntrySizeExceeded=!0),this.#W(e,`set`),this;let u=this.#c===0?void 0:this.#u.get(e);if(u===void 0)u=this.#c===0?this.#g:this.#_.length===0?this.#c===this.#e?this.#z(!1):this.#c:this.#_.pop(),this.#d[u]=e,this.#f[u]=t,this.#u.set(e,u),this.#p[this.#g]=u,this.#m[u]=this.#g,this.#g=u,this.#c++,this.#P(u,l,s),s&&(s.set=`add`),c=!1,this.#E&&this.#r?.(t,e,`add`);else{this.#U(u);let n=this.#f[u];if(t!==n){if(this.#w&&this.#V(n)){n.__abortController.abort(Error(`replaced`));let{__staleWhileFetching:t}=n;t!==void 0&&!a&&(this.#C&&this.#n?.(t,e,`set`),this.#T&&this.#v?.push([t,e,`set`]))}else a||(this.#C&&this.#n?.(n,e,`set`),this.#T&&this.#v?.push([n,e,`set`]));if(this.#N(u),this.#P(u,l,s),this.#f[u]=t,s){s.set=`replace`;let e=n&&this.#V(n)?n.__staleWhileFetching:n;e!==void 0&&(s.oldValue=e)}}else s&&(s.set=`update`);this.#E&&this.onInsert?.(t,e,t===n?`update`:`replace`)}if(r!==0&&!this.#x&&this.#D(),this.#x&&(c||this.#A(u,r,i),s&&this.#k(s,u)),!a&&this.#T&&this.#v){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}return this}pop(){try{for(;this.#c;){let e=this.#f[this.#h];if(this.#z(!0),this.#V(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#T&&this.#v){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}}}#z(e){let t=this.#h,n=this.#d[t],r=this.#f[t];return this.#w&&this.#V(r)?r.__abortController.abort(Error(`evicted`)):(this.#C||this.#T)&&(this.#C&&this.#n?.(r,n,`evict`),this.#T&&this.#v?.push([r,n,`evict`])),this.#N(t),this.#S?.[t]&&(clearTimeout(this.#S[t]),this.#S[t]=void 0),e&&(this.#d[t]=void 0,this.#f[t]=void 0,this.#_.push(t)),this.#c===1?(this.#h=this.#g=0,this.#_.length=0):this.#h=this.#p[t],this.#u.delete(n),this.#c--,t}has(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:r}=t,i=this.#u.get(e);if(i!==void 0){let e=this.#f[i];if(this.#V(e)&&e.__staleWhileFetching===void 0)return!1;if(this.#j(i))r&&(r.has=`stale`,this.#k(r,i));else return n&&this.#O(i),r&&(r.has=`hit`,this.#k(r,i)),!0}else r&&(r.has=`miss`);return!1}peek(e,t={}){let{allowStale:n=this.allowStale}=t,r=this.#u.get(e);if(r===void 0||!n&&this.#j(r))return;let i=this.#f[r];return this.#V(i)?i.__staleWhileFetching:i}#B(e,t,n,r){let i=t===void 0?void 0:this.#f[t];if(this.#V(i))return i;let o=new a,{signal:s}=n;s?.addEventListener(`abort`,()=>o.abort(s.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:r},l=(r,i=!1)=>{let{aborted:a}=o.signal,s=n.ignoreFetchAbort&&r!==void 0,l=n.ignoreFetchAbort||!!(n.allowStaleOnFetchAbort&&r!==void 0);if(n.status&&(a&&!i?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,s&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),a&&!s&&!i)return d(o.signal.reason,l);let u=p,f=this.#f[t];return(f===p||s&&i&&f===void 0)&&(r===void 0?u.__staleWhileFetching===void 0?this.#W(e,`fetch`):this.#f[t]=u.__staleWhileFetching:(n.status&&(n.status.fetchUpdated=!0),this.set(e,r,c.options))),r},u=e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),d(e,!1)),d=(r,i)=>{let{aborted:a}=o.signal,s=a&&n.allowStaleOnFetchAbort,c=s||n.allowStaleOnFetchRejection,l=c||n.noDeleteOnFetchRejection,u=p;if(this.#f[t]===p&&(!l||!i&&u.__staleWhileFetching===void 0?this.#W(e,`fetch`):s||(this.#f[t]=u.__staleWhileFetching)),c)return n.status&&u.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),u.__staleWhileFetching;if(u.__returned===u)throw r},f=(t,r)=>{let a=this.#a?.(e,i,c);a&&a instanceof Promise&&a.then(e=>t(e===void 0?void 0:e),r),o.signal.addEventListener(`abort`,()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(t(void 0),n.allowStaleOnFetchAbort&&(t=e=>l(e,!0)))})};n.status&&(n.status.fetchDispatched=!0);let p=new Promise(f).then(l,u),m=Object.assign(p,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return t===void 0?(this.set(e,m,{...c.options,status:void 0}),t=this.#u.get(e)):this.#f[t]=m,m}#V(e){if(!this.#w)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty(`__staleWhileFetching`)&&t.__abortController instanceof a}async fetch(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:s=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:h=!1,status:g,signal:_}=t;if(!this.#w)return g&&(g.fetch=`get`),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:g});let v={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:a,noDisposeOnSet:o,size:s,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:g,signal:_},y=this.#u.get(e);if(y===void 0){g&&(g.fetch=`miss`);let t=this.#B(e,y,v,m);return t.__returned=t}else{let t=this.#f[y];if(this.#V(t)){let e=n&&t.__staleWhileFetching!==void 0;return g&&(g.fetch=`inflight`,e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let i=this.#j(y);if(!h&&!i)return g&&(g.fetch=`hit`),this.#U(y),r&&this.#O(y),g&&this.#k(g,y),t;let a=this.#B(e,y,v,m),o=a.__staleWhileFetching!==void 0&&n;return g&&(g.fetch=i?`stale`:`refresh`,o&&i&&(g.returnedStale=!0)),o?a.__staleWhileFetching:a.__returned=a}}async forceFetch(e,t={}){let n=await this.fetch(e,t);if(n===void 0)throw Error(`fetch() returned undefined`);return n}memo(e,t={}){let n=this.#o;if(!n)throw Error(`no memoMethod provided to constructor`);let{context:r,forceRefresh:i,...a}=t,o=this.get(e,a);if(!i&&o!==void 0)return o;let s=n(e,o,{options:a,context:r});return this.set(e,s,a),s}get(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:a}=t,o=this.#u.get(e);if(o!==void 0){let t=this.#f[o],s=this.#V(t);return a&&this.#k(a,o),this.#j(o)?(a&&(a.get=`stale`),s?(a&&n&&t.__staleWhileFetching!==void 0&&(a.returnedStale=!0),n?t.__staleWhileFetching:void 0):(i||this.#W(e,`expire`),a&&n&&(a.returnedStale=!0),n?t:void 0)):(a&&(a.get=`hit`),s?t.__staleWhileFetching:(this.#U(o),r&&this.#O(o),t))}else a&&(a.get=`miss`)}#H(e,t){this.#m[t]=e,this.#p[e]=t}#U(e){e!==this.#g&&(e===this.#h?this.#h=this.#p[e]:this.#H(this.#m[e],this.#p[e]),this.#H(this.#g,e),this.#g=e)}delete(e){return this.#W(e,`delete`)}#W(e,t){let n=!1;if(this.#c!==0){let r=this.#u.get(e);if(r!==void 0)if(this.#S?.[r]&&(clearTimeout(this.#S?.[r]),this.#S[r]=void 0),n=!0,this.#c===1)this.#G(t);else{this.#N(r);let n=this.#f[r];if(this.#V(n)?n.__abortController.abort(Error(`deleted`)):(this.#C||this.#T)&&(this.#C&&this.#n?.(n,e,t),this.#T&&this.#v?.push([n,e,t])),this.#u.delete(e),this.#d[r]=void 0,this.#f[r]=void 0,r===this.#g)this.#g=this.#m[r];else if(r===this.#h)this.#h=this.#p[r];else{let e=this.#m[r];this.#p[e]=this.#p[r];let t=this.#p[r];this.#m[t]=this.#m[r]}this.#c--,this.#_.push(r)}}if(this.#T&&this.#v?.length){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}return n}clear(){return this.#G(`delete`)}#G(e){for(let t of this.#L({allowStale:!0})){let n=this.#f[t];if(this.#V(n))n.__abortController.abort(Error(`deleted`));else{let r=this.#d[t];this.#C&&this.#n?.(n,r,e),this.#T&&this.#v?.push([n,r,e])}}if(this.#u.clear(),this.#f.fill(void 0),this.#d.fill(void 0),this.#x&&this.#b){this.#x.fill(0),this.#b.fill(0);for(let e of this.#S??[])e!==void 0&&clearTimeout(e);this.#S?.fill(void 0)}if(this.#y&&this.#y.fill(0),this.#h=0,this.#g=0,this.#_.length=0,this.#l=0,this.#c=0,this.#T&&this.#v){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}}}}),d=t(e=>{"use strict";var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Minipass=e.isWritable=e.isReadable=e.isStream=void 0;var n=typeof process==`object`&&process?process:{stdout:null,stderr:null},r=require("node:events"),i=t(require("node:stream")),a=require("node:string_decoder");e.isStream=t=>!!t&&typeof t==`object`&&(t instanceof U||t instanceof i.default||(0,e.isReadable)(t)||(0,e.isWritable)(t)),e.isReadable=e=>!!e&&typeof e==`object`&&e instanceof r.EventEmitter&&typeof e.pipe==`function`&&e.pipe!==i.default.Writable.prototype.pipe,e.isWritable=e=>!!e&&typeof e==`object`&&e instanceof r.EventEmitter&&typeof e.write==`function`&&typeof e.end==`function`;var o=Symbol(`EOF`),s=Symbol(`maybeEmitEnd`),c=Symbol(`emittedEnd`),l=Symbol(`emittingEnd`),u=Symbol(`emittedError`),d=Symbol(`closed`),f=Symbol(`read`),p=Symbol(`flush`),m=Symbol(`flushChunk`),h=Symbol(`encoding`),g=Symbol(`decoder`),_=Symbol(`flowing`),v=Symbol(`paused`),y=Symbol(`resume`),b=Symbol(`buffer`),x=Symbol(`pipes`),S=Symbol(`bufferLength`),C=Symbol(`bufferPush`),w=Symbol(`bufferShift`),T=Symbol(`objectMode`),E=Symbol(`destroyed`),D=Symbol(`error`),O=Symbol(`emitData`),k=Symbol(`emitEnd`),A=Symbol(`emitEnd2`),j=Symbol(`async`),M=Symbol(`abort`),ee=Symbol(`aborted`),N=Symbol(`signal`),P=Symbol(`dataListeners`),F=Symbol(`discarded`),I=e=>Promise.resolve().then(e),L=e=>e(),R=e=>e===`end`||e===`finish`||e===`prefinish`,te=e=>e instanceof ArrayBuffer||!!e&&typeof e==`object`&&e.constructor&&e.constructor.name===`ArrayBuffer`&&e.byteLength>=0,z=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e),B=class{src;dest;opts;ondrain;constructor(e,t,n){this.src=e,this.dest=t,this.opts=n,this.ondrain=()=>e[y](),this.dest.on(`drain`,this.ondrain)}unpipe(){this.dest.removeListener(`drain`,this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},V=class extends B{unpipe(){this.src.removeListener(`error`,this.proxyErrors),super.unpipe()}constructor(e,t,n){super(e,t,n),this.proxyErrors=e=>this.dest.emit(`error`,e),e.on(`error`,this.proxyErrors)}},ne=e=>!!e.objectMode,H=e=>!e.objectMode&&!!e.encoding&&e.encoding!==`buffer`,U=class extends r.EventEmitter{[_]=!1;[v]=!1;[x]=[];[b]=[];[T];[h];[j];[g];[o]=!1;[c]=!1;[l]=!1;[d]=!1;[u]=null;[S]=0;[E]=!1;[N];[ee]=!1;[P]=0;[F]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding==`string`)throw TypeError(`Encoding and objectMode may not be used together`);ne(t)?(this[T]=!0,this[h]=null):H(t)?(this[h]=t.encoding,this[T]=!1):(this[T]=!1,this[h]=null),this[j]=!!t.async,this[g]=this[h]?new a.StringDecoder(this[h]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[b]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[x]});let{signal:n}=t;n&&(this[N]=n,n.aborted?this[M]():n.addEventListener(`abort`,()=>this[M]()))}get bufferLength(){return this[S]}get encoding(){return this[h]}set encoding(e){throw Error(`Encoding must be set at instantiation time`)}setEncoding(e){throw Error(`Encoding must be set at instantiation time`)}get objectMode(){return this[T]}set objectMode(e){throw Error(`objectMode must be set at instantiation time`)}get async(){return this[j]}set async(e){this[j]=this[j]||!!e}[M](){this[ee]=!0,this.emit(`abort`,this[N]?.reason),this.destroy(this[N]?.reason)}get aborted(){return this[ee]}set aborted(e){}write(e,t,n){if(this[ee])return!1;if(this[o])throw Error(`write after end`);if(this[E])return this.emit(`error`,Object.assign(Error(`Cannot call write after a stream was destroyed`),{code:`ERR_STREAM_DESTROYED`})),!0;typeof t==`function`&&(n=t,t=`utf8`),t||=`utf8`;let r=this[j]?I:L;if(!this[T]&&!Buffer.isBuffer(e)){if(z(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(te(e))e=Buffer.from(e);else if(typeof e!=`string`)throw Error(`Non-contiguous data written to non-objectMode stream`)}return this[T]?(this[_]&&this[S]!==0&&this[p](!0),this[_]?this.emit(`data`,e):this[C](e),this[S]!==0&&this.emit(`readable`),n&&r(n),this[_]):e.length?(typeof e==`string`&&!(t===this[h]&&!this[g]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[h]&&(e=this[g].write(e)),this[_]&&this[S]!==0&&this[p](!0),this[_]?this.emit(`data`,e):this[C](e),this[S]!==0&&this.emit(`readable`),n&&r(n),this[_]):(this[S]!==0&&this.emit(`readable`),n&&r(n),this[_])}read(e){if(this[E])return null;if(this[F]=!1,this[S]===0||e===0||e&&e>this[S])return this[s](),null;this[T]&&(e=null),this[b].length>1&&!this[T]&&(this[b]=[this[h]?this[b].join(``):Buffer.concat(this[b],this[S])]);let t=this[f](e||null,this[b][0]);return this[s](),t}[f](e,t){if(this[T])this[w]();else{let n=t;e===n.length||e===null?this[w]():typeof n==`string`?(this[b][0]=n.slice(e),t=n.slice(0,e),this[S]-=e):(this[b][0]=n.subarray(e),t=n.subarray(0,e),this[S]-=e)}return this.emit(`data`,t),!this[b].length&&!this[o]&&this.emit(`drain`),t}end(e,t,n){return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=`utf8`),e!==void 0&&this.write(e,t),n&&this.once(`end`,n),this[o]=!0,this.writable=!1,(this[_]||!this[v])&&this[s](),this}[y](){this[E]||(!this[P]&&!this[x].length&&(this[F]=!0),this[v]=!1,this[_]=!0,this.emit(`resume`),this[b].length?this[p]():this[o]?this[s]():this.emit(`drain`))}resume(){return this[y]()}pause(){this[_]=!1,this[v]=!0,this[F]=!1}get destroyed(){return this[E]}get flowing(){return this[_]}get paused(){return this[v]}[C](e){this[T]?this[S]+=1:this[S]+=e.length,this[b].push(e)}[w](){return this[T]?--this[S]:this[S]-=this[b][0].length,this[b].shift()}[p](e=!1){do;while(this[m](this[w]())&&this[b].length);!e&&!this[b].length&&!this[o]&&this.emit(`drain`)}[m](e){return this.emit(`data`,e),this[_]}pipe(e,t){if(this[E])return e;this[F]=!1;let r=this[c];return t||={},e===n.stdout||e===n.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this[x].push(t.proxyErrors?new V(this,e,t):new B(this,e,t)),this[j]?I(()=>this[y]()):this[y]()),e}unpipe(e){let t=this[x].find(t=>t.dest===e);t&&(this[x].length===1?(this[_]&&this[P]===0&&(this[_]=!1),this[x]=[]):this[x].splice(this[x].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let n=super.on(e,t);if(e===`data`)this[F]=!1,this[P]++,!this[x].length&&!this[_]&&this[y]();else if(e===`readable`&&this[S]!==0)super.emit(`readable`);else if(R(e)&&this[c])super.emit(e),this.removeAllListeners(e);else if(e===`error`&&this[u]){let e=t;this[j]?I(()=>e.call(this,this[u])):e.call(this,this[u])}return n}removeListener(e,t){return this.off(e,t)}off(e,t){let n=super.off(e,t);return e===`data`&&(this[P]=this.listeners(`data`).length,this[P]===0&&!this[F]&&!this[x].length&&(this[_]=!1)),n}removeAllListeners(e){let t=super.removeAllListeners(e);return(e===`data`||e===void 0)&&(this[P]=0,!this[F]&&!this[x].length&&(this[_]=!1)),t}get emittedEnd(){return this[c]}[s](){!this[l]&&!this[c]&&!this[E]&&this[b].length===0&&this[o]&&(this[l]=!0,this.emit(`end`),this.emit(`prefinish`),this.emit(`finish`),this[d]&&this.emit(`close`),this[l]=!1)}emit(e,...t){let n=t[0];if(e!==`error`&&e!==`close`&&e!==E&&this[E])return!1;if(e===`data`)return!this[T]&&!n?!1:this[j]?(I(()=>this[O](n)),!0):this[O](n);if(e===`end`)return this[k]();if(e===`close`){if(this[d]=!0,!this[c]&&!this[E])return!1;let e=super.emit(`close`);return this.removeAllListeners(`close`),e}else if(e===`error`){this[u]=n,super.emit(D,n);let e=!this[N]||this.listeners(`error`).length?super.emit(`error`,n):!1;return this[s](),e}else if(e===`resume`){let e=super.emit(`resume`);return this[s](),e}else if(e===`finish`||e===`prefinish`){let t=super.emit(e);return this.removeAllListeners(e),t}let r=super.emit(e,...t);return this[s](),r}[O](e){for(let t of this[x])t.dest.write(e)===!1&&this.pause();let t=this[F]?!1:super.emit(`data`,e);return this[s](),t}[k](){return this[c]?!1:(this[c]=!0,this.readable=!1,this[j]?(I(()=>this[A]()),!0):this[A]())}[A](){if(this[g]){let e=this[g].end();if(e){for(let t of this[x])t.dest.write(e);this[F]||super.emit(`data`,e)}}for(let e of this[x])e.end();let e=super.emit(`end`);return this.removeAllListeners(`end`),e}async collect(){let e=Object.assign([],{dataLength:0});this[T]||(e.dataLength=0);let t=this.promise();return this.on(`data`,t=>{e.push(t),this[T]||(e.dataLength+=t.length)}),await t,e}async concat(){if(this[T])throw Error(`cannot concat in objectMode`);let e=await this.collect();return this[h]?e.join(``):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(E,()=>t(Error(`stream destroyed`))),this.on(`error`,e=>t(e)),this.on(`end`,()=>e())})}[Symbol.asyncIterator](){this[F]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return t();let n=this.read();if(n!==null)return Promise.resolve({done:!1,value:n});if(this[o])return t();let r,i,a=e=>{this.off(`data`,s),this.off(`end`,c),this.off(E,l),t(),i(e)},s=e=>{this.off(`error`,a),this.off(`end`,c),this.off(E,l),this.pause(),r({value:e,done:!!this[o]})},c=()=>{this.off(`error`,a),this.off(`data`,s),this.off(E,l),t(),r({done:!0,value:void 0})},l=()=>a(Error(`stream destroyed`));return new Promise((e,t)=>{i=t,r=e,this.once(E,l),this.once(`error`,a),this.once(`end`,c),this.once(`data`,s)})},throw:t,return:t,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[F]=!1;let e=!1,t=()=>(this.pause(),this.off(D,t),this.off(E,t),this.off(`end`,t),e=!0,{done:!0,value:void 0});return this.once(`end`,t),this.once(D,t),this.once(E,t),{next:()=>{if(e)return t();let n=this.read();return n===null?t():{done:!1,value:n}},throw:t,return:t,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(e){if(this[E])return e?this.emit(`error`,e):this.emit(E),this;this[E]=!0,this[F]=!0,this[b].length=0,this[S]=0;let t=this;return typeof t.close==`function`&&!this[d]&&t.close(),e?this.emit(`error`,e):this.emit(E),this}static get isStream(){return e.isStream}};e.Minipass=U}),f=t(e=>{"use strict";var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.PathScurry=e.Path=e.PathScurryDarwin=e.PathScurryPosix=e.PathScurryWin32=e.PathScurryBase=e.PathPosix=e.PathWin32=e.PathBase=e.ChildrenCache=e.ResolveCache=void 0;var i=u(),a=require("node:path"),o=require("node:url"),s=require("fs"),c=r(require("node:fs")),l=s.realpathSync.native,f=require("node:fs/promises"),p=d(),m={lstatSync:s.lstatSync,readdir:s.readdir,readdirSync:s.readdirSync,readlinkSync:s.readlinkSync,realpathSync:l,promises:{lstat:f.lstat,readdir:f.readdir,readlink:f.readlink,realpath:f.realpath}},h=e=>!e||e===m||e===c?m:{...m,...e,promises:{...m.promises,...e.promises||{}}},g=/^\\\\\?\\([a-z]:)\\?$/i,_=e=>e.replace(/\//g,`\\`).replace(g,`$1\\`),v=/[\\\/]/,y=0,b=1,x=2,S=4,C=6,w=8,T=10,E=12,D=15,O=~D,k=16,A=32,j=64,M=128,ee=256,N=512,P=j|M|N,F=1023,I=e=>e.isFile()?w:e.isDirectory()?S:e.isSymbolicLink()?T:e.isCharacterDevice()?x:e.isBlockDevice()?C:e.isSocket()?E:e.isFIFO()?b:y,L=new i.LRUCache({max:2**12}),R=e=>{let t=L.get(e);if(t)return t;let n=e.normalize(`NFKD`);return L.set(e,n),n},te=new i.LRUCache({max:2**12}),z=e=>{let t=te.get(e);if(t)return t;let n=R(e.toLowerCase());return te.set(e,n),n},B=class extends i.LRUCache{constructor(){super({max:256})}};e.ResolveCache=B;var V=class extends i.LRUCache{constructor(e=16*1024){super({maxSize:e,sizeCalculation:e=>e.length+1})}};e.ChildrenCache=V;var ne=Symbol(`PathScurry setAsCwd`),H=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#n;get mode(){return this.#n}#r;get nlink(){return this.#r}#i;get uid(){return this.#i}#a;get gid(){return this.#a}#o;get rdev(){return this.#o}#s;get blksize(){return this.#s}#c;get ino(){return this.#c}#l;get size(){return this.#l}#u;get blocks(){return this.#u}#d;get atimeMs(){return this.#d}#f;get mtimeMs(){return this.#f}#p;get ctimeMs(){return this.#p}#m;get birthtimeMs(){return this.#m}#h;get atime(){return this.#h}#g;get mtime(){return this.#g}#_;get ctime(){return this.#_}#v;get birthtime(){return this.#v}#y;#b;#x;#S;#C;#w;#T;#E;#D;#O;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=y,n,r,i,a,o){this.name=e,this.#y=i?z(e):R(e),this.#T=t&F,this.nocase=i,this.roots=r,this.root=n||this,this.#E=a,this.#x=o.fullpath,this.#C=o.relative,this.#w=o.relativePosix,this.parent=o.parent,this.parent?this.#e=this.parent.#e:this.#e=h(o.fs)}depth(){return this.#b===void 0?this.parent?this.#b=this.parent.depth()+1:this.#b=0:this.#b}childrenCache(){return this.#E}resolve(e){if(!e)return this;let t=this.getRootString(e),n=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#k(n):this.#k(n)}#k(e){let t=this;for(let n of e)t=t.child(n);return t}children(){let e=this.#E.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#E.set(this,t),this.#T&=~k,t}child(e,t){if(e===``||e===`.`)return this;if(e===`..`)return this.parent||this;let n=this.children(),r=this.nocase?z(e):R(e);for(let e of n)if(e.#y===r)return e;let i=this.parent?this.sep:``,a=this.#x?this.#x+i+e:void 0,o=this.newChild(e,y,{...t,parent:this,fullpath:a});return this.canReaddir()||(o.#T|=M),n.push(o),o}relative(){if(this.isCWD)return``;if(this.#C!==void 0)return this.#C;let e=this.name,t=this.parent;if(!t)return this.#C=this.name;let n=t.relative();return n+(!n||!t.parent?``:this.sep)+e}relativePosix(){if(this.sep===`/`)return this.relative();if(this.isCWD)return``;if(this.#w!==void 0)return this.#w;let e=this.name,t=this.parent;if(!t)return this.#w=this.fullpathPosix();let n=t.relativePosix();return n+(!n||!t.parent?``:`/`)+e}fullpath(){if(this.#x!==void 0)return this.#x;let e=this.name,t=this.parent;if(!t)return this.#x=this.name;let n=t.fullpath()+(t.parent?this.sep:``)+e;return this.#x=n}fullpathPosix(){if(this.#S!==void 0)return this.#S;if(this.sep===`/`)return this.#S=this.fullpath();if(!this.parent){let e=this.fullpath().replace(/\\/g,`/`);return/^[a-z]:\//i.test(e)?this.#S=`//?/${e}`:this.#S=e}let e=this.parent,t=e.fullpathPosix(),n=t+(!t||!e.parent?``:`/`)+this.name;return this.#S=n}isUnknown(){return(this.#T&D)===y}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?`Unknown`:this.isDirectory()?`Directory`:this.isFile()?`File`:this.isSymbolicLink()?`SymbolicLink`:this.isFIFO()?`FIFO`:this.isCharacterDevice()?`CharacterDevice`:this.isBlockDevice()?`BlockDevice`:this.isSocket()?`Socket`:`Unknown`}isFile(){return(this.#T&D)===w}isDirectory(){return(this.#T&D)===S}isCharacterDevice(){return(this.#T&D)===x}isBlockDevice(){return(this.#T&D)===C}isFIFO(){return(this.#T&D)===b}isSocket(){return(this.#T&D)===E}isSymbolicLink(){return(this.#T&T)===T}lstatCached(){return this.#T&A?this:void 0}readlinkCached(){return this.#D}realpathCached(){return this.#O}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#D)return!0;if(!this.parent)return!1;let e=this.#T&D;return!(e!==y&&e!==T||this.#T&ee||this.#T&M)}calledReaddir(){return!!(this.#T&k)}isENOENT(){return!!(this.#T&M)}isNamed(e){return this.nocase?this.#y===z(e):this.#y===R(e)}async readlink(){let e=this.#D;if(e)return e;if(this.canReadlink()&&this.parent)try{let e=await this.#e.promises.readlink(this.fullpath()),t=(await this.parent.realpath())?.resolve(e);if(t)return this.#D=t}catch(e){this.#L(e.code);return}}readlinkSync(){let e=this.#D;if(e)return e;if(this.canReadlink()&&this.parent)try{let e=this.#e.readlinkSync(this.fullpath()),t=this.parent.realpathSync()?.resolve(e);if(t)return this.#D=t}catch(e){this.#L(e.code);return}}#A(e){this.#T|=k;for(let t=e.provisional;t<e.length;t++){let n=e[t];n&&n.#j()}}#j(){this.#T&M||(this.#T=(this.#T|M)&O,this.#M())}#M(){let e=this.children();e.provisional=0;for(let t of e)t.#j()}#N(){this.#T|=N,this.#P()}#P(){if(this.#T&j)return;let e=this.#T;(e&D)===S&&(e&=O),this.#T=e|j,this.#M()}#F(e=``){e===`ENOTDIR`||e===`EPERM`?this.#P():e===`ENOENT`?this.#j():this.children().provisional=0}#I(e=``){e===`ENOTDIR`?this.parent.#P():e===`ENOENT`&&this.#j()}#L(e=``){let t=this.#T;t|=ee,e===`ENOENT`&&(t|=M),(e===`EINVAL`||e===`UNKNOWN`)&&(t&=O),this.#T=t,e===`ENOTDIR`&&this.parent&&this.parent.#P()}#R(e,t){return this.#B(e,t)||this.#z(e,t)}#z(e,t){let n=I(e),r=this.newChild(e.name,n,{parent:this}),i=r.#T&D;return i!==S&&i!==T&&i!==y&&(r.#T|=j),t.unshift(r),t.provisional++,r}#B(e,t){for(let n=t.provisional;n<t.length;n++){let r=t[n];if((this.nocase?z(e.name):R(e.name))===r.#y)return this.#V(e,r,n,t)}}#V(e,t,n,r){let i=t.name;return t.#T=t.#T&O|I(e),i!==e.name&&(t.name=e.name),n!==r.provisional&&(n===r.length-1?r.pop():r.splice(n,1),r.unshift(t)),r.provisional++,t}async lstat(){if((this.#T&M)===0)try{return this.#H(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#I(e.code)}}lstatSync(){if((this.#T&M)===0)try{return this.#H(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#I(e.code)}}#H(e){let{atime:t,atimeMs:n,birthtime:r,birthtimeMs:i,blksize:a,blocks:o,ctime:s,ctimeMs:c,dev:l,gid:u,ino:d,mode:f,mtime:p,mtimeMs:m,nlink:h,rdev:g,size:_,uid:v}=e;this.#h=t,this.#d=n,this.#v=r,this.#m=i,this.#s=a,this.#u=o,this.#_=s,this.#p=c,this.#t=l,this.#a=u,this.#c=d,this.#n=f,this.#g=p,this.#f=m,this.#r=h,this.#o=g,this.#l=_,this.#i=v;let b=I(e);this.#T=this.#T&O|b|A,b!==y&&b!==S&&b!==T&&(this.#T|=j)}#U=[];#W=!1;#G(e){this.#W=!1;let t=this.#U.slice();this.#U.length=0,t.forEach(t=>t(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let r=n.slice(0,n.provisional);t?e(null,r):queueMicrotask(()=>e(null,r));return}if(this.#U.push(e),this.#W)return;this.#W=!0;let r=this.fullpath();this.#e.readdir(r,{withFileTypes:!0},(e,t)=>{if(e)this.#F(e.code),n.provisional=0;else{for(let e of t)this.#R(e,n);this.#A(n)}this.#G(n.slice(0,n.provisional))})}#K;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#K)await this.#K;else{let n=()=>{};this.#K=new Promise(e=>n=e);try{for(let n of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#R(n,e);this.#A(e)}catch(t){this.#F(t.code),e.provisional=0}this.#K=void 0,n()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let n of this.#e.readdirSync(t,{withFileTypes:!0}))this.#R(n,e);this.#A(e)}catch(t){this.#F(t.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#T&P)return!1;let e=D&this.#T;return e===y||e===S||e===T}shouldWalk(e,t){return(this.#T&S)===S&&!(this.#T&P)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#O)return this.#O;if(!((N|ee|M)&this.#T))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#O=this.resolve(e)}catch{this.#N()}}realpathSync(){if(this.#O)return this.#O;if(!((N|ee|M)&this.#T))try{let e=this.#e.realpathSync(this.fullpath());return this.#O=this.resolve(e)}catch{this.#N()}}[ne](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),n=[],r=this;for(;r&&r.parent;)t.add(r),r.#C=n.join(this.sep),r.#w=n.join(`/`),r=r.parent,n.push(`..`);for(r=e;r&&r.parent&&!t.has(r);)r.#C=void 0,r.#w=void 0,r=r.parent}};e.PathBase=H;var U=class e extends H{sep=`\\`;splitSep=v;constructor(e,t=y,n,r,i,a,o){super(e,t,n,r,i,a,o)}newChild(t,n=y,r={}){return new e(t,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return a.win32.parse(e).root}getRoot(e){if(e=_(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,n]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=n;return this.roots[e]=new ie(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,`\\`).replace(g,`$1\\`),e===t}};e.PathWin32=U;var W=class e extends H{splitSep=`/`;sep=`/`;constructor(e,t=y,n,r,i,a,o){super(e,t,n,r,i,a,o)}getRootString(e){return e.startsWith(`/`)?`/`:``}getRoot(e){return this.root}newChild(t,n=y,r={}){return new e(t,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}};e.PathPosix=W;var re=class{root;rootPath;roots;cwd;#e;#t;#n;nocase;#r;constructor(e=process.cwd(),t,n,{nocase:r,childrenCacheSize:i=16*1024,fs:a=m}={}){this.#r=h(a),(e instanceof URL||e.startsWith(`file://`))&&(e=(0,o.fileURLToPath)(e));let s=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(s),this.#e=new B,this.#t=new B,this.#n=new V(i);let c=s.substring(this.rootPath.length).split(n);if(c.length===1&&!c[0]&&c.pop(),r===void 0)throw TypeError(`must provide nocase setting to PathScurryBase ctor`);this.nocase=r,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=t.sep,f=this.rootPath,p=!1;for(let e of c){let t=u--;l=l.child(e,{relative:Array(t).fill(`..`).join(d),relativePosix:Array(t).fill(`..`).join(`/`),fullpath:f+=(p?``:d)+e}),p=!0}this.cwd=l}depth(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#n}resolve(...e){let t=``;for(let n=e.length-1;n>=0;n--){let r=e[n];if(!(!r||r===`.`)&&(t=t?`${r}/${t}`:r,this.isAbsolute(r)))break}let n=this.#e.get(t);if(n!==void 0)return n;let r=this.cwd.resolve(t).fullpath();return this.#e.set(t,r),r}resolvePosix(...e){let t=``;for(let n=e.length-1;n>=0;n--){let r=e[n];if(!(!r||r===`.`)&&(t=t?`${r}/${t}`:r,this.isAbsolute(r)))break}let n=this.#t.get(t);if(n!==void 0)return n;let r=this.cwd.resolve(t).fullpathPosix();return this.#t.set(t,r),r}relative(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof H||(t=e,e=this.cwd);let{withFileTypes:n}=t;if(e.canReaddir()){let t=await e.readdir();return n?t:t.map(e=>e.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof H||(t=e,e=this.cwd);let{withFileTypes:n=!0}=t;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(e=>e.name):[]}async lstat(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof H||(t=e.withFileTypes,e=this.cwd);let n=await e.readlink();return t?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof H||(t=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return t?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof H||(t=e.withFileTypes,e=this.cwd);let n=await e.realpath();return t?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof H||(t=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return t?n:n?.fullpath()}async walk(e=this.cwd,t={}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof H||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t,o=[];(!i||i(e))&&o.push(n?e:e.fullpath());let s=new Set,c=(e,t)=>{s.add(e),e.readdirCB((e,l)=>{if(e)return t(e);let u=l.length;if(!u)return t();let d=()=>{--u===0&&t()};for(let e of l)(!i||i(e))&&o.push(n?e:e.fullpath()),r&&e.isSymbolicLink()?e.realpath().then(e=>e?.isUnknown()?e.lstat():e).then(e=>e?.shouldWalk(s,a)?c(e,d):d()):e.shouldWalk(s,a)?c(e,d):d()},!0)},l=e;return new Promise((e,t)=>{c(l,n=>{if(n)return t(n);e(o)})})}walkSync(e=this.cwd,t={}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof H||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t,o=[];(!i||i(e))&&o.push(n?e:e.fullpath());let s=new Set([e]);for(let e of s){let t=e.readdirSync();for(let e of t){(!i||i(e))&&o.push(n?e:e.fullpath());let t=e;if(e.isSymbolicLink()){if(!(r&&(t=e.realpathSync())))continue;t.isUnknown()&&t.lstatSync()}t.shouldWalk(s,a)&&s.add(t)}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e==`string`?e=this.cwd.resolve(e):e instanceof H||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof H||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t;(!i||i(e))&&(yield n?e:e.fullpath());let o=new Set([e]);for(let e of o){let t=e.readdirSync();for(let e of t){(!i||i(e))&&(yield n?e:e.fullpath());let t=e;if(e.isSymbolicLink()){if(!(r&&(t=e.realpathSync())))continue;t.isUnknown()&&t.lstatSync()}t.shouldWalk(o,a)&&o.add(t)}}}stream(e=this.cwd,t={}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof H||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t,o=new p.Minipass({objectMode:!0});(!i||i(e))&&o.write(n?e:e.fullpath());let s=new Set,c=[e],l=0,u=()=>{let e=!1;for(;!e;){let t=c.shift();if(!t){l===0&&o.end();return}l++,s.add(t);let d=(t,p,m=!1)=>{if(t)return o.emit(`error`,t);if(r&&!m){let e=[];for(let t of p)t.isSymbolicLink()&&e.push(t.realpath().then(e=>e?.isUnknown()?e.lstat():e));if(e.length){Promise.all(e).then(()=>d(null,p,!0));return}}for(let t of p)t&&(!i||i(t))&&(o.write(n?t:t.fullpath())||(e=!0));l--;for(let e of p){let t=e.realpathCached()||e;t.shouldWalk(s,a)&&c.push(t)}e&&!o.flowing?o.once(`drain`,u):f||u()},f=!0;t.readdirCB(d,!0),f=!1}};return u(),o}streamSync(e=this.cwd,t={}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof H||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t,o=new p.Minipass({objectMode:!0}),s=new Set;(!i||i(e))&&o.write(n?e:e.fullpath());let c=[e],l=0,u=()=>{let e=!1;for(;!e;){let t=c.shift();if(!t){l===0&&o.end();return}l++,s.add(t);let u=t.readdirSync();for(let t of u)(!i||i(t))&&(o.write(n?t:t.fullpath())||(e=!0));l--;for(let e of u){let t=e;if(e.isSymbolicLink()){if(!(r&&(t=e.realpathSync())))continue;t.isUnknown()&&t.lstatSync()}t.shouldWalk(s,a)&&c.push(t)}}e&&!o.flowing&&o.once(`drain`,u)};return u(),o}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e==`string`?this.cwd.resolve(e):e,this.cwd[ne](t)}};e.PathScurryBase=re;var ie=class extends re{sep=`\\`;constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,a.win32,`\\`,{...t,nocase:n}),this.nocase=n;for(let e=this.cwd;e;e=e.parent)e.nocase=this.nocase}parseRootPath(e){return a.win32.parse(e).root.toUpperCase()}newRoot(e){return new U(this.rootPath,S,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith(`/`)||e.startsWith(`\\`)||/^[a-z]:(\/|\\)/i.test(e)}};e.PathScurryWin32=ie;var ae=class extends re{sep=`/`;constructor(e=process.cwd(),t={}){let{nocase:n=!1}=t;super(e,a.posix,`/`,{...t,nocase:n}),this.nocase=n}parseRootPath(e){return`/`}newRoot(e){return new W(this.rootPath,S,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith(`/`)}};e.PathScurryPosix=ae;var oe=class extends ae{constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,{...t,nocase:n})}};e.PathScurryDarwin=oe,e.Path=process.platform===`win32`?U:W,e.PathScurry=process.platform===`win32`?ie:process.platform===`darwin`?oe:ae}),p=t(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Pattern=void 0;var t=l(),n=e=>e.length>=1,r=e=>e.length>=1,i=Symbol.for(`nodejs.util.inspect.custom`);e.Pattern=class e{#e;#t;#n;length;#r;#i;#a;#o;#s;#c;#l=!0;constructor(e,t,i,a){if(!n(e))throw TypeError(`empty pattern list`);if(!r(t))throw TypeError(`empty glob list`);if(t.length!==e.length)throw TypeError(`mismatched pattern list and glob list lengths`);if(this.length=e.length,i<0||i>=this.length)throw TypeError(`index out of range`);if(this.#e=e,this.#t=t,this.#n=i,this.#r=a,this.#n===0){if(this.isUNC()){let[e,t,n,r,...i]=this.#e,[a,o,s,c,...l]=this.#t;i[0]===``&&(i.shift(),l.shift());let u=[e,t,n,r,``].join(`/`),d=[a,o,s,c,``].join(`/`);this.#e=[u,...i],this.#t=[d,...l],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[e,...t]=this.#e,[n,...r]=this.#t;t[0]===``&&(t.shift(),r.shift());let i=e+`/`,a=n+`/`;this.#e=[i,...t],this.#t=[a,...r],this.length=this.#e.length}}}[i](){return`Pattern <`+this.#t.slice(this.#n).join(`/`)+`>`}pattern(){return this.#e[this.#n]}isString(){return typeof this.#e[this.#n]==`string`}isGlobstar(){return this.#e[this.#n]===t.GLOBSTAR}isRegExp(){return this.#e[this.#n]instanceof RegExp}globString(){return this.#a=this.#a||(this.#n===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join(`/`):this.#t.join(`/`):this.#t.slice(this.#n).join(`/`))}hasMore(){return this.length>this.#n+1}rest(){return this.#i===void 0?this.hasMore()?(this.#i=new e(this.#e,this.#t,this.#n+1,this.#r),this.#i.#c=this.#c,this.#i.#s=this.#s,this.#i.#o=this.#o,this.#i):this.#i=null:this.#i}isUNC(){let e=this.#e;return this.#s===void 0?this.#s=this.#r===`win32`&&this.#n===0&&e[0]===``&&e[1]===``&&typeof e[2]==`string`&&!!e[2]&&typeof e[3]==`string`&&!!e[3]:this.#s}isDrive(){let e=this.#e;return this.#o===void 0?this.#o=this.#r===`win32`&&this.#n===0&&this.length>1&&typeof e[0]==`string`&&/^[a-z]:$/i.test(e[0]):this.#o}isAbsolute(){let e=this.#e;return this.#c===void 0?this.#c=e[0]===``&&e.length>1||this.isDrive()||this.isUNC():this.#c}root(){let e=this.#e[0];return typeof e==`string`&&this.isAbsolute()&&this.#n===0?e:``}checkFollowGlobstar(){return!(this.#n===0||!this.isGlobstar()||!this.#l)}markFollowGlobstar(){return this.#n===0||!this.isGlobstar()||!this.#l?!1:(this.#l=!1,!0)}}}),m=t(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Ignore=void 0;var t=l(),n=p(),r=typeof process==`object`&&process&&typeof process.platform==`string`?process.platform:`linux`;e.Ignore=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:n,noext:i,noglobstar:a,platform:o=r}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:n,noext:i,noglobstar:a,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let t of e)this.add(t)}add(e){let r=new t.Minimatch(e,this.mmopts);for(let e=0;e<r.set.length;e++){let i=r.set[e],a=r.globParts[e];if(!i||!a)throw Error(`invalid pattern object`);for(;i[0]===`.`&&a[0]===`.`;)i.shift(),a.shift();let o=new n.Pattern(i,a,0,this.platform),s=new t.Minimatch(o.globString(),this.mmopts),c=a[a.length-1]===`**`,l=o.isAbsolute();l?this.absolute.push(s):this.relative.push(s),c&&(l?this.absoluteChildren.push(s):this.relativeChildren.push(s))}}ignored(e){let t=e.fullpath(),n=`${t}/`,r=e.relative()||`.`,i=`${r}/`;for(let e of this.relative)if(e.match(r)||e.match(i))return!0;for(let e of this.absolute)if(e.match(t)||e.match(n))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+`/`,n=(e.relative()||`.`)+`/`;for(let e of this.relativeChildren)if(e.match(n))return!0;for(let e of this.absoluteChildren)if(e.match(t))return!0;return!1}}}),h=t(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Processor=e.SubWalks=e.MatchRecord=e.HasWalkedCache=void 0;var t=l(),n=class e{store;constructor(e=new Map){this.store=e}copy(){return new e(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let n=e.fullpath(),r=this.store.get(n);r?r.add(t.globString()):this.store.set(n,new Set([t.globString()]))}};e.HasWalkedCache=n;var r=class{store=new Map;add(e,t,n){let r=(t?2:0)|!!n,i=this.store.get(e);this.store.set(e,i===void 0?r:r&i)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}};e.MatchRecord=r;var i=class{store=new Map;add(e,t){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(e=>e.globString()===t.globString())||n.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw Error(`attempting to walk unknown path`);return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}};e.SubWalks=i,e.Processor=class e{hasWalkedCache;matches=new r;subwalks=new i;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new n}processPatterns(e,n){this.patterns=n;let r=n.map(t=>[e,t]);for(let[e,n]of r){this.hasWalkedCache.storeWalked(e,n);let r=n.root(),i=n.isAbsolute()&&this.opts.absolute!==!1;if(r){e=e.resolve(r===`/`&&this.opts.root!==void 0?this.opts.root:r);let t=n.rest();if(t)n=t;else{this.matches.add(e,!0,!1);continue}}if(e.isENOENT())continue;let a,o,s=!1;for(;typeof(a=n.pattern())==`string`&&(o=n.rest());)e=e.resolve(a),n=o,s=!0;if(a=n.pattern(),o=n.rest(),s){if(this.hasWalkedCache.hasWalked(e,n))continue;this.hasWalkedCache.storeWalked(e,n)}if(typeof a==`string`){let t=a===`..`||a===``||a===`.`;this.matches.add(e.resolve(a),i,t);continue}else if(a===t.GLOBSTAR){(!e.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(e,n);let t=o?.pattern(),r=o?.rest();if(!o||(t===``||t===`.`)&&!r)this.matches.add(e,i,t===``||t===`.`);else if(t===`..`){let t=e.parent||e;r?this.hasWalkedCache.hasWalked(t,r)||this.subwalks.add(t,r):this.matches.add(t,i,!0)}}else a instanceof RegExp&&this.subwalks.add(e,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new e(this.opts,this.hasWalkedCache)}filterEntries(e,n){let r=this.subwalks.get(e),i=this.child();for(let e of n)for(let n of r){let r=n.isAbsolute(),a=n.pattern(),o=n.rest();a===t.GLOBSTAR?i.testGlobstar(e,n,o,r):a instanceof RegExp?i.testRegExp(e,a,o,r):i.testString(e,a,o,r)}return i}testGlobstar(e,t,n,r){if((this.dot||!e.name.startsWith(`.`))&&(t.hasMore()||this.matches.add(e,r,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(n&&t.checkFollowGlobstar()?this.subwalks.add(e,n):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),n){let t=n.pattern();if(typeof t==`string`&&t!==`..`&&t!==``&&t!==`.`)this.testString(e,t,n.rest(),r);else if(t===`..`){let t=e.parent||e;this.subwalks.add(t,n)}else t instanceof RegExp&&this.testRegExp(e,t,n.rest(),r)}}testRegExp(e,t,n,r){t.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,r,!1))}testString(e,t,n,r){e.isNamed(t)&&(n?this.subwalks.add(e,n):this.matches.add(e,r,!1))}}}),g=t(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GlobStream=e.GlobWalker=e.GlobUtil=void 0;var t=d(),n=m(),r=h(),i=(e,t)=>typeof e==`string`?new n.Ignore([e],t):Array.isArray(e)?new n.Ignore(e,t):e,a=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#n;signal;maxDepth;includeChildMatches;constructor(e,t,n){if(this.patterns=e,this.path=t,this.opts=n,this.#n=!n.posix&&n.platform===`win32`?`\\`:`/`,this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#t=i(n.ignore??[],n),!this.includeChildMatches&&typeof this.#t.add!=`function`))throw Error(`cannot ignore child matches, ignore lacks add() method.`);this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener(`abort`,()=>{this.#e.length=0}))}#r(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#i(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}let r=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let e=await r.realpath();e&&(e.isUnknown()||this.opts.stat)&&await e.lstat()}return this.matchCheckTest(r,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#r(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}let r=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let e=r.realpathSync();e&&(e?.isUnknown()||this.opts.stat)&&e.lstatSync()}return this.matchCheckTest(r,t)}matchFinish(e,t){if(this.#r(e))return;if(!this.includeChildMatches&&this.#t?.add){let t=`${e.relativePosix()}/**`;this.#t.add(t)}let n=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let r=this.opts.mark&&e.isDirectory()?this.#n:``;if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let t=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(t+r)}else{let t=this.opts.posix?e.relativePosix():e.relative(),n=this.opts.dotRelative&&!t.startsWith(`..`+this.#n)?`.`+this.#n:``;this.matchEmit(t?n+t+r:`.`+r)}}async match(e,t,n){let r=await this.matchCheck(e,n);r&&this.matchFinish(r,t)}matchSync(e,t,n){let r=this.matchCheckSync(e,n);r&&this.matchFinish(r,t)}walkCB(e,t,n){this.signal?.aborted&&n(),this.walkCB2(e,t,new r.Processor(this.opts),n)}walkCB2(e,t,n,r){if(this.#i(e))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2(e,t,n,r));return}n.processPatterns(e,t);let i=1,a=()=>{--i===0&&r()};for(let[e,t,r]of n.matches.entries())this.#r(e)||(i++,this.match(e,t,r).then(()=>a()));for(let e of n.subwalkTargets()){if(this.maxDepth!==1/0&&e.depth()>=this.maxDepth)continue;i++;let t=e.readdirCached();e.calledReaddir()?this.walkCB3(e,t,n,a):e.readdirCB((t,r)=>this.walkCB3(e,r,n,a),!0)}a()}walkCB3(e,t,n,r){n=n.filterEntries(e,t);let i=1,a=()=>{--i===0&&r()};for(let[e,t,r]of n.matches.entries())this.#r(e)||(i++,this.match(e,t,r).then(()=>a()));for(let[e,t]of n.subwalks.entries())i++,this.walkCB2(e,t,n.child(),a);a()}walkCBSync(e,t,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,t,new r.Processor(this.opts),n)}walkCB2Sync(e,t,n,r){if(this.#i(e))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,n,r));return}n.processPatterns(e,t);let i=1,a=()=>{--i===0&&r()};for(let[e,t,r]of n.matches.entries())this.#r(e)||this.matchSync(e,t,r);for(let e of n.subwalkTargets()){if(this.maxDepth!==1/0&&e.depth()>=this.maxDepth)continue;i++;let t=e.readdirSync();this.walkCB3Sync(e,t,n,a)}a()}walkCB3Sync(e,t,n,r){n=n.filterEntries(e,t);let i=1,a=()=>{--i===0&&r()};for(let[e,t,r]of n.matches.entries())this.#r(e)||this.matchSync(e,t,r);for(let[e,t]of n.subwalks.entries())i++,this.walkCB2Sync(e,t,n.child(),a);a()}};e.GlobUtil=a,e.GlobWalker=class extends a{matches=new Set;constructor(e,t,n){super(e,t,n)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},e.GlobStream=class extends a{results;constructor(e,n,r){super(e,n,r),this.results=new t.Minipass({signal:this.signal,objectMode:!0}),this.results.on(`drain`,()=>this.resume()),this.results.on(`resume`,()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}}}),_=t(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Glob=void 0;var t=l(),n=require("node:url"),r=f(),i=p(),a=g(),o=typeof process==`object`&&process&&typeof process.platform==`string`?process.platform:`linux`;e.Glob=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,a){if(!a)throw TypeError(`glob options required`);if(this.withFileTypes=!!a.withFileTypes,this.signal=a.signal,this.follow=!!a.follow,this.dot=!!a.dot,this.dotRelative=!!a.dotRelative,this.nodir=!!a.nodir,this.mark=!!a.mark,a.cwd?(a.cwd instanceof URL||a.cwd.startsWith(`file://`))&&(a.cwd=(0,n.fileURLToPath)(a.cwd)):this.cwd=``,this.cwd=a.cwd||``,this.root=a.root,this.magicalBraces=!!a.magicalBraces,this.nobrace=!!a.nobrace,this.noext=!!a.noext,this.realpath=!!a.realpath,this.absolute=a.absolute,this.includeChildMatches=a.includeChildMatches!==!1,this.noglobstar=!!a.noglobstar,this.matchBase=!!a.matchBase,this.maxDepth=typeof a.maxDepth==`number`?a.maxDepth:1/0,this.stat=!!a.stat,this.ignore=a.ignore,this.withFileTypes&&this.absolute!==void 0)throw Error(`cannot set absolute and withFileTypes:true`);if(typeof e==`string`&&(e=[e]),this.windowsPathsNoEscape=!!a.windowsPathsNoEscape||a.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(e=>e.replace(/\\/g,`/`))),this.matchBase){if(a.noglobstar)throw TypeError(`base matching requires globstar`);e=e.map(e=>e.includes(`/`)?e:`./**/${e}`)}if(this.pattern=e,this.platform=a.platform||o,this.opts={...a,platform:this.platform},a.scurry){if(this.scurry=a.scurry,a.nocase!==void 0&&a.nocase!==a.scurry.nocase)throw Error(`nocase option contradicts provided scurry option`)}else{let e=a.platform===`win32`?r.PathScurryWin32:a.platform===`darwin`?r.PathScurryDarwin:a.platform?r.PathScurryPosix:r.PathScurry;this.scurry=new e(this.cwd,{nocase:a.nocase,fs:a.fs})}this.nocase=this.scurry.nocase;let s=this.platform===`darwin`||this.platform===`win32`,c={braceExpandMax:1e4,...a,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:s,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},[l,u]=this.pattern.map(e=>new t.Minimatch(e,c)).reduce((e,t)=>(e[0].push(...t.set),e[1].push(...t.globParts),e),[[],[]]);this.patterns=l.map((e,t)=>{let n=u[t];if(!n)throw Error(`invalid pattern object`);return new i.Pattern(e,n,0,this.platform)})}async walk(){return[...await new a.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth===1/0?1/0:this.maxDepth+this.scurry.cwd.depth(),platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new a.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth===1/0?1/0:this.maxDepth+this.scurry.cwd.depth(),platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new a.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth===1/0?1/0:this.maxDepth+this.scurry.cwd.depth(),platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new a.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth===1/0?1/0:this.maxDepth+this.scurry.cwd.depth(),platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}}),v=t(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hasMagic=void 0;var t=l();e.hasMagic=(e,n={})=>{Array.isArray(e)||(e=[e]);for(let r of e)if(new t.Minimatch(r,n).hasMagic())return!0;return!1}});Object.defineProperty(e,"__esModule",{value:!0}),e.glob=e.sync=e.iterate=e.iterateSync=e.stream=e.streamSync=e.Ignore=e.hasMagic=e.Glob=e.unescape=e.escape=void 0,e.globStreamSync=E,e.globStream=D,e.globSync=O,e.globIterateSync=A,e.globIterate=j;var y=l(),b=_(),x=v(),S=l();Object.defineProperty(e,"escape",{enumerable:!0,get:function(){return S.escape}}),Object.defineProperty(e,"unescape",{enumerable:!0,get:function(){return S.unescape}});var C=_();Object.defineProperty(e,"Glob",{enumerable:!0,get:function(){return C.Glob}});var w=v();Object.defineProperty(e,"hasMagic",{enumerable:!0,get:function(){return w.hasMagic}});var T=m();Object.defineProperty(e,"Ignore",{enumerable:!0,get:function(){return T.Ignore}});function E(e,t={}){return new b.Glob(e,t).streamSync()}function D(e,t={}){return new b.Glob(e,t).stream()}function O(e,t={}){return new b.Glob(e,t).walkSync()}async function k(e,t={}){return new b.Glob(e,t).walk()}function A(e,t={}){return new b.Glob(e,t).iterateSync()}function j(e,t={}){return new b.Glob(e,t).iterate()}e.streamSync=E,e.stream=Object.assign(D,{sync:E}),e.iterateSync=A,e.iterate=Object.assign(j,{sync:A}),e.sync=Object.assign(O,{stream:E,iterate:A}),e.glob=Object.assign(k,{glob:k,globSync:O,sync:e.sync,globStream:D,stream:e.stream,globStreamSync:E,streamSync:e.streamSync,globIterate:j,iterate:e.iterate,globIterateSync:A,iterateSync:e.iterateSync,Glob:b.Glob,hasMagic:x.hasMagic,escape:y.escape,unescape:y.unescape}),e.glob.glob=e.glob})),pc=s(((e,t)=>{var{glob:n}=fc(),r=require("path"),i=e=>e.split(r.win32.sep).join(r.posix.sep);t.exports=(e,t)=>n(i(e),t)})),mc=s(((e,t)=>{var n=require("fs/promises"),r=ic(),{hasContent:i}=cc();t.exports=a;async function a(e,t){let a=await i(e,t);return a&&a.sri?(await n.rm(r(e,a.sri),{recursive:!0,force:!0}),!0):!1}})),hc=s(((e,t)=>{var{rm:n}=require("fs/promises"),r=pc(),i=ac(),a=oc(),o=require("path"),s=mc();t.exports=c,t.exports.entry=c;function c(e,t,n){return a.clearMemoized(),i.delete(e,t,n)}t.exports.content=l;function l(e,t){return a.clearMemoized(),s(e,t)}t.exports.all=u;async function u(e){a.clearMemoized();let t=await r(o.join(e,`*(content-*|index-*)`),{silent:!0,nosort:!0});return Promise.all(t.map(e=>n(e,{recursive:!0,force:!0})))}})),gc=s(((e,t)=>{var{mkdir:n,readFile:r,rm:i,stat:a,truncate:o,writeFile:s}=require("fs/promises"),c=ic(),l=sc(),u=pc(),d=ac(),f=require("path"),p=Ss(),m=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),h=e=>({concurrency:20,log:{silly(){}},...e});t.exports=g;async function g(e,t){t=h(t),t.log.silly(`verify`,`verifying cache at`,e);let n=[_,y,b,S,w,T,v],r={};for(let i of n){let n=i.name,a=new Date,o=await i(e,t);o&&Object.keys(o).forEach(e=>{r[e]=o[e]});let s=new Date;r.runTime||={},r.runTime[n]=s-a}return r.runTime.total=r.endTime-r.startTime,t.log.silly(`verify`,`verification finished for`,e,`in`,`${r.runTime.total}ms`),r}async function _(){return{startTime:new Date}}async function v(){return{endTime:new Date}}async function y(e,t){return t.log.silly(`verify`,`fixing cache permissions`),await n(e,{recursive:!0}),null}async function b(e,t){t.log.silly(`verify`,`garbage collecting content`);let{default:n}=await Promise.resolve().then(()=>(Ux(),Bx)),r=d.lsStream(e),o=new Set;r.on(`data`,e=>{if(t.filter&&!t.filter(e))return;let n=p.parse(e.integrity);for(let e in n)o.add(n[e].toString())}),await new Promise((e,t)=>{r.on(`end`,e).on(`error`,t)});let s=c.contentDir(e),l=await u(f.join(s,`**`),{follow:!1,nodir:!0,nosort:!0}),m={verifiedContent:0,reclaimedCount:0,reclaimedSize:0,badContentCount:0,keptSize:0};return await n(l,async e=>{let t=e.split(/[/\\]/),n=t.slice(t.length-3).join(``),r=t[t.length-4],s=p.fromHex(n,r);if(o.has(s.toString())){let t=await x(e,s);t.valid?(m.verifiedContent++,m.keptSize+=t.size):(m.reclaimedCount++,m.badContentCount++,m.reclaimedSize+=t.size)}else{m.reclaimedCount++;let t=await a(e);await i(e,{recursive:!0,force:!0}),m.reclaimedSize+=t.size}return m},{concurrency:t.concurrency}),m}async function x(e,t){let n={};try{let{size:r}=await a(e);n.size=r,n.valid=!0,await p.checkStream(new l.ReadStream(e),t)}catch(t){if(t.code===`ENOENT`)return{size:0,valid:!1};if(t.code!==`EINTEGRITY`)throw t;await i(e,{recursive:!0,force:!0}),n.valid=!1}return n}async function S(e,t){t.log.silly(`verify`,`rebuilding index`);let{default:n}=await Promise.resolve().then(()=>(Ux(),Bx)),r=await d.ls(e),i={missingContent:0,rejectedEntries:0,totalEntries:0},a={};for(let n in r)if(m(r,n)){let o=d.hashKey(n),s=r[n],c=t.filter&&!t.filter(s);c&&i.rejectedEntries++,a[o]&&!c?a[o].push(s):a[o]&&c||(c?(a[o]=[],a[o]._path=d.bucketPath(e,n)):(a[o]=[s],a[o]._path=d.bucketPath(e,n)))}return await n(Object.keys(a),n=>C(e,a[n],i,t),{concurrency:t.concurrency}),i}async function C(e,t,n){await o(t._path);for(let r of t){let t=c(e,r.integrity);try{await a(t),await d.insert(e,r.key,r.integrity,{metadata:r.metadata,size:r.size,time:r.time}),n.totalEntries++}catch(e){if(e.code===`ENOENT`)n.rejectedEntries++,n.missingContent++;else throw e}}}function w(e,t){return t.log.silly(`verify`,`cleaning tmp directory`),i(f.join(e,`tmp`),{recursive:!0,force:!0})}async function T(e,t){let n=f.join(e,`_lastverified`);return t.log.silly(`verify`,`writing verifile to `+n),s(n,`${Date.now()}`)}t.exports.lastRun=E;async function E(e){let t=await r(f.join(e,`_lastverified`),{encoding:`utf8`});return new Date(+t)}})),_c=s(((e,t)=>{var n=lc(),r=dc(),i=hc(),a=gc(),{clearMemoized:o}=oc(),s=zs(),c=ac();t.exports.index={},t.exports.index.compact=c.compact,t.exports.index.insert=c.insert,t.exports.ls=c.ls,t.exports.ls.stream=c.lsStream,t.exports.get=n,t.exports.get.byDigest=n.byDigest,t.exports.get.stream=n.stream,t.exports.get.stream.byDigest=n.stream.byDigest,t.exports.get.copy=n.copy,t.exports.get.copy.byDigest=n.copy.byDigest,t.exports.get.info=n.info,t.exports.get.hasContent=n.hasContent,t.exports.put=r,t.exports.put.stream=r.stream,t.exports.rm=i.entry,t.exports.rm.all=i.all,t.exports.rm.entry=t.exports.rm,t.exports.rm.content=i.content,t.exports.clearMemoized=o,t.exports.tmp={},t.exports.tmp.mkdir=s.mkdir,t.exports.tmp.withTmp=s.withTmp,t.exports.verify=a,t.exports.verify.lastRun=a.lastRun})),vc=s(((e,t)=>{var n=ks();t.exports=class extends n{#e=[];#t=new Map;constructor(e,...t){super(),this.#e=e.events,t.length&&this.push(...t)}on(e,t){return this.#e.includes(e)&&this.#t.has(e)?t(...this.#t.get(e)):super.on(e,t)}emit(e,...t){return this.#e.includes(e)&&this.#t.set(e,t),super.emit(e,...t)}}})),yc=s(((e,t)=>{var{URL:n,format:r}=require("url"),i={auth:!1,fragment:!1,search:!0,unicode:!1};t.exports=e=>`make-fetch-happen:request-cache:${r(new n(e.url),i)}`})),bc=s(((e,t)=>{t.exports={RetryOperation:class{#e=1;#t=null;#n=[];#r=null;#i;#a=null;#o;#s;#c=null;#l;constructor(e,t={}){this.#o=[...e],this.#s=[...e],this.#l=t.unref,this.#i=t.maxRetryTime||1/0,t.forever&&(this.#t=[...this.#s])}get timeouts(){return[...this.#s]}get errors(){return[...this.#n]}get attempts(){return this.#e}get mainError(){let e=null;if(this.#n.length){let t=0,n={};for(let r=0;r<this.#n.length;r++){let i=this.#n[r],{message:a}=i;n[a]||(n[a]=0),n[a]++,n[a]>=t&&(e=i,t=n[a])}}return e}reset(){this.#e=1,this.#s=[...this.#o]}stop(){this.#c&&clearTimeout(this.#c),this.#s=[],this.#t=null}retry(e){if(this.#n.push(e),new Date().getTime()-this.#a>=this.#i)return this.#n.unshift(Error(`RetryOperation timeout occurred`)),!1;let t=this.#s.shift();if(t===void 0)if(this.#t)this.#n.pop(),t=this.#t.at(-1);else return!1;return this.#c=setTimeout(()=>{this.#e++,this.#r(this.#e)},t),this.#l&&this.#c.unref(),!0}attempt(e){this.#r=e,this.#a=new Date().getTime(),this.#r(this.#e)}}}})),xc=s(((e,t)=>{var{RetryOperation:n}=bc(),r=(e,t)=>Math.min(Math.round((1+(t.randomize?Math.random():0))*Math.max(t.minTimeout,1)*t.factor**+e),t.maxTimeout),i=e=>e?.code===`EPROMISERETRY`&&Object.hasOwn(e,`retried`);t.exports={promiseRetry:async(e,t={})=>{let a=[];if(t instanceof Array)a=[...t];else{t.retries===1/0&&(t.forever=!0,delete t.retries);let e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1,...t};if(e.minTimeout>e.maxTimeout)throw Error(`minTimeout is greater than maxTimeout`);if(e.retries){for(let t=0;t<e.retries;t++)a.push(r(t,e));a.sort((e,t)=>e-t)}else t.forever&&a.push(r(0,e))}let o=new n(a,{forever:t.forever,unref:t.unref,maxRetryTime:t.maxRetryTime});return new Promise(function(t,n){o.attempt(async r=>{try{return t(await e(e=>{throw Object.assign(Error(`Retrying`),{code:`EPROMISERETRY`,retried:e})},r,o))}catch(e){if(!i(e))return n(e);if(!o.retry(e.retried||Error()))return n(e.retried)}})})}}})),Sc=s(((e,t)=>{var{LRUCache:n}=zn(),r=require("dns"),i=new n({max:50});t.exports={cache:i,getOptions:({family:e=0,hints:t=r.ADDRCONFIG,all:n=!1,verbatim:a=void 0,ttl:o=300*1e3,lookup:s=r.lookup})=>({hints:t,lookup:(r,...c)=>{let l=c.pop(),u=c[0]??{},d={family:e,hints:t,all:n,verbatim:a,...typeof u==`number`?{family:u}:u},f=JSON.stringify({hostname:r,...d});if(i.has(f)){let e=i.get(f);return process.nextTick(l,null,...e)}s(r,d,(e,...t)=>e?l(e):(i.set(f,t,{ttl:o}),l(null,...t)))}})}})),Cc=s(((e,t)=>{var n=Sc(),r=e=>{let t=parseInt(e.family??`0`,10),r=e.keepAlive??!0,i={keepAliveMsecs:r?1e3:void 0,maxSockets:e.maxSockets??15,maxTotalSockets:1/0,maxFreeSockets:r?256:void 0,scheduling:`fifo`,...e,family:t,keepAlive:r,timeouts:{idle:e.timeout??0,connection:0,response:0,transfer:0,...e.timeouts},...n.getOptions({family:t,...e.dns})};return delete i.timeout,i},i=e=>{let t=``,n=Object.entries(e).sort((e,t)=>e[0]-t[0]);for(let[e,r]of n)r==null?r=`null`:r instanceof URL?r=r.toString():typeof r==`object`&&(r=i(r)),t+=`${e}:${r}:`;return t};t.exports={normalizeOptions:r,cacheOptions:({secureEndpoint:e,...t})=>i({secureEndpoint:!!e,family:t.family,hints:t.hints,localAddress:t.localAddress,strictSsl:e?!!t.rejectUnauthorized:!1,ca:e?t.ca:null,cert:e?t.cert:null,key:e?t.key:null,keepAlive:t.keepAlive,keepAliveMsecs:t.keepAliveMsecs,maxSockets:t.maxSockets,maxTotalSockets:t.maxTotalSockets,maxFreeSockets:t.maxFreeSockets,scheduling:t.scheduling,timeouts:t.timeouts,proxy:t.proxy})}})),wc=s(((e,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*7,s=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return c(e);if(n===`number`&&isFinite(e))return t.long?u(e):l(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function c(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var c=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return c*s;case`weeks`:case`week`:case`w`:return c*o;case`days`:case`day`:case`d`:return c*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return c*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return c*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return c*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return c;default:return}}}}function l(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+`d`:t>=i?Math.round(e/i)+`h`:t>=r?Math.round(e/r)+`m`:t>=n?Math.round(e/n)+`s`:e+`ms`}function u(e){var t=Math.abs(e);return t>=a?d(e,t,a,`day`):t>=i?d(e,t,i,`hour`):t>=r?d(e,t,r,`minute`):t>=n?d(e,t,n,`second`):e+` ms`}function d(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}})),Tc=s(((e,t)=>{function n(e){n.debug=n,n.default=n,n.coerce=c,n.disable=o,n.enable=i,n.enabled=s,n.humanize=wc(),n.destroy=l,Object.keys(e).forEach(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={};function t(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]}n.selectColor=t;function n(e){let t,i=null,a,o;function s(...e){if(!s.enabled)return;let r=s,i=Number(new Date);r.diff=i-(t||i),r.prev=t,r.curr=i,t=i,e[0]=n.coerce(e[0]),typeof e[0]!=`string`&&e.unshift(`%O`);let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,i)=>{if(t===`%%`)return`%`;a++;let o=n.formatters[i];if(typeof o==`function`){let n=e[a];t=o.call(r,n),e.splice(a,1),a--}return t}),n.formatArgs.call(r,e),(r.log||n.log).apply(r,e)}return s.namespace=e,s.useColors=n.useColors(),s.color=n.selectColor(e),s.extend=r,s.destroy=n.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>i===null?(a!==n.namespaces&&(a=n.namespaces,o=n.enabled(e)),o):i,set:e=>{i=e}}),typeof n.init==`function`&&n.init(s),s}function r(e,t){let r=n(this.namespace+(t===void 0?`:`:t)+e);return r.log=this.log,r}function i(e){n.save(e),n.namespaces=e,n.names=[],n.skips=[];let t=(typeof e==`string`?e:``).trim().replace(/\s+/g,`,`).split(`,`).filter(Boolean);for(let e of t)e[0]===`-`?n.skips.push(e.slice(1)):n.names.push(e)}function a(e,t){let n=0,r=0,i=-1,a=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||t[r]===`*`))t[r]===`*`?(i=r,a=n,r++):(n++,r++);else if(i!==-1)r=i+1,a++,n=a;else return!1;for(;r<t.length&&t[r]===`*`;)r++;return r===t.length}function o(){let e=[...n.names,...n.skips.map(e=>`-`+e)].join(`,`);return n.enable(``),e}function s(e){for(let t of n.skips)if(a(e,t))return!1;for(let t of n.names)if(a(e,t))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}t.exports=n})),Ec=s(((e,t)=>{e.formatArgs=r,e.save=i,e.load=a,e.useColors=n,e.storage=o(),e.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=`#0000CC.#0000FF.#0033CC.#0033FF.#0066CC.#0066FF.#0099CC.#0099FF.#00CC00.#00CC33.#00CC66.#00CC99.#00CCCC.#00CCFF.#3300CC.#3300FF.#3333CC.#3333FF.#3366CC.#3366FF.#3399CC.#3399FF.#33CC00.#33CC33.#33CC66.#33CC99.#33CCCC.#33CCFF.#6600CC.#6600FF.#6633CC.#6633FF.#66CC00.#66CC33.#9900CC.#9900FF.#9933CC.#9933FF.#99CC00.#99CC33.#CC0000.#CC0033.#CC0066.#CC0099.#CC00CC.#CC00FF.#CC3300.#CC3333.#CC3366.#CC3399.#CC33CC.#CC33FF.#CC6600.#CC6633.#CC9900.#CC9933.#CCCC00.#CCCC33.#FF0000.#FF0033.#FF0066.#FF0099.#FF00CC.#FF00FF.#FF3300.#FF3333.#FF3366.#FF3399.#FF33CC.#FF33FF.#FF6600.#FF6633.#FF9900.#FF9933.#FFCC00.#FFCC33`.split(`.`);function n(){if(typeof window<`u`&&window.process&&(window.process.type===`renderer`||window.process.__nwjs))return!0;if(typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<`u`&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<`u`&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<`u`&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(e){if(e[0]=(this.useColors?`%c`:``)+this.namespace+(this.useColors?` %c`:` `)+e[0]+(this.useColors?`%c `:` `)+`+`+t.exports.humanize(this.diff),!this.useColors)return;let n=`color: `+this.color;e.splice(1,0,n,`color: inherit`);let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{e!==`%%`&&(r++,e===`%c`&&(i=r))}),e.splice(i,0,n)}e.log=console.debug||console.log||(()=>{});function i(t){try{t?e.storage.setItem(`debug`,t):e.storage.removeItem(`debug`)}catch{}}function a(){let t;try{t=e.storage.getItem(`debug`)||e.storage.getItem(`DEBUG`)}catch{}return!t&&typeof process<`u`&&`env`in process&&(t=process.env.DEBUG),t}function o(){try{return localStorage}catch{}}t.exports=Tc()(e);var{formatters:s}=t.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}}})),Dc=s(((e,t)=>{t.exports=(e,t=process.argv)=>{let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1||r<i)}})),Oc=s(((e,t)=>{var n=require("os"),r=require("tty"),i=Dc(),{env:a}=process,o;i(`no-color`)||i(`no-colors`)||i(`color=false`)||i(`color=never`)?o=0:(i(`color`)||i(`colors`)||i(`color=true`)||i(`color=always`))&&(o=1);function s(){if(`FORCE_COLOR`in a)return a.FORCE_COLOR===`true`?1:a.FORCE_COLOR===`false`?0:a.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(a.FORCE_COLOR,10),3)}function c(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function l(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let c=s();c!==void 0&&(o=c);let l=r?o:c;if(l===0)return 0;if(r){if(i(`color=16m`)||i(`color=full`)||i(`color=truecolor`))return 3;if(i(`color=256`))return 2}if(e&&!t&&l===void 0)return 0;let u=l||0;if(a.TERM===`dumb`)return u;if(process.platform===`win32`){let e=n.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in a)return[`TRAVIS`,`CIRCLECI`,`APPVEYOR`,`GITLAB_CI`,`GITHUB_ACTIONS`,`BUILDKITE`,`DRONE`].some(e=>e in a)||a.CI_NAME===`codeship`?1:u;if(`TEAMCITY_VERSION`in a)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(a.TEAMCITY_VERSION);if(a.COLORTERM===`truecolor`)return 3;if(`TERM_PROGRAM`in a){let e=Number.parseInt((a.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(a.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(a.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(a.TERM)||`COLORTERM`in a?1:u}function u(e,t={}){return c(l(e,{streamIsTTY:e&&e.isTTY,...t}))}t.exports={supportsColor:u,stdout:u({isTTY:r.isatty(1)}),stderr:u({isTTY:r.isatty(2)})}})),kc=s(((e,t)=>{var n=require("tty"),r=require("util");e.init=u,e.log=s,e.formatArgs=a,e.save=c,e.load=l,e.useColors=i,e.destroy=r.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),e.colors=[6,2,3,4,5,1];try{let t=Oc();t&&(t.stderr||t).level>=2&&(e.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}e.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),r=process.env[t];return r=/^(yes|on|true|enabled)$/i.test(r)?!0:/^(no|off|false|disabled)$/i.test(r)?!1:r===`null`?null:Number(r),e[n]=r,e},{});function i(){return`colors`in e.inspectOpts?!!e.inspectOpts.colors:n.isatty(process.stderr.fd)}function a(e){let{namespace:n,useColors:r}=this;if(r){let r=this.color,i=`\x1B[3`+(r<8?r:`8;5;`+r),a=` ${i};1m${n} \u001B[0m`;e[0]=a+e[0].split(`
441
+ >>> no match, partial?`,t,f,n,p),f===c))}let a;if(typeof u==`string`?(a=d===u,this.debug(`string match`,u,d,a)):(a=u.test(d),this.debug(`pattern match`,u,d,a)),!a)return!1}if(o===c&&s===l)return!0;if(o===c)return r;if(s===l)return o===c-1&&t[o]===``;throw Error(`wtf?`)}braceExpand(){return(0,e.braceExpand)(this.pattern,this.options)}parse(t){(0,n.assertValidPattern)(t);let r=this.options;if(t===`**`)return e.GLOBSTAR;if(t===``)return``;let i,o=null;(i=t.match(x))?o=r.dot?C:S:(i=t.match(d))?o=(r.nocase?r.dot?h:m:r.dot?p:f)(i[1]):(i=t.match(w))?o=(r.nocase?r.dot?E:T:r.dot?D:O)(i):(i=t.match(g))?o=r.dot?v:_:(i=t.match(y))&&(o=b);let s=a.AST.fromGlob(t,this.options).toMMPattern();return o&&typeof s==`object`&&Reflect.defineProperty(s,"test",{value:o}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?ee:n.dot?N:P,i=new Set(n.nocase?[`i`]:[]),a=t.map(t=>{let n=t.map(t=>{if(t instanceof RegExp)for(let e of t.flags.split(``))i.add(e);return typeof t==`string`?L(t):t===e.GLOBSTAR?e.GLOBSTAR:t._src});n.forEach((t,i)=>{let a=n[i+1],o=n[i-1];t!==e.GLOBSTAR||o===e.GLOBSTAR||(o===void 0?a!==void 0&&a!==e.GLOBSTAR?n[i+1]=`(?:\\/|`+r+`\\/)?`+a:n[i]=r:a===void 0?n[i-1]=o+`(?:\\/|\\/`+r+`)?`:a!==e.GLOBSTAR&&(n[i-1]=o+`(?:\\/|\\/`+r+`\\/)`+a,n[i+1]=e.GLOBSTAR))});let a=n.filter(t=>t!==e.GLOBSTAR);if(this.partial&&a.length>=1){let e=[];for(let t=1;t<=a.length;t++)e.push(a.slice(0,t).join(`/`));return`(?:`+e.join(`|`)+`)`}return a.join(`/`)}).join(`|`),[o,s]=t.length>1?[`(?:`,`)`]:[``,``];a=`^`+o+a+s+`$`,this.partial&&(a=`^(?:\\/|`+o+a.slice(1,-1)+s+`)$`),this.negate&&(a=`^(?!`+a+`).+$`);try{this.regexp=new RegExp(a,[...i].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^\/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e=0;e<i.length;e++){let o=i[e],s=r;if(n.matchBase&&o.length===1&&(s=[a]),this.matchOne(s,o,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(t){return e.minimatch.defaults(t).Minimatch}};e.Minimatch=R;var te=s();Object.defineProperty(e,"AST",{enumerable:!0,get:function(){return te.AST}});var z=c();Object.defineProperty(e,"escape",{enumerable:!0,get:function(){return z.escape}});var B=o();Object.defineProperty(e,"unescape",{enumerable:!0,get:function(){return B.unescape}}),e.minimatch.AST=a.AST,e.minimatch.Minimatch=R,e.minimatch.escape=l.escape,e.minimatch.unescape=u.unescape}),u=t(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=void 0;var t=typeof performance==`object`&&performance&&typeof performance.now==`function`?performance:Date,n=new Set,r=typeof process==`object`&&process?process:{},i=(e,t,n,i)=>{typeof r.emitWarning==`function`?r.emitWarning(e,t,n,i):console.error(`[${n}] ${t}: ${e}`)},a=globalThis.AbortController,o=globalThis.AbortSignal;if(typeof a>`u`){o=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},a=class{constructor(){t()}signal=new o;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(let t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e=r.env?.LRU_CACHE_IGNORE_AC_WARNING!==`1`,t=()=>{e&&(e=!1,i("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.",`NO_ABORT_CONTROLLER`,`ENOTSUP`,t))}}var s=e=>!n.has(e),c=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),l=e=>c(e)?e<=2**8?Uint8Array:e<=2**16?Uint16Array:e<=2**32?Uint32Array:e<=2**53-1?u:null:null,u=class extends Array{constructor(e){super(e),this.fill(0)}},d=class e{heap;length;static#e=!1;static create(t){let n=l(t);if(!n)return[];e.#e=!0;let r=new e(t,n);return e.#e=!1,r}constructor(t,n){if(!e.#e)throw TypeError(`instantiate Stack using Stack.create(n)`);this.heap=new n(t),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};e.LRUCache=class e{#e;#t;#n;#r;#i;#a;#o;#s;get perf(){return this.#s}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;#C;#w;#T;#E;static unsafeExposeInternals(e){return{starts:e.#b,ttls:e.#x,autopurgeTimers:e.#S,sizes:e.#y,keyMap:e.#u,keyList:e.#d,valList:e.#f,next:e.#p,prev:e.#m,get head(){return e.#h},get tail(){return e.#g},free:e.#_,isBackgroundFetch:t=>e.#V(t),backgroundFetch:(t,n,r,i)=>e.#B(t,n,r,i),moveToTail:t=>e.#U(t),indexes:t=>e.#I(t),rindexes:t=>e.#L(t),isStale:t=>e.#j(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#l}get size(){return this.#c}get fetchMethod(){return this.#a}get memoMethod(){return this.#o}get dispose(){return this.#n}get onInsert(){return this.#r}get disposeAfter(){return this.#i}constructor(r){let{max:a=0,ttl:o,ttlResolution:u=1,ttlAutopurge:f,updateAgeOnGet:p,updateAgeOnHas:m,allowStale:h,dispose:g,onInsert:_,disposeAfter:v,noDisposeOnSet:y,noUpdateTTL:b,maxSize:x=0,maxEntrySize:S=0,sizeCalculation:C,fetchMethod:w,memoMethod:T,noDeleteOnFetchRejection:E,noDeleteOnStaleGet:D,allowStaleOnFetchRejection:O,allowStaleOnFetchAbort:k,ignoreFetchAbort:A,perf:j}=r;if(j!==void 0&&typeof j?.now!=`function`)throw TypeError(`perf option must have a now() method if specified`);if(this.#s=j??t,a!==0&&!c(a))throw TypeError(`max option must be a nonnegative integer`);let M=a?l(a):Array;if(!M)throw Error(`invalid max value: `+a);if(this.#e=a,this.#t=x,this.maxEntrySize=S||this.#t,this.sizeCalculation=C,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw TypeError(`cannot set sizeCalculation without setting maxSize or maxEntrySize`);if(typeof this.sizeCalculation!=`function`)throw TypeError(`sizeCalculation set to non-function`)}if(T!==void 0&&typeof T!=`function`)throw TypeError(`memoMethod must be a function if defined`);if(this.#o=T,w!==void 0&&typeof w!=`function`)throw TypeError(`fetchMethod must be a function if specified`);if(this.#a=w,this.#w=!!w,this.#u=new Map,this.#d=Array(a).fill(void 0),this.#f=Array(a).fill(void 0),this.#p=new M(a),this.#m=new M(a),this.#h=0,this.#g=0,this.#_=d.create(a),this.#c=0,this.#l=0,typeof g==`function`&&(this.#n=g),typeof _==`function`&&(this.#r=_),typeof v==`function`?(this.#i=v,this.#v=[]):(this.#i=void 0,this.#v=void 0),this.#C=!!this.#n,this.#E=!!this.#r,this.#T=!!this.#i,this.noDisposeOnSet=!!y,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!E,this.allowStaleOnFetchRejection=!!O,this.allowStaleOnFetchAbort=!!k,this.ignoreFetchAbort=!!A,this.maxEntrySize!==0){if(this.#t!==0&&!c(this.#t))throw TypeError(`maxSize must be a positive integer if specified`);if(!c(this.maxEntrySize))throw TypeError(`maxEntrySize must be a positive integer if specified`);this.#M()}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!D,this.updateAgeOnGet=!!p,this.updateAgeOnHas=!!m,this.ttlResolution=c(u)||u===0?u:1,this.ttlAutopurge=!!f,this.ttl=o||0,this.ttl){if(!c(this.ttl))throw TypeError(`ttl must be a positive integer if specified`);this.#D()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw TypeError(`At least one of max, maxSize, or ttl is required`);if(!this.ttlAutopurge&&!this.#e&&!this.#t){let t=`LRU_CACHE_UNBOUNDED`;s(t)&&(n.add(t),i(`TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.`,`UnboundedCacheWarning`,t,e))}}getRemainingTTL(e){return this.#u.has(e)?1/0:0}#D(){let e=new u(this.#e),t=new u(this.#e);this.#x=e,this.#b=t;let n=this.ttlAutopurge?Array(this.#e):void 0;this.#S=n,this.#A=(r,i,a=this.#s.now())=>{if(t[r]=i===0?0:a,e[r]=i,n?.[r]&&(clearTimeout(n[r]),n[r]=void 0),i!==0&&n){let e=setTimeout(()=>{this.#j(r)&&this.#W(this.#d[r],`expire`)},i+1);e.unref&&e.unref(),n[r]=e}},this.#O=n=>{t[n]=e[n]===0?0:this.#s.now()},this.#k=(n,a)=>{if(e[a]){let o=e[a],s=t[a];if(!o||!s)return;n.ttl=o,n.start=s,n.now=r||i(),n.remainingTTL=o-(n.now-s)}};let r=0,i=()=>{let e=this.#s.now();if(this.ttlResolution>0){r=e;let t=setTimeout(()=>r=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=n=>{let a=this.#u.get(n);if(a===void 0)return 0;let o=e[a],s=t[a];return!o||!s?1/0:o-((r||i())-s)},this.#j=n=>{let a=t[n],o=e[n];return!!o&&!!a&&(r||i())-a>o}}#O=()=>{};#k=()=>{};#A=()=>{};#j=()=>!1;#M(){let e=new u(this.#e);this.#l=0,this.#y=e,this.#N=t=>{this.#l-=e[t],e[t]=0},this.#F=(e,t,n,r)=>{if(this.#V(t))return 0;if(!c(n))if(r){if(typeof r!=`function`)throw TypeError(`sizeCalculation must be a function`);if(n=r(t,e),!c(n))throw TypeError(`sizeCalculation return invalid (expect positive integer)`)}else throw TypeError(`invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.`);return n},this.#P=(t,n,r)=>{if(e[t]=n,this.#t){let n=this.#t-e[t];for(;this.#l>n;)this.#z(!0)}this.#l+=e[t],r&&(r.entrySize=n,r.totalCalculatedSize=this.#l)}}#N=e=>{};#P=(e,t,n)=>{};#F=(e,t,n,r)=>{if(n||r)throw TypeError(`cannot set size without setting maxSize or maxEntrySize on cache`);return 0};*#I({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#g;!(!this.#R(t)||((e||!this.#j(t))&&(yield t),t===this.#h));)t=this.#m[t]}*#L({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#h;!(!this.#R(t)||((e||!this.#j(t))&&(yield t),t===this.#g));)t=this.#p[t]}#R(e){return e!==void 0&&this.#u.get(this.#d[e])===e}*entries(){for(let e of this.#I())this.#f[e]!==void 0&&this.#d[e]!==void 0&&!this.#V(this.#f[e])&&(yield[this.#d[e],this.#f[e]])}*rentries(){for(let e of this.#L())this.#f[e]!==void 0&&this.#d[e]!==void 0&&!this.#V(this.#f[e])&&(yield[this.#d[e],this.#f[e]])}*keys(){for(let e of this.#I()){let t=this.#d[e];t!==void 0&&!this.#V(this.#f[e])&&(yield t)}}*rkeys(){for(let e of this.#L()){let t=this.#d[e];t!==void 0&&!this.#V(this.#f[e])&&(yield t)}}*values(){for(let e of this.#I())this.#f[e]!==void 0&&!this.#V(this.#f[e])&&(yield this.#f[e])}*rvalues(){for(let e of this.#L())this.#f[e]!==void 0&&!this.#V(this.#f[e])&&(yield this.#f[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]=`LRUCache`;find(e,t={}){for(let n of this.#I()){let r=this.#f[n],i=this.#V(r)?r.__staleWhileFetching:r;if(i!==void 0&&e(i,this.#d[n],this))return this.get(this.#d[n],t)}}forEach(e,t=this){for(let n of this.#I()){let r=this.#f[n],i=this.#V(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#d[n],this)}}rforEach(e,t=this){for(let n of this.#L()){let r=this.#f[n],i=this.#V(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#d[n],this)}}purgeStale(){let e=!1;for(let t of this.#L({allowStale:!0}))this.#j(t)&&(this.#W(this.#d[t],`expire`),e=!0);return e}info(e){let t=this.#u.get(e);if(t===void 0)return;let n=this.#f[t],r=this.#V(n)?n.__staleWhileFetching:n;if(r===void 0)return;let i={value:r};if(this.#x&&this.#b){let e=this.#x[t],n=this.#b[t];e&&n&&(i.ttl=e-(this.#s.now()-n),i.start=Date.now())}return this.#y&&(i.size=this.#y[t]),i}dump(){let e=[];for(let t of this.#I({allowStale:!0})){let n=this.#d[t],r=this.#f[t],i=this.#V(r)?r.__staleWhileFetching:r;if(i===void 0||n===void 0)continue;let a={value:i};if(this.#x&&this.#b){a.ttl=this.#x[t];let e=this.#s.now()-this.#b[t];a.start=Math.floor(Date.now()-e)}this.#y&&(a.size=this.#y[t]),e.unshift([n,a])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let e=Date.now()-n.start;n.start=this.#s.now()-e}this.set(t,n.value,n)}}set(e,t,n={}){if(t===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:i,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:s}=n,{noUpdateTTL:c=this.noUpdateTTL}=n,l=this.#F(e,t,n.size||0,o);if(this.maxEntrySize&&l>this.maxEntrySize)return s&&(s.set=`miss`,s.maxEntrySizeExceeded=!0),this.#W(e,`set`),this;let u=this.#c===0?void 0:this.#u.get(e);if(u===void 0)u=this.#c===0?this.#g:this.#_.length===0?this.#c===this.#e?this.#z(!1):this.#c:this.#_.pop(),this.#d[u]=e,this.#f[u]=t,this.#u.set(e,u),this.#p[this.#g]=u,this.#m[u]=this.#g,this.#g=u,this.#c++,this.#P(u,l,s),s&&(s.set=`add`),c=!1,this.#E&&this.#r?.(t,e,`add`);else{this.#U(u);let n=this.#f[u];if(t!==n){if(this.#w&&this.#V(n)){n.__abortController.abort(Error(`replaced`));let{__staleWhileFetching:t}=n;t!==void 0&&!a&&(this.#C&&this.#n?.(t,e,`set`),this.#T&&this.#v?.push([t,e,`set`]))}else a||(this.#C&&this.#n?.(n,e,`set`),this.#T&&this.#v?.push([n,e,`set`]));if(this.#N(u),this.#P(u,l,s),this.#f[u]=t,s){s.set=`replace`;let e=n&&this.#V(n)?n.__staleWhileFetching:n;e!==void 0&&(s.oldValue=e)}}else s&&(s.set=`update`);this.#E&&this.onInsert?.(t,e,t===n?`update`:`replace`)}if(r!==0&&!this.#x&&this.#D(),this.#x&&(c||this.#A(u,r,i),s&&this.#k(s,u)),!a&&this.#T&&this.#v){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}return this}pop(){try{for(;this.#c;){let e=this.#f[this.#h];if(this.#z(!0),this.#V(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#T&&this.#v){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}}}#z(e){let t=this.#h,n=this.#d[t],r=this.#f[t];return this.#w&&this.#V(r)?r.__abortController.abort(Error(`evicted`)):(this.#C||this.#T)&&(this.#C&&this.#n?.(r,n,`evict`),this.#T&&this.#v?.push([r,n,`evict`])),this.#N(t),this.#S?.[t]&&(clearTimeout(this.#S[t]),this.#S[t]=void 0),e&&(this.#d[t]=void 0,this.#f[t]=void 0,this.#_.push(t)),this.#c===1?(this.#h=this.#g=0,this.#_.length=0):this.#h=this.#p[t],this.#u.delete(n),this.#c--,t}has(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:r}=t,i=this.#u.get(e);if(i!==void 0){let e=this.#f[i];if(this.#V(e)&&e.__staleWhileFetching===void 0)return!1;if(this.#j(i))r&&(r.has=`stale`,this.#k(r,i));else return n&&this.#O(i),r&&(r.has=`hit`,this.#k(r,i)),!0}else r&&(r.has=`miss`);return!1}peek(e,t={}){let{allowStale:n=this.allowStale}=t,r=this.#u.get(e);if(r===void 0||!n&&this.#j(r))return;let i=this.#f[r];return this.#V(i)?i.__staleWhileFetching:i}#B(e,t,n,r){let i=t===void 0?void 0:this.#f[t];if(this.#V(i))return i;let o=new a,{signal:s}=n;s?.addEventListener(`abort`,()=>o.abort(s.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:r},l=(r,i=!1)=>{let{aborted:a}=o.signal,s=n.ignoreFetchAbort&&r!==void 0,l=n.ignoreFetchAbort||!!(n.allowStaleOnFetchAbort&&r!==void 0);if(n.status&&(a&&!i?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,s&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),a&&!s&&!i)return d(o.signal.reason,l);let u=p,f=this.#f[t];return(f===p||s&&i&&f===void 0)&&(r===void 0?u.__staleWhileFetching===void 0?this.#W(e,`fetch`):this.#f[t]=u.__staleWhileFetching:(n.status&&(n.status.fetchUpdated=!0),this.set(e,r,c.options))),r},u=e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),d(e,!1)),d=(r,i)=>{let{aborted:a}=o.signal,s=a&&n.allowStaleOnFetchAbort,c=s||n.allowStaleOnFetchRejection,l=c||n.noDeleteOnFetchRejection,u=p;if(this.#f[t]===p&&(!l||!i&&u.__staleWhileFetching===void 0?this.#W(e,`fetch`):s||(this.#f[t]=u.__staleWhileFetching)),c)return n.status&&u.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),u.__staleWhileFetching;if(u.__returned===u)throw r},f=(t,r)=>{let a=this.#a?.(e,i,c);a&&a instanceof Promise&&a.then(e=>t(e===void 0?void 0:e),r),o.signal.addEventListener(`abort`,()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(t(void 0),n.allowStaleOnFetchAbort&&(t=e=>l(e,!0)))})};n.status&&(n.status.fetchDispatched=!0);let p=new Promise(f).then(l,u),m=Object.assign(p,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return t===void 0?(this.set(e,m,{...c.options,status:void 0}),t=this.#u.get(e)):this.#f[t]=m,m}#V(e){if(!this.#w)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty(`__staleWhileFetching`)&&t.__abortController instanceof a}async fetch(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:s=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:h=!1,status:g,signal:_}=t;if(!this.#w)return g&&(g.fetch=`get`),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:g});let v={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:a,noDisposeOnSet:o,size:s,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:g,signal:_},y=this.#u.get(e);if(y===void 0){g&&(g.fetch=`miss`);let t=this.#B(e,y,v,m);return t.__returned=t}else{let t=this.#f[y];if(this.#V(t)){let e=n&&t.__staleWhileFetching!==void 0;return g&&(g.fetch=`inflight`,e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let i=this.#j(y);if(!h&&!i)return g&&(g.fetch=`hit`),this.#U(y),r&&this.#O(y),g&&this.#k(g,y),t;let a=this.#B(e,y,v,m),o=a.__staleWhileFetching!==void 0&&n;return g&&(g.fetch=i?`stale`:`refresh`,o&&i&&(g.returnedStale=!0)),o?a.__staleWhileFetching:a.__returned=a}}async forceFetch(e,t={}){let n=await this.fetch(e,t);if(n===void 0)throw Error(`fetch() returned undefined`);return n}memo(e,t={}){let n=this.#o;if(!n)throw Error(`no memoMethod provided to constructor`);let{context:r,forceRefresh:i,...a}=t,o=this.get(e,a);if(!i&&o!==void 0)return o;let s=n(e,o,{options:a,context:r});return this.set(e,s,a),s}get(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:a}=t,o=this.#u.get(e);if(o!==void 0){let t=this.#f[o],s=this.#V(t);return a&&this.#k(a,o),this.#j(o)?(a&&(a.get=`stale`),s?(a&&n&&t.__staleWhileFetching!==void 0&&(a.returnedStale=!0),n?t.__staleWhileFetching:void 0):(i||this.#W(e,`expire`),a&&n&&(a.returnedStale=!0),n?t:void 0)):(a&&(a.get=`hit`),s?t.__staleWhileFetching:(this.#U(o),r&&this.#O(o),t))}else a&&(a.get=`miss`)}#H(e,t){this.#m[t]=e,this.#p[e]=t}#U(e){e!==this.#g&&(e===this.#h?this.#h=this.#p[e]:this.#H(this.#m[e],this.#p[e]),this.#H(this.#g,e),this.#g=e)}delete(e){return this.#W(e,`delete`)}#W(e,t){let n=!1;if(this.#c!==0){let r=this.#u.get(e);if(r!==void 0)if(this.#S?.[r]&&(clearTimeout(this.#S?.[r]),this.#S[r]=void 0),n=!0,this.#c===1)this.#G(t);else{this.#N(r);let n=this.#f[r];if(this.#V(n)?n.__abortController.abort(Error(`deleted`)):(this.#C||this.#T)&&(this.#C&&this.#n?.(n,e,t),this.#T&&this.#v?.push([n,e,t])),this.#u.delete(e),this.#d[r]=void 0,this.#f[r]=void 0,r===this.#g)this.#g=this.#m[r];else if(r===this.#h)this.#h=this.#p[r];else{let e=this.#m[r];this.#p[e]=this.#p[r];let t=this.#p[r];this.#m[t]=this.#m[r]}this.#c--,this.#_.push(r)}}if(this.#T&&this.#v?.length){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}return n}clear(){return this.#G(`delete`)}#G(e){for(let t of this.#L({allowStale:!0})){let n=this.#f[t];if(this.#V(n))n.__abortController.abort(Error(`deleted`));else{let r=this.#d[t];this.#C&&this.#n?.(n,r,e),this.#T&&this.#v?.push([n,r,e])}}if(this.#u.clear(),this.#f.fill(void 0),this.#d.fill(void 0),this.#x&&this.#b){this.#x.fill(0),this.#b.fill(0);for(let e of this.#S??[])e!==void 0&&clearTimeout(e);this.#S?.fill(void 0)}if(this.#y&&this.#y.fill(0),this.#h=0,this.#g=0,this.#_.length=0,this.#l=0,this.#c=0,this.#T&&this.#v){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}}}}),d=t(e=>{"use strict";var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Minipass=e.isWritable=e.isReadable=e.isStream=void 0;var n=typeof process==`object`&&process?process:{stdout:null,stderr:null},r=require("node:events"),i=t(require("node:stream")),a=require("node:string_decoder");e.isStream=t=>!!t&&typeof t==`object`&&(t instanceof U||t instanceof i.default||(0,e.isReadable)(t)||(0,e.isWritable)(t)),e.isReadable=e=>!!e&&typeof e==`object`&&e instanceof r.EventEmitter&&typeof e.pipe==`function`&&e.pipe!==i.default.Writable.prototype.pipe,e.isWritable=e=>!!e&&typeof e==`object`&&e instanceof r.EventEmitter&&typeof e.write==`function`&&typeof e.end==`function`;var o=Symbol(`EOF`),s=Symbol(`maybeEmitEnd`),c=Symbol(`emittedEnd`),l=Symbol(`emittingEnd`),u=Symbol(`emittedError`),d=Symbol(`closed`),f=Symbol(`read`),p=Symbol(`flush`),m=Symbol(`flushChunk`),h=Symbol(`encoding`),g=Symbol(`decoder`),_=Symbol(`flowing`),v=Symbol(`paused`),y=Symbol(`resume`),b=Symbol(`buffer`),x=Symbol(`pipes`),S=Symbol(`bufferLength`),C=Symbol(`bufferPush`),w=Symbol(`bufferShift`),T=Symbol(`objectMode`),E=Symbol(`destroyed`),D=Symbol(`error`),O=Symbol(`emitData`),k=Symbol(`emitEnd`),A=Symbol(`emitEnd2`),j=Symbol(`async`),M=Symbol(`abort`),ee=Symbol(`aborted`),N=Symbol(`signal`),P=Symbol(`dataListeners`),F=Symbol(`discarded`),I=e=>Promise.resolve().then(e),L=e=>e(),R=e=>e===`end`||e===`finish`||e===`prefinish`,te=e=>e instanceof ArrayBuffer||!!e&&typeof e==`object`&&e.constructor&&e.constructor.name===`ArrayBuffer`&&e.byteLength>=0,z=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e),B=class{src;dest;opts;ondrain;constructor(e,t,n){this.src=e,this.dest=t,this.opts=n,this.ondrain=()=>e[y](),this.dest.on(`drain`,this.ondrain)}unpipe(){this.dest.removeListener(`drain`,this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},V=class extends B{unpipe(){this.src.removeListener(`error`,this.proxyErrors),super.unpipe()}constructor(e,t,n){super(e,t,n),this.proxyErrors=e=>this.dest.emit(`error`,e),e.on(`error`,this.proxyErrors)}},ne=e=>!!e.objectMode,H=e=>!e.objectMode&&!!e.encoding&&e.encoding!==`buffer`,U=class extends r.EventEmitter{[_]=!1;[v]=!1;[x]=[];[b]=[];[T];[h];[j];[g];[o]=!1;[c]=!1;[l]=!1;[d]=!1;[u]=null;[S]=0;[E]=!1;[N];[ee]=!1;[P]=0;[F]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding==`string`)throw TypeError(`Encoding and objectMode may not be used together`);ne(t)?(this[T]=!0,this[h]=null):H(t)?(this[h]=t.encoding,this[T]=!1):(this[T]=!1,this[h]=null),this[j]=!!t.async,this[g]=this[h]?new a.StringDecoder(this[h]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[b]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[x]});let{signal:n}=t;n&&(this[N]=n,n.aborted?this[M]():n.addEventListener(`abort`,()=>this[M]()))}get bufferLength(){return this[S]}get encoding(){return this[h]}set encoding(e){throw Error(`Encoding must be set at instantiation time`)}setEncoding(e){throw Error(`Encoding must be set at instantiation time`)}get objectMode(){return this[T]}set objectMode(e){throw Error(`objectMode must be set at instantiation time`)}get async(){return this[j]}set async(e){this[j]=this[j]||!!e}[M](){this[ee]=!0,this.emit(`abort`,this[N]?.reason),this.destroy(this[N]?.reason)}get aborted(){return this[ee]}set aborted(e){}write(e,t,n){if(this[ee])return!1;if(this[o])throw Error(`write after end`);if(this[E])return this.emit(`error`,Object.assign(Error(`Cannot call write after a stream was destroyed`),{code:`ERR_STREAM_DESTROYED`})),!0;typeof t==`function`&&(n=t,t=`utf8`),t||=`utf8`;let r=this[j]?I:L;if(!this[T]&&!Buffer.isBuffer(e)){if(z(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(te(e))e=Buffer.from(e);else if(typeof e!=`string`)throw Error(`Non-contiguous data written to non-objectMode stream`)}return this[T]?(this[_]&&this[S]!==0&&this[p](!0),this[_]?this.emit(`data`,e):this[C](e),this[S]!==0&&this.emit(`readable`),n&&r(n),this[_]):e.length?(typeof e==`string`&&!(t===this[h]&&!this[g]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[h]&&(e=this[g].write(e)),this[_]&&this[S]!==0&&this[p](!0),this[_]?this.emit(`data`,e):this[C](e),this[S]!==0&&this.emit(`readable`),n&&r(n),this[_]):(this[S]!==0&&this.emit(`readable`),n&&r(n),this[_])}read(e){if(this[E])return null;if(this[F]=!1,this[S]===0||e===0||e&&e>this[S])return this[s](),null;this[T]&&(e=null),this[b].length>1&&!this[T]&&(this[b]=[this[h]?this[b].join(``):Buffer.concat(this[b],this[S])]);let t=this[f](e||null,this[b][0]);return this[s](),t}[f](e,t){if(this[T])this[w]();else{let n=t;e===n.length||e===null?this[w]():typeof n==`string`?(this[b][0]=n.slice(e),t=n.slice(0,e),this[S]-=e):(this[b][0]=n.subarray(e),t=n.subarray(0,e),this[S]-=e)}return this.emit(`data`,t),!this[b].length&&!this[o]&&this.emit(`drain`),t}end(e,t,n){return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=`utf8`),e!==void 0&&this.write(e,t),n&&this.once(`end`,n),this[o]=!0,this.writable=!1,(this[_]||!this[v])&&this[s](),this}[y](){this[E]||(!this[P]&&!this[x].length&&(this[F]=!0),this[v]=!1,this[_]=!0,this.emit(`resume`),this[b].length?this[p]():this[o]?this[s]():this.emit(`drain`))}resume(){return this[y]()}pause(){this[_]=!1,this[v]=!0,this[F]=!1}get destroyed(){return this[E]}get flowing(){return this[_]}get paused(){return this[v]}[C](e){this[T]?this[S]+=1:this[S]+=e.length,this[b].push(e)}[w](){return this[T]?--this[S]:this[S]-=this[b][0].length,this[b].shift()}[p](e=!1){do;while(this[m](this[w]())&&this[b].length);!e&&!this[b].length&&!this[o]&&this.emit(`drain`)}[m](e){return this.emit(`data`,e),this[_]}pipe(e,t){if(this[E])return e;this[F]=!1;let r=this[c];return t||={},e===n.stdout||e===n.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this[x].push(t.proxyErrors?new V(this,e,t):new B(this,e,t)),this[j]?I(()=>this[y]()):this[y]()),e}unpipe(e){let t=this[x].find(t=>t.dest===e);t&&(this[x].length===1?(this[_]&&this[P]===0&&(this[_]=!1),this[x]=[]):this[x].splice(this[x].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let n=super.on(e,t);if(e===`data`)this[F]=!1,this[P]++,!this[x].length&&!this[_]&&this[y]();else if(e===`readable`&&this[S]!==0)super.emit(`readable`);else if(R(e)&&this[c])super.emit(e),this.removeAllListeners(e);else if(e===`error`&&this[u]){let e=t;this[j]?I(()=>e.call(this,this[u])):e.call(this,this[u])}return n}removeListener(e,t){return this.off(e,t)}off(e,t){let n=super.off(e,t);return e===`data`&&(this[P]=this.listeners(`data`).length,this[P]===0&&!this[F]&&!this[x].length&&(this[_]=!1)),n}removeAllListeners(e){let t=super.removeAllListeners(e);return(e===`data`||e===void 0)&&(this[P]=0,!this[F]&&!this[x].length&&(this[_]=!1)),t}get emittedEnd(){return this[c]}[s](){!this[l]&&!this[c]&&!this[E]&&this[b].length===0&&this[o]&&(this[l]=!0,this.emit(`end`),this.emit(`prefinish`),this.emit(`finish`),this[d]&&this.emit(`close`),this[l]=!1)}emit(e,...t){let n=t[0];if(e!==`error`&&e!==`close`&&e!==E&&this[E])return!1;if(e===`data`)return!this[T]&&!n?!1:this[j]?(I(()=>this[O](n)),!0):this[O](n);if(e===`end`)return this[k]();if(e===`close`){if(this[d]=!0,!this[c]&&!this[E])return!1;let e=super.emit(`close`);return this.removeAllListeners(`close`),e}else if(e===`error`){this[u]=n,super.emit(D,n);let e=!this[N]||this.listeners(`error`).length?super.emit(`error`,n):!1;return this[s](),e}else if(e===`resume`){let e=super.emit(`resume`);return this[s](),e}else if(e===`finish`||e===`prefinish`){let t=super.emit(e);return this.removeAllListeners(e),t}let r=super.emit(e,...t);return this[s](),r}[O](e){for(let t of this[x])t.dest.write(e)===!1&&this.pause();let t=this[F]?!1:super.emit(`data`,e);return this[s](),t}[k](){return this[c]?!1:(this[c]=!0,this.readable=!1,this[j]?(I(()=>this[A]()),!0):this[A]())}[A](){if(this[g]){let e=this[g].end();if(e){for(let t of this[x])t.dest.write(e);this[F]||super.emit(`data`,e)}}for(let e of this[x])e.end();let e=super.emit(`end`);return this.removeAllListeners(`end`),e}async collect(){let e=Object.assign([],{dataLength:0});this[T]||(e.dataLength=0);let t=this.promise();return this.on(`data`,t=>{e.push(t),this[T]||(e.dataLength+=t.length)}),await t,e}async concat(){if(this[T])throw Error(`cannot concat in objectMode`);let e=await this.collect();return this[h]?e.join(``):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(E,()=>t(Error(`stream destroyed`))),this.on(`error`,e=>t(e)),this.on(`end`,()=>e())})}[Symbol.asyncIterator](){this[F]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return t();let n=this.read();if(n!==null)return Promise.resolve({done:!1,value:n});if(this[o])return t();let r,i,a=e=>{this.off(`data`,s),this.off(`end`,c),this.off(E,l),t(),i(e)},s=e=>{this.off(`error`,a),this.off(`end`,c),this.off(E,l),this.pause(),r({value:e,done:!!this[o]})},c=()=>{this.off(`error`,a),this.off(`data`,s),this.off(E,l),t(),r({done:!0,value:void 0})},l=()=>a(Error(`stream destroyed`));return new Promise((e,t)=>{i=t,r=e,this.once(E,l),this.once(`error`,a),this.once(`end`,c),this.once(`data`,s)})},throw:t,return:t,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[F]=!1;let e=!1,t=()=>(this.pause(),this.off(D,t),this.off(E,t),this.off(`end`,t),e=!0,{done:!0,value:void 0});return this.once(`end`,t),this.once(D,t),this.once(E,t),{next:()=>{if(e)return t();let n=this.read();return n===null?t():{done:!1,value:n}},throw:t,return:t,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(e){if(this[E])return e?this.emit(`error`,e):this.emit(E),this;this[E]=!0,this[F]=!0,this[b].length=0,this[S]=0;let t=this;return typeof t.close==`function`&&!this[d]&&t.close(),e?this.emit(`error`,e):this.emit(E),this}static get isStream(){return e.isStream}};e.Minipass=U}),f=t(e=>{"use strict";var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.PathScurry=e.Path=e.PathScurryDarwin=e.PathScurryPosix=e.PathScurryWin32=e.PathScurryBase=e.PathPosix=e.PathWin32=e.PathBase=e.ChildrenCache=e.ResolveCache=void 0;var i=u(),a=require("node:path"),o=require("node:url"),s=require("fs"),c=r(require("node:fs")),l=s.realpathSync.native,f=require("node:fs/promises"),p=d(),m={lstatSync:s.lstatSync,readdir:s.readdir,readdirSync:s.readdirSync,readlinkSync:s.readlinkSync,realpathSync:l,promises:{lstat:f.lstat,readdir:f.readdir,readlink:f.readlink,realpath:f.realpath}},h=e=>!e||e===m||e===c?m:{...m,...e,promises:{...m.promises,...e.promises||{}}},g=/^\\\\\?\\([a-z]:)\\?$/i,_=e=>e.replace(/\//g,`\\`).replace(g,`$1\\`),v=/[\\\/]/,y=0,b=1,x=2,S=4,C=6,w=8,T=10,E=12,D=15,O=~D,k=16,A=32,j=64,M=128,ee=256,N=512,P=j|M|N,F=1023,I=e=>e.isFile()?w:e.isDirectory()?S:e.isSymbolicLink()?T:e.isCharacterDevice()?x:e.isBlockDevice()?C:e.isSocket()?E:e.isFIFO()?b:y,L=new i.LRUCache({max:2**12}),R=e=>{let t=L.get(e);if(t)return t;let n=e.normalize(`NFKD`);return L.set(e,n),n},te=new i.LRUCache({max:2**12}),z=e=>{let t=te.get(e);if(t)return t;let n=R(e.toLowerCase());return te.set(e,n),n},B=class extends i.LRUCache{constructor(){super({max:256})}};e.ResolveCache=B;var V=class extends i.LRUCache{constructor(e=16*1024){super({maxSize:e,sizeCalculation:e=>e.length+1})}};e.ChildrenCache=V;var ne=Symbol(`PathScurry setAsCwd`),H=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#n;get mode(){return this.#n}#r;get nlink(){return this.#r}#i;get uid(){return this.#i}#a;get gid(){return this.#a}#o;get rdev(){return this.#o}#s;get blksize(){return this.#s}#c;get ino(){return this.#c}#l;get size(){return this.#l}#u;get blocks(){return this.#u}#d;get atimeMs(){return this.#d}#f;get mtimeMs(){return this.#f}#p;get ctimeMs(){return this.#p}#m;get birthtimeMs(){return this.#m}#h;get atime(){return this.#h}#g;get mtime(){return this.#g}#_;get ctime(){return this.#_}#v;get birthtime(){return this.#v}#y;#b;#x;#S;#C;#w;#T;#E;#D;#O;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=y,n,r,i,a,o){this.name=e,this.#y=i?z(e):R(e),this.#T=t&F,this.nocase=i,this.roots=r,this.root=n||this,this.#E=a,this.#x=o.fullpath,this.#C=o.relative,this.#w=o.relativePosix,this.parent=o.parent,this.parent?this.#e=this.parent.#e:this.#e=h(o.fs)}depth(){return this.#b===void 0?this.parent?this.#b=this.parent.depth()+1:this.#b=0:this.#b}childrenCache(){return this.#E}resolve(e){if(!e)return this;let t=this.getRootString(e),n=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#k(n):this.#k(n)}#k(e){let t=this;for(let n of e)t=t.child(n);return t}children(){let e=this.#E.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#E.set(this,t),this.#T&=~k,t}child(e,t){if(e===``||e===`.`)return this;if(e===`..`)return this.parent||this;let n=this.children(),r=this.nocase?z(e):R(e);for(let e of n)if(e.#y===r)return e;let i=this.parent?this.sep:``,a=this.#x?this.#x+i+e:void 0,o=this.newChild(e,y,{...t,parent:this,fullpath:a});return this.canReaddir()||(o.#T|=M),n.push(o),o}relative(){if(this.isCWD)return``;if(this.#C!==void 0)return this.#C;let e=this.name,t=this.parent;if(!t)return this.#C=this.name;let n=t.relative();return n+(!n||!t.parent?``:this.sep)+e}relativePosix(){if(this.sep===`/`)return this.relative();if(this.isCWD)return``;if(this.#w!==void 0)return this.#w;let e=this.name,t=this.parent;if(!t)return this.#w=this.fullpathPosix();let n=t.relativePosix();return n+(!n||!t.parent?``:`/`)+e}fullpath(){if(this.#x!==void 0)return this.#x;let e=this.name,t=this.parent;if(!t)return this.#x=this.name;let n=t.fullpath()+(t.parent?this.sep:``)+e;return this.#x=n}fullpathPosix(){if(this.#S!==void 0)return this.#S;if(this.sep===`/`)return this.#S=this.fullpath();if(!this.parent){let e=this.fullpath().replace(/\\/g,`/`);return/^[a-z]:\//i.test(e)?this.#S=`//?/${e}`:this.#S=e}let e=this.parent,t=e.fullpathPosix(),n=t+(!t||!e.parent?``:`/`)+this.name;return this.#S=n}isUnknown(){return(this.#T&D)===y}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?`Unknown`:this.isDirectory()?`Directory`:this.isFile()?`File`:this.isSymbolicLink()?`SymbolicLink`:this.isFIFO()?`FIFO`:this.isCharacterDevice()?`CharacterDevice`:this.isBlockDevice()?`BlockDevice`:this.isSocket()?`Socket`:`Unknown`}isFile(){return(this.#T&D)===w}isDirectory(){return(this.#T&D)===S}isCharacterDevice(){return(this.#T&D)===x}isBlockDevice(){return(this.#T&D)===C}isFIFO(){return(this.#T&D)===b}isSocket(){return(this.#T&D)===E}isSymbolicLink(){return(this.#T&T)===T}lstatCached(){return this.#T&A?this:void 0}readlinkCached(){return this.#D}realpathCached(){return this.#O}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#D)return!0;if(!this.parent)return!1;let e=this.#T&D;return!(e!==y&&e!==T||this.#T&ee||this.#T&M)}calledReaddir(){return!!(this.#T&k)}isENOENT(){return!!(this.#T&M)}isNamed(e){return this.nocase?this.#y===z(e):this.#y===R(e)}async readlink(){let e=this.#D;if(e)return e;if(this.canReadlink()&&this.parent)try{let e=await this.#e.promises.readlink(this.fullpath()),t=(await this.parent.realpath())?.resolve(e);if(t)return this.#D=t}catch(e){this.#L(e.code);return}}readlinkSync(){let e=this.#D;if(e)return e;if(this.canReadlink()&&this.parent)try{let e=this.#e.readlinkSync(this.fullpath()),t=this.parent.realpathSync()?.resolve(e);if(t)return this.#D=t}catch(e){this.#L(e.code);return}}#A(e){this.#T|=k;for(let t=e.provisional;t<e.length;t++){let n=e[t];n&&n.#j()}}#j(){this.#T&M||(this.#T=(this.#T|M)&O,this.#M())}#M(){let e=this.children();e.provisional=0;for(let t of e)t.#j()}#N(){this.#T|=N,this.#P()}#P(){if(this.#T&j)return;let e=this.#T;(e&D)===S&&(e&=O),this.#T=e|j,this.#M()}#F(e=``){e===`ENOTDIR`||e===`EPERM`?this.#P():e===`ENOENT`?this.#j():this.children().provisional=0}#I(e=``){e===`ENOTDIR`?this.parent.#P():e===`ENOENT`&&this.#j()}#L(e=``){let t=this.#T;t|=ee,e===`ENOENT`&&(t|=M),(e===`EINVAL`||e===`UNKNOWN`)&&(t&=O),this.#T=t,e===`ENOTDIR`&&this.parent&&this.parent.#P()}#R(e,t){return this.#B(e,t)||this.#z(e,t)}#z(e,t){let n=I(e),r=this.newChild(e.name,n,{parent:this}),i=r.#T&D;return i!==S&&i!==T&&i!==y&&(r.#T|=j),t.unshift(r),t.provisional++,r}#B(e,t){for(let n=t.provisional;n<t.length;n++){let r=t[n];if((this.nocase?z(e.name):R(e.name))===r.#y)return this.#V(e,r,n,t)}}#V(e,t,n,r){let i=t.name;return t.#T=t.#T&O|I(e),i!==e.name&&(t.name=e.name),n!==r.provisional&&(n===r.length-1?r.pop():r.splice(n,1),r.unshift(t)),r.provisional++,t}async lstat(){if((this.#T&M)===0)try{return this.#H(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#I(e.code)}}lstatSync(){if((this.#T&M)===0)try{return this.#H(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#I(e.code)}}#H(e){let{atime:t,atimeMs:n,birthtime:r,birthtimeMs:i,blksize:a,blocks:o,ctime:s,ctimeMs:c,dev:l,gid:u,ino:d,mode:f,mtime:p,mtimeMs:m,nlink:h,rdev:g,size:_,uid:v}=e;this.#h=t,this.#d=n,this.#v=r,this.#m=i,this.#s=a,this.#u=o,this.#_=s,this.#p=c,this.#t=l,this.#a=u,this.#c=d,this.#n=f,this.#g=p,this.#f=m,this.#r=h,this.#o=g,this.#l=_,this.#i=v;let b=I(e);this.#T=this.#T&O|b|A,b!==y&&b!==S&&b!==T&&(this.#T|=j)}#U=[];#W=!1;#G(e){this.#W=!1;let t=this.#U.slice();this.#U.length=0,t.forEach(t=>t(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let r=n.slice(0,n.provisional);t?e(null,r):queueMicrotask(()=>e(null,r));return}if(this.#U.push(e),this.#W)return;this.#W=!0;let r=this.fullpath();this.#e.readdir(r,{withFileTypes:!0},(e,t)=>{if(e)this.#F(e.code),n.provisional=0;else{for(let e of t)this.#R(e,n);this.#A(n)}this.#G(n.slice(0,n.provisional))})}#K;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#K)await this.#K;else{let n=()=>{};this.#K=new Promise(e=>n=e);try{for(let n of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#R(n,e);this.#A(e)}catch(t){this.#F(t.code),e.provisional=0}this.#K=void 0,n()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let n of this.#e.readdirSync(t,{withFileTypes:!0}))this.#R(n,e);this.#A(e)}catch(t){this.#F(t.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#T&P)return!1;let e=D&this.#T;return e===y||e===S||e===T}shouldWalk(e,t){return(this.#T&S)===S&&!(this.#T&P)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#O)return this.#O;if(!((N|ee|M)&this.#T))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#O=this.resolve(e)}catch{this.#N()}}realpathSync(){if(this.#O)return this.#O;if(!((N|ee|M)&this.#T))try{let e=this.#e.realpathSync(this.fullpath());return this.#O=this.resolve(e)}catch{this.#N()}}[ne](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),n=[],r=this;for(;r&&r.parent;)t.add(r),r.#C=n.join(this.sep),r.#w=n.join(`/`),r=r.parent,n.push(`..`);for(r=e;r&&r.parent&&!t.has(r);)r.#C=void 0,r.#w=void 0,r=r.parent}};e.PathBase=H;var U=class e extends H{sep=`\\`;splitSep=v;constructor(e,t=y,n,r,i,a,o){super(e,t,n,r,i,a,o)}newChild(t,n=y,r={}){return new e(t,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return a.win32.parse(e).root}getRoot(e){if(e=_(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,n]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=n;return this.roots[e]=new ie(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,`\\`).replace(g,`$1\\`),e===t}};e.PathWin32=U;var W=class e extends H{splitSep=`/`;sep=`/`;constructor(e,t=y,n,r,i,a,o){super(e,t,n,r,i,a,o)}getRootString(e){return e.startsWith(`/`)?`/`:``}getRoot(e){return this.root}newChild(t,n=y,r={}){return new e(t,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}};e.PathPosix=W;var re=class{root;rootPath;roots;cwd;#e;#t;#n;nocase;#r;constructor(e=process.cwd(),t,n,{nocase:r,childrenCacheSize:i=16*1024,fs:a=m}={}){this.#r=h(a),(e instanceof URL||e.startsWith(`file://`))&&(e=(0,o.fileURLToPath)(e));let s=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(s),this.#e=new B,this.#t=new B,this.#n=new V(i);let c=s.substring(this.rootPath.length).split(n);if(c.length===1&&!c[0]&&c.pop(),r===void 0)throw TypeError(`must provide nocase setting to PathScurryBase ctor`);this.nocase=r,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=t.sep,f=this.rootPath,p=!1;for(let e of c){let t=u--;l=l.child(e,{relative:Array(t).fill(`..`).join(d),relativePosix:Array(t).fill(`..`).join(`/`),fullpath:f+=(p?``:d)+e}),p=!0}this.cwd=l}depth(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#n}resolve(...e){let t=``;for(let n=e.length-1;n>=0;n--){let r=e[n];if(!(!r||r===`.`)&&(t=t?`${r}/${t}`:r,this.isAbsolute(r)))break}let n=this.#e.get(t);if(n!==void 0)return n;let r=this.cwd.resolve(t).fullpath();return this.#e.set(t,r),r}resolvePosix(...e){let t=``;for(let n=e.length-1;n>=0;n--){let r=e[n];if(!(!r||r===`.`)&&(t=t?`${r}/${t}`:r,this.isAbsolute(r)))break}let n=this.#t.get(t);if(n!==void 0)return n;let r=this.cwd.resolve(t).fullpathPosix();return this.#t.set(t,r),r}relative(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof H||(t=e,e=this.cwd);let{withFileTypes:n}=t;if(e.canReaddir()){let t=await e.readdir();return n?t:t.map(e=>e.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof H||(t=e,e=this.cwd);let{withFileTypes:n=!0}=t;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(e=>e.name):[]}async lstat(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof H||(t=e.withFileTypes,e=this.cwd);let n=await e.readlink();return t?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof H||(t=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return t?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof H||(t=e.withFileTypes,e=this.cwd);let n=await e.realpath();return t?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof H||(t=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return t?n:n?.fullpath()}async walk(e=this.cwd,t={}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof H||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t,o=[];(!i||i(e))&&o.push(n?e:e.fullpath());let s=new Set,c=(e,t)=>{s.add(e),e.readdirCB((e,l)=>{if(e)return t(e);let u=l.length;if(!u)return t();let d=()=>{--u===0&&t()};for(let e of l)(!i||i(e))&&o.push(n?e:e.fullpath()),r&&e.isSymbolicLink()?e.realpath().then(e=>e?.isUnknown()?e.lstat():e).then(e=>e?.shouldWalk(s,a)?c(e,d):d()):e.shouldWalk(s,a)?c(e,d):d()},!0)},l=e;return new Promise((e,t)=>{c(l,n=>{if(n)return t(n);e(o)})})}walkSync(e=this.cwd,t={}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof H||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t,o=[];(!i||i(e))&&o.push(n?e:e.fullpath());let s=new Set([e]);for(let e of s){let t=e.readdirSync();for(let e of t){(!i||i(e))&&o.push(n?e:e.fullpath());let t=e;if(e.isSymbolicLink()){if(!(r&&(t=e.realpathSync())))continue;t.isUnknown()&&t.lstatSync()}t.shouldWalk(s,a)&&s.add(t)}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e==`string`?e=this.cwd.resolve(e):e instanceof H||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof H||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t;(!i||i(e))&&(yield n?e:e.fullpath());let o=new Set([e]);for(let e of o){let t=e.readdirSync();for(let e of t){(!i||i(e))&&(yield n?e:e.fullpath());let t=e;if(e.isSymbolicLink()){if(!(r&&(t=e.realpathSync())))continue;t.isUnknown()&&t.lstatSync()}t.shouldWalk(o,a)&&o.add(t)}}}stream(e=this.cwd,t={}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof H||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t,o=new p.Minipass({objectMode:!0});(!i||i(e))&&o.write(n?e:e.fullpath());let s=new Set,c=[e],l=0,u=()=>{let e=!1;for(;!e;){let t=c.shift();if(!t){l===0&&o.end();return}l++,s.add(t);let d=(t,p,m=!1)=>{if(t)return o.emit(`error`,t);if(r&&!m){let e=[];for(let t of p)t.isSymbolicLink()&&e.push(t.realpath().then(e=>e?.isUnknown()?e.lstat():e));if(e.length){Promise.all(e).then(()=>d(null,p,!0));return}}for(let t of p)t&&(!i||i(t))&&(o.write(n?t:t.fullpath())||(e=!0));l--;for(let e of p){let t=e.realpathCached()||e;t.shouldWalk(s,a)&&c.push(t)}e&&!o.flowing?o.once(`drain`,u):f||u()},f=!0;t.readdirCB(d,!0),f=!1}};return u(),o}streamSync(e=this.cwd,t={}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof H||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t,o=new p.Minipass({objectMode:!0}),s=new Set;(!i||i(e))&&o.write(n?e:e.fullpath());let c=[e],l=0,u=()=>{let e=!1;for(;!e;){let t=c.shift();if(!t){l===0&&o.end();return}l++,s.add(t);let u=t.readdirSync();for(let t of u)(!i||i(t))&&(o.write(n?t:t.fullpath())||(e=!0));l--;for(let e of u){let t=e;if(e.isSymbolicLink()){if(!(r&&(t=e.realpathSync())))continue;t.isUnknown()&&t.lstatSync()}t.shouldWalk(s,a)&&c.push(t)}}e&&!o.flowing&&o.once(`drain`,u)};return u(),o}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e==`string`?this.cwd.resolve(e):e,this.cwd[ne](t)}};e.PathScurryBase=re;var ie=class extends re{sep=`\\`;constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,a.win32,`\\`,{...t,nocase:n}),this.nocase=n;for(let e=this.cwd;e;e=e.parent)e.nocase=this.nocase}parseRootPath(e){return a.win32.parse(e).root.toUpperCase()}newRoot(e){return new U(this.rootPath,S,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith(`/`)||e.startsWith(`\\`)||/^[a-z]:(\/|\\)/i.test(e)}};e.PathScurryWin32=ie;var ae=class extends re{sep=`/`;constructor(e=process.cwd(),t={}){let{nocase:n=!1}=t;super(e,a.posix,`/`,{...t,nocase:n}),this.nocase=n}parseRootPath(e){return`/`}newRoot(e){return new W(this.rootPath,S,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith(`/`)}};e.PathScurryPosix=ae;var oe=class extends ae{constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,{...t,nocase:n})}};e.PathScurryDarwin=oe,e.Path=process.platform===`win32`?U:W,e.PathScurry=process.platform===`win32`?ie:process.platform===`darwin`?oe:ae}),p=t(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Pattern=void 0;var t=l(),n=e=>e.length>=1,r=e=>e.length>=1,i=Symbol.for(`nodejs.util.inspect.custom`);e.Pattern=class e{#e;#t;#n;length;#r;#i;#a;#o;#s;#c;#l=!0;constructor(e,t,i,a){if(!n(e))throw TypeError(`empty pattern list`);if(!r(t))throw TypeError(`empty glob list`);if(t.length!==e.length)throw TypeError(`mismatched pattern list and glob list lengths`);if(this.length=e.length,i<0||i>=this.length)throw TypeError(`index out of range`);if(this.#e=e,this.#t=t,this.#n=i,this.#r=a,this.#n===0){if(this.isUNC()){let[e,t,n,r,...i]=this.#e,[a,o,s,c,...l]=this.#t;i[0]===``&&(i.shift(),l.shift());let u=[e,t,n,r,``].join(`/`),d=[a,o,s,c,``].join(`/`);this.#e=[u,...i],this.#t=[d,...l],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[e,...t]=this.#e,[n,...r]=this.#t;t[0]===``&&(t.shift(),r.shift());let i=e+`/`,a=n+`/`;this.#e=[i,...t],this.#t=[a,...r],this.length=this.#e.length}}}[i](){return`Pattern <`+this.#t.slice(this.#n).join(`/`)+`>`}pattern(){return this.#e[this.#n]}isString(){return typeof this.#e[this.#n]==`string`}isGlobstar(){return this.#e[this.#n]===t.GLOBSTAR}isRegExp(){return this.#e[this.#n]instanceof RegExp}globString(){return this.#a=this.#a||(this.#n===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join(`/`):this.#t.join(`/`):this.#t.slice(this.#n).join(`/`))}hasMore(){return this.length>this.#n+1}rest(){return this.#i===void 0?this.hasMore()?(this.#i=new e(this.#e,this.#t,this.#n+1,this.#r),this.#i.#c=this.#c,this.#i.#s=this.#s,this.#i.#o=this.#o,this.#i):this.#i=null:this.#i}isUNC(){let e=this.#e;return this.#s===void 0?this.#s=this.#r===`win32`&&this.#n===0&&e[0]===``&&e[1]===``&&typeof e[2]==`string`&&!!e[2]&&typeof e[3]==`string`&&!!e[3]:this.#s}isDrive(){let e=this.#e;return this.#o===void 0?this.#o=this.#r===`win32`&&this.#n===0&&this.length>1&&typeof e[0]==`string`&&/^[a-z]:$/i.test(e[0]):this.#o}isAbsolute(){let e=this.#e;return this.#c===void 0?this.#c=e[0]===``&&e.length>1||this.isDrive()||this.isUNC():this.#c}root(){let e=this.#e[0];return typeof e==`string`&&this.isAbsolute()&&this.#n===0?e:``}checkFollowGlobstar(){return!(this.#n===0||!this.isGlobstar()||!this.#l)}markFollowGlobstar(){return this.#n===0||!this.isGlobstar()||!this.#l?!1:(this.#l=!1,!0)}}}),m=t(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Ignore=void 0;var t=l(),n=p(),r=typeof process==`object`&&process&&typeof process.platform==`string`?process.platform:`linux`;e.Ignore=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:n,noext:i,noglobstar:a,platform:o=r}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:n,noext:i,noglobstar:a,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let t of e)this.add(t)}add(e){let r=new t.Minimatch(e,this.mmopts);for(let e=0;e<r.set.length;e++){let i=r.set[e],a=r.globParts[e];if(!i||!a)throw Error(`invalid pattern object`);for(;i[0]===`.`&&a[0]===`.`;)i.shift(),a.shift();let o=new n.Pattern(i,a,0,this.platform),s=new t.Minimatch(o.globString(),this.mmopts),c=a[a.length-1]===`**`,l=o.isAbsolute();l?this.absolute.push(s):this.relative.push(s),c&&(l?this.absoluteChildren.push(s):this.relativeChildren.push(s))}}ignored(e){let t=e.fullpath(),n=`${t}/`,r=e.relative()||`.`,i=`${r}/`;for(let e of this.relative)if(e.match(r)||e.match(i))return!0;for(let e of this.absolute)if(e.match(t)||e.match(n))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+`/`,n=(e.relative()||`.`)+`/`;for(let e of this.relativeChildren)if(e.match(n))return!0;for(let e of this.absoluteChildren)if(e.match(t))return!0;return!1}}}),h=t(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Processor=e.SubWalks=e.MatchRecord=e.HasWalkedCache=void 0;var t=l(),n=class e{store;constructor(e=new Map){this.store=e}copy(){return new e(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let n=e.fullpath(),r=this.store.get(n);r?r.add(t.globString()):this.store.set(n,new Set([t.globString()]))}};e.HasWalkedCache=n;var r=class{store=new Map;add(e,t,n){let r=(t?2:0)|!!n,i=this.store.get(e);this.store.set(e,i===void 0?r:r&i)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}};e.MatchRecord=r;var i=class{store=new Map;add(e,t){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(e=>e.globString()===t.globString())||n.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw Error(`attempting to walk unknown path`);return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}};e.SubWalks=i,e.Processor=class e{hasWalkedCache;matches=new r;subwalks=new i;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new n}processPatterns(e,n){this.patterns=n;let r=n.map(t=>[e,t]);for(let[e,n]of r){this.hasWalkedCache.storeWalked(e,n);let r=n.root(),i=n.isAbsolute()&&this.opts.absolute!==!1;if(r){e=e.resolve(r===`/`&&this.opts.root!==void 0?this.opts.root:r);let t=n.rest();if(t)n=t;else{this.matches.add(e,!0,!1);continue}}if(e.isENOENT())continue;let a,o,s=!1;for(;typeof(a=n.pattern())==`string`&&(o=n.rest());)e=e.resolve(a),n=o,s=!0;if(a=n.pattern(),o=n.rest(),s){if(this.hasWalkedCache.hasWalked(e,n))continue;this.hasWalkedCache.storeWalked(e,n)}if(typeof a==`string`){let t=a===`..`||a===``||a===`.`;this.matches.add(e.resolve(a),i,t);continue}else if(a===t.GLOBSTAR){(!e.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(e,n);let t=o?.pattern(),r=o?.rest();if(!o||(t===``||t===`.`)&&!r)this.matches.add(e,i,t===``||t===`.`);else if(t===`..`){let t=e.parent||e;r?this.hasWalkedCache.hasWalked(t,r)||this.subwalks.add(t,r):this.matches.add(t,i,!0)}}else a instanceof RegExp&&this.subwalks.add(e,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new e(this.opts,this.hasWalkedCache)}filterEntries(e,n){let r=this.subwalks.get(e),i=this.child();for(let e of n)for(let n of r){let r=n.isAbsolute(),a=n.pattern(),o=n.rest();a===t.GLOBSTAR?i.testGlobstar(e,n,o,r):a instanceof RegExp?i.testRegExp(e,a,o,r):i.testString(e,a,o,r)}return i}testGlobstar(e,t,n,r){if((this.dot||!e.name.startsWith(`.`))&&(t.hasMore()||this.matches.add(e,r,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(n&&t.checkFollowGlobstar()?this.subwalks.add(e,n):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),n){let t=n.pattern();if(typeof t==`string`&&t!==`..`&&t!==``&&t!==`.`)this.testString(e,t,n.rest(),r);else if(t===`..`){let t=e.parent||e;this.subwalks.add(t,n)}else t instanceof RegExp&&this.testRegExp(e,t,n.rest(),r)}}testRegExp(e,t,n,r){t.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,r,!1))}testString(e,t,n,r){e.isNamed(t)&&(n?this.subwalks.add(e,n):this.matches.add(e,r,!1))}}}),g=t(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GlobStream=e.GlobWalker=e.GlobUtil=void 0;var t=d(),n=m(),r=h(),i=(e,t)=>typeof e==`string`?new n.Ignore([e],t):Array.isArray(e)?new n.Ignore(e,t):e,a=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#n;signal;maxDepth;includeChildMatches;constructor(e,t,n){if(this.patterns=e,this.path=t,this.opts=n,this.#n=!n.posix&&n.platform===`win32`?`\\`:`/`,this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#t=i(n.ignore??[],n),!this.includeChildMatches&&typeof this.#t.add!=`function`))throw Error(`cannot ignore child matches, ignore lacks add() method.`);this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener(`abort`,()=>{this.#e.length=0}))}#r(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#i(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}let r=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let e=await r.realpath();e&&(e.isUnknown()||this.opts.stat)&&await e.lstat()}return this.matchCheckTest(r,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#r(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}let r=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let e=r.realpathSync();e&&(e?.isUnknown()||this.opts.stat)&&e.lstatSync()}return this.matchCheckTest(r,t)}matchFinish(e,t){if(this.#r(e))return;if(!this.includeChildMatches&&this.#t?.add){let t=`${e.relativePosix()}/**`;this.#t.add(t)}let n=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let r=this.opts.mark&&e.isDirectory()?this.#n:``;if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let t=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(t+r)}else{let t=this.opts.posix?e.relativePosix():e.relative(),n=this.opts.dotRelative&&!t.startsWith(`..`+this.#n)?`.`+this.#n:``;this.matchEmit(t?n+t+r:`.`+r)}}async match(e,t,n){let r=await this.matchCheck(e,n);r&&this.matchFinish(r,t)}matchSync(e,t,n){let r=this.matchCheckSync(e,n);r&&this.matchFinish(r,t)}walkCB(e,t,n){this.signal?.aborted&&n(),this.walkCB2(e,t,new r.Processor(this.opts),n)}walkCB2(e,t,n,r){if(this.#i(e))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2(e,t,n,r));return}n.processPatterns(e,t);let i=1,a=()=>{--i===0&&r()};for(let[e,t,r]of n.matches.entries())this.#r(e)||(i++,this.match(e,t,r).then(()=>a()));for(let e of n.subwalkTargets()){if(this.maxDepth!==1/0&&e.depth()>=this.maxDepth)continue;i++;let t=e.readdirCached();e.calledReaddir()?this.walkCB3(e,t,n,a):e.readdirCB((t,r)=>this.walkCB3(e,r,n,a),!0)}a()}walkCB3(e,t,n,r){n=n.filterEntries(e,t);let i=1,a=()=>{--i===0&&r()};for(let[e,t,r]of n.matches.entries())this.#r(e)||(i++,this.match(e,t,r).then(()=>a()));for(let[e,t]of n.subwalks.entries())i++,this.walkCB2(e,t,n.child(),a);a()}walkCBSync(e,t,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,t,new r.Processor(this.opts),n)}walkCB2Sync(e,t,n,r){if(this.#i(e))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,n,r));return}n.processPatterns(e,t);let i=1,a=()=>{--i===0&&r()};for(let[e,t,r]of n.matches.entries())this.#r(e)||this.matchSync(e,t,r);for(let e of n.subwalkTargets()){if(this.maxDepth!==1/0&&e.depth()>=this.maxDepth)continue;i++;let t=e.readdirSync();this.walkCB3Sync(e,t,n,a)}a()}walkCB3Sync(e,t,n,r){n=n.filterEntries(e,t);let i=1,a=()=>{--i===0&&r()};for(let[e,t,r]of n.matches.entries())this.#r(e)||this.matchSync(e,t,r);for(let[e,t]of n.subwalks.entries())i++,this.walkCB2Sync(e,t,n.child(),a);a()}};e.GlobUtil=a,e.GlobWalker=class extends a{matches=new Set;constructor(e,t,n){super(e,t,n)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},e.GlobStream=class extends a{results;constructor(e,n,r){super(e,n,r),this.results=new t.Minipass({signal:this.signal,objectMode:!0}),this.results.on(`drain`,()=>this.resume()),this.results.on(`resume`,()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}}}),_=t(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Glob=void 0;var t=l(),n=require("node:url"),r=f(),i=p(),a=g(),o=typeof process==`object`&&process&&typeof process.platform==`string`?process.platform:`linux`;e.Glob=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,a){if(!a)throw TypeError(`glob options required`);if(this.withFileTypes=!!a.withFileTypes,this.signal=a.signal,this.follow=!!a.follow,this.dot=!!a.dot,this.dotRelative=!!a.dotRelative,this.nodir=!!a.nodir,this.mark=!!a.mark,a.cwd?(a.cwd instanceof URL||a.cwd.startsWith(`file://`))&&(a.cwd=(0,n.fileURLToPath)(a.cwd)):this.cwd=``,this.cwd=a.cwd||``,this.root=a.root,this.magicalBraces=!!a.magicalBraces,this.nobrace=!!a.nobrace,this.noext=!!a.noext,this.realpath=!!a.realpath,this.absolute=a.absolute,this.includeChildMatches=a.includeChildMatches!==!1,this.noglobstar=!!a.noglobstar,this.matchBase=!!a.matchBase,this.maxDepth=typeof a.maxDepth==`number`?a.maxDepth:1/0,this.stat=!!a.stat,this.ignore=a.ignore,this.withFileTypes&&this.absolute!==void 0)throw Error(`cannot set absolute and withFileTypes:true`);if(typeof e==`string`&&(e=[e]),this.windowsPathsNoEscape=!!a.windowsPathsNoEscape||a.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(e=>e.replace(/\\/g,`/`))),this.matchBase){if(a.noglobstar)throw TypeError(`base matching requires globstar`);e=e.map(e=>e.includes(`/`)?e:`./**/${e}`)}if(this.pattern=e,this.platform=a.platform||o,this.opts={...a,platform:this.platform},a.scurry){if(this.scurry=a.scurry,a.nocase!==void 0&&a.nocase!==a.scurry.nocase)throw Error(`nocase option contradicts provided scurry option`)}else{let e=a.platform===`win32`?r.PathScurryWin32:a.platform===`darwin`?r.PathScurryDarwin:a.platform?r.PathScurryPosix:r.PathScurry;this.scurry=new e(this.cwd,{nocase:a.nocase,fs:a.fs})}this.nocase=this.scurry.nocase;let s=this.platform===`darwin`||this.platform===`win32`,c={braceExpandMax:1e4,...a,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:s,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},[l,u]=this.pattern.map(e=>new t.Minimatch(e,c)).reduce((e,t)=>(e[0].push(...t.set),e[1].push(...t.globParts),e),[[],[]]);this.patterns=l.map((e,t)=>{let n=u[t];if(!n)throw Error(`invalid pattern object`);return new i.Pattern(e,n,0,this.platform)})}async walk(){return[...await new a.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth===1/0?1/0:this.maxDepth+this.scurry.cwd.depth(),platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new a.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth===1/0?1/0:this.maxDepth+this.scurry.cwd.depth(),platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new a.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth===1/0?1/0:this.maxDepth+this.scurry.cwd.depth(),platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new a.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth===1/0?1/0:this.maxDepth+this.scurry.cwd.depth(),platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}}),v=t(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hasMagic=void 0;var t=l();e.hasMagic=(e,n={})=>{Array.isArray(e)||(e=[e]);for(let r of e)if(new t.Minimatch(r,n).hasMagic())return!0;return!1}});Object.defineProperty(e,"__esModule",{value:!0}),e.glob=e.sync=e.iterate=e.iterateSync=e.stream=e.streamSync=e.Ignore=e.hasMagic=e.Glob=e.unescape=e.escape=void 0,e.globStreamSync=E,e.globStream=D,e.globSync=O,e.globIterateSync=A,e.globIterate=j;var y=l(),b=_(),x=v(),S=l();Object.defineProperty(e,"escape",{enumerable:!0,get:function(){return S.escape}}),Object.defineProperty(e,"unescape",{enumerable:!0,get:function(){return S.unescape}});var C=_();Object.defineProperty(e,"Glob",{enumerable:!0,get:function(){return C.Glob}});var w=v();Object.defineProperty(e,"hasMagic",{enumerable:!0,get:function(){return w.hasMagic}});var T=m();Object.defineProperty(e,"Ignore",{enumerable:!0,get:function(){return T.Ignore}});function E(e,t={}){return new b.Glob(e,t).streamSync()}function D(e,t={}){return new b.Glob(e,t).stream()}function O(e,t={}){return new b.Glob(e,t).walkSync()}async function k(e,t={}){return new b.Glob(e,t).walk()}function A(e,t={}){return new b.Glob(e,t).iterateSync()}function j(e,t={}){return new b.Glob(e,t).iterate()}e.streamSync=E,e.stream=Object.assign(D,{sync:E}),e.iterateSync=A,e.iterate=Object.assign(j,{sync:A}),e.sync=Object.assign(O,{stream:E,iterate:A}),e.glob=Object.assign(k,{glob:k,globSync:O,sync:e.sync,globStream:D,stream:e.stream,globStreamSync:E,streamSync:e.streamSync,globIterate:j,iterate:e.iterate,globIterateSync:A,iterateSync:e.iterateSync,Glob:b.Glob,hasMagic:x.hasMagic,escape:y.escape,unescape:y.unescape}),e.glob.glob=e.glob})),pc=s(((e,t)=>{var{glob:n}=fc(),r=require("path"),i=e=>e.split(r.win32.sep).join(r.posix.sep);t.exports=(e,t)=>n(i(e),t)})),mc=s(((e,t)=>{var n=require("fs/promises"),r=ic(),{hasContent:i}=cc();t.exports=a;async function a(e,t){let a=await i(e,t);return a&&a.sri?(await n.rm(r(e,a.sri),{recursive:!0,force:!0}),!0):!1}})),hc=s(((e,t)=>{var{rm:n}=require("fs/promises"),r=pc(),i=ac(),a=oc(),o=require("path"),s=mc();t.exports=c,t.exports.entry=c;function c(e,t,n){return a.clearMemoized(),i.delete(e,t,n)}t.exports.content=l;function l(e,t){return a.clearMemoized(),s(e,t)}t.exports.all=u;async function u(e){a.clearMemoized();let t=await r(o.join(e,`*(content-*|index-*)`),{silent:!0,nosort:!0});return Promise.all(t.map(e=>n(e,{recursive:!0,force:!0})))}})),gc=s(((e,t)=>{var{mkdir:n,readFile:r,rm:i,stat:a,truncate:o,writeFile:s}=require("fs/promises"),c=ic(),l=sc(),u=pc(),d=ac(),f=require("path"),p=Ss(),m=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),h=e=>({concurrency:20,log:{silly(){}},...e});t.exports=g;async function g(e,t){t=h(t),t.log.silly(`verify`,`verifying cache at`,e);let n=[_,y,b,S,w,T,v],r={};for(let i of n){let n=i.name,a=new Date,o=await i(e,t);o&&Object.keys(o).forEach(e=>{r[e]=o[e]});let s=new Date;r.runTime||={},r.runTime[n]=s-a}return r.runTime.total=r.endTime-r.startTime,t.log.silly(`verify`,`verification finished for`,e,`in`,`${r.runTime.total}ms`),r}async function _(){return{startTime:new Date}}async function v(){return{endTime:new Date}}async function y(e,t){return t.log.silly(`verify`,`fixing cache permissions`),await n(e,{recursive:!0}),null}async function b(e,t){t.log.silly(`verify`,`garbage collecting content`);let{default:n}=await Promise.resolve().then(()=>(Vx(),Rx)),r=d.lsStream(e),o=new Set;r.on(`data`,e=>{if(t.filter&&!t.filter(e))return;let n=p.parse(e.integrity);for(let e in n)o.add(n[e].toString())}),await new Promise((e,t)=>{r.on(`end`,e).on(`error`,t)});let s=c.contentDir(e),l=await u(f.join(s,`**`),{follow:!1,nodir:!0,nosort:!0}),m={verifiedContent:0,reclaimedCount:0,reclaimedSize:0,badContentCount:0,keptSize:0};return await n(l,async e=>{let t=e.split(/[/\\]/),n=t.slice(t.length-3).join(``),r=t[t.length-4],s=p.fromHex(n,r);if(o.has(s.toString())){let t=await x(e,s);t.valid?(m.verifiedContent++,m.keptSize+=t.size):(m.reclaimedCount++,m.badContentCount++,m.reclaimedSize+=t.size)}else{m.reclaimedCount++;let t=await a(e);await i(e,{recursive:!0,force:!0}),m.reclaimedSize+=t.size}return m},{concurrency:t.concurrency}),m}async function x(e,t){let n={};try{let{size:r}=await a(e);n.size=r,n.valid=!0,await p.checkStream(new l.ReadStream(e),t)}catch(t){if(t.code===`ENOENT`)return{size:0,valid:!1};if(t.code!==`EINTEGRITY`)throw t;await i(e,{recursive:!0,force:!0}),n.valid=!1}return n}async function S(e,t){t.log.silly(`verify`,`rebuilding index`);let{default:n}=await Promise.resolve().then(()=>(Vx(),Rx)),r=await d.ls(e),i={missingContent:0,rejectedEntries:0,totalEntries:0},a={};for(let n in r)if(m(r,n)){let o=d.hashKey(n),s=r[n],c=t.filter&&!t.filter(s);c&&i.rejectedEntries++,a[o]&&!c?a[o].push(s):a[o]&&c||(c?(a[o]=[],a[o]._path=d.bucketPath(e,n)):(a[o]=[s],a[o]._path=d.bucketPath(e,n)))}return await n(Object.keys(a),n=>C(e,a[n],i,t),{concurrency:t.concurrency}),i}async function C(e,t,n){await o(t._path);for(let r of t){let t=c(e,r.integrity);try{await a(t),await d.insert(e,r.key,r.integrity,{metadata:r.metadata,size:r.size,time:r.time}),n.totalEntries++}catch(e){if(e.code===`ENOENT`)n.rejectedEntries++,n.missingContent++;else throw e}}}function w(e,t){return t.log.silly(`verify`,`cleaning tmp directory`),i(f.join(e,`tmp`),{recursive:!0,force:!0})}async function T(e,t){let n=f.join(e,`_lastverified`);return t.log.silly(`verify`,`writing verifile to `+n),s(n,`${Date.now()}`)}t.exports.lastRun=E;async function E(e){let t=await r(f.join(e,`_lastverified`),{encoding:`utf8`});return new Date(+t)}})),_c=s(((e,t)=>{var n=lc(),r=dc(),i=hc(),a=gc(),{clearMemoized:o}=oc(),s=zs(),c=ac();t.exports.index={},t.exports.index.compact=c.compact,t.exports.index.insert=c.insert,t.exports.ls=c.ls,t.exports.ls.stream=c.lsStream,t.exports.get=n,t.exports.get.byDigest=n.byDigest,t.exports.get.stream=n.stream,t.exports.get.stream.byDigest=n.stream.byDigest,t.exports.get.copy=n.copy,t.exports.get.copy.byDigest=n.copy.byDigest,t.exports.get.info=n.info,t.exports.get.hasContent=n.hasContent,t.exports.put=r,t.exports.put.stream=r.stream,t.exports.rm=i.entry,t.exports.rm.all=i.all,t.exports.rm.entry=t.exports.rm,t.exports.rm.content=i.content,t.exports.clearMemoized=o,t.exports.tmp={},t.exports.tmp.mkdir=s.mkdir,t.exports.tmp.withTmp=s.withTmp,t.exports.verify=a,t.exports.verify.lastRun=a.lastRun})),vc=s(((e,t)=>{var n=ks();t.exports=class extends n{#e=[];#t=new Map;constructor(e,...t){super(),this.#e=e.events,t.length&&this.push(...t)}on(e,t){return this.#e.includes(e)&&this.#t.has(e)?t(...this.#t.get(e)):super.on(e,t)}emit(e,...t){return this.#e.includes(e)&&this.#t.set(e,t),super.emit(e,...t)}}})),yc=s(((e,t)=>{var{URL:n,format:r}=require("url"),i={auth:!1,fragment:!1,search:!0,unicode:!1};t.exports=e=>`make-fetch-happen:request-cache:${r(new n(e.url),i)}`})),bc=s(((e,t)=>{t.exports={RetryOperation:class{#e=1;#t=null;#n=[];#r=null;#i;#a=null;#o;#s;#c=null;#l;constructor(e,t={}){this.#o=[...e],this.#s=[...e],this.#l=t.unref,this.#i=t.maxRetryTime||1/0,t.forever&&(this.#t=[...this.#s])}get timeouts(){return[...this.#s]}get errors(){return[...this.#n]}get attempts(){return this.#e}get mainError(){let e=null;if(this.#n.length){let t=0,n={};for(let r=0;r<this.#n.length;r++){let i=this.#n[r],{message:a}=i;n[a]||(n[a]=0),n[a]++,n[a]>=t&&(e=i,t=n[a])}}return e}reset(){this.#e=1,this.#s=[...this.#o]}stop(){this.#c&&clearTimeout(this.#c),this.#s=[],this.#t=null}retry(e){if(this.#n.push(e),new Date().getTime()-this.#a>=this.#i)return this.#n.unshift(Error(`RetryOperation timeout occurred`)),!1;let t=this.#s.shift();if(t===void 0)if(this.#t)this.#n.pop(),t=this.#t.at(-1);else return!1;return this.#c=setTimeout(()=>{this.#e++,this.#r(this.#e)},t),this.#l&&this.#c.unref(),!0}attempt(e){this.#r=e,this.#a=new Date().getTime(),this.#r(this.#e)}}}})),xc=s(((e,t)=>{var{RetryOperation:n}=bc(),r=(e,t)=>Math.min(Math.round((1+(t.randomize?Math.random():0))*Math.max(t.minTimeout,1)*t.factor**+e),t.maxTimeout),i=e=>e?.code===`EPROMISERETRY`&&Object.hasOwn(e,`retried`);t.exports={promiseRetry:async(e,t={})=>{let a=[];if(t instanceof Array)a=[...t];else{t.retries===1/0&&(t.forever=!0,delete t.retries);let e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1,...t};if(e.minTimeout>e.maxTimeout)throw Error(`minTimeout is greater than maxTimeout`);if(e.retries){for(let t=0;t<e.retries;t++)a.push(r(t,e));a.sort((e,t)=>e-t)}else t.forever&&a.push(r(0,e))}let o=new n(a,{forever:t.forever,unref:t.unref,maxRetryTime:t.maxRetryTime});return new Promise(function(t,n){o.attempt(async r=>{try{return t(await e(e=>{throw Object.assign(Error(`Retrying`),{code:`EPROMISERETRY`,retried:e})},r,o))}catch(e){if(!i(e))return n(e);if(!o.retry(e.retried||Error()))return n(e.retried)}})})}}})),Sc=s(((e,t)=>{var{LRUCache:n}=zn(),r=require("dns"),i=new n({max:50});t.exports={cache:i,getOptions:({family:e=0,hints:t=r.ADDRCONFIG,all:n=!1,verbatim:a=void 0,ttl:o=300*1e3,lookup:s=r.lookup})=>({hints:t,lookup:(r,...c)=>{let l=c.pop(),u=c[0]??{},d={family:e,hints:t,all:n,verbatim:a,...typeof u==`number`?{family:u}:u},f=JSON.stringify({hostname:r,...d});if(i.has(f)){let e=i.get(f);return process.nextTick(l,null,...e)}s(r,d,(e,...t)=>e?l(e):(i.set(f,t,{ttl:o}),l(null,...t)))}})}})),Cc=s(((e,t)=>{var n=Sc(),r=e=>{let t=parseInt(e.family??`0`,10),r=e.keepAlive??!0,i={keepAliveMsecs:r?1e3:void 0,maxSockets:e.maxSockets??15,maxTotalSockets:1/0,maxFreeSockets:r?256:void 0,scheduling:`fifo`,...e,family:t,keepAlive:r,timeouts:{idle:e.timeout??0,connection:0,response:0,transfer:0,...e.timeouts},...n.getOptions({family:t,...e.dns})};return delete i.timeout,i},i=e=>{let t=``,n=Object.entries(e).sort((e,t)=>e[0]-t[0]);for(let[e,r]of n)r==null?r=`null`:r instanceof URL?r=r.toString():typeof r==`object`&&(r=i(r)),t+=`${e}:${r}:`;return t};t.exports={normalizeOptions:r,cacheOptions:({secureEndpoint:e,...t})=>i({secureEndpoint:!!e,family:t.family,hints:t.hints,localAddress:t.localAddress,strictSsl:e?!!t.rejectUnauthorized:!1,ca:e?t.ca:null,cert:e?t.cert:null,key:e?t.key:null,keepAlive:t.keepAlive,keepAliveMsecs:t.keepAliveMsecs,maxSockets:t.maxSockets,maxTotalSockets:t.maxTotalSockets,maxFreeSockets:t.maxFreeSockets,scheduling:t.scheduling,timeouts:t.timeouts,proxy:t.proxy})}})),wc=s(((e,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*7,s=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return c(e);if(n===`number`&&isFinite(e))return t.long?u(e):l(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function c(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var c=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return c*s;case`weeks`:case`week`:case`w`:return c*o;case`days`:case`day`:case`d`:return c*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return c*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return c*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return c*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return c;default:return}}}}function l(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+`d`:t>=i?Math.round(e/i)+`h`:t>=r?Math.round(e/r)+`m`:t>=n?Math.round(e/n)+`s`:e+`ms`}function u(e){var t=Math.abs(e);return t>=a?d(e,t,a,`day`):t>=i?d(e,t,i,`hour`):t>=r?d(e,t,r,`minute`):t>=n?d(e,t,n,`second`):e+` ms`}function d(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}})),Tc=s(((e,t)=>{function n(e){n.debug=n,n.default=n,n.coerce=c,n.disable=o,n.enable=i,n.enabled=s,n.humanize=wc(),n.destroy=l,Object.keys(e).forEach(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={};function t(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]}n.selectColor=t;function n(e){let t,i=null,a,o;function s(...e){if(!s.enabled)return;let r=s,i=Number(new Date);r.diff=i-(t||i),r.prev=t,r.curr=i,t=i,e[0]=n.coerce(e[0]),typeof e[0]!=`string`&&e.unshift(`%O`);let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,i)=>{if(t===`%%`)return`%`;a++;let o=n.formatters[i];if(typeof o==`function`){let n=e[a];t=o.call(r,n),e.splice(a,1),a--}return t}),n.formatArgs.call(r,e),(r.log||n.log).apply(r,e)}return s.namespace=e,s.useColors=n.useColors(),s.color=n.selectColor(e),s.extend=r,s.destroy=n.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>i===null?(a!==n.namespaces&&(a=n.namespaces,o=n.enabled(e)),o):i,set:e=>{i=e}}),typeof n.init==`function`&&n.init(s),s}function r(e,t){let r=n(this.namespace+(t===void 0?`:`:t)+e);return r.log=this.log,r}function i(e){n.save(e),n.namespaces=e,n.names=[],n.skips=[];let t=(typeof e==`string`?e:``).trim().replace(/\s+/g,`,`).split(`,`).filter(Boolean);for(let e of t)e[0]===`-`?n.skips.push(e.slice(1)):n.names.push(e)}function a(e,t){let n=0,r=0,i=-1,a=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||t[r]===`*`))t[r]===`*`?(i=r,a=n,r++):(n++,r++);else if(i!==-1)r=i+1,a++,n=a;else return!1;for(;r<t.length&&t[r]===`*`;)r++;return r===t.length}function o(){let e=[...n.names,...n.skips.map(e=>`-`+e)].join(`,`);return n.enable(``),e}function s(e){for(let t of n.skips)if(a(e,t))return!1;for(let t of n.names)if(a(e,t))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}t.exports=n})),Ec=s(((e,t)=>{e.formatArgs=r,e.save=i,e.load=a,e.useColors=n,e.storage=o(),e.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=`#0000CC.#0000FF.#0033CC.#0033FF.#0066CC.#0066FF.#0099CC.#0099FF.#00CC00.#00CC33.#00CC66.#00CC99.#00CCCC.#00CCFF.#3300CC.#3300FF.#3333CC.#3333FF.#3366CC.#3366FF.#3399CC.#3399FF.#33CC00.#33CC33.#33CC66.#33CC99.#33CCCC.#33CCFF.#6600CC.#6600FF.#6633CC.#6633FF.#66CC00.#66CC33.#9900CC.#9900FF.#9933CC.#9933FF.#99CC00.#99CC33.#CC0000.#CC0033.#CC0066.#CC0099.#CC00CC.#CC00FF.#CC3300.#CC3333.#CC3366.#CC3399.#CC33CC.#CC33FF.#CC6600.#CC6633.#CC9900.#CC9933.#CCCC00.#CCCC33.#FF0000.#FF0033.#FF0066.#FF0099.#FF00CC.#FF00FF.#FF3300.#FF3333.#FF3366.#FF3399.#FF33CC.#FF33FF.#FF6600.#FF6633.#FF9900.#FF9933.#FFCC00.#FFCC33`.split(`.`);function n(){if(typeof window<`u`&&window.process&&(window.process.type===`renderer`||window.process.__nwjs))return!0;if(typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<`u`&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<`u`&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<`u`&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(e){if(e[0]=(this.useColors?`%c`:``)+this.namespace+(this.useColors?` %c`:` `)+e[0]+(this.useColors?`%c `:` `)+`+`+t.exports.humanize(this.diff),!this.useColors)return;let n=`color: `+this.color;e.splice(1,0,n,`color: inherit`);let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{e!==`%%`&&(r++,e===`%c`&&(i=r))}),e.splice(i,0,n)}e.log=console.debug||console.log||(()=>{});function i(t){try{t?e.storage.setItem(`debug`,t):e.storage.removeItem(`debug`)}catch{}}function a(){let t;try{t=e.storage.getItem(`debug`)||e.storage.getItem(`DEBUG`)}catch{}return!t&&typeof process<`u`&&`env`in process&&(t=process.env.DEBUG),t}function o(){try{return localStorage}catch{}}t.exports=Tc()(e);var{formatters:s}=t.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}}})),Dc=s(((e,t)=>{t.exports=(e,t=process.argv)=>{let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1||r<i)}})),Oc=s(((e,t)=>{var n=require("os"),r=require("tty"),i=Dc(),{env:a}=process,o;i(`no-color`)||i(`no-colors`)||i(`color=false`)||i(`color=never`)?o=0:(i(`color`)||i(`colors`)||i(`color=true`)||i(`color=always`))&&(o=1);function s(){if(`FORCE_COLOR`in a)return a.FORCE_COLOR===`true`?1:a.FORCE_COLOR===`false`?0:a.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(a.FORCE_COLOR,10),3)}function c(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function l(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let c=s();c!==void 0&&(o=c);let l=r?o:c;if(l===0)return 0;if(r){if(i(`color=16m`)||i(`color=full`)||i(`color=truecolor`))return 3;if(i(`color=256`))return 2}if(e&&!t&&l===void 0)return 0;let u=l||0;if(a.TERM===`dumb`)return u;if(process.platform===`win32`){let e=n.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in a)return[`TRAVIS`,`CIRCLECI`,`APPVEYOR`,`GITLAB_CI`,`GITHUB_ACTIONS`,`BUILDKITE`,`DRONE`].some(e=>e in a)||a.CI_NAME===`codeship`?1:u;if(`TEAMCITY_VERSION`in a)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(a.TEAMCITY_VERSION);if(a.COLORTERM===`truecolor`)return 3;if(`TERM_PROGRAM`in a){let e=Number.parseInt((a.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(a.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(a.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(a.TERM)||`COLORTERM`in a?1:u}function u(e,t={}){return c(l(e,{streamIsTTY:e&&e.isTTY,...t}))}t.exports={supportsColor:u,stdout:u({isTTY:r.isatty(1)}),stderr:u({isTTY:r.isatty(2)})}})),kc=s(((e,t)=>{var n=require("tty"),r=require("util");e.init=u,e.log=s,e.formatArgs=a,e.save=c,e.load=l,e.useColors=i,e.destroy=r.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),e.colors=[6,2,3,4,5,1];try{let t=Oc();t&&(t.stderr||t).level>=2&&(e.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}e.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),r=process.env[t];return r=/^(yes|on|true|enabled)$/i.test(r)?!0:/^(no|off|false|disabled)$/i.test(r)?!1:r===`null`?null:Number(r),e[n]=r,e},{});function i(){return`colors`in e.inspectOpts?!!e.inspectOpts.colors:n.isatty(process.stderr.fd)}function a(e){let{namespace:n,useColors:r}=this;if(r){let r=this.color,i=`\x1B[3`+(r<8?r:`8;5;`+r),a=` ${i};1m${n} \u001B[0m`;e[0]=a+e[0].split(`
442
442
  `).join(`
443
443
  `+a),e.push(i+`m+`+t.exports.humanize(this.diff)+`\x1B[0m`)}else e[0]=o()+n+` `+e[0]}function o(){return e.inspectOpts.hideDate?``:new Date().toISOString()+` `}function s(...t){return process.stderr.write(r.formatWithOptions(e.inspectOpts,...t)+`
444
444
  `)}function c(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function l(){return process.env.DEBUG}function u(t){t.inspectOpts={};let n=Object.keys(e.inspectOpts);for(let r=0;r<n.length;r++)t.inspectOpts[n[r]]=e.inspectOpts[n[r]]}t.exports=Tc()(e);var{formatters:d}=t.exports;d.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split(`
@@ -448,7 +448,7 @@ globstar while`,t,f,n,p,m),this.matchOne(t.slice(f),n.slice(p),r))return this.de
448
448
  `)+4,e.outputData[0].data=e._header+n.substring(r),d(`Output buffer: %o`,e.outputData[0].data));let i;return this.proxy.protocol===`https:`?(d("Creating `tls.Socket`: %o",this.connectOpts),i=o.connect(this.connectOpts)):(d("Creating `net.Socket`: %o",this.connectOpts),i=a.connect(this.connectOpts)),await(0,c.once)(i,`connect`),i}};f.protocols=[`http`,`https`],e.HttpProxyAgent=f;function p(e,...t){let n={},r;for(r in e)t.includes(r)||(n[r]=e[r]);return n}})),Pc=s((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.parseProxyResponse=void 0;var n=(0,t(Ac()).default)(`https-proxy-agent:parse-proxy-response`);function r(e){return new Promise((t,r)=>{let i=0,a=[];function o(){let t=e.read();t?u(t):e.once(`readable`,o)}function s(){e.removeListener(`end`,c),e.removeListener(`error`,l),e.removeListener(`readable`,o)}function c(){s(),n(`onend`),r(Error(`Proxy connection ended before receiving CONNECT response`))}function l(e){s(),n(`onerror %o`,e),r(e)}function u(c){a.push(c),i+=c.length;let l=Buffer.concat(a,i),u=l.indexOf(`\r
449
449
  \r
450
450
  `);if(u===-1){n(`have not received end of HTTP headers yet...`),o();return}let d=l.slice(0,u).toString(`ascii`).split(`\r
451
- `),f=d.shift();if(!f)return e.destroy(),r(Error(`No header received from proxy CONNECT response`));let p=f.split(` `),m=+p[1],h=p.slice(2).join(` `),g={};for(let t of d){if(!t)continue;let n=t.indexOf(`:`);if(n===-1)return e.destroy(),r(Error(`Invalid header from proxy CONNECT response: "${t}"`));let i=t.slice(0,n).toLowerCase(),a=t.slice(n+1).trimStart(),o=g[i];typeof o==`string`?g[i]=[o,a]:Array.isArray(o)?o.push(a):g[i]=a}n(`got proxy server response: %o %o`,f,g),s(),t({connect:{statusCode:m,statusText:h,headers:g},buffered:l})}e.on(`error`,l),e.on(`end`,c),o()})}e.parseProxyResponse=r})),Fc=s((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.HttpsProxyAgent=void 0;var a=r(require("net")),o=r(require("tls")),s=i(require("assert")),c=i(Ac()),l=Mc(),u=require("url"),d=Pc(),f=(0,c.default)(`https-proxy-agent`),p=e=>e.servername===void 0&&e.host&&!a.isIP(e.host)?{...e,servername:e.host}:e,m=class extends l.Agent{constructor(e,t){super(t),this.options={path:void 0},this.proxy=typeof e==`string`?new u.URL(e):e,this.proxyHeaders=t?.headers??{},f(`Creating new HttpsProxyAgent instance: %o`,this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,``),r=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol===`https:`?443:80;this.connectOpts={ALPNProtocols:[`http/1.1`],...t?g(t,`headers`):null,host:n,port:r}}async connect(e,t){let{proxy:n}=this;if(!t.host)throw TypeError(`No "host" provided`);let r;n.protocol===`https:`?(f("Creating `tls.Socket`: %o",this.connectOpts),r=o.connect(p(this.connectOpts))):(f("Creating `net.Socket`: %o",this.connectOpts),r=a.connect(this.connectOpts));let i=typeof this.proxyHeaders==`function`?this.proxyHeaders():{...this.proxyHeaders},c=a.isIPv6(t.host)?`[${t.host}]`:t.host,l=`CONNECT ${c}:${t.port} HTTP/1.1\r\n`;if(n.username||n.password){let e=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;i[`Proxy-Authorization`]=`Basic ${Buffer.from(e).toString(`base64`)}`}i.Host=`${c}:${t.port}`,i[`Proxy-Connection`]||=this.keepAlive?`Keep-Alive`:`close`;for(let e of Object.keys(i))l+=`${e}: ${i[e]}\r\n`;let u=(0,d.parseProxyResponse)(r);r.write(`${l}\r\n`);let{connect:m,buffered:_}=await u;if(e.emit(`proxyConnect`,m),this.emit(`proxyConnect`,m,e),m.statusCode===200)return e.once(`socket`,h),t.secureEndpoint?(f(`Upgrading socket connection to TLS`),o.connect({...g(p(t),`host`,`path`,`port`),socket:r})):r;r.destroy();let v=new a.Socket({writable:!1});return v.readable=!0,e.once(`socket`,e=>{f(`Replaying proxy buffer for failed request`),(0,s.default)(e.listenerCount(`data`)>0),e.push(_),e.push(null)}),v}};m.protocols=[`http`,`https`],e.HttpsProxyAgent=m;function h(e){e.resume()}function g(e,...t){let n={},r;for(r in e)t.includes(r)||(n[r]=e[r]);return n}})),Ic=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=require("buffer"),n={INVALID_ENCODING:`Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.`,INVALID_SMARTBUFFER_SIZE:`Invalid size provided. Size must be a valid integer greater than zero.`,INVALID_SMARTBUFFER_BUFFER:`Invalid Buffer provided in SmartBufferOptions.`,INVALID_SMARTBUFFER_OBJECT:`Invalid SmartBufferOptions object supplied to SmartBuffer constructor or factory methods.`,INVALID_OFFSET:`An invalid offset value was provided.`,INVALID_OFFSET_NON_NUMBER:`An invalid offset value was provided. A numeric value is required.`,INVALID_LENGTH:`An invalid length value was provided.`,INVALID_LENGTH_NON_NUMBER:`An invalid length value was provived. A numeric value is required.`,INVALID_TARGET_OFFSET:`Target offset is beyond the bounds of the internal SmartBuffer data.`,INVALID_TARGET_LENGTH:`Specified length value moves cursor beyong the bounds of the internal SmartBuffer data.`,INVALID_READ_BEYOND_BOUNDS:`Attempted to read beyond the bounds of the managed data.`,INVALID_WRITE_BEYOND_BOUNDS:`Attempted to write beyond the bounds of the managed data.`};e.ERRORS=n;function r(e){if(!t.Buffer.isEncoding(e))throw Error(n.INVALID_ENCODING)}e.checkEncoding=r;function i(e){return typeof e==`number`&&isFinite(e)&&l(e)}e.isFiniteInteger=i;function a(e,t){if(typeof e==`number`){if(!i(e)||e<0)throw Error(t?n.INVALID_OFFSET:n.INVALID_LENGTH)}else throw Error(t?n.INVALID_OFFSET_NON_NUMBER:n.INVALID_LENGTH_NON_NUMBER)}function o(e){a(e,!1)}e.checkLengthValue=o;function s(e){a(e,!0)}e.checkOffsetValue=s;function c(e,t){if(e<0||e>t.length)throw Error(n.INVALID_TARGET_OFFSET)}e.checkTargetOffset=c;function l(e){return typeof e==`number`&&isFinite(e)&&Math.floor(e)===e}function u(e){if(typeof BigInt>`u`)throw Error(`Platform does not support JS BigInt type.`);if(t.Buffer.prototype[e]===void 0)throw Error(`Platform does not support Buffer.prototype.${e}.`)}e.bigIntAndBufferInt64Check=u})),Lc=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Ic(),n=4096,r=`utf8`;e.SmartBuffer=class e{constructor(i){if(this.length=0,this._encoding=r,this._writeOffset=0,this._readOffset=0,e.isSmartBufferOptions(i))if(i.encoding&&(t.checkEncoding(i.encoding),this._encoding=i.encoding),i.size)if(t.isFiniteInteger(i.size)&&i.size>0)this._buff=Buffer.allocUnsafe(i.size);else throw Error(t.ERRORS.INVALID_SMARTBUFFER_SIZE);else if(i.buff)if(Buffer.isBuffer(i.buff))this._buff=i.buff,this.length=i.buff.length;else throw Error(t.ERRORS.INVALID_SMARTBUFFER_BUFFER);else this._buff=Buffer.allocUnsafe(n);else{if(i!==void 0)throw Error(t.ERRORS.INVALID_SMARTBUFFER_OBJECT);this._buff=Buffer.allocUnsafe(n)}}static fromSize(e,t){return new this({size:e,encoding:t})}static fromBuffer(e,t){return new this({buff:e,encoding:t})}static fromOptions(e){return new this(e)}static isSmartBufferOptions(e){let t=e;return t&&(t.encoding!==void 0||t.size!==void 0||t.buff!==void 0)}readInt8(e){return this._readNumberValue(Buffer.prototype.readInt8,1,e)}readInt16BE(e){return this._readNumberValue(Buffer.prototype.readInt16BE,2,e)}readInt16LE(e){return this._readNumberValue(Buffer.prototype.readInt16LE,2,e)}readInt32BE(e){return this._readNumberValue(Buffer.prototype.readInt32BE,4,e)}readInt32LE(e){return this._readNumberValue(Buffer.prototype.readInt32LE,4,e)}readBigInt64BE(e){return t.bigIntAndBufferInt64Check(`readBigInt64BE`),this._readNumberValue(Buffer.prototype.readBigInt64BE,8,e)}readBigInt64LE(e){return t.bigIntAndBufferInt64Check(`readBigInt64LE`),this._readNumberValue(Buffer.prototype.readBigInt64LE,8,e)}writeInt8(e,t){return this._writeNumberValue(Buffer.prototype.writeInt8,1,e,t),this}insertInt8(e,t){return this._insertNumberValue(Buffer.prototype.writeInt8,1,e,t)}writeInt16BE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt16BE,2,e,t)}insertInt16BE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt16BE,2,e,t)}writeInt16LE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt16LE,2,e,t)}insertInt16LE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt16LE,2,e,t)}writeInt32BE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt32BE,4,e,t)}insertInt32BE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt32BE,4,e,t)}writeInt32LE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt32LE,4,e,t)}insertInt32LE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt32LE,4,e,t)}writeBigInt64BE(e,n){return t.bigIntAndBufferInt64Check(`writeBigInt64BE`),this._writeNumberValue(Buffer.prototype.writeBigInt64BE,8,e,n)}insertBigInt64BE(e,n){return t.bigIntAndBufferInt64Check(`writeBigInt64BE`),this._insertNumberValue(Buffer.prototype.writeBigInt64BE,8,e,n)}writeBigInt64LE(e,n){return t.bigIntAndBufferInt64Check(`writeBigInt64LE`),this._writeNumberValue(Buffer.prototype.writeBigInt64LE,8,e,n)}insertBigInt64LE(e,n){return t.bigIntAndBufferInt64Check(`writeBigInt64LE`),this._insertNumberValue(Buffer.prototype.writeBigInt64LE,8,e,n)}readUInt8(e){return this._readNumberValue(Buffer.prototype.readUInt8,1,e)}readUInt16BE(e){return this._readNumberValue(Buffer.prototype.readUInt16BE,2,e)}readUInt16LE(e){return this._readNumberValue(Buffer.prototype.readUInt16LE,2,e)}readUInt32BE(e){return this._readNumberValue(Buffer.prototype.readUInt32BE,4,e)}readUInt32LE(e){return this._readNumberValue(Buffer.prototype.readUInt32LE,4,e)}readBigUInt64BE(e){return t.bigIntAndBufferInt64Check(`readBigUInt64BE`),this._readNumberValue(Buffer.prototype.readBigUInt64BE,8,e)}readBigUInt64LE(e){return t.bigIntAndBufferInt64Check(`readBigUInt64LE`),this._readNumberValue(Buffer.prototype.readBigUInt64LE,8,e)}writeUInt8(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt8,1,e,t)}insertUInt8(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt8,1,e,t)}writeUInt16BE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt16BE,2,e,t)}insertUInt16BE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt16BE,2,e,t)}writeUInt16LE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt16LE,2,e,t)}insertUInt16LE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt16LE,2,e,t)}writeUInt32BE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt32BE,4,e,t)}insertUInt32BE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt32BE,4,e,t)}writeUInt32LE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt32LE,4,e,t)}insertUInt32LE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt32LE,4,e,t)}writeBigUInt64BE(e,n){return t.bigIntAndBufferInt64Check(`writeBigUInt64BE`),this._writeNumberValue(Buffer.prototype.writeBigUInt64BE,8,e,n)}insertBigUInt64BE(e,n){return t.bigIntAndBufferInt64Check(`writeBigUInt64BE`),this._insertNumberValue(Buffer.prototype.writeBigUInt64BE,8,e,n)}writeBigUInt64LE(e,n){return t.bigIntAndBufferInt64Check(`writeBigUInt64LE`),this._writeNumberValue(Buffer.prototype.writeBigUInt64LE,8,e,n)}insertBigUInt64LE(e,n){return t.bigIntAndBufferInt64Check(`writeBigUInt64LE`),this._insertNumberValue(Buffer.prototype.writeBigUInt64LE,8,e,n)}readFloatBE(e){return this._readNumberValue(Buffer.prototype.readFloatBE,4,e)}readFloatLE(e){return this._readNumberValue(Buffer.prototype.readFloatLE,4,e)}writeFloatBE(e,t){return this._writeNumberValue(Buffer.prototype.writeFloatBE,4,e,t)}insertFloatBE(e,t){return this._insertNumberValue(Buffer.prototype.writeFloatBE,4,e,t)}writeFloatLE(e,t){return this._writeNumberValue(Buffer.prototype.writeFloatLE,4,e,t)}insertFloatLE(e,t){return this._insertNumberValue(Buffer.prototype.writeFloatLE,4,e,t)}readDoubleBE(e){return this._readNumberValue(Buffer.prototype.readDoubleBE,8,e)}readDoubleLE(e){return this._readNumberValue(Buffer.prototype.readDoubleLE,8,e)}writeDoubleBE(e,t){return this._writeNumberValue(Buffer.prototype.writeDoubleBE,8,e,t)}insertDoubleBE(e,t){return this._insertNumberValue(Buffer.prototype.writeDoubleBE,8,e,t)}writeDoubleLE(e,t){return this._writeNumberValue(Buffer.prototype.writeDoubleLE,8,e,t)}insertDoubleLE(e,t){return this._insertNumberValue(Buffer.prototype.writeDoubleLE,8,e,t)}readString(e,n){let r;typeof e==`number`?(t.checkLengthValue(e),r=Math.min(e,this.length-this._readOffset)):(n=e,r=this.length-this._readOffset),n!==void 0&&t.checkEncoding(n);let i=this._buff.slice(this._readOffset,this._readOffset+r).toString(n||this._encoding);return this._readOffset+=r,i}insertString(e,n,r){return t.checkOffsetValue(n),this._handleString(e,!0,n,r)}writeString(e,t,n){return this._handleString(e,!1,t,n)}readStringNT(e){e!==void 0&&t.checkEncoding(e);let n=this.length;for(let e=this._readOffset;e<this.length;e++)if(this._buff[e]===0){n=e;break}let r=this._buff.slice(this._readOffset,n);return this._readOffset=n+1,r.toString(e||this._encoding)}insertStringNT(e,n,r){return t.checkOffsetValue(n),this.insertString(e,n,r),this.insertUInt8(0,n+e.length),this}writeStringNT(e,t,n){return this.writeString(e,t,n),this.writeUInt8(0,typeof t==`number`?t+e.length:this.writeOffset),this}readBuffer(e){e!==void 0&&t.checkLengthValue(e);let n=typeof e==`number`?e:this.length,r=Math.min(this.length,this._readOffset+n),i=this._buff.slice(this._readOffset,r);return this._readOffset=r,i}insertBuffer(e,n){return t.checkOffsetValue(n),this._handleBuffer(e,!0,n)}writeBuffer(e,t){return this._handleBuffer(e,!1,t)}readBufferNT(){let e=this.length;for(let t=this._readOffset;t<this.length;t++)if(this._buff[t]===0){e=t;break}let t=this._buff.slice(this._readOffset,e);return this._readOffset=e+1,t}insertBufferNT(e,n){return t.checkOffsetValue(n),this.insertBuffer(e,n),this.insertUInt8(0,n+e.length),this}writeBufferNT(e,n){return n!==void 0&&t.checkOffsetValue(n),this.writeBuffer(e,n),this.writeUInt8(0,typeof n==`number`?n+e.length:this._writeOffset),this}clear(){return this._writeOffset=0,this._readOffset=0,this.length=0,this}remaining(){return this.length-this._readOffset}get readOffset(){return this._readOffset}set readOffset(e){t.checkOffsetValue(e),t.checkTargetOffset(e,this),this._readOffset=e}get writeOffset(){return this._writeOffset}set writeOffset(e){t.checkOffsetValue(e),t.checkTargetOffset(e,this),this._writeOffset=e}get encoding(){return this._encoding}set encoding(e){t.checkEncoding(e),this._encoding=e}get internalBuffer(){return this._buff}toBuffer(){return this._buff.slice(0,this.length)}toString(e){let n=typeof e==`string`?e:this._encoding;return t.checkEncoding(n),this._buff.toString(n,0,this.length)}destroy(){return this.clear(),this}_handleString(e,n,r,i){let a=this._writeOffset,o=this._encoding;typeof r==`number`?a=r:typeof r==`string`&&(t.checkEncoding(r),o=r),typeof i==`string`&&(t.checkEncoding(i),o=i);let s=Buffer.byteLength(e,o);return n?this.ensureInsertable(s,a):this._ensureWriteable(s,a),this._buff.write(e,a,s,o),n?this._writeOffset+=s:typeof r==`number`?this._writeOffset=Math.max(this._writeOffset,a+s):this._writeOffset+=s,this}_handleBuffer(e,t,n){let r=typeof n==`number`?n:this._writeOffset;return t?this.ensureInsertable(e.length,r):this._ensureWriteable(e.length,r),e.copy(this._buff,r),t?this._writeOffset+=e.length:typeof n==`number`?this._writeOffset=Math.max(this._writeOffset,r+e.length):this._writeOffset+=e.length,this}ensureReadable(e,n){let r=this._readOffset;if(n!==void 0&&(t.checkOffsetValue(n),r=n),r<0||r+e>this.length)throw Error(t.ERRORS.INVALID_READ_BEYOND_BOUNDS)}ensureInsertable(e,n){t.checkOffsetValue(n),this._ensureCapacity(this.length+e),n<this.length&&this._buff.copy(this._buff,n+e,n,this._buff.length),n+e>this.length?this.length=n+e:this.length+=e}_ensureWriteable(e,t){let n=typeof t==`number`?t:this._writeOffset;this._ensureCapacity(n+e),n+e>this.length&&(this.length=n+e)}_ensureCapacity(e){let t=this._buff.length;if(e>t){let n=this._buff,r=t*3/2+1;r<e&&(r=e),this._buff=Buffer.allocUnsafe(r),n.copy(this._buff,0,0,t)}}_readNumberValue(e,t,n){this.ensureReadable(t,n);let r=e.call(this._buff,typeof n==`number`?n:this._readOffset);return n===void 0&&(this._readOffset+=t),r}_insertNumberValue(e,n,r,i){return t.checkOffsetValue(i),this.ensureInsertable(n,i),e.call(this._buff,r,i),this._writeOffset+=n,this}_writeNumberValue(e,n,r,i){if(typeof i==`number`){if(i<0)throw Error(t.ERRORS.INVALID_WRITE_BEYOND_BOUNDS);t.checkOffsetValue(i)}let a=typeof i==`number`?i:this._writeOffset;return this._ensureWriteable(n,a),e.call(this._buff,r,a),typeof i==`number`?this._writeOffset=Math.max(this._writeOffset,a+n):this._writeOffset+=n,this}}})),Rc=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SOCKS5_NO_ACCEPTABLE_AUTH=e.SOCKS5_CUSTOM_AUTH_END=e.SOCKS5_CUSTOM_AUTH_START=e.SOCKS_INCOMING_PACKET_SIZES=e.SocksClientState=e.Socks5Response=e.Socks5HostType=e.Socks5Auth=e.Socks4Response=e.SocksCommand=e.ERRORS=e.DEFAULT_TIMEOUT=void 0,e.DEFAULT_TIMEOUT=3e4,e.ERRORS={InvalidSocksCommand:`An invalid SOCKS command was provided. Valid options are connect, bind, and associate.`,InvalidSocksCommandForOperation:`An invalid SOCKS command was provided. Only a subset of commands are supported for this operation.`,InvalidSocksCommandChain:`An invalid SOCKS command was provided. Chaining currently only supports the connect command.`,InvalidSocksClientOptionsDestination:`An invalid destination host was provided.`,InvalidSocksClientOptionsExistingSocket:`An invalid existing socket was provided. This should be an instance of stream.Duplex.`,InvalidSocksClientOptionsProxy:`Invalid SOCKS proxy details were provided.`,InvalidSocksClientOptionsTimeout:`An invalid timeout value was provided. Please enter a value above 0 (in ms).`,InvalidSocksClientOptionsProxiesLength:`At least two socks proxies must be provided for chaining.`,InvalidSocksClientOptionsCustomAuthRange:`Custom auth must be a value between 0x80 and 0xFE.`,InvalidSocksClientOptionsCustomAuthOptions:`When a custom_auth_method is provided, custom_auth_request_handler, custom_auth_response_size, and custom_auth_response_handler must also be provided and valid.`,NegotiationError:`Negotiation error`,SocketClosed:`Socket closed`,ProxyConnectionTimedOut:`Proxy connection timed out`,InternalError:`SocksClient internal error (this should not happen)`,InvalidSocks4HandshakeResponse:`Received invalid Socks4 handshake response`,Socks4ProxyRejectedConnection:`Socks4 Proxy rejected connection`,InvalidSocks4IncomingConnectionResponse:`Socks4 invalid incoming connection response`,Socks4ProxyRejectedIncomingBoundConnection:`Socks4 Proxy rejected incoming bound connection`,InvalidSocks5InitialHandshakeResponse:`Received invalid Socks5 initial handshake response`,InvalidSocks5IntiailHandshakeSocksVersion:`Received invalid Socks5 initial handshake (invalid socks version)`,InvalidSocks5InitialHandshakeNoAcceptedAuthType:`Received invalid Socks5 initial handshake (no accepted authentication type)`,InvalidSocks5InitialHandshakeUnknownAuthType:`Received invalid Socks5 initial handshake (unknown authentication type)`,Socks5AuthenticationFailed:`Socks5 Authentication failed`,InvalidSocks5FinalHandshake:`Received invalid Socks5 final handshake response`,InvalidSocks5FinalHandshakeRejected:`Socks5 proxy rejected connection`,InvalidSocks5IncomingConnectionResponse:`Received invalid Socks5 incoming connection response`,Socks5ProxyRejectedIncomingBoundConnection:`Socks5 Proxy rejected incoming bound connection`},e.SOCKS_INCOMING_PACKET_SIZES={Socks5InitialHandshakeResponse:2,Socks5UserPassAuthenticationResponse:2,Socks5ResponseHeader:5,Socks5ResponseIPv4:10,Socks5ResponseIPv6:22,Socks5ResponseHostname:e=>e+7,Socks4Response:8};var t;(function(e){e[e.connect=1]=`connect`,e[e.bind=2]=`bind`,e[e.associate=3]=`associate`})(t||(e.SocksCommand=t={}));var n;(function(e){e[e.Granted=90]=`Granted`,e[e.Failed=91]=`Failed`,e[e.Rejected=92]=`Rejected`,e[e.RejectedIdent=93]=`RejectedIdent`})(n||(e.Socks4Response=n={}));var r;(function(e){e[e.NoAuth=0]=`NoAuth`,e[e.GSSApi=1]=`GSSApi`,e[e.UserPass=2]=`UserPass`})(r||(e.Socks5Auth=r={})),e.SOCKS5_CUSTOM_AUTH_START=128,e.SOCKS5_CUSTOM_AUTH_END=254,e.SOCKS5_NO_ACCEPTABLE_AUTH=255;var i;(function(e){e[e.Granted=0]=`Granted`,e[e.Failure=1]=`Failure`,e[e.NotAllowed=2]=`NotAllowed`,e[e.NetworkUnreachable=3]=`NetworkUnreachable`,e[e.HostUnreachable=4]=`HostUnreachable`,e[e.ConnectionRefused=5]=`ConnectionRefused`,e[e.TTLExpired=6]=`TTLExpired`,e[e.CommandNotSupported=7]=`CommandNotSupported`,e[e.AddressNotSupported=8]=`AddressNotSupported`})(i||(e.Socks5Response=i={}));var a;(function(e){e[e.IPv4=1]=`IPv4`,e[e.Hostname=3]=`Hostname`,e[e.IPv6=4]=`IPv6`})(a||(e.Socks5HostType=a={}));var o;(function(e){e[e.Created=0]=`Created`,e[e.Connecting=1]=`Connecting`,e[e.Connected=2]=`Connected`,e[e.SentInitialHandshake=3]=`SentInitialHandshake`,e[e.ReceivedInitialHandshakeResponse=4]=`ReceivedInitialHandshakeResponse`,e[e.SentAuthentication=5]=`SentAuthentication`,e[e.ReceivedAuthenticationResponse=6]=`ReceivedAuthenticationResponse`,e[e.SentFinalHandshake=7]=`SentFinalHandshake`,e[e.ReceivedFinalResponse=8]=`ReceivedFinalResponse`,e[e.BoundWaitingForConnection=9]=`BoundWaitingForConnection`,e[e.Established=10]=`Established`,e[e.Disconnected=11]=`Disconnected`,e[e.Error=99]=`Error`})(o||(e.SocksClientState=o={}))})),zc=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.shuffleArray=e.SocksClientError=void 0,e.SocksClientError=class extends Error{constructor(e,t){super(e),this.options=t}};function t(e){for(let t=e.length-1;t>0;t--){let n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}}e.shuffleArray=t})),Bc=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AddressError=void 0,e.AddressError=class extends Error{constructor(e,t){super(e),this.name=`AddressError`,this.parseMessage=t}}})),Vc=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isInSubnet=n,e.isCorrect=r,e.prefixLengthFromMask=i,e.numberToPaddedHex=a,e.stringToPaddedHex=o,e.testBit=s;var t=Bc();function n(e){return this.subnetMask<e.subnetMask?!1:this.mask(e.subnetMask)===e.mask()}function r(e){return function(){return this.addressMinusSuffix===this.correctForm()?this.subnetMask===e&&!this.parsedSubnet?!0:this.parsedSubnet===String(this.subnetMask):!1}}function i(e,n){let r=e.toString(2).padStart(n,`0`);if(r.length>n)throw new t.AddressError(`Invalid subnet mask.`);let i=r.indexOf(`0`);if(i===-1)return n;if(r.slice(i).includes(`1`))throw new t.AddressError(`Invalid subnet mask.`);return i}function a(e){return e.toString(16).padStart(2,`0`)}function o(e){return a(parseInt(e,10))}function s(e,t){let{length:n}=e;if(t>n)return!1;let r=n-t;return e.substring(r,r+1)===`1`}})),Hc=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RE_SUBNET_STRING=e.RE_ADDRESS=e.GROUPS=e.BITS=void 0,e.BITS=32,e.GROUPS=4,e.RE_ADDRESS=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g,e.RE_SUBNET_STRING=/\/\d{1,2}$/})),Uc=s((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.Address4=void 0;var i=r(Vc()),a=r(Hc()),o=Bc(),s=i.isCorrect(a.BITS),c=class e{constructor(e){this.groups=a.GROUPS,this.parsedAddress=[],this.parsedSubnet=``,this.subnet=`/32`,this.subnetMask=32,this.v4=!0,this.isCorrect=s,this.isInSubnet=i.isInSubnet,this.address=e;let t=a.RE_SUBNET_STRING.exec(e);if(t){if(this.parsedSubnet=t[0].replace(`/`,``),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,this.subnetMask<0||this.subnetMask>a.BITS)throw new o.AddressError(`Invalid subnet mask.`);e=e.replace(a.RE_SUBNET_STRING,``)}this.addressMinusSuffix=e,this.parsedAddress=this.parse(e)}static isValid(t){try{return new e(t),!0}catch{return!1}}parse(e){let t=e.split(`.`);if(!e.match(a.RE_ADDRESS))throw new o.AddressError(`Invalid IPv4 address.`);return t}correctForm(){return this.parsedAddress.map(e=>parseInt(e,10)).join(`.`)}static fromAddressAndMask(t,n){return new e(`${t}/${i.prefixLengthFromMask(new e(n).bigInt(),a.BITS)}`)}static fromAddressAndWildcardMask(t,n){let r=new e(n).bigInt()^(BigInt(1)<<BigInt(a.BITS))-BigInt(1);return new e(`${t}/${i.prefixLengthFromMask(r,a.BITS)}`)}static fromWildcard(t){let n=t.split(`.`);if(n.length!==a.GROUPS)throw new o.AddressError(`Wildcard pattern must have 4 octets`);let r=-1;for(let e=0;e<n.length;e++)if(n[e]===`*`)r===-1&&(r=e);else if(r!==-1)throw new o.AddressError("Wildcard `*` must only appear in trailing octets (e.g. `192.168.0.*`)");let i=r===-1?0:n.length-r,s=n.map(e=>e===`*`?`0`:e),c=a.BITS-i*8;return new e(`${s.join(`.`)}/${c}`)}static fromHex(t){let n=t.replace(/:/g,``);if(!/^[0-9a-fA-F]{8}$/.test(n))throw new o.AddressError(`IPv4 hex must be exactly 8 hex digits`);let r=[];for(let e=0;e<8;e+=2)r.push(parseInt(n.slice(e,e+2),16));return new e(r.join(`.`))}static fromInteger(t){if(!Number.isInteger(t)||t<0||t>4294967295)throw new o.AddressError(`IPv4 integer must be in the range 0 to 2**32 - 1`);return e.fromHex(t.toString(16).padStart(8,`0`))}static fromArpa(t){return new e(t.replace(/(\.in-addr\.arpa)?\.$/,``).split(`.`).reverse().join(`.`))}toHex(){return this.parsedAddress.map(e=>i.stringToPaddedHex(e)).join(`:`)}toArray(){return this.parsedAddress.map(e=>parseInt(e,10))}toGroup6(){let e=[],t;for(t=0;t<a.GROUPS;t+=2)e.push(`${i.stringToPaddedHex(this.parsedAddress[t])}${i.stringToPaddedHex(this.parsedAddress[t+1])}`);return e.join(`:`)}bigInt(){return BigInt(`0x${this.parsedAddress.map(e=>i.stringToPaddedHex(e)).join(``)}`)}_startAddress(){return BigInt(`0b${this.mask()+`0`.repeat(a.BITS-this.subnetMask)}`)}startAddress(){return e.fromBigInt(this._startAddress())}startAddressExclusive(){let t=BigInt(`1`);return e.fromBigInt(this._startAddress()+t)}_endAddress(){return BigInt(`0b${this.mask()+`1`.repeat(a.BITS-this.subnetMask)}`)}endAddress(){return e.fromBigInt(this._endAddress())}endAddressExclusive(){let t=BigInt(`1`);return e.fromBigInt(this._endAddress()-t)}subnetMaskAddress(){return e.fromBigInt(BigInt(`0b${`1`.repeat(this.subnetMask)}${`0`.repeat(a.BITS-this.subnetMask)}`))}wildcardMask(){return e.fromBigInt(BigInt(`0b${`0`.repeat(this.subnetMask)}${`1`.repeat(a.BITS-this.subnetMask)}`))}networkForm(){return`${this.startAddress().correctForm()}/${this.subnetMask}`}static fromBigInt(t){if(t<0n||t>4294967295n)throw new o.AddressError(`IPv4 BigInt must be in the range 0 to 2**32 - 1`);return e.fromHex(t.toString(16).padStart(8,`0`))}static fromByteArray(e){if(e.length!==4)throw new o.AddressError(`IPv4 addresses require exactly 4 bytes`);for(let t=0;t<e.length;t++)if(!Number.isInteger(e[t])||e[t]<0||e[t]>255)throw new o.AddressError(`All bytes must be integers between 0 and 255`);return this.fromUnsignedByteArray(e)}static fromUnsignedByteArray(t){if(t.length!==4)throw new o.AddressError(`IPv4 addresses require exactly 4 bytes`);return new e(t.join(`.`))}mask(e){return e===void 0&&(e=this.subnetMask),this.getBitsBase2(0,e)}getBitsBase2(e,t){return this.binaryZeroPad().slice(e,t)}reverseForm(e){e||={};let t=this.correctForm().split(`.`).reverse().join(`.`);return e.omitSuffix?t:`${t}.in-addr.arpa.`}isMulticast(){return this.isInSubnet(l)}isPrivate(){return u.some(e=>this.isInSubnet(e))}isLoopback(){return this.isInSubnet(d)}isLinkLocal(){return this.isInSubnet(f)}isUnspecified(){return this.isInSubnet(p)}isBroadcast(){return this.isInSubnet(m)}isCGNAT(){return this.isInSubnet(h)}binaryZeroPad(){return this._binaryZeroPad===void 0&&(this._binaryZeroPad=this.bigInt().toString(2).padStart(a.BITS,`0`)),this._binaryZeroPad}groupForV6(){let e=this.parsedAddress;return this.address.replace(a.RE_ADDRESS,`<span class="hover-group group-v4 group-6">${e.slice(0,2).join(`.`)}</span>.<span class="hover-group group-v4 group-7">${e.slice(2,4).join(`.`)}</span>`)}};e.Address4=c;var l=new c(`224.0.0.0/4`),u=[new c(`10.0.0.0/8`),new c(`172.16.0.0/12`),new c(`192.168.0.0/16`)],d=new c(`127.0.0.0/8`),f=new c(`169.254.0.0/16`),p=new c(`0.0.0.0/32`),m=new c(`255.255.255.255/32`),h=new c(`100.64.0.0/10`)})),Wc=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RE_URL_WITH_PORT=e.RE_URL=e.RE_ZONE_STRING=e.RE_SUBNET_STRING=e.RE_BAD_ADDRESS=e.RE_BAD_CHARACTERS=e.TYPES=e.SCOPES=e.GROUPS=e.BITS=void 0,e.BITS=128,e.GROUPS=8,e.SCOPES={0:`Reserved`,1:`Interface local`,2:`Link local`,4:`Admin local`,5:`Site local`,8:`Organization local`,14:`Global`,15:`Reserved`},e.TYPES={"ff01::1/128":`Multicast (All nodes on this interface)`,"ff01::2/128":`Multicast (All routers on this interface)`,"ff02::1/128":`Multicast (All nodes on this link)`,"ff02::2/128":`Multicast (All routers on this link)`,"ff05::2/128":`Multicast (All routers in this site)`,"ff02::5/128":`Multicast (OSPFv3 AllSPF routers)`,"ff02::6/128":`Multicast (OSPFv3 AllDR routers)`,"ff02::9/128":`Multicast (RIP routers)`,"ff02::a/128":`Multicast (EIGRP routers)`,"ff02::d/128":`Multicast (PIM routers)`,"ff02::16/128":`Multicast (MLDv2 reports)`,"ff01::fb/128":`Multicast (mDNSv6)`,"ff02::fb/128":`Multicast (mDNSv6)`,"ff05::fb/128":`Multicast (mDNSv6)`,"ff02::1:2/128":`Multicast (All DHCP servers and relay agents on this link)`,"ff05::1:2/128":`Multicast (All DHCP servers and relay agents in this site)`,"ff02::1:3/128":`Multicast (All DHCP servers on this link)`,"ff05::1:3/128":`Multicast (All DHCP servers in this site)`,"::/128":`Unspecified`,"::1/128":`Loopback`,"ff00::/8":`Multicast`,"fe80::/10":`Link-local unicast`,"fc00::/7":`Unique local`,"2002::/16":`6to4`,"2001:db8::/32":`Documentation`,"64:ff9b::/96":`NAT64 (well-known)`,"64:ff9b:1::/48":`NAT64 (local-use)`},e.RE_BAD_CHARACTERS=/([^0-9a-f:/%])/gi,e.RE_BAD_ADDRESS=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi,e.RE_SUBNET_STRING=/\/\d{1,3}(?=%|$)/,e.RE_ZONE_STRING=/%.*$/,e.RE_URL=/^\[{0,1}([0-9a-f:]+)\]{0,1}/,e.RE_URL_WITH_PORT=/\[([0-9a-f:]+)\]:([0-9]{1,5})/})),Gc=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.escapeHtml=t,e.spanAllZeroes=n,e.spanAll=r,e.spanLeadingZeroes=a,e.simpleGroup=o;function t(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}function n(e){return t(e).replace(/(0+)/g,`<span class="zero">$1</span>`)}function r(e,r=0){return e.split(``).map((e,i)=>`<span class="digit value-${t(e)} position-${i+r}">${n(e)}</span>`).join(``)}function i(e){return t(e).replace(/^(0+)/,`<span class="zero">$1</span>`)}function a(e){return e.split(`:`).map(e=>i(e)).join(`:`)}function o(e,t=0){return e.split(`:`).map((e,n)=>/group-v4/.test(e)?e:`<span class="hover-group group-${n+t}">${i(e)}</span>`)}})),Kc=s((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.ADDRESS_BOUNDARY=void 0,e.groupPossibilities=a,e.padGroup=o,e.simpleRegularExpression=s,e.possibleElisions=c;var i=r(Wc());function a(e){return`(${e.join(`|`)})`}function o(e){return e.length<4?`0{0,${4-e.length}}${e}`:e}e.ADDRESS_BOUNDARY=`[^A-Fa-f0-9:]`;function s(e){let t=[];e.forEach((e,n)=>{parseInt(e,16)===0&&t.push(n)});let n=t.map(t=>e.map((e,n)=>{if(n===t){let t=n===0||n===i.GROUPS-1?`:`:``;return a([o(e),t])}return o(e)}).join(`:`));return n.push(e.map(o).join(`:`)),a(n)}function c(e,t,n){let r=t?``:`:`,i=n?``:`:`,o=[];!t&&!n&&o.push(`::`),t&&n&&o.push(``),(n&&!t||!n&&t)&&o.push(`:`),o.push(`${r}(:0{1,4}){1,${e-1}}`),o.push(`(0{1,4}:){1,${e-1}}${i}`),o.push(`(0{1,4}:){${e-1}}0{1,4}`);for(let t=1;t<e-1;t++)for(let n=1;n<e-t;n++)o.push(`(0{1,4}:){${n}}:(0{1,4}:){${e-n-t-1}}0{1,4}`);return a(o)}})),qc=s((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.Address6=void 0;var i=r(Vc()),a=r(Hc()),o=r(Wc()),s=r(Gc()),c=Uc(),l=Kc(),u=Bc(),d=Vc(),f=i.isCorrect(o.BITS);function p(e){if(!e)throw Error(`Assertion failed.`)}function m(e){let t=/(\d+)(\d{3})/;for(;t.test(e);)e=e.replace(t,`$1,$2`);return e}function h(e){return e=e.replace(/^(0{1,})([1-9]+)$/,`<span class="parse-error">$1</span>$2`),e=e.replace(/^(0{1,})(0)$/,`<span class="parse-error">$1</span>$2`),e}function g(e,t){let n=[],r=[],i;for(i=0;i<e.length;i++)i<t[0]?n.push(e[i]):i>t[1]&&r.push(e[i]);return n.concat([`compact`]).concat(r)}function _(e){return parseInt(e,16).toString(16).padStart(4,`0`)}function v(e){return e&255}var y=class e{constructor(e,t){this.addressMinusSuffix=``,this.parsedSubnet=``,this.subnet=`/128`,this.subnetMask=128,this.v4=!1,this.zone=``,this.isInSubnet=i.isInSubnet,this.isCorrect=f,t===void 0?this.groups=o.GROUPS:this.groups=t,this.address=e;let n=o.RE_SUBNET_STRING.exec(e);if(n){if(this.parsedSubnet=n[0].replace(`/`,``),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,Number.isNaN(this.subnetMask)||this.subnetMask<0||this.subnetMask>o.BITS)throw new u.AddressError(`Invalid subnet mask.`);e=e.replace(o.RE_SUBNET_STRING,``)}else if(/\//.test(e))throw new u.AddressError(`Invalid subnet mask.`);let r=o.RE_ZONE_STRING.exec(e);r&&(this.zone=r[0],e=e.replace(o.RE_ZONE_STRING,``)),this.addressMinusSuffix=e,this.parsedAddress=this.parse(this.addressMinusSuffix)}static isValid(t){try{return new e(t),!0}catch{return!1}}static fromBigInt(t){if(t<0n||t>(1n<<BigInt(o.BITS))-1n)throw new u.AddressError(`IPv6 BigInt must be in the range 0 to 2**128 - 1`);let n=t.toString(16).padStart(32,`0`),r=[];for(let e=0;e<o.GROUPS;e++)r.push(n.slice(e*4,(e+1)*4));return new e(r.join(`:`))}static fromURL(t){let n,r=null,i;if(t.indexOf(`[`)!==-1&&t.indexOf(`]:`)!==-1){if(i=o.RE_URL_WITH_PORT.exec(t),i===null)return{error:`failed to parse address with port`,address:null,port:null};n=i[1],r=i[2]}else if(t.indexOf(`/`)!==-1){if(t=t.replace(/^[a-z0-9]+:\/\//,``),i=o.RE_URL.exec(t),i===null)return{error:`failed to parse address from URL`,address:null,port:null};n=i[1]}else n=t;return r?(r=parseInt(r,10),(r<0||r>65536)&&(r=null)):r=null,{address:new e(n),port:r}}static fromAddressAndMask(t,n){return new e(`${t}/${i.prefixLengthFromMask(new e(n).bigInt(),o.BITS)}`)}static fromAddressAndWildcardMask(t,n){let r=new e(n).bigInt()^(BigInt(1)<<BigInt(o.BITS))-BigInt(1);return new e(`${t}/${i.prefixLengthFromMask(r,o.BITS)}`)}static fromWildcard(t){if(t.includes(`%`)||t.includes(`/`))throw new u.AddressError(`Wildcard pattern must not include a zone or CIDR suffix`);let n=t.split(`::`);if(n.length>2)throw new u.AddressError(`Wildcard pattern cannot contain more than one '::'`);let r;if(n.length===2){let e=n[0]===``?[]:n[0].split(`:`),t=n[1]===``?[]:n[1].split(`:`),i=o.GROUPS-e.length-t.length;if(i<1)throw new u.AddressError(`Wildcard pattern with '::' has too many groups`);r=[...e,...Array(i).fill(`0`),...t]}else r=t.split(`:`);if(r.length!==o.GROUPS)throw new u.AddressError(`Wildcard pattern must have 8 groups`);let i=-1;for(let e=0;e<r.length;e++)if(r[e]===`*`)i===-1&&(i=e);else if(i!==-1)throw new u.AddressError("Wildcard `*` must only appear in trailing groups (e.g. `2001:db8:*:*:*:*:*:*`)");let a=i===-1?0:r.length-i,s=r.map(e=>e===`*`?`0`:e),c=o.BITS-a*16;return new e(`${s.join(`:`)}/${c}`)}static fromAddress4(t){let n=new c.Address4(t),r=o.BITS-(a.BITS-n.subnetMask);return new e(`::ffff:${n.correctForm()}/${r}`)}static fromArpa(t){let n=t.replace(/(\.ip6\.arpa)?\.$/,``);if(n.length!==63)throw new u.AddressError(`Invalid 'ip6.arpa' form.`);let r=n.split(`.`).reverse();for(let e=7;e>0;e--){let t=e*4;r.splice(t,0,`:`)}return n=r.join(``),new e(n)}microsoftTranscription(){return`${this.correctForm().replace(/:/g,`-`)}.ipv6-literal.net`}mask(e=this.subnetMask){return this.getBitsBase2(0,e)}possibleSubnets(e=128){let t=o.BITS-this.subnetMask-Math.abs(e-o.BITS);return t<0?`0`:m((BigInt(`2`)**BigInt(t)).toString(10))}_startAddress(){return BigInt(`0b${this.mask()+`0`.repeat(o.BITS-this.subnetMask)}`)}startAddress(){return e.fromBigInt(this._startAddress())}startAddressExclusive(){let t=BigInt(`1`);return e.fromBigInt(this._startAddress()+t)}_endAddress(){return BigInt(`0b${this.mask()+`1`.repeat(o.BITS-this.subnetMask)}`)}endAddress(){return e.fromBigInt(this._endAddress())}endAddressExclusive(){let t=BigInt(`1`);return e.fromBigInt(this._endAddress()-t)}subnetMaskAddress(){return e.fromBigInt(BigInt(`0b${`1`.repeat(this.subnetMask)}${`0`.repeat(o.BITS-this.subnetMask)}`))}wildcardMask(){return e.fromBigInt(BigInt(`0b${`0`.repeat(this.subnetMask)}${`1`.repeat(o.BITS-this.subnetMask)}`))}networkForm(){return`${this.startAddress().correctForm()}/${this.subnetMask}`}getScope(){let e=this.getType();return e===`Multicast`||e.startsWith(`Multicast `)?o.SCOPES[parseInt(this.getBits(12,16).toString(10),10)]||`Unknown`:e===`Link-local unicast`||e===`Loopback`?`Link local`:e===`Unspecified`?`Unknown`:`Global`}getType(){for(let e=0;e<b.length;e++){let t=b[e];if(this.isInSubnet(t[0]))return t[1]}return`Global unicast`}getBits(e,t){return BigInt(`0b${this.getBitsBase2(e,t)}`)}getBitsBase2(e,t){return this.binaryZeroPad().slice(e,t)}getBitsBase16(e,t){let n=t-e;if(n%4!=0)throw Error(`Length of bits to retrieve must be divisible by four`);return this.getBits(e,t).toString(16).padStart(n/4,`0`)}getBitsPastSubnet(){return this.getBitsBase2(this.subnetMask,o.BITS)}reverseForm(e){e||={};let t=Math.floor(this.subnetMask/4),n=this.canonicalForm().replace(/:/g,``).split(``).slice(0,t).reverse().join(`.`);return t>0?e.omitSuffix?n:`${n}.ip6.arpa.`:e.omitSuffix?``:`ip6.arpa.`}correctForm(){let e,t=[],n=0,r=[];for(e=0;e<this.parsedAddress.length;e++){let t=parseInt(this.parsedAddress[e],16);t===0&&n++,t!==0&&n>0&&(n>1&&r.push([e-n,e-1]),n=0)}n>1&&r.push([this.parsedAddress.length-n,this.parsedAddress.length-1]);let i=r.map(e=>e[1]-e[0]+1);if(r.length>0){let e=i.indexOf(Math.max(...i));t=g(this.parsedAddress,r[e])}else t=this.parsedAddress;for(e=0;e<t.length;e++)t[e]!==`compact`&&(t[e]=parseInt(t[e],16).toString(16));let a=t.join(`:`);return a=a.replace(/^compact$/,`::`),a=a.replace(/(^compact)|(compact$)/,`:`),a=a.replace(/compact/,``),a}binaryZeroPad(){return this._binaryZeroPad===void 0&&(this._binaryZeroPad=this.bigInt().toString(2).padStart(o.BITS,`0`)),this._binaryZeroPad}parse4in6(e){if(e.indexOf(`.`)===-1)return e;let t=e.split(`:`),n=t.slice(-1)[0].match(a.RE_ADDRESS);if(n){this.parsedAddress4=n[0],this.address4=new c.Address4(this.parsedAddress4);for(let e=0;e<this.address4.groups;e++)if(/^0[0-9]+/.test(this.address4.parsedAddress[e])){let e=this.address4.parsedAddress.map(h).join(`.`),n=t.slice(0,-1).map(s.escapeHtml).join(`:`),r=t.length>1?`:`:``;throw new u.AddressError(`IPv4 addresses can't have leading zeroes.`,`${n}${r}${e}`)}this.v4=!0,t[t.length-1]=this.address4.toGroup6(),e=t.join(`:`)}return e}parse(e){e=this.parse4in6(e);let t=e.match(o.RE_BAD_CHARACTERS);if(t)throw new u.AddressError(`Bad character${t.length>1?`s`:``} detected in address: ${t.join(``)}`,e.replace(o.RE_BAD_CHARACTERS,`<span class="parse-error">$1</span>`));let n=e.match(o.RE_BAD_ADDRESS);if(n)throw new u.AddressError(`Address failed regex: ${n.join(``)}`,e.replace(o.RE_BAD_ADDRESS,`<span class="parse-error">$1</span>`));let r=[],i=e.split(`::`);if(i.length===2){let e=i[0].split(`:`),t=i[1].split(`:`);e.length===1&&e[0]===``&&(e=[]),t.length===1&&t[0]===``&&(t=[]);let n=this.groups-(e.length+t.length);if(!n)throw new u.AddressError(`Error parsing groups`);this.elidedGroups=n,this.elisionBegin=e.length,this.elisionEnd=e.length+this.elidedGroups,r=r.concat(e);for(let e=0;e<n;e++)r.push(`0`);r=r.concat(t)}else if(i.length===1)r=e.split(`:`),this.elidedGroups=0;else throw new u.AddressError(`Too many :: groups found`);if(r=r.map(e=>parseInt(e,16).toString(16)),r.length!==this.groups)throw new u.AddressError(`Incorrect number of groups found`);return r}canonicalForm(){return this.parsedAddress.map(_).join(`:`)}decimal(){return this.parsedAddress.map(e=>parseInt(e,16).toString(10).padStart(5,`0`)).join(`:`)}bigInt(){return BigInt(`0x${this.parsedAddress.map(_).join(``)}`)}to4(){let e=this.binaryZeroPad().split(``);return c.Address4.fromHex(BigInt(`0b${e.slice(96,128).join(``)}`).toString(16).padStart(8,`0`))}to4in6(){let t=this.to4(),n=new e(this.parsedAddress.slice(0,6).join(`:`),6).correctForm(),r=``;return/:$/.test(n)||(r=`:`),n+r+t.address}inspectTeredo(){let e=this.getBitsBase16(0,32),t=(this.getBits(80,96)^BigInt(`0xffff`)).toString(),n=c.Address4.fromHex(this.getBitsBase16(32,64)),r=this.getBits(96,128),i=c.Address4.fromHex((r^BigInt(`0xffffffff`)).toString(16).padStart(8,`0`)),a=this.getBitsBase2(64,80),o=(0,d.testBit)(a,15),s=(0,d.testBit)(a,14),l=(0,d.testBit)(a,8),u=(0,d.testBit)(a,9),f=BigInt(`0b${a.slice(2,6)+a.slice(8,16)}`).toString(10);return{prefix:`${e.slice(0,4)}:${e.slice(4,8)}`,server4:n.address,client4:i.address,flags:a,coneNat:o,microsoft:{reserved:s,universalLocal:u,groupIndividual:l,nonce:f},udpPort:t}}inspect6to4(){let e=this.getBitsBase16(0,16),t=c.Address4.fromHex(this.getBitsBase16(16,48));return{prefix:e.slice(0,4),gateway:t.address}}to6to4(){return this.is4()?new e([`2002`,this.getBitsBase16(96,112),this.getBitsBase16(112,128),``,`/16`].join(`:`)):null}static fromAddress4Nat64(t,n=`64:ff9b::/96`){let r=new c.Address4(t),i=new e(n),a=i.subnetMask;if(a!==32&&a!==40&&a!==48&&a!==56&&a!==64&&a!==96)throw new u.AddressError(`NAT64 prefix length must be 32, 40, 48, 56, 64, or 96`);let o=i.binaryZeroPad(),s=r.binaryZeroPad(),l;if(a===96)l=o.slice(0,96)+s;else{let e=64-a;l=o.slice(0,a)+s.slice(0,e)+`00000000`+s.slice(e)+`0`.repeat(56-(32-e))}let d=BigInt(`0b${l}`).toString(16).padStart(32,`0`),f=[];for(let e=0;e<8;e++)f.push(d.slice(e*4,(e+1)*4));return new e(f.join(`:`))}toAddress4Nat64(t=`64:ff9b::/96`){let n=new e(t),r=n.subnetMask;if(r!==32&&r!==40&&r!==48&&r!==56&&r!==64&&r!==96)throw new u.AddressError(`NAT64 prefix length must be 32, 40, 48, 56, 64, or 96`);if(!this.isInSubnet(n))return null;let i=this.binaryZeroPad(),a;if(r===96)a=i.slice(96,128);else{let e=64-r;a=i.slice(r,r+e)+i.slice(72,72+(32-e))}let o=[];for(let e=0;e<4;e++)o.push(parseInt(a.slice(e*8,(e+1)*8),2).toString());return new c.Address4(o.join(`.`))}toByteArray(){let e=this.bigInt().toString(16),t=`${`0`.repeat(e.length%2)}${e}`,n=[];for(let e=0,r=t.length;e<r;e+=2)n.push(parseInt(t.substring(e,e+2),16));return n}toUnsignedByteArray(){return this.toByteArray().map(v)}static fromByteArray(e){return this.fromUnsignedByteArray(e.map(v))}static fromUnsignedByteArray(t){let n=BigInt(`256`),r=BigInt(`0`),i=BigInt(`1`);for(let e=t.length-1;e>=0;e--)r+=i*BigInt(t[e].toString(10)),i*=n;return e.fromBigInt(r)}isCanonical(){return this.addressMinusSuffix===this.canonicalForm()}isLinkLocal(){return this.getBitsBase2(0,64)===`1111111010000000000000000000000000000000000000000000000000000000`}isMulticast(){let e=this.getType();return e===`Multicast`||e.startsWith(`Multicast `)}is4(){return this.v4}isMapped4(){return this.isInSubnet(T)}isTeredo(){return this.isInSubnet(x)}is6to4(){return this.isInSubnet(S)}isLoopback(){return this.getType()===`Loopback`}isULA(){return this.isInSubnet(C)}isUnspecified(){return this.getType()===`Unspecified`}isDocumentation(){return this.isInSubnet(w)}href(e){return e=e===void 0?``:`:${e}`,`http://[${this.correctForm()}]${e}/`}link(e){e||={},e.className===void 0&&(e.className=``),e.prefix===void 0&&(e.prefix=`/#address=`),e.v4===void 0&&(e.v4=!1);let t=this.correctForm;e.v4&&(t=this.to4in6);let n=t.call(this),r=s.escapeHtml(`${e.prefix}${n}`),i=s.escapeHtml(n);return e.className?`<a href="${r}" class="${s.escapeHtml(e.className)}">${i}</a>`:`<a href="${r}">${i}</a>`}group(){if(this.elidedGroups===0)return s.simpleGroup(this.addressMinusSuffix).join(`:`);p(typeof this.elidedGroups==`number`),p(typeof this.elisionBegin==`number`);let e=[],[t,n]=this.addressMinusSuffix.split(`::`);t.length?e.push(...s.simpleGroup(t)):e.push(``);let r=[`hover-group`];for(let e=this.elisionBegin;e<this.elisionBegin+this.elidedGroups;e++)r.push(`group-${e}`);return e.push(`<span class="${r.join(` `)}"></span>`),n.length?e.push(...s.simpleGroup(n,this.elisionEnd)):e.push(``),this.is4()&&(p(this.address4 instanceof c.Address4),e.pop(),e.push(this.address4.groupForV6())),e.join(`:`)}regularExpressionString(t=!1){let n=[],r=new e(this.correctForm());if(r.elidedGroups===0)n.push((0,l.simpleRegularExpression)(r.parsedAddress));else if(r.elidedGroups===o.GROUPS)n.push((0,l.possibleElisions)(o.GROUPS));else{let e=r.address.split(`::`);e[0].length&&n.push((0,l.simpleRegularExpression)(e[0].split(`:`))),p(typeof r.elidedGroups==`number`),n.push((0,l.possibleElisions)(r.elidedGroups,e[0].length!==0,e[1].length!==0)),e[1].length&&n.push((0,l.simpleRegularExpression)(e[1].split(`:`))),n=[n.join(`:`)]}return t||(n=[`(?=^|`,l.ADDRESS_BOUNDARY,`|[^\\w\\:])(`,...n,`)(?=[^\\w\\:]|`,l.ADDRESS_BOUNDARY,`|$)`]),n.join(``)}regularExpression(e=!1){return new RegExp(this.regularExpressionString(e),`i`)}};e.Address6=y;var b=Object.keys(o.TYPES).map(e=>[new y(e),o.TYPES[e]]),x=new y(`2001::/32`),S=new y(`2002::/16`),C=new y(`fc00::/7`),w=new y(`2001:db8::/32`),T=new y(`::ffff:0:0/96`)})),Jc=s((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.v6=e.AddressError=e.Address6=e.Address4=void 0;var i=Uc();Object.defineProperty(e,"Address4",{enumerable:!0,get:function(){return i.Address4}});var a=qc();Object.defineProperty(e,"Address6",{enumerable:!0,get:function(){return a.Address6}});var o=Bc();Object.defineProperty(e,"AddressError",{enumerable:!0,get:function(){return o.AddressError}}),e.v6={helpers:r(Gc())}})),Yc=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ipToBuffer=e.int32ToIpv4=e.ipv4ToInt32=e.validateSocksClientChainOptions=e.validateSocksClientOptions=void 0;var t=zc(),n=Rc(),r=require("stream"),i=Jc(),a=require("net");function o(e,i=[`connect`,`bind`,`associate`]){if(!n.SocksCommand[e.command])throw new t.SocksClientError(n.ERRORS.InvalidSocksCommand,e);if(i.indexOf(e.command)===-1)throw new t.SocksClientError(n.ERRORS.InvalidSocksCommandForOperation,e);if(!l(e.destination))throw new t.SocksClientError(n.ERRORS.InvalidSocksClientOptionsDestination,e);if(!u(e.proxy))throw new t.SocksClientError(n.ERRORS.InvalidSocksClientOptionsProxy,e);if(c(e.proxy,e),e.timeout&&!d(e.timeout))throw new t.SocksClientError(n.ERRORS.InvalidSocksClientOptionsTimeout,e);if(e.existing_socket&&!(e.existing_socket instanceof r.Duplex))throw new t.SocksClientError(n.ERRORS.InvalidSocksClientOptionsExistingSocket,e)}e.validateSocksClientOptions=o;function s(e){if(e.command!==`connect`)throw new t.SocksClientError(n.ERRORS.InvalidSocksCommandChain,e);if(!l(e.destination))throw new t.SocksClientError(n.ERRORS.InvalidSocksClientOptionsDestination,e);if(!(e.proxies&&Array.isArray(e.proxies)&&e.proxies.length>=2))throw new t.SocksClientError(n.ERRORS.InvalidSocksClientOptionsProxiesLength,e);if(e.proxies.forEach(r=>{if(!u(r))throw new t.SocksClientError(n.ERRORS.InvalidSocksClientOptionsProxy,e);c(r,e)}),e.timeout&&!d(e.timeout))throw new t.SocksClientError(n.ERRORS.InvalidSocksClientOptionsTimeout,e)}e.validateSocksClientChainOptions=s;function c(e,r){if(e.custom_auth_method!==void 0){if(e.custom_auth_method<n.SOCKS5_CUSTOM_AUTH_START||e.custom_auth_method>n.SOCKS5_CUSTOM_AUTH_END)throw new t.SocksClientError(n.ERRORS.InvalidSocksClientOptionsCustomAuthRange,r);if(e.custom_auth_request_handler===void 0||typeof e.custom_auth_request_handler!=`function`||e.custom_auth_response_size===void 0||e.custom_auth_response_handler===void 0||typeof e.custom_auth_response_handler!=`function`)throw new t.SocksClientError(n.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,r)}}function l(e){return e&&typeof e.host==`string`&&Buffer.byteLength(e.host)<256&&typeof e.port==`number`&&e.port>=0&&e.port<=65535}function u(e){return e&&(typeof e.host==`string`||typeof e.ipaddress==`string`)&&typeof e.port==`number`&&e.port>=0&&e.port<=65535&&(e.type===4||e.type===5)}function d(e){return typeof e==`number`&&e>0}function f(e){return new i.Address4(e).toArray().reduce((e,t)=>(e<<8)+t,0)>>>0}e.ipv4ToInt32=f;function p(e){return[e>>>24&255,e>>>16&255,e>>>8&255,e&255].join(`.`)}e.int32ToIpv4=p;function m(e){if(a.isIPv4(e)){let t=new i.Address4(e);return Buffer.from(t.toArray())}else if(a.isIPv6(e)){let t=new i.Address6(e);return Buffer.from(t.canonicalForm().split(`:`).map(e=>e.padStart(4,`0`)).join(``),`hex`)}else throw Error(`Invalid IP address format`)}e.ipToBuffer=m})),Xc=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ReceiveBuffer=void 0,e.ReceiveBuffer=class{constructor(e=4096){this.buffer=Buffer.allocUnsafe(e),this.offset=0,this.originalSize=e}get length(){return this.offset}append(e){if(!Buffer.isBuffer(e))throw Error(`Attempted to append a non-buffer instance to ReceiveBuffer.`);if(this.offset+e.length>=this.buffer.length){let t=this.buffer;this.buffer=Buffer.allocUnsafe(Math.max(this.buffer.length+this.originalSize,this.buffer.length+e.length)),t.copy(this.buffer)}return e.copy(this.buffer,this.offset),this.offset+=e.length}peek(e){if(e>this.offset)throw Error(`Attempted to read beyond the bounds of the managed internal data.`);return this.buffer.slice(0,e)}get(e){if(e>this.offset)throw Error(`Attempted to read beyond the bounds of the managed internal data.`);let t=Buffer.allocUnsafe(e);return this.buffer.slice(0,e).copy(t),this.buffer.copyWithin(0,e,e+this.offset-e),this.offset-=e,t}}})),Zc=s((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.SocksClientError=e.SocksClient=void 0;var n=require("events"),r=require("net"),i=Lc(),a=Rc(),o=Yc(),s=Xc(),c=zc();Object.defineProperty(e,"SocksClientError",{enumerable:!0,get:function(){return c.SocksClientError}});var l=Jc();e.SocksClient=class e extends n.EventEmitter{constructor(e){super(),this.options=Object.assign({},e),(0,o.validateSocksClientOptions)(e),this.setState(a.SocksClientState.Created)}static createConnection(t,n){return new Promise((r,i)=>{try{(0,o.validateSocksClientOptions)(t,[`connect`])}catch(e){return typeof n==`function`?(n(e),r(e)):i(e)}let a=new e(t);a.connect(t.existing_socket),a.once(`established`,e=>{a.removeAllListeners(),typeof n==`function`&&n(null,e),r(e)}),a.once(`error`,e=>{a.removeAllListeners(),typeof n==`function`?(n(e),r(e)):i(e)})})}static createConnectionChain(n,r){return new Promise((i,a)=>t(this,void 0,void 0,function*(){try{(0,o.validateSocksClientChainOptions)(n)}catch(e){return typeof r==`function`?(r(e),i(e)):a(e)}n.randomizeChain&&(0,c.shuffleArray)(n.proxies);try{let t;for(let r=0;r<n.proxies.length;r++){let i=n.proxies[r],a=r===n.proxies.length-1?n.destination:{host:n.proxies[r+1].host||n.proxies[r+1].ipaddress,port:n.proxies[r+1].port},o=yield e.createConnection({command:`connect`,proxy:i,destination:a,existing_socket:t});t||=o.socket}typeof r==`function`&&r(null,{socket:t}),i({socket:t})}catch(e){typeof r==`function`?(r(e),i(e)):a(e)}}))}static createUDPFrame(e){let t=new i.SmartBuffer;return t.writeUInt16BE(0),t.writeUInt8(e.frameNumber||0),r.isIPv4(e.remoteHost.host)?(t.writeUInt8(a.Socks5HostType.IPv4),t.writeUInt32BE((0,o.ipv4ToInt32)(e.remoteHost.host))):r.isIPv6(e.remoteHost.host)?(t.writeUInt8(a.Socks5HostType.IPv6),t.writeBuffer((0,o.ipToBuffer)(e.remoteHost.host))):(t.writeUInt8(a.Socks5HostType.Hostname),t.writeUInt8(Buffer.byteLength(e.remoteHost.host)),t.writeString(e.remoteHost.host)),t.writeUInt16BE(e.remoteHost.port),t.writeBuffer(e.data),t.toBuffer()}static parseUDPFrame(e){let t=i.SmartBuffer.fromBuffer(e);t.readOffset=2;let n=t.readUInt8(),r=t.readUInt8(),s;s=r===a.Socks5HostType.IPv4?(0,o.int32ToIpv4)(t.readUInt32BE()):r===a.Socks5HostType.IPv6?l.Address6.fromByteArray(Array.from(t.readBuffer(16))).canonicalForm():t.readString(t.readUInt8());let c=t.readUInt16BE();return{frameNumber:n,remoteHost:{host:s,port:c},data:t.readBuffer()}}setState(e){this.state!==a.SocksClientState.Error&&(this.state=e)}connect(e){this.onDataReceived=e=>this.onDataReceivedHandler(e),this.onClose=()=>this.onCloseHandler(),this.onError=e=>this.onErrorHandler(e),this.onConnect=()=>this.onConnectHandler();let t=setTimeout(()=>this.onEstablishedTimeout(),this.options.timeout||a.DEFAULT_TIMEOUT);t.unref&&typeof t.unref==`function`&&t.unref(),e?this.socket=e:this.socket=new r.Socket,this.socket.once(`close`,this.onClose),this.socket.once(`error`,this.onError),this.socket.once(`connect`,this.onConnect),this.socket.on(`data`,this.onDataReceived),this.setState(a.SocksClientState.Connecting),this.receiveBuffer=new s.ReceiveBuffer,e?this.socket.emit(`connect`):(this.socket.connect(this.getSocketOptions()),this.options.set_tcp_nodelay!==void 0&&this.options.set_tcp_nodelay!==null&&this.socket.setNoDelay(!!this.options.set_tcp_nodelay)),this.prependOnceListener(`established`,e=>{setImmediate(()=>{if(this.receiveBuffer.length>0){let t=this.receiveBuffer.get(this.receiveBuffer.length);e.socket.emit(`data`,t)}e.socket.resume()})})}getSocketOptions(){return Object.assign(Object.assign({},this.options.socket_options),{host:this.options.proxy.host||this.options.proxy.ipaddress,port:this.options.proxy.port})}onEstablishedTimeout(){this.state!==a.SocksClientState.Established&&this.state!==a.SocksClientState.BoundWaitingForConnection&&this.closeSocket(a.ERRORS.ProxyConnectionTimedOut)}onConnectHandler(){this.setState(a.SocksClientState.Connected),this.options.proxy.type===4?this.sendSocks4InitialHandshake():this.sendSocks5InitialHandshake(),this.setState(a.SocksClientState.SentInitialHandshake)}onDataReceivedHandler(e){this.receiveBuffer.append(e),this.processData()}processData(){for(;this.state!==a.SocksClientState.Established&&this.state!==a.SocksClientState.Error&&this.receiveBuffer.length>=this.nextRequiredPacketBufferSize;)if(this.state===a.SocksClientState.SentInitialHandshake)this.options.proxy.type===4?this.handleSocks4FinalHandshakeResponse():this.handleInitialSocks5HandshakeResponse();else if(this.state===a.SocksClientState.SentAuthentication)this.handleInitialSocks5AuthenticationHandshakeResponse();else if(this.state===a.SocksClientState.SentFinalHandshake)this.handleSocks5FinalHandshakeResponse();else if(this.state===a.SocksClientState.BoundWaitingForConnection)this.options.proxy.type===4?this.handleSocks4IncomingConnectionResponse():this.handleSocks5IncomingConnectionResponse();else{this.closeSocket(a.ERRORS.InternalError);break}}onCloseHandler(){this.closeSocket(a.ERRORS.SocketClosed)}onErrorHandler(e){this.closeSocket(e.message)}removeInternalSocketHandlers(){this.socket.pause(),this.socket.removeListener(`data`,this.onDataReceived),this.socket.removeListener(`close`,this.onClose),this.socket.removeListener(`error`,this.onError),this.socket.removeListener(`connect`,this.onConnect)}closeSocket(e){this.state!==a.SocksClientState.Error&&(this.setState(a.SocksClientState.Error),this.socket.destroy(),this.removeInternalSocketHandlers(),this.emit(`error`,new c.SocksClientError(e,this.options)))}sendSocks4InitialHandshake(){let e=this.options.proxy.userId||``,t=new i.SmartBuffer;t.writeUInt8(4),t.writeUInt8(a.SocksCommand[this.options.command]),t.writeUInt16BE(this.options.destination.port),r.isIPv4(this.options.destination.host)?(t.writeBuffer((0,o.ipToBuffer)(this.options.destination.host)),t.writeStringNT(e)):(t.writeUInt8(0),t.writeUInt8(0),t.writeUInt8(0),t.writeUInt8(1),t.writeStringNT(e),t.writeStringNT(this.options.destination.host)),this.nextRequiredPacketBufferSize=a.SOCKS_INCOMING_PACKET_SIZES.Socks4Response,this.socket.write(t.toBuffer())}handleSocks4FinalHandshakeResponse(){let e=this.receiveBuffer.get(8);if(e[1]!==a.Socks4Response.Granted)this.closeSocket(`${a.ERRORS.Socks4ProxyRejectedConnection} - (${a.Socks4Response[e[1]]})`);else if(a.SocksCommand[this.options.command]===a.SocksCommand.bind){let t=i.SmartBuffer.fromBuffer(e);t.readOffset=2;let n={port:t.readUInt16BE(),host:(0,o.int32ToIpv4)(t.readUInt32BE())};n.host===`0.0.0.0`&&(n.host=this.options.proxy.ipaddress),this.setState(a.SocksClientState.BoundWaitingForConnection),this.emit(`bound`,{remoteHost:n,socket:this.socket})}else this.setState(a.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit(`established`,{socket:this.socket})}handleSocks4IncomingConnectionResponse(){let e=this.receiveBuffer.get(8);if(e[1]!==a.Socks4Response.Granted)this.closeSocket(`${a.ERRORS.Socks4ProxyRejectedIncomingBoundConnection} - (${a.Socks4Response[e[1]]})`);else{let t=i.SmartBuffer.fromBuffer(e);t.readOffset=2;let n={port:t.readUInt16BE(),host:(0,o.int32ToIpv4)(t.readUInt32BE())};this.setState(a.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit(`established`,{remoteHost:n,socket:this.socket})}}sendSocks5InitialHandshake(){let e=new i.SmartBuffer,t=[a.Socks5Auth.NoAuth];(this.options.proxy.userId||this.options.proxy.password)&&t.push(a.Socks5Auth.UserPass),this.options.proxy.custom_auth_method!==void 0&&t.push(this.options.proxy.custom_auth_method),e.writeUInt8(5),e.writeUInt8(t.length);for(let n of t)e.writeUInt8(n);this.nextRequiredPacketBufferSize=a.SOCKS_INCOMING_PACKET_SIZES.Socks5InitialHandshakeResponse,this.socket.write(e.toBuffer()),this.setState(a.SocksClientState.SentInitialHandshake)}handleInitialSocks5HandshakeResponse(){let e=this.receiveBuffer.get(2);e[0]===5?e[1]===a.SOCKS5_NO_ACCEPTABLE_AUTH?this.closeSocket(a.ERRORS.InvalidSocks5InitialHandshakeNoAcceptedAuthType):e[1]===a.Socks5Auth.NoAuth?(this.socks5ChosenAuthType=a.Socks5Auth.NoAuth,this.sendSocks5CommandRequest()):e[1]===a.Socks5Auth.UserPass?(this.socks5ChosenAuthType=a.Socks5Auth.UserPass,this.sendSocks5UserPassAuthentication()):e[1]===this.options.proxy.custom_auth_method?(this.socks5ChosenAuthType=this.options.proxy.custom_auth_method,this.sendSocks5CustomAuthentication()):this.closeSocket(a.ERRORS.InvalidSocks5InitialHandshakeUnknownAuthType):this.closeSocket(a.ERRORS.InvalidSocks5IntiailHandshakeSocksVersion)}sendSocks5UserPassAuthentication(){let e=this.options.proxy.userId||``,t=this.options.proxy.password||``,n=new i.SmartBuffer;n.writeUInt8(1),n.writeUInt8(Buffer.byteLength(e)),n.writeString(e),n.writeUInt8(Buffer.byteLength(t)),n.writeString(t),this.nextRequiredPacketBufferSize=a.SOCKS_INCOMING_PACKET_SIZES.Socks5UserPassAuthenticationResponse,this.socket.write(n.toBuffer()),this.setState(a.SocksClientState.SentAuthentication)}sendSocks5CustomAuthentication(){return t(this,void 0,void 0,function*(){this.nextRequiredPacketBufferSize=this.options.proxy.custom_auth_response_size,this.socket.write(yield this.options.proxy.custom_auth_request_handler()),this.setState(a.SocksClientState.SentAuthentication)})}handleSocks5CustomAuthHandshakeResponse(e){return t(this,void 0,void 0,function*(){return yield this.options.proxy.custom_auth_response_handler(e)})}handleSocks5AuthenticationNoAuthHandshakeResponse(e){return t(this,void 0,void 0,function*(){return e[1]===0})}handleSocks5AuthenticationUserPassHandshakeResponse(e){return t(this,void 0,void 0,function*(){return e[1]===0})}handleInitialSocks5AuthenticationHandshakeResponse(){return t(this,void 0,void 0,function*(){this.setState(a.SocksClientState.ReceivedAuthenticationResponse);let e=!1;this.socks5ChosenAuthType===a.Socks5Auth.NoAuth?e=yield this.handleSocks5AuthenticationNoAuthHandshakeResponse(this.receiveBuffer.get(2)):this.socks5ChosenAuthType===a.Socks5Auth.UserPass?e=yield this.handleSocks5AuthenticationUserPassHandshakeResponse(this.receiveBuffer.get(2)):this.socks5ChosenAuthType===this.options.proxy.custom_auth_method&&(e=yield this.handleSocks5CustomAuthHandshakeResponse(this.receiveBuffer.get(this.options.proxy.custom_auth_response_size))),e?this.sendSocks5CommandRequest():this.closeSocket(a.ERRORS.Socks5AuthenticationFailed)})}sendSocks5CommandRequest(){let e=new i.SmartBuffer;e.writeUInt8(5),e.writeUInt8(a.SocksCommand[this.options.command]),e.writeUInt8(0),r.isIPv4(this.options.destination.host)?(e.writeUInt8(a.Socks5HostType.IPv4),e.writeBuffer((0,o.ipToBuffer)(this.options.destination.host))):r.isIPv6(this.options.destination.host)?(e.writeUInt8(a.Socks5HostType.IPv6),e.writeBuffer((0,o.ipToBuffer)(this.options.destination.host))):(e.writeUInt8(a.Socks5HostType.Hostname),e.writeUInt8(this.options.destination.host.length),e.writeString(this.options.destination.host)),e.writeUInt16BE(this.options.destination.port),this.nextRequiredPacketBufferSize=a.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader,this.socket.write(e.toBuffer()),this.setState(a.SocksClientState.SentFinalHandshake)}handleSocks5FinalHandshakeResponse(){let e=this.receiveBuffer.peek(5);if(e[0]!==5||e[1]!==a.Socks5Response.Granted)this.closeSocket(`${a.ERRORS.InvalidSocks5FinalHandshakeRejected} - ${a.Socks5Response[e[1]]}`);else{let t=e[3],n,r;if(t===a.Socks5HostType.IPv4){let e=a.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;if(this.receiveBuffer.length<e){this.nextRequiredPacketBufferSize=e;return}r=i.SmartBuffer.fromBuffer(this.receiveBuffer.get(e).slice(4)),n={host:(0,o.int32ToIpv4)(r.readUInt32BE()),port:r.readUInt16BE()},n.host===`0.0.0.0`&&(n.host=this.options.proxy.ipaddress)}else if(t===a.Socks5HostType.Hostname){let t=e[4],o=a.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(t);if(this.receiveBuffer.length<o){this.nextRequiredPacketBufferSize=o;return}r=i.SmartBuffer.fromBuffer(this.receiveBuffer.get(o).slice(5)),n={host:r.readString(t),port:r.readUInt16BE()}}else if(t===a.Socks5HostType.IPv6){let e=a.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;if(this.receiveBuffer.length<e){this.nextRequiredPacketBufferSize=e;return}r=i.SmartBuffer.fromBuffer(this.receiveBuffer.get(e).slice(4)),n={host:l.Address6.fromByteArray(Array.from(r.readBuffer(16))).canonicalForm(),port:r.readUInt16BE()}}this.setState(a.SocksClientState.ReceivedFinalResponse),a.SocksCommand[this.options.command]===a.SocksCommand.connect?(this.setState(a.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit(`established`,{remoteHost:n,socket:this.socket})):a.SocksCommand[this.options.command]===a.SocksCommand.bind?(this.setState(a.SocksClientState.BoundWaitingForConnection),this.nextRequiredPacketBufferSize=a.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader,this.emit(`bound`,{remoteHost:n,socket:this.socket})):a.SocksCommand[this.options.command]===a.SocksCommand.associate&&(this.setState(a.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit(`established`,{remoteHost:n,socket:this.socket}))}}handleSocks5IncomingConnectionResponse(){let e=this.receiveBuffer.peek(5);if(e[0]!==5||e[1]!==a.Socks5Response.Granted)this.closeSocket(`${a.ERRORS.Socks5ProxyRejectedIncomingBoundConnection} - ${a.Socks5Response[e[1]]}`);else{let t=e[3],n,r;if(t===a.Socks5HostType.IPv4){let e=a.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;if(this.receiveBuffer.length<e){this.nextRequiredPacketBufferSize=e;return}r=i.SmartBuffer.fromBuffer(this.receiveBuffer.get(e).slice(4)),n={host:(0,o.int32ToIpv4)(r.readUInt32BE()),port:r.readUInt16BE()},n.host===`0.0.0.0`&&(n.host=this.options.proxy.ipaddress)}else if(t===a.Socks5HostType.Hostname){let t=e[4],o=a.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(t);if(this.receiveBuffer.length<o){this.nextRequiredPacketBufferSize=o;return}r=i.SmartBuffer.fromBuffer(this.receiveBuffer.get(o).slice(5)),n={host:r.readString(t),port:r.readUInt16BE()}}else if(t===a.Socks5HostType.IPv6){let e=a.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;if(this.receiveBuffer.length<e){this.nextRequiredPacketBufferSize=e;return}r=i.SmartBuffer.fromBuffer(this.receiveBuffer.get(e).slice(4)),n={host:l.Address6.fromByteArray(Array.from(r.readBuffer(16))).canonicalForm(),port:r.readUInt16BE()}}this.setState(a.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit(`established`,{remoteHost:n,socket:this.socket})}}get socksClientOptions(){return Object.assign({},this.options)}}})),Qc=s((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(Zc(),e)})),$c=s((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.SocksProxyAgent=void 0;var a=Qc(),o=Mc(),s=i(Ac()),c=r(require("dns")),l=r(require("net")),u=r(require("tls")),d=require("url"),f=(0,s.default)(`socks-proxy-agent`),p=e=>e.servername===void 0&&e.host&&!l.isIP(e.host)?{...e,servername:e.host}:e;function m(e){let t=!1,n=5,r=e.hostname,i=parseInt(e.port,10)||1080;switch(e.protocol.replace(`:`,``)){case`socks4`:t=!0,n=4;break;case`socks4a`:n=4;break;case`socks5`:t=!0,n=5;break;case`socks`:n=5;break;case`socks5h`:n=5;break;default:throw TypeError(`A "socks" protocol must be specified! Got: ${String(e.protocol)}`)}let a={host:r,port:i,type:n};return e.username&&Object.defineProperty(a,"userId",{value:decodeURIComponent(e.username),enumerable:!1}),e.password!=null&&Object.defineProperty(a,"password",{value:decodeURIComponent(e.password),enumerable:!1}),{lookup:t,proxy:a}}var h=class extends o.Agent{constructor(e,t){super(t);let{proxy:n,lookup:r}=m(typeof e==`string`?new d.URL(e):e);this.shouldLookup=r,this.proxy=n,this.timeout=t?.timeout??null,this.socketOptions=t?.socketOptions??null}async connect(e,t){let{shouldLookup:n,proxy:r,timeout:i}=this;if(!t.host)throw Error("No `host` defined!");let{host:o}=t,{port:s,lookup:l=c.lookup}=t;n&&(o=await new Promise((e,t)=>{l(o,{},(n,r)=>{n?t(n):e(r)})}));let d={proxy:r,destination:{host:o,port:typeof s==`number`?s:parseInt(s,10)},command:`connect`,timeout:i??void 0,socket_options:this.socketOptions??void 0},m=t=>{e.destroy(),h.destroy(),t&&t.destroy()};f(`Creating socks proxy connection: %o`,d);let{socket:h}=await a.SocksClient.createConnection(d);if(f(`Successfully created socks proxy connection`),i!==null&&(h.setTimeout(i),h.on(`timeout`,()=>m())),t.secureEndpoint){f(`Upgrading socket connection to TLS`);let e=u.connect({...g(p(t),`host`,`path`,`port`),socket:h});return e.once(`error`,t=>{f(`Socket TLS error`,t.message),m(e)}),e}return h}};h.protocols=[`socks`,`socks4`,`socks4a`,`socks5`,`socks5h`],e.SocksProxyAgent=h;function g(e,...t){let n={},r;for(r in e)t.includes(r)||(n[r]=e[r]);return n}})),el=s(((e,t)=>{t.exports={InvalidProxyProtocolError:class extends Error{constructor(e){super(`Invalid protocol \`${e.protocol}\` connecting to proxy \`${e.host}\``),this.code=`EINVALIDPROXY`,this.proxy=e}},ConnectionTimeoutError:class extends Error{constructor(e){super(`Timeout connecting to host \`${e}\``),this.code=`ECONNECTIONTIMEOUT`,this.host=e}},IdleTimeoutError:class extends Error{constructor(e){super(`Idle timeout reached for host \`${e}\``),this.code=`EIDLETIMEOUT`,this.host=e}},ResponseTimeoutError:class extends Error{constructor(e,t){let n=`Response timeout `;t&&(n+=`from proxy \`${t.host}\` `),n+=`connecting to host \`${e.host}\``,super(n),this.code=`ERESPONSETIMEOUT`,this.proxy=t,this.request=e}},TransferTimeoutError:class extends Error{constructor(e,t){let n=`Transfer timeout `;t&&(n+=`from proxy \`${t.host}\` `),n+=`for \`${e.host}\``,super(n),this.code=`ETRANSFERTIMEOUT`,this.proxy=t,this.request=e}}}})),tl=s(((e,t)=>{var{HttpProxyAgent:n}=Nc(),{HttpsProxyAgent:r}=Fc(),{SocksProxyAgent:i}=$c(),{LRUCache:a}=zn(),{InvalidProxyProtocolError:o}=el(),s=new a({max:20}),c=new Set(i.protocols),l=new Set([`https_proxy`,`http_proxy`,`proxy`,`no_proxy`]),u=Object.entries(process.env).reduce((e,[t,n])=>(t=t.toLowerCase(),l.has(t)&&(e[t]=n),e),{}),d=e=>{e=new URL(e);let t=e.protocol.slice(0,-1);if(c.has(t))return i;if(t===`https`||t===`http`)return[n,r];throw new o(e)},f=(e,t)=>{if(typeof t==`string`&&(t=t.split(`,`).map(e=>e.trim()).filter(Boolean)),!t||!t.length)return!1;let n=e.hostname.split(`.`).reverse();return t.some(e=>{let t=e.split(`.`).filter(Boolean).reverse();if(!t.length)return!1;for(let e=0;e<t.length;e++)if(n[e]!==t[e])return!1;return!0})};t.exports={getProxyAgent:d,getProxy:(e,{proxy:t,noProxy:n})=>(e=new URL(e),t||=e.protocol===`https:`?u.https_proxy:u.https_proxy||u.http_proxy||u.proxy,n||=u.no_proxy,!t||f(e,n)?null:new URL(t)),proxyCache:s}})),nl=s(((e,t)=>{var n=require("net"),r=require("tls"),{once:i}=require("events"),a=require("timers/promises"),{normalizeOptions:o,cacheOptions:s}=Cc(),{getProxy:c,getProxyAgent:l,proxyCache:u}=tl(),d=el(),{Agent:f}=Mc();t.exports=class extends f{#e;#t;#n;#r;#i;constructor(e={}){let{timeouts:t,proxy:n,noProxy:r,...i}=o(e);super(i),this.#e=i,this.#t=t,n&&(this.#n=new URL(n),this.#r=r,this.#i=l(n))}get proxy(){return this.#n?{url:this.#n}:{}}#a(e){if(!this.#n)return;let t=c(`${e.protocol}//${e.host}:${e.port}`,{proxy:this.#n,noProxy:this.#r});if(!t)return;let n=s({...e,...this.#e,timeouts:this.#t,proxy:t});if(u.has(n))return u.get(n);let r=this.#i;Array.isArray(r)&&(r=this.isSecureEndpoint(e)?r[1]:r[0]);let i=new r(t,{...this.#e,socketOptions:{family:this.#e.family}});return u.set(n,i),i}async#o({promises:e,options:t,timeout:n},r=new AbortController){if(n){let i=a.setTimeout(n,null,{signal:r.signal}).then(()=>{throw new d.ConnectionTimeoutError(`${t.host}:${t.port}`)}).catch(e=>{if(e.name!==`AbortError`)throw e});e.push(i)}let i;try{i=await Promise.race(e),r.abort()}catch(e){throw r.abort(),e}return i}async connect(e,t){t.lookup??=this.#e.lookup;let a,o=this.#t.connection,s=this.isSecureEndpoint(t),c=this.#a(t);if(c){let n=Date.now();a=await this.#o({options:t,timeout:o,promises:[c.connect(e,t)]}),o&&(o-=Date.now()-n)}else a=(s?r:n).connect(t);a.setKeepAlive(this.keepAlive,this.keepAliveMsecs),a.setNoDelay(this.keepAlive);let l=new AbortController,{signal:u}=l,f=a[s?`secureConnecting`:`connecting`]?i(a,s?`secureConnect`:`connect`,{signal:u}):Promise.resolve();return await this.#o({options:t,timeout:o,promises:[f,i(a,`error`,{signal:u}).then(e=>{throw e[0]})]},l),this.#t.idle&&a.setTimeout(this.#t.idle,()=>{a.destroy(new d.IdleTimeoutError(`${t.host}:${t.port}`))}),a}addRequest(e,t){let n=this.#a(t);return n?.setRequestProps&&n.setRequestProps(e,t),e.setHeader(`connection`,this.keepAlive?`keep-alive`:`close`),this.#t.response&&(e.once(`finish`,()=>{setTimeout(()=>{e.destroy(new d.ResponseTimeoutError(e,this.#n))},this.#t.response)}),e.once(`response`,()=>{clearTimeout(void 0)})),this.#t.transfer&&e.once(`response`,t=>{setTimeout(()=>{t.destroy(new d.TransferTimeoutError(e,this.#n))},this.#t.transfer),t.once(`close`,()=>{clearTimeout(void 0)})}),super.addRequest(e,t)}}})),rl=s(((e,t)=>{var{LRUCache:n}=zn(),{normalizeOptions:r,cacheOptions:i}=Cc(),{getProxy:a,proxyCache:o}=tl(),s=Sc(),c=nl(),l=new n({max:20});t.exports={getAgent:(e,{agent:t,proxy:n,noProxy:o,...s}={})=>{if(t!=null)return t;e=new URL(e);let u=a(e,{proxy:n,noProxy:o}),d={...r(s),proxy:u},f=i({...d,secureEndpoint:e.protocol===`https:`});if(l.has(f))return l.get(f);let p=new c(d);return l.set(f,p),p},Agent:c,HttpAgent:c,HttpsAgent:c,cache:{proxy:o,agent:l,dns:s.cache,clear:()=>{o.clear(),l.clear(),s.cache.clear()}}}})),il=c({author:()=>pl,default:()=>yl,dependencies:()=>ml,description:()=>sl,devDependencies:()=>hl,engines:()=>gl,files:()=>ll,keywords:()=>fl,license:()=>`ISC`,main:()=>cl,name:()=>al,repository:()=>dl,scripts:()=>ul,tap:()=>_l,templateOSS:()=>vl,version:()=>ol}),al,ol,sl,cl,ll,ul,dl,fl,pl,ml,hl,gl,_l,vl,yl,bl=o((()=>{al=`make-fetch-happen`,ol=`15.0.5`,sl=`Opinionated, caching, retrying fetch client`,cl=`lib/index.js`,ll=[`bin/`,`lib/`],ul={test:`tap`,posttest:`npm run lint`,eslint:`eslint "**/*.{js,cjs,ts,mjs,jsx,tsx}"`,lint:`npm run eslint`,lintfix:`npm run eslint -- --fix`,postlint:`template-oss-check`,snap:`tap`,"template-oss-apply":`template-oss-apply --force`},dl={type:`git`,url:`git+https://github.com/npm/make-fetch-happen.git`},fl=[`http`,`request`,`fetch`,`mean girls`,`caching`,`cache`,`subresource integrity`],pl=`GitHub Inc.`,ml={"@gar/promise-retry":`^1.0.0`,"@npmcli/agent":`^4.0.0`,"@npmcli/redact":`^4.0.0`,cacache:`^20.0.1`,"http-cache-semantics":`^4.1.1`,minipass:`^7.0.2`,"minipass-fetch":`^5.0.0`,"minipass-flush":`^1.0.5`,"minipass-pipeline":`^1.2.4`,negotiator:`^1.0.0`,"proc-log":`^6.0.0`,ssri:`^13.0.0`},hl={"@npmcli/eslint-config":`^5.0.0`,"@npmcli/template-oss":`4.25.0`,nock:`^13.2.4`,"safe-buffer":`^5.2.1`,"standard-version":`^9.3.2`,tap:`^16.0.0`},gl={node:`^20.17.0 || >=22.9.0`},_l={color:1,files:`test/*.js`,"check-coverage":!0,timeout:60,"nyc-arg":[`--exclude`,`tap-snapshots/**`]},vl={"//@npmcli/template-oss":`This file is partially managed by @npmcli/template-oss. Edits may be overwritten.`,version:`4.25.0`,publish:`true`},yl={name:al,version:ol,description:sl,main:cl,files:ll,scripts:ul,repository:dl,keywords:fl,author:pl,license:`ISC`,dependencies:ml,devDependencies:hl,engines:gl,tap:_l,templateOSS:vl}})),xl=s(((e,t)=>{var{Minipass:n}=Ca(),r=Bo(),{promiseRetry:i}=xc(),a=Ss(),{log:o}=is(),{redact:s}=ss(),c=vc(),{getAgent:l}=rl(),u=(bl(),d(il).default),f=`${u.name}/${u.version} (+https://npm.im/${u.name})`,p=[`ECONNRESET`,`ECONNREFUSED`,`EADDRINUSE`,`ETIMEDOUT`,`ECONNECTIONTIMEOUT`,`EIDLETIMEOUT`,`ERESPONSETIMEOUT`,`ETRANSFERTIMEOUT`],m=[`request-timeout`];t.exports=(e,t)=>{let u=l(e.url,{...t,signal:void 0});e.headers.has(`connection`)||e.headers.set(`connection`,u?`keep-alive`:`close`),e.headers.has(`user-agent`)||e.headers.set(`user-agent`,f);let d={...t,agent:u,redirect:`manual`};return i(async(i,l)=>{let u=new r.Request(e,d),f=s(u.url);try{let e=await r(u,d);if(d.integrity&&e.status===200){let t=a.integrityStream({algorithms:d.algorithms,integrity:d.integrity,size:d.size}),n=new c({events:[`integrity`,`size`]},e.body,t);t.on(`integrity`,e=>n.emit(`integrity`,e)),t.on(`size`,e=>n.emit(`size`,e)),e=new r.Response(n,e),e.body.hasIntegrityEmitter=!0}e.headers.set(`x-fetch-attempts`,l);let s=n.isStream(u.body);return u.method!==`POST`&&!s&&([408,420,429].includes(e.status)||e.status>=500)?(typeof t.onRetry==`function`&&t.onRetry(e),o.http(`fetch`,`${u.method} ${f} attempt ${l} failed with ${e.status}`),i(e)):e}catch(e){let n=e.code===`EPROMISERETRY`?e.retried.code:e.code,a=e.retried instanceof r.Response||p.includes(n)&&m.includes(e.type);if(u.method===`POST`||a)throw e;return typeof t.onRetry==`function`&&t.onRetry(e),o.http(`fetch`,`${u.method} ${f} attempt ${l} failed with ${e.code}`),i(e)}},t.retry).catch(e=>{if(e.status>=400&&e.type!==`system`)return e;throw e})}})),Sl=s(((e,t)=>{var{Request:n,Response:r}=Bo(),{Minipass:i}=Ca(),a=Es(),o=_c(),s=require("url"),c=vc(),l=Cs(),u=yc(),d=xl(),f=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),p=[`accept-charset`,`accept-encoding`,`accept-language`,`accept`,`cache-control`],m=[`cache-control`,`content-encoding`,`content-language`,`content-type`,`date`,`etag`,`expires`,`last-modified`,`link`,`location`,`pragma`,`vary`],h=(e,t,n)=>{let r={time:Date.now(),url:e.url,reqHeaders:{},resHeaders:{},options:{compress:n.compress==null?e.compress:n.compress}};t.status!==200&&t.status!==304&&(r.status=t.status);for(let t of p)e.headers.has(t)&&(r.reqHeaders[t]=e.headers.get(t));let i=e.headers.get(`host`),a=new s.URL(e.url);if(i&&a.host!==i&&(r.reqHeaders.host=i),t.headers.has(`vary`)){let n=t.headers.get(`vary`);if(n!==`*`){let t=n.trim().toLowerCase().split(/\s*,\s*/);for(let n of t)e.headers.has(n)&&(r.reqHeaders[n]=e.headers.get(n))}}for(let e of m)t.headers.has(e)&&(r.resHeaders[e]=t.headers.get(e));for(let e of n.cacheAdditionalHeaders)t.headers.has(e)&&(r.resHeaders[e]=t.headers.get(e));return r},g=Symbol(`request`),_=Symbol(`response`),v=Symbol(`policy`);t.exports=class e{constructor({entry:e,request:t,response:n,options:r}){e?(this.key=e.key,this.entry=e,this.entry.metadata.time=this.entry.metadata.time||this.entry.time):this.key=u(t),this.options=r,this[g]=t,this[_]=n,this[v]=null}static async find(t,n){try{var r=await o.index.compact(n.cachePath,u(t),(t,r)=>{let i=new e({entry:t,options:n}),a=new e({entry:r,options:n});return i.policy.satisfies(a.request)},{validateEntry:e=>e.metadata&&e.metadata.resHeaders&&e.metadata.resHeaders[`content-encoding`]===null?!1:e.integrity===null?!!(e.metadata&&e.metadata.status):!0})}catch{return}if(n.cache===`reload`)return;let i;for(let a of r){let r=new e({entry:a,options:n});if(r.policy.satisfies(t)){i=r;break}}return i}static async invalidate(e,t){let n=u(e);try{await o.rm.entry(t.cachePath,n,{removeFully:!0})}catch{}}get request(){return this[g]||(this[g]=new n(this.entry.metadata.url,{method:`GET`,headers:this.entry.metadata.reqHeaders,...this.entry.metadata.options})),this[g]}get response(){return this[_]||(this[_]=new r(null,{url:this.entry.metadata.url,counter:this.options.counter,status:this.entry.metadata.status||200,headers:{...this.entry.metadata.resHeaders,"content-length":this.entry.size}})),this[_]}get policy(){return this[v]||(this[v]=new l({entry:this.entry,request:this.request,response:this.response,options:this.options})),this[v]}async store(e){if(this.request.method!==`GET`||![200,301,308].includes(this.response.status)||!this.policy.storable())return this.response.headers.set(`x-local-cache-status`,`skip`),this.response;let t=this.response.headers.get(`content-length`),n={algorithms:this.options.algorithms,metadata:h(this.request,this.response,this.options),size:t,integrity:this.options.integrity,integrityEmitter:this.response.body.hasIntegrityEmitter&&this.response.body},s=null;if(this.response.status===200){let e,t,r=new Promise((n,r)=>{e=n,t=r}).catch(e=>{s.emit(`error`,e)});s=new c({events:[`integrity`,`size`]},new a({flush(){return r}})),s.hasIntegrityEmitter=!0;let l=()=>{let r=new i,a=o.put.stream(this.options.cachePath,this.key,n);a.on(`integrity`,e=>s.emit(`integrity`,e)),a.on(`size`,e=>s.emit(`size`,e)),r.pipe(a),a.promise().then(e,t),s.unshift(r),s.unshift(this.response.body)};s.once(`resume`,l),s.once(`end`,()=>s.removeListener(`resume`,l))}else await o.index.insert(this.options.cachePath,this.key,null,n);return this.response.headers.set(`x-local-cache`,encodeURIComponent(this.options.cachePath)),this.response.headers.set(`x-local-cache-key`,encodeURIComponent(this.key)),this.response.headers.set(`x-local-cache-mode`,`stream`),this.response.headers.set(`x-local-cache-status`,e),this.response.headers.set(`x-local-cache-time`,new Date().toISOString()),new r(s,{url:this.response.url,status:this.response.status,headers:this.response.headers,counter:this.options.counter})}async respond(t,n,a){let s;if(t===`HEAD`||[301,308].includes(this.response.status))s=this.response;else{let t=new i,a={...this.policy.responseHeaders()},c=()=>{let n=o.get.stream.byDigest(this.options.cachePath,this.entry.integrity,{memoize:this.options.memoize});n.on(`error`,async r=>{n.pause(),r.code===`EINTEGRITY`&&await o.rm.content(this.options.cachePath,this.entry.integrity,{memoize:this.options.memoize}),(r.code===`ENOENT`||r.code===`EINTEGRITY`)&&await e.invalidate(this.request,this.options),t.emit(`error`,r),n.resume()}),t.emit(`integrity`,this.entry.integrity),t.emit(`size`,Number(a[`content-length`])),n.pipe(t)};t.once(`resume`,c),t.once(`end`,()=>t.removeListener(`resume`,c)),s=new r(t,{url:this.entry.metadata.url,counter:n.counter,status:200,headers:a})}return s.headers.set(`x-local-cache`,encodeURIComponent(this.options.cachePath)),s.headers.set(`x-local-cache-hash`,encodeURIComponent(this.entry.integrity)),s.headers.set(`x-local-cache-key`,encodeURIComponent(this.key)),s.headers.set(`x-local-cache-mode`,`stream`),s.headers.set(`x-local-cache-status`,a),s.headers.set(`x-local-cache-time`,new Date(this.entry.metadata.time).toUTCString()),s}async revalidate(t,r){let i=new n(t,{headers:this.policy.revalidationHeaders(t)});try{var a=await d(i,{...r,headers:void 0})}catch(e){if(!this.policy.mustRevalidate)return this.respond(t.method,r,`stale`);throw e}if(this.policy.revalidated(i,a)){let e=h(t,a,r);for(let t of m)!f(e.resHeaders,t)&&f(this.entry.metadata.resHeaders,t)&&(e.resHeaders[t]=this.entry.metadata.resHeaders[t]);for(let t of r.cacheAdditionalHeaders){let n=f(e.resHeaders,t),r=f(this.entry.metadata.resHeaders,t),i=f(this.policy.response.headers,t);!n&&r&&(e.resHeaders[t]=this.entry.metadata.resHeaders[t]),!i&&n&&(this.policy.response.headers[t]=e.resHeaders[t])}try{await o.index.insert(r.cachePath,this.key,this.entry.integrity,{size:this.entry.size,metadata:e})}catch{}return this.respond(t.method,r,`revalidated`)}return new e({request:t,response:a,options:r}).store(`updated`)}}})),Cl=s(((e,t)=>{var{NotCachedError:n}=ws(),r=Sl(),i=xl(),a=async(e,t)=>{let a=await r.find(e,t);if(!a){if(t.cache===`only-if-cached`)throw new n(e.url);return new r({request:e,response:await i(e,t),options:t}).store(`miss`)}if(t.cache===`no-cache`)return a.revalidate(e,t);let o=a.policy.needsRevalidation(e);return t.cache===`force-cache`||t.cache===`only-if-cached`||!o?a.respond(e.method,t,o?`stale`:`hit`):a.revalidate(e,t)};a.invalidate=async(e,t)=>{if(t.cachePath)return r.invalidate(e,t)},t.exports=a})),wl=s(((e,t)=>{var{FetchError:n,Request:r,isRedirect:i}=Bo(),a=require("url"),o=Cs(),s=Cl(),c=xl(),l=(e,t,r)=>{if(!i(t.status)||r.redirect===`manual`)return!1;if(r.redirect===`error`)throw new n(`redirect mode is set to error: ${e.url}`,`no-redirect`,{code:`ENOREDIRECT`});if(!t.headers.has(`location`))throw new n(`redirect location header missing for: ${e.url}`,`no-location`,{code:`EINVALIDREDIRECT`});if(e.counter>=e.follow)throw new n(`maximum redirect reached at: ${e.url}`,`max-redirect`,{code:`EMAXREDIRECT`});return!0},u=(e,t,n)=>{let i={...n},o=t.headers.get(`location`),s=new a.URL(o,/^https?:/.test(o)?void 0:e.url);return new a.URL(e.url).hostname!==s.hostname&&(e.headers.delete(`authorization`),e.headers.delete(`cookie`)),(t.status===303||e.method===`POST`&&[301,302].includes(t.status))&&(i.method=`GET`,i.body=null,e.headers.delete(`content-length`)),i.headers={},e.headers.forEach((e,t)=>{i.headers[t]=e}),i.counter=++e.counter,{request:new r(a.format(s),i),options:i}},d=async(e,t)=>{let n=o.storable(e,t)?await s(e,t):await c(e,t);if(![`GET`,`HEAD`].includes(e.method)&&n.status>=200&&n.status<=399&&await s.invalidate(e,t),!l(e,n,t))return n;let r=u(e,n,t);return d(r.request,r.options)};t.exports=d})),Tl=s(((e,t)=>{var{FetchError:n,Headers:r,Request:i,Response:a}=Bo(),o=hs(),s=wl(),c=(e,t)=>{let n=o(t);return s(new i(e,n),n)};c.defaults=(e,t={},n=c)=>{typeof e==`object`&&(t=e,e=null);let r=(r,i={})=>n(r||e,{...t,...i,headers:{...t.headers,...i.headers}});return r.defaults=(e,t={})=>c.defaults(e,t,r),r},t.exports=c,t.exports.FetchError=n,t.exports.Headers=r,t.exports.Request=i,t.exports.Response=a})),El=s(((e,t)=>{var n={},r=n.LEFT_BRACE=1,i=n.RIGHT_BRACE=2,a=n.LEFT_BRACKET=3,o=n.RIGHT_BRACKET=4,s=n.COLON=5,c=n.COMMA=6,l=n.TRUE=7,u=n.FALSE=8,d=n.NULL=9,f=n.STRING=10,p=n.NUMBER=11,m=n.START=17,h=n.STOP=18,g=n.TRUE1=33,_=n.TRUE2=34,v=n.TRUE3=35,y=n.FALSE1=49,b=n.FALSE2=50,x=n.FALSE3=51,S=n.FALSE4=52,C=n.NULL1=65,w=n.NULL2=66,T=n.NULL3=67,E=n.NUMBER1=81,D=n.NUMBER3=83,O=n.STRING1=97,k=n.STRING2=98,A=n.STRING3=99,j=n.STRING4=100,M=n.STRING5=101,ee=n.STRING6=102,N=n.VALUE=113,P=n.KEY=114,F=n.OBJECT=129,I=n.ARRAY=130,L=92,R=47,te=8,z=12,B=10,V=13,ne=9,H=64*1024;function U(){this.tState=m,this.value=void 0,this.string=void 0,this.stringBuffer=Buffer.alloc?Buffer.alloc(H):new Buffer(H),this.stringBufferOffset=0,this.unicode=void 0,this.highSurrogate=void 0,this.key=void 0,this.mode=void 0,this.stack=[],this.state=N,this.bytes_remaining=0,this.bytes_in_sequence=0,this.temp_buffs={2:new Buffer(2),3:new Buffer(3),4:new Buffer(4)},this.offset=-1}U.toknam=function(e){for(var t=Object.keys(n),r=0,i=t.length;r<i;r++){var a=t[r];if(n[a]===e)return a}return e&&`0x`+e.toString(16)};var W=U.prototype;W.onError=function(e){throw e},W.charError=function(e,t){this.tState=h,this.onError(Error(`Unexpected `+JSON.stringify(String.fromCharCode(e[t]))+` at position `+t+` in state `+U.toknam(this.tState)))},W.appendStringChar=function(e){this.stringBufferOffset>=H&&(this.string+=this.stringBuffer.toString(`utf8`),this.stringBufferOffset=0),this.stringBuffer[this.stringBufferOffset++]=e},W.appendStringBuf=function(e,t,n){var r=e.length;typeof t==`number`&&(r=typeof n==`number`?n<0?e.length-t+n:n-t:e.length-t),r<0&&(r=0),this.stringBufferOffset+r>H&&(this.string+=this.stringBuffer.toString(`utf8`,0,this.stringBufferOffset),this.stringBufferOffset=0),e.copy(this.stringBuffer,this.stringBufferOffset,t,n),this.stringBufferOffset+=r},W.write=function(e){typeof e==`string`&&(e=new Buffer(e));for(var t,n=0,h=e.length;n<h;n++)if(this.tState===m){if(t=e[n],this.offset++,t===123)this.onToken(r,`{`);else if(t===125)this.onToken(i,`}`);else if(t===91)this.onToken(a,`[`);else if(t===93)this.onToken(o,`]`);else if(t===58)this.onToken(s,`:`);else if(t===44)this.onToken(c,`,`);else if(t===116)this.tState=g;else if(t===102)this.tState=y;else if(t===110)this.tState=C;else if(t===34)this.string=``,this.stringBufferOffset=0,this.tState=O;else if(t===45)this.string=`-`,this.tState=E;else if(t>=48&&t<64)this.string=String.fromCharCode(t),this.tState=D;else if(!(t===32||t===9||t===10||t===13))return this.charError(e,n)}else if(this.tState===O)if(t=e[n],this.bytes_remaining>0){for(var N=0;N<this.bytes_remaining;N++)this.temp_buffs[this.bytes_in_sequence][this.bytes_in_sequence-this.bytes_remaining+N]=e[N];this.appendStringBuf(this.temp_buffs[this.bytes_in_sequence]),this.bytes_in_sequence=this.bytes_remaining=0,n=n+N-1}else if(this.bytes_remaining===0&&t>=128){if(t<=193||t>244)return this.onError(Error(`Invalid UTF-8 character at position `+n+` in state `+U.toknam(this.tState)));if(t>=194&&t<=223&&(this.bytes_in_sequence=2),t>=224&&t<=239&&(this.bytes_in_sequence=3),t>=240&&t<=244&&(this.bytes_in_sequence=4),this.bytes_in_sequence+n>e.length){for(var P=0;P<=e.length-1-n;P++)this.temp_buffs[this.bytes_in_sequence][P]=e[n+P];this.bytes_remaining=n+this.bytes_in_sequence-e.length,n=e.length-1}else this.appendStringBuf(e,n,n+this.bytes_in_sequence),n=n+this.bytes_in_sequence-1}else if(t===34)this.tState=m,this.string+=this.stringBuffer.toString(`utf8`,0,this.stringBufferOffset),this.stringBufferOffset=0,this.onToken(f,this.string),this.offset+=Buffer.byteLength(this.string,`utf8`)+1,this.string=void 0;else if(t===92)this.tState=k;else if(t>=32)this.appendStringChar(t);else return this.charError(e,n);else if(this.tState===k)if(t=e[n],t===34)this.appendStringChar(t),this.tState=O;else if(t===92)this.appendStringChar(L),this.tState=O;else if(t===47)this.appendStringChar(R),this.tState=O;else if(t===98)this.appendStringChar(te),this.tState=O;else if(t===102)this.appendStringChar(z),this.tState=O;else if(t===110)this.appendStringChar(B),this.tState=O;else if(t===114)this.appendStringChar(V),this.tState=O;else if(t===116)this.appendStringChar(ne),this.tState=O;else if(t===117)this.unicode=``,this.tState=A;else return this.charError(e,n);else if(this.tState===A||this.tState===j||this.tState===M||this.tState===ee)if(t=e[n],t>=48&&t<64||t>64&&t<=70||t>96&&t<=102){if(this.unicode+=String.fromCharCode(t),this.tState++===ee){var F=parseInt(this.unicode,16);this.unicode=void 0,this.highSurrogate!==void 0&&F>=56320&&F<57344?(this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate,F))),this.highSurrogate=void 0):this.highSurrogate===void 0&&F>=55296&&F<56320?this.highSurrogate=F:(this.highSurrogate!==void 0&&(this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate))),this.highSurrogate=void 0),this.appendStringBuf(new Buffer(String.fromCharCode(F)))),this.tState=O}}else return this.charError(e,n);else if(this.tState===E||this.tState===D)switch(t=e[n],t){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 46:case 101:case 69:case 43:case 45:this.string+=String.fromCharCode(t),this.tState=D;break;default:this.tState=m;var I=Number(this.string);if(isNaN(I))return this.charError(e,n);this.string.match(/[0-9]+/)==this.string&&I.toString()!=this.string?this.onToken(f,this.string):this.onToken(p,I),this.offset+=this.string.length-1,this.string=void 0,n--;break}else if(this.tState===g)if(e[n]===114)this.tState=_;else return this.charError(e,n);else if(this.tState===_)if(e[n]===117)this.tState=v;else return this.charError(e,n);else if(this.tState===v)if(e[n]===101)this.tState=m,this.onToken(l,!0),this.offset+=3;else return this.charError(e,n);else if(this.tState===y)if(e[n]===97)this.tState=b;else return this.charError(e,n);else if(this.tState===b)if(e[n]===108)this.tState=x;else return this.charError(e,n);else if(this.tState===x)if(e[n]===115)this.tState=S;else return this.charError(e,n);else if(this.tState===S)if(e[n]===101)this.tState=m,this.onToken(u,!1),this.offset+=4;else return this.charError(e,n);else if(this.tState===C)if(e[n]===117)this.tState=w;else return this.charError(e,n);else if(this.tState===w)if(e[n]===108)this.tState=T;else return this.charError(e,n);else if(this.tState===T)if(e[n]===108)this.tState=m,this.onToken(d,null),this.offset+=3;else return this.charError(e,n)},W.onToken=function(e,t){},W.parseError=function(e,t){this.tState=h,this.onError(Error(`Unexpected `+U.toknam(e)+(t?`(`+JSON.stringify(t)+`)`:``)+` in state `+U.toknam(this.state)))},W.push=function(){this.stack.push({value:this.value,key:this.key,mode:this.mode})},W.pop=function(){var e=this.value,t=this.stack.pop();this.value=t.value,this.key=t.key,this.mode=t.mode,this.emit(e),this.mode||(this.state=N)},W.emit=function(e){this.mode&&(this.state=c),this.onValue(e)},W.onValue=function(e){},W.onToken=function(e,t){if(this.state===N)if(e===f||e===p||e===l||e===u||e===d)this.value&&(this.value[this.key]=t),this.emit(t);else if(e===r)this.push(),this.value?this.value=this.value[this.key]={}:this.value={},this.key=void 0,this.state=P,this.mode=F;else if(e===a)this.push(),this.value?this.value=this.value[this.key]=[]:this.value=[],this.key=0,this.mode=I,this.state=N;else if(e===i)if(this.mode===F)this.pop();else return this.parseError(e,t);else if(e===o)if(this.mode===I)this.pop();else return this.parseError(e,t);else return this.parseError(e,t);else if(this.state===P)if(e===f)this.key=t,this.state=s;else if(e===i)this.pop();else return this.parseError(e,t);else if(this.state===s)if(e===s)this.state=N;else return this.parseError(e,t);else if(this.state===c)if(e===c)this.mode===I?(this.key++,this.state=N):this.mode===F&&(this.state=P);else if(e===o&&this.mode===I||e===i&&this.mode===F)this.pop();else return this.parseError(e,t);else return this.parseError(e,t)},U.C=n,t.exports=U})),Dl=s(((e,t)=>{var n=El(),{Minipass:r}=Ca(),i=class extends Error{constructor(e,t){super(e.message),Error.captureStackTrace(this,t||this.constructor)}get name(){return`JSONStreamError`}},a=(e,t)=>typeof e==`string`?String(t)===e:e&&typeof e.test==`function`?e.test(t):typeof e==`boolean`||typeof e==`object`?e:typeof e==`function`?e(t):!1;t.exports=class e extends r{#e=0;#t=!1;#n=null;#r=null;#i=null;#a;#o;#s=null;#c=null;constructor(e){super({...e,objectMode:!0});let t=this.#o=new n;t.onValue=e=>this.#f(e),this.#a=t.onToken,t.onToken=(e,t)=>this.#d(e,t),t.onError=e=>this.#u(e),this.#s=typeof e.path==`string`?e.path.split(`.`).map(e=>e===`$*`?{emitKey:!0}:e===`*`?!0:e===``?{recurse:!0}:e):Array.isArray(e.path)&&e.path.length?e.path:null,typeof e.map==`function`&&(this.#i=e.map)}#l(e,t){this.#r!==!1&&(this.#r=this.#r||{},this.#r[e]=t),this.#n!==!1&&this.#r===!1&&(this.#n=this.#n||{},this.#n[e]=t)}#u(e){let t=this.#t?this.end:this.write;return this.#t=!1,this.emit(`error`,new i(e,t))}#d(e,t){let n=this.#o;if(this.#a.call(this.#o,e,t),n.stack.length===0&&this.#c){let e=this.#c;this.#s||super.write(e),this.#c=null,this.#e=0}}#f(e){let t=this.#o;if(this.#c=e,!this.#s)return;let n=0,r=0,i=!1;for(;n<this.#s.length;){let o=this.#s[n];if(r++,o&&!o.recurse){let s=r===t.stack.length?t:t.stack[r];if(!s)return;if(!a(o,s.key)){this.#l(s.key,e);return}i=!!o.emitKey,n++}else{if(n++,n>=this.#s.length)return;let i=this.#s[n];if(!i)return;for(;;){let o=r===t.stack.length?t:t.stack[r];if(!o)return;if(a(i,o.key)){n++,Object.isFrozen(t.stack[r])||(t.stack[r].value=null);break}else this.#l(o.key,e);r++}}}if(this.#r){let e=this.#r;this.#r=!1,this.emit(`header`,e)}if(r!==t.stack.length)return;this.#e++;let o=t.stack.slice(1).map(e=>e.key).concat([t.key]);if(e!=null){let n=this.#i?this.#i(e,o):e;if(n!=null){let e=i?{value:n}:n;i&&(e.key=t.key),super.write(e)}}t.value&&delete t.value[t.key];for(let e of t.stack)e.value=null}write(e,t){if(typeof e==`string`)e=Buffer.from(e,t);else if(!Buffer.isBuffer(e))return this.emit(`error`,TypeError(`Can only parse JSON from string or buffer input`));return this.#o.write(e),this.flowing}end(e,t){this.#t=!0,e&&this.write(e,t);let n=this.#r;this.#r=null;let r=this.#n;return this.#n=null,n&&this.emit(`header`,n),r&&this.emit(`footer`,r),super.end()}static get JSONStreamError(){return i}static parse(t,n){return new e({path:t,map:n})}}})),Ol=s(((e,t)=>{var{HttpErrorAuthOTP:n}=Sa(),r=cs(),i=ms(),a=Tl(),o=Dl(),s=ps(),c=require("querystring"),l=require("url"),u=Ta(),{Minipass:d}=Ca(),f=rs(),p=e=>{try{return!!new l.URL(e)}catch{return!1}};t.exports=m;function m(e,t={}){let o={...f,...t},s=p(e),h=o.registry||f.registry;s||(h=o.registry=o.spec&&_(o.spec,o)||o.registry||h,e=`${h.trim().replace(/\/?$/g,``)}/${e.trim().replace(/^\//,``)}`,new l.URL(e));let g=o.method||`GET`,b=Date.now(),x=i(e,o),S=y(e,x,o),C=o.body,w=d.isStream(C),T=C&&typeof C==`object`&&typeof C.then==`function`;if(C&&!w&&!T&&typeof C!=`string`&&!Buffer.isBuffer(C)?(S[`content-type`]=S[`content-type`]||`application/json`,C=JSON.stringify(C)):C&&!S[`content-type`]&&(S[`content-type`]=`application/octet-stream`),o.gzip)if(S[`content-encoding`]=`gzip`,w){let e=new u.Gzip;C.on(`error`,t=>e.emit(`error`,t)),C=C.pipe(e)}else T||(C=new u.Gzip().end(C).concat());let E=new l.URL(e);if(o.query){let t=typeof o.query==`string`?c.parse(o.query):o.query;Object.keys(t).forEach(e=>{t[e]!==void 0&&E.searchParams.set(e,t[e])}),e=l.format(E)}return E.searchParams.get(`write`)===`true`&&g===`GET`&&(o.offline=!1,o.preferOffline=!1,o.preferOnline=!0),Promise.resolve(C).then(async t=>{let i=a(e,{agent:o.agent,algorithms:o.algorithms,body:t,cache:v(o),cachePath:o.cache,ca:o.ca,cert:x.cert||o.cert,headers:S,integrity:o.integrity,key:x.key||o.key,localAddress:o.localAddress,maxSockets:o.maxSockets,memoize:o.memoize,method:g,noProxy:o.noProxy,proxy:o.httpsProxy||o.proxy,retry:o.retry?o.retry:{retries:o.fetchRetries,factor:o.fetchRetryFactor,minTimeout:o.fetchRetryMintimeout,maxTimeout:o.fetchRetryMaxtimeout},strictSSL:o.strictSSL,timeout:o.timeout||30*1e3,signal:o.signal}).then(t=>r({method:g,uri:e,res:t,registry:h,startTime:b,auth:x,opts:o}));return typeof o.otpPrompt==`function`?i.catch(async t=>{if(t instanceof n){let n;try{n=await o.otpPrompt()}catch{}if(!n)throw t;return m(e,{...o,otp:n})}throw t}):i})}t.exports.getAuth=i,t.exports.json=h;function h(e,t){return m(e,t).then(e=>e.json())}t.exports.json.stream=g;function g(e,t,n={}){let r={...f,...n},i=o.parse(t,r.mapJSON);return m(e,r).then(e=>e.body.on(`error`,e=>i.emit(`error`,e)).pipe(i)).catch(e=>i.emit(`error`,e)),i}t.exports.pickRegistry=_;function _(e,t={}){e=s(e);let n=e.scope&&t[e.scope.replace(/^@?/,`@`)+`:registry`];return!n&&t.scope&&(n=t[t.scope.replace(/^@?/,`@`)+`:registry`]),n||=t.registry||f.registry,n}function v(e){return e.offline?`only-if-cached`:e.preferOffline?`force-cache`:e.preferOnline?`no-cache`:`default`}function y(e,t,n){let r=Object.assign({"user-agent":n.userAgent},n.headers||{});return n.authType&&(r[`npm-auth-type`]=n.authType),n.scope&&(r[`npm-scope`]=n.scope),n.npmSession&&(r[`npm-session`]=n.npmSession),n.npmCommand&&(r[`npm-command`]=n.npmCommand),t.token?r.authorization=`Bearer ${t.token}`:t.auth&&(r.authorization=`Basic ${t.auth}`),n.otp&&(r[`npm-otp`]=n.otp),r}})),kl=u(ba(),1),Al=u(xa(),1),jl=u(Ol(),1),Ml,Nl;function Pl(e){if(typeof e!=`string`)throw TypeError(`Expected a string, got ${typeof e}`);if(Ml===void 0&&(Ml=v.default.homedir()),Ml&&/^~(?=$|\/|\\)/.test(e))return e.replace(/^~/,Ml);let t=e.match(/^~([^/\\]+)(.*)/);if(t&&(Nl===void 0&&(Nl=v.default.userInfo().username),Nl)){let e=t[1],n=t[2];if(e===Nl)return Ml+n}return e}var Fl=class{value;next;constructor(e){this.value=e}},Il=class{#e;#t;#n;constructor(){this.clear()}enqueue(e){let t=new Fl(e);this.#e?(this.#t.next=t,this.#t=t):(this.#e=t,this.#t=t),this.#n++}dequeue(){let e=this.#e;if(e)return this.#e=this.#e.next,this.#n--,this.#e||(this.#t=void 0),e.value}peek(){if(this.#e)return this.#e.value}clear(){this.#e=void 0,this.#t=void 0,this.#n=0}get size(){return this.#n}*[Symbol.iterator](){let e=this.#e;for(;e;)yield e.value,e=e.next}*drain(){for(;this.#e;)yield this.dequeue()}};function Ll(e){if(!((Number.isInteger(e)||e===1/0)&&e>0))throw TypeError("Expected `concurrency` to be a number from 1 and up");let t=new Il,n=0,r=()=>{n--,t.size>0&&t.dequeue()()},i=async(e,t,i)=>{n++;let a=(async()=>e(...i))();t(a);try{await a}catch{}r()},a=(r,a,o)=>{t.enqueue(i.bind(void 0,r,a,o)),(async()=>{await Promise.resolve(),n<e&&t.size>0&&t.dequeue()()})()},o=(e,...t)=>new Promise(n=>{a(e,n,t)});return Object.defineProperties(o,{activeCount:{get:()=>n},pendingCount:{get:()=>t.size},clearQueue:{value:()=>{t.clear()}}}),o}var Rl=class extends Error{constructor(e){super(),this.value=e}},zl=async(e,t)=>t(await e),Bl=async e=>{let t=await Promise.all(e);if(t[1]===!0)throw new Rl(t[0]);return!1};async function Vl(e,t,{concurrency:n=1/0,preserveOrder:r=!0}={}){let i=Ll(n),a=[...e].map(e=>[e,i(zl,e,t)]),o=Ll(r?1:1/0);try{await Promise.all(a.map(e=>o(Bl,e)))}catch(e){if(e instanceof Rl)return e.value;throw e}}var Hl={directory:`isDirectory`,file:`isFile`};function Ul(e){if(!(e===`both`||Object.hasOwn(Hl,e)))throw Error(`Invalid type specified: ${e}`)}var Wl=(e,t)=>e===`both`?t.isFile()||t.isDirectory():t[Hl[e]](),Gl=e=>e instanceof URL?(0,C.fileURLToPath)(e):e;async function Kl(e,{cwd:t=_.default.cwd(),type:n=`file`,allowSymlinks:r=!0,concurrency:i,preserveOrder:a}={}){Ul(n),t=Gl(t);let o=r?T.promises.stat:T.promises.lstat;return Vl(e,async e=>{try{return Wl(n,await o(S.default.resolve(t,e)))}catch{return!1}},{concurrency:i,preserveOrder:a})}function ql(e,{cwd:t=_.default.cwd(),type:n=`file`,allowSymlinks:r=!0}={}){Ul(n),t=Gl(t);let i=r?T.default.statSync:T.default.lstatSync;for(let r of e)try{let e=i(S.default.resolve(t,r),{throwIfNoEntry:!1});if(!e)continue;if(Wl(n,e))return r}catch{}}(0,w.promisify)(E.execFile);function Jl(e){return e instanceof URL?(0,C.fileURLToPath)(e):e}var Yl=Symbol(`findUpStop`);async function Xl(e,t={}){let n=S.default.resolve(Jl(t.cwd)??``),{root:r}=S.default.parse(n),i=S.default.resolve(n,Jl(t.stopAt)??r),a=t.limit??1/0,o=[e].flat(),s=async t=>{if(typeof e!=`function`)return Kl(o,t);let n=await e(t.cwd);return typeof n==`string`?Kl([n],t):n},c=[];for(;;){let e=await s({...t,cwd:n});if(e===Yl||(e&&c.push(S.default.resolve(n,e)),n===i||c.length>=a))break;n=S.default.dirname(n)}return c}function Zl(e,t={}){let n=S.default.resolve(Jl(t.cwd)??``),{root:r}=S.default.parse(n),i=S.default.resolve(n,Jl(t.stopAt)??r),a=t.limit??1/0,o=[e].flat(),s=t=>{if(typeof e!=`function`)return ql(o,t);let n=e(t.cwd);return typeof n==`string`?ql([n],t):n},c=[];for(;;){let e=s({...t,cwd:n});if(e===Yl||(e&&c.push(S.default.resolve(n,e)),n===i||c.length>=a))break;n=S.default.dirname(n)}return c}async function Ql(e,t={}){return(await Xl(e,{...t,limit:1}))[0]}function $l(e,t={}){return Zl(e,{...t,limit:1})[0]}var eu=class e{constructor(e,t,n){this.__specs=e||{},this.__opts=t||{},this.__providers=au(n.filter(e=>typeof e==`object`&&!!e)),this.__isFiggyPudding=!0}get(e){return tu(this,e,!0)}toJSON(){let e={};return this.forEach((t,n)=>{e[n]=t}),e}forEach(e,t=this){for(let[n,r]of this.entries())e.call(t,r,n,this)}*entries(e){for(let e of Object.keys(this.__specs))yield[e,this.get(e)];let t=e||this.__opts.other;if(t){let e=new Set;for(let n of this.__providers){let r=n.entries?n.entries(t):ou(n);for(let[n,i]of r)t(n)&&!e.has(n)&&(e.add(n),yield[n,i])}}}concat(...t){return new Proxy(new e(this.__specs,this.__opts,au(this.__providers).concat(t)),ru)}};function tu(e,t,n){let r=e.__specs[t];r||={};let i;for(let n of e.__providers)if(i=nu(t,n),i!==void 0)break;return i===void 0&&r.default!==void 0?typeof r.default==`function`?r.default(e):r.default:i}function nu(e,t){let n;return n=t.__isFiggyPudding?tu(t,e,!1):t[e],n}var ru={get(e,t){return typeof t==`symbol`||t.slice(0,2)===`__`||t in eu.prototype?e[t]:e.get(t)}};function iu(e,t){function n(...n){return new Proxy(new eu(e,t,n),ru)}return n}function au(e){let t=[];return e.forEach(e=>t.unshift(e)),t}function ou(e){return Object.keys(e).map(t=>[t,e[t]])}var su=iu({},{other(){return!0}}),cu=iu({cache:{default:S.default.join(process.env.HOME||v.default.homedir(),`.npm`)},configNames:{default:[`npmrc`,`.npmrc`]},envPrefix:{default:/^npm_config_/i},cwd:{default:()=>process.cwd()},globalconfig:{default:()=>S.default.join(du(),`etc`,`npmrc`)},userconfig:{default:S.default.join(process.env.HOME||v.default.homedir(),`.npmrc`)}});function lu(e,t){let n=cu(t),r={};Object.keys(process.env).forEach(e=>{if(!e.match(n.envPrefix))return;let t=e.toLowerCase().replace(n.envPrefix,``).replace(/(?!^)_/g,`-`);r[t]=process.env[e]});let i=su(e),a=n.userconfig||i.userconfig||r.userconfig,o=a&&uu(a),s=n.globalconfig||i.globalconfig||r.globalconfig,c=s&&uu(s),l=$l(n.configNames,{cwd:n.cwd}),u={};l&&l!==a&&(u=uu(l));let d=su(n,c,o,u,r,i);return d.cache?d.concat({cache:S.default.resolve(i.cache||r.cache?n.cwd:u.cache?S.default.dirname(l):o.cache?S.default.dirname(a):c.cache?S.default.dirname(s):S.default.dirname(a),d.cache)}):d}function uu(e){let t;try{t=T.default.readFileSync(e,`utf8`)}catch(e){if(e.code===`ENOENT`)return``;throw e}return Al.default.parse(t)}function du(){if(process.env.PREFIX)return process.env.PREFIX;if(process.platform===`win32`)return S.default.dirname(process.execPath);{let e=S.default.dirname(S.default.dirname(process.execPath));return process.env.DESTDIR&&(e=S.default.join(process.env.DESTDIR,e)),e}}var fu=(e,t=process.platform)=>t===`win32`&&e!==`bun`?[`${e}.cmd`,e]:[e];async function pu(e,t,n,r){let i=fu(e);for(let[e,a]of i.entries())try{return await(0,Wi.default)(a,t,n,r)}catch(t){if(t.code!==`ENOENT`||e===i.length-1)throw t}throw Error(`No spawn commands available for ${e}`)}function mu(e,t){return t.deprecated||!e.deprecated}function hu(e,t){return t.pre?!0:!e.version||!Tr(e.version)}function gu(e,t){if(!t)return!0;let n=q.default.minVersion(t)?.version;if(!n)return!0;let r=e?.engines?.node;return!r||q.default.satisfies(n,r)}function _u(e,t){return t?Object.values(t).every(t=>t[e.name]===void 0||q.default.satisfies(e.version,t[e.name])):!0}var vu=(e,t,n,r)=>{if(!t)return!1;if(!r||!n)return!0;let i=new Date(n),a=typeof r==`function`?r(e??``)??0:r,o=typeof a==`string`?ui(a)??0:a;return Date.now()-i.getTime()>=o*864e5};function yu(e){let t=[t=>mu(t,e),t=>hu(t,e),e.enginesNode?t=>gu(t,e.nodeEngineVersion):null,e.peerDependencies?t=>_u(t,e.peerDependencies):null];return e=>t.every(t=>t?t(e):!0)}var bu=c({default:()=>Fu,defaultPrefix:()=>Iu,distTag:()=>Vu,getEngines:()=>zu,getPeerDependencies:()=>Ru,greatest:()=>Lu,latest:()=>Hu,list:()=>Bu,minor:()=>Wu,newest:()=>Uu,normalizeNpmConfig:()=>Du,npmApi:()=>Ou,packageAuthorChanged:()=>ju,parseJson:()=>Au,patch:()=>Gu,semver:()=>Ku}),xu=new Set([`-`,`||`,`&&`,`<`,`<=`,`>`,`>=`]),Su=e=>(0,$n.parseRange)(e).some(e=>xu.has(e.operator||``)),Cu=e=>e&&(!q.default.validRange(e)||mr(e)),wu=async(e,t,n,r={},i)=>{let a=jl.default.pickRegistry(e,r),o={"user-agent":r.userAgent||`npm-check-updates/${ge.version} node/${process.version}`,"ncu-version":ge.version,"ncu-pkg-id":`registry:${e}`,accept:r.fullMetadata?`application/json`:`application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*`,...r.headers},s=new URL(encodeURIComponent(e),a.endsWith(`/`)?a:`${a}/`);i&&(s.pathname+=`/${i}`);let c={...r,headers:o,spec:e};try{if(r.fullMetadata)return jl.default.json(s.href,c);{n||=`latest`;let r=await(0,jl.default)(s.href,c),i=new oa({paths:[`$.*`],keepStack:!1}),a={name:e},o=!1,l=null;i.onValue=({key:e,value:n})=>{if(o||e===void 0)return;let r=e;t.includes(r)&&(a[r]=n,Object.keys(a).length===t.length+1&&(o=!0))},i.onError=e=>{l=e};for await(let e of r.body){if(i.write(e),l)throw l;if(o)break}if(l)throw l;return a}}catch(a){if(a.code!==`E404`||r.fullMetadata)throw a;return wu(e,t,n,{...r,fullMetadata:!0},i)}},Tu=({packageName:e,currentVersion:t,options:n,versions:r,time:i,filter:a=()=>!0,compare:o=xr})=>{let s=yu(n),c=q.default.validRange(t)?q.default.minVersion(t)?.version:null;if(!c)return{targetVersion:null,fallbackVersion:null,targetBlockedByCooldown:!1};let l=!vu(e,c,i?.[c],n.cooldown),u=r.reduce((t,r)=>{let c=r.version;if(!c||o(c,t.fallbackVersion)<=0||!s({...r,name:e})||!a?.(c))return t;let l=i?.[c],u=n.cooldown?vu(e,c,l,n.cooldown):!0;return o(c,t.targetVersion)>0&&(t.targetVersion=c,t.targetBlockedByCooldown=!u),u&&(t.fallbackVersion=c),t},{targetVersion:c,fallbackVersion:c,targetBlockedByCooldown:l}),d=u.targetVersion,f=u.fallbackVersion;return f===u.targetVersion&&(f=null),f&&!q.default.gt(f,c)&&(f=null),l&&d===c&&(u.targetBlockedByCooldown=!1),{...u,targetVersion:d,fallbackVersion:f}},Eu=({packageName:e,currentVersion:t,options:n,time:r,targetVersion:i,fallbackVersion:a,targetBlockedByCooldown:o})=>{let s={version:i,...i&&r?.[i]?{time:r[i]}:null};if(n.cooldown&&i&&o){let n=q.default.validRange(t)?q.default.minVersion(t)?.version:null,i={name:e,currentVersion:t,...n?{currentVersionTime:r?.[n]}:null,...s};if(a){let e=r?.[a];return i.fallbackVersion=a,{version:a,...e?{time:e}:null,cooldownInfo:i}}return{cooldownInfo:i}}return s},Du=(e,t)=>{let n={cafile:e=>{if(!e)return;let n=p.default.readFileSync(f.default.resolve(t||``,Pl(e)),`utf8`),r=`-----END CERTIFICATE-----`;return{ca:n.split(r).filter(e=>!!e.trim()).map(e=>`${e.trimStart()}${r}`)}},maxsockets:`maxSockets`,"strict-ssl":`strictSSL`},r={all:`boolean`,allowsameversion:`boolean`,audit:`boolean`,binlinks:`boolean`,color:`boolean`,commithooks:`boolean`,description:`boolean`,dev:`boolean`,diffignoreallspace:`boolean`,diffnameonly:`boolean`,diffnoprefix:`boolean`,difftext:`boolean`,dryrun:`boolean`,enginestrict:`boolean`,force:`boolean`,foregroundscripts:`boolean`,formatpackagelock:`boolean`,fund:`boolean`,gittagversion:`boolean`,global:`boolean`,globalstyle:`boolean`,ifpresent:`boolean`,ignorescripts:`boolean`,includestaged:`boolean`,includeworkspaceroot:`boolean`,installlinks:`boolean`,json:`boolean`,legacybundling:`boolean`,legacypeerdeps:`boolean`,link:`boolean`,long:`boolean`,offline:`boolean`,omitlockfileregistryresolved:`boolean`,packagelock:`boolean`,packagelockonly:`boolean`,parseable:`boolean`,preferoffline:`boolean`,preferonline:`boolean`,progress:`boolean`,readonly:`boolean`,rebuildbundle:`boolean`,save:`boolean`,savebundle:`boolean`,savedev:`boolean`,saveexact:`boolean`,saveoptional:`boolean`,savepeer:`boolean`,saveprod:`boolean`,shrinkwrap:`boolean`,signgitcommit:`boolean`,signgittag:`boolean`,strictpeerdeps:`boolean`,strictssl:`boolean`,timing:`boolean`,unicode:`boolean`,updatenotifier:`boolean`,usage:`boolean`,version:`boolean`,versions:`boolean`,workspacesupdate:`boolean`,diffunified:`number`,fetchretries:`number`,fetchretryfactor:`number`,fetchretrymaxtimeout:`number`,fetchretrymintimeout:`number`,fetchtimeout:`number`,logsmax:`number`,maxsockets:`number`,searchlimit:`number`,searchstaleness:`number`,ssopollfrequency:`number`,timeout:`number`},i=e=>!!e&&e!==`false`&&e!==`0`,a=e=>parseInt(e)||0;return Dn(e,(e,t)=>{let o=typeof t==`string`?r[e.replace(/-/g,``).toLowerCase()]===`boolean`?i(t):r[e.replace(/-/g,``).toLowerCase()]===`number`?a(t):t.replace(/\${([^}]+)}/,(e,t)=>process.env[t]):t,{[e]:s}=n;return typeof s==`string`?{[s]:o}:typeof s==`function`?{...s(o.toString())}:{[e.match(/^[a-z]/i)?ya(e):e]:o}})},Ou={};Ou.findNpmConfig=(0,kl.default)(e=>{let t;if(e)try{t=Al.default.parse(p.default.readFileSync(e,`utf-8`))}catch(e){if(e.code===`ENOENT`)return null;throw e}else t={...lu(null,{userconfig:process.env.npm_config_userconfig||process.env.NPM_CONFIG_USERCONFIG}).toJSON(),cache:!1};return Du(t,e)});var ku=Ou.findNpmConfig();function Au(e,t){let n;try{n=JSON.parse(e)}catch(n){throw Error(`Expected JSON from "${t.command}".${t.packageName?` There could be problems with the ${t.packageName} package.`:``} ${e?`Instead received: `+e:`Received empty response.`}`,{cause:n})}return n}async function ju(e,t,n,r={},i){let a=await wu(e,[`versions`],null,{...i,...ku,fullMetadata:!0,...r.registry?{registry:r.registry,silent:!0}:null});if(a.versions){let e=Object.keys(a.versions),r=q.default.minSatisfying(e,t),i=q.default.maxSatisfying(e,n);if(r&&i&&a.versions[r]._npmUser&&a.versions[i]._npmUser)return a.versions[r]._npmUser?.name!==a.versions[i]._npmUser?.name}return!1}var Mu=e=>!!(e&&(e.name||e.engines||e.version||e.versions));Ou.mockFetchUpgradedPackument=e=>(t,n,r,i)=>{let a=typeof e==`function`?e(i)?.[t]:typeof e==`string`||Mu(e)?e:e[t],o=Mu(a)?a.version:a;if(!o)throw Error(`fetchUpgradedPackument is mocked, but no mock version was supplied for ${t}. Make sure that all dependencies are mocked. `);let s=Mu(a)&&a.time?a.time?.[o]:new Date().toISOString(),c={name:t,"dist-tags":{[i.distTag||`latest`]:o},engines:{node:``},time:{[o]:s},version:o,versions:{},...Mu(a)?a:null},{versions:l,...u}=c;return Promise.resolve({...c,versions:{...Mu(a)&&a.versions||{[o]:u}}})};var Nu=(0,kl.default)(({npmConfigLocal:e,npmConfigUser:t,npmConfigWorkspaceProject:n},r)=>{let i=r.packageFile?f.default.join(r.packageFile,`../.npmrc`):null,a=r.packageFile?Ou.findNpmConfig(i||void 0):null,o=r.cwd?f.default.join(r.cwd,`.npmrc`):null,s=r.cwd?Ou.findNpmConfig(o):null;if(n&&Object.keys(n).length>0){Y(r,`
451
+ `),f=d.shift();if(!f)return e.destroy(),r(Error(`No header received from proxy CONNECT response`));let p=f.split(` `),m=+p[1],h=p.slice(2).join(` `),g={};for(let t of d){if(!t)continue;let n=t.indexOf(`:`);if(n===-1)return e.destroy(),r(Error(`Invalid header from proxy CONNECT response: "${t}"`));let i=t.slice(0,n).toLowerCase(),a=t.slice(n+1).trimStart(),o=g[i];typeof o==`string`?g[i]=[o,a]:Array.isArray(o)?o.push(a):g[i]=a}n(`got proxy server response: %o %o`,f,g),s(),t({connect:{statusCode:m,statusText:h,headers:g},buffered:l})}e.on(`error`,l),e.on(`end`,c),o()})}e.parseProxyResponse=r})),Fc=s((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.HttpsProxyAgent=void 0;var a=r(require("net")),o=r(require("tls")),s=i(require("assert")),c=i(Ac()),l=Mc(),u=require("url"),d=Pc(),f=(0,c.default)(`https-proxy-agent`),p=e=>e.servername===void 0&&e.host&&!a.isIP(e.host)?{...e,servername:e.host}:e,m=class extends l.Agent{constructor(e,t){super(t),this.options={path:void 0},this.proxy=typeof e==`string`?new u.URL(e):e,this.proxyHeaders=t?.headers??{},f(`Creating new HttpsProxyAgent instance: %o`,this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,``),r=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol===`https:`?443:80;this.connectOpts={ALPNProtocols:[`http/1.1`],...t?g(t,`headers`):null,host:n,port:r}}async connect(e,t){let{proxy:n}=this;if(!t.host)throw TypeError(`No "host" provided`);let r;n.protocol===`https:`?(f("Creating `tls.Socket`: %o",this.connectOpts),r=o.connect(p(this.connectOpts))):(f("Creating `net.Socket`: %o",this.connectOpts),r=a.connect(this.connectOpts));let i=typeof this.proxyHeaders==`function`?this.proxyHeaders():{...this.proxyHeaders},c=a.isIPv6(t.host)?`[${t.host}]`:t.host,l=`CONNECT ${c}:${t.port} HTTP/1.1\r\n`;if(n.username||n.password){let e=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;i[`Proxy-Authorization`]=`Basic ${Buffer.from(e).toString(`base64`)}`}i.Host=`${c}:${t.port}`,i[`Proxy-Connection`]||=this.keepAlive?`Keep-Alive`:`close`;for(let e of Object.keys(i))l+=`${e}: ${i[e]}\r\n`;let u=(0,d.parseProxyResponse)(r);r.write(`${l}\r\n`);let{connect:m,buffered:_}=await u;if(e.emit(`proxyConnect`,m),this.emit(`proxyConnect`,m,e),m.statusCode===200)return e.once(`socket`,h),t.secureEndpoint?(f(`Upgrading socket connection to TLS`),o.connect({...g(p(t),`host`,`path`,`port`),socket:r})):r;r.destroy();let v=new a.Socket({writable:!1});return v.readable=!0,e.once(`socket`,e=>{f(`Replaying proxy buffer for failed request`),(0,s.default)(e.listenerCount(`data`)>0),e.push(_),e.push(null)}),v}};m.protocols=[`http`,`https`],e.HttpsProxyAgent=m;function h(e){e.resume()}function g(e,...t){let n={},r;for(r in e)t.includes(r)||(n[r]=e[r]);return n}})),Ic=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=require("buffer"),n={INVALID_ENCODING:`Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.`,INVALID_SMARTBUFFER_SIZE:`Invalid size provided. Size must be a valid integer greater than zero.`,INVALID_SMARTBUFFER_BUFFER:`Invalid Buffer provided in SmartBufferOptions.`,INVALID_SMARTBUFFER_OBJECT:`Invalid SmartBufferOptions object supplied to SmartBuffer constructor or factory methods.`,INVALID_OFFSET:`An invalid offset value was provided.`,INVALID_OFFSET_NON_NUMBER:`An invalid offset value was provided. A numeric value is required.`,INVALID_LENGTH:`An invalid length value was provided.`,INVALID_LENGTH_NON_NUMBER:`An invalid length value was provived. A numeric value is required.`,INVALID_TARGET_OFFSET:`Target offset is beyond the bounds of the internal SmartBuffer data.`,INVALID_TARGET_LENGTH:`Specified length value moves cursor beyong the bounds of the internal SmartBuffer data.`,INVALID_READ_BEYOND_BOUNDS:`Attempted to read beyond the bounds of the managed data.`,INVALID_WRITE_BEYOND_BOUNDS:`Attempted to write beyond the bounds of the managed data.`};e.ERRORS=n;function r(e){if(!t.Buffer.isEncoding(e))throw Error(n.INVALID_ENCODING)}e.checkEncoding=r;function i(e){return typeof e==`number`&&isFinite(e)&&l(e)}e.isFiniteInteger=i;function a(e,t){if(typeof e==`number`){if(!i(e)||e<0)throw Error(t?n.INVALID_OFFSET:n.INVALID_LENGTH)}else throw Error(t?n.INVALID_OFFSET_NON_NUMBER:n.INVALID_LENGTH_NON_NUMBER)}function o(e){a(e,!1)}e.checkLengthValue=o;function s(e){a(e,!0)}e.checkOffsetValue=s;function c(e,t){if(e<0||e>t.length)throw Error(n.INVALID_TARGET_OFFSET)}e.checkTargetOffset=c;function l(e){return typeof e==`number`&&isFinite(e)&&Math.floor(e)===e}function u(e){if(typeof BigInt>`u`)throw Error(`Platform does not support JS BigInt type.`);if(t.Buffer.prototype[e]===void 0)throw Error(`Platform does not support Buffer.prototype.${e}.`)}e.bigIntAndBufferInt64Check=u})),Lc=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Ic(),n=4096,r=`utf8`;e.SmartBuffer=class e{constructor(i){if(this.length=0,this._encoding=r,this._writeOffset=0,this._readOffset=0,e.isSmartBufferOptions(i))if(i.encoding&&(t.checkEncoding(i.encoding),this._encoding=i.encoding),i.size)if(t.isFiniteInteger(i.size)&&i.size>0)this._buff=Buffer.allocUnsafe(i.size);else throw Error(t.ERRORS.INVALID_SMARTBUFFER_SIZE);else if(i.buff)if(Buffer.isBuffer(i.buff))this._buff=i.buff,this.length=i.buff.length;else throw Error(t.ERRORS.INVALID_SMARTBUFFER_BUFFER);else this._buff=Buffer.allocUnsafe(n);else{if(i!==void 0)throw Error(t.ERRORS.INVALID_SMARTBUFFER_OBJECT);this._buff=Buffer.allocUnsafe(n)}}static fromSize(e,t){return new this({size:e,encoding:t})}static fromBuffer(e,t){return new this({buff:e,encoding:t})}static fromOptions(e){return new this(e)}static isSmartBufferOptions(e){let t=e;return t&&(t.encoding!==void 0||t.size!==void 0||t.buff!==void 0)}readInt8(e){return this._readNumberValue(Buffer.prototype.readInt8,1,e)}readInt16BE(e){return this._readNumberValue(Buffer.prototype.readInt16BE,2,e)}readInt16LE(e){return this._readNumberValue(Buffer.prototype.readInt16LE,2,e)}readInt32BE(e){return this._readNumberValue(Buffer.prototype.readInt32BE,4,e)}readInt32LE(e){return this._readNumberValue(Buffer.prototype.readInt32LE,4,e)}readBigInt64BE(e){return t.bigIntAndBufferInt64Check(`readBigInt64BE`),this._readNumberValue(Buffer.prototype.readBigInt64BE,8,e)}readBigInt64LE(e){return t.bigIntAndBufferInt64Check(`readBigInt64LE`),this._readNumberValue(Buffer.prototype.readBigInt64LE,8,e)}writeInt8(e,t){return this._writeNumberValue(Buffer.prototype.writeInt8,1,e,t),this}insertInt8(e,t){return this._insertNumberValue(Buffer.prototype.writeInt8,1,e,t)}writeInt16BE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt16BE,2,e,t)}insertInt16BE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt16BE,2,e,t)}writeInt16LE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt16LE,2,e,t)}insertInt16LE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt16LE,2,e,t)}writeInt32BE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt32BE,4,e,t)}insertInt32BE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt32BE,4,e,t)}writeInt32LE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt32LE,4,e,t)}insertInt32LE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt32LE,4,e,t)}writeBigInt64BE(e,n){return t.bigIntAndBufferInt64Check(`writeBigInt64BE`),this._writeNumberValue(Buffer.prototype.writeBigInt64BE,8,e,n)}insertBigInt64BE(e,n){return t.bigIntAndBufferInt64Check(`writeBigInt64BE`),this._insertNumberValue(Buffer.prototype.writeBigInt64BE,8,e,n)}writeBigInt64LE(e,n){return t.bigIntAndBufferInt64Check(`writeBigInt64LE`),this._writeNumberValue(Buffer.prototype.writeBigInt64LE,8,e,n)}insertBigInt64LE(e,n){return t.bigIntAndBufferInt64Check(`writeBigInt64LE`),this._insertNumberValue(Buffer.prototype.writeBigInt64LE,8,e,n)}readUInt8(e){return this._readNumberValue(Buffer.prototype.readUInt8,1,e)}readUInt16BE(e){return this._readNumberValue(Buffer.prototype.readUInt16BE,2,e)}readUInt16LE(e){return this._readNumberValue(Buffer.prototype.readUInt16LE,2,e)}readUInt32BE(e){return this._readNumberValue(Buffer.prototype.readUInt32BE,4,e)}readUInt32LE(e){return this._readNumberValue(Buffer.prototype.readUInt32LE,4,e)}readBigUInt64BE(e){return t.bigIntAndBufferInt64Check(`readBigUInt64BE`),this._readNumberValue(Buffer.prototype.readBigUInt64BE,8,e)}readBigUInt64LE(e){return t.bigIntAndBufferInt64Check(`readBigUInt64LE`),this._readNumberValue(Buffer.prototype.readBigUInt64LE,8,e)}writeUInt8(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt8,1,e,t)}insertUInt8(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt8,1,e,t)}writeUInt16BE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt16BE,2,e,t)}insertUInt16BE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt16BE,2,e,t)}writeUInt16LE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt16LE,2,e,t)}insertUInt16LE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt16LE,2,e,t)}writeUInt32BE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt32BE,4,e,t)}insertUInt32BE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt32BE,4,e,t)}writeUInt32LE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt32LE,4,e,t)}insertUInt32LE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt32LE,4,e,t)}writeBigUInt64BE(e,n){return t.bigIntAndBufferInt64Check(`writeBigUInt64BE`),this._writeNumberValue(Buffer.prototype.writeBigUInt64BE,8,e,n)}insertBigUInt64BE(e,n){return t.bigIntAndBufferInt64Check(`writeBigUInt64BE`),this._insertNumberValue(Buffer.prototype.writeBigUInt64BE,8,e,n)}writeBigUInt64LE(e,n){return t.bigIntAndBufferInt64Check(`writeBigUInt64LE`),this._writeNumberValue(Buffer.prototype.writeBigUInt64LE,8,e,n)}insertBigUInt64LE(e,n){return t.bigIntAndBufferInt64Check(`writeBigUInt64LE`),this._insertNumberValue(Buffer.prototype.writeBigUInt64LE,8,e,n)}readFloatBE(e){return this._readNumberValue(Buffer.prototype.readFloatBE,4,e)}readFloatLE(e){return this._readNumberValue(Buffer.prototype.readFloatLE,4,e)}writeFloatBE(e,t){return this._writeNumberValue(Buffer.prototype.writeFloatBE,4,e,t)}insertFloatBE(e,t){return this._insertNumberValue(Buffer.prototype.writeFloatBE,4,e,t)}writeFloatLE(e,t){return this._writeNumberValue(Buffer.prototype.writeFloatLE,4,e,t)}insertFloatLE(e,t){return this._insertNumberValue(Buffer.prototype.writeFloatLE,4,e,t)}readDoubleBE(e){return this._readNumberValue(Buffer.prototype.readDoubleBE,8,e)}readDoubleLE(e){return this._readNumberValue(Buffer.prototype.readDoubleLE,8,e)}writeDoubleBE(e,t){return this._writeNumberValue(Buffer.prototype.writeDoubleBE,8,e,t)}insertDoubleBE(e,t){return this._insertNumberValue(Buffer.prototype.writeDoubleBE,8,e,t)}writeDoubleLE(e,t){return this._writeNumberValue(Buffer.prototype.writeDoubleLE,8,e,t)}insertDoubleLE(e,t){return this._insertNumberValue(Buffer.prototype.writeDoubleLE,8,e,t)}readString(e,n){let r;typeof e==`number`?(t.checkLengthValue(e),r=Math.min(e,this.length-this._readOffset)):(n=e,r=this.length-this._readOffset),n!==void 0&&t.checkEncoding(n);let i=this._buff.slice(this._readOffset,this._readOffset+r).toString(n||this._encoding);return this._readOffset+=r,i}insertString(e,n,r){return t.checkOffsetValue(n),this._handleString(e,!0,n,r)}writeString(e,t,n){return this._handleString(e,!1,t,n)}readStringNT(e){e!==void 0&&t.checkEncoding(e);let n=this.length;for(let e=this._readOffset;e<this.length;e++)if(this._buff[e]===0){n=e;break}let r=this._buff.slice(this._readOffset,n);return this._readOffset=n+1,r.toString(e||this._encoding)}insertStringNT(e,n,r){return t.checkOffsetValue(n),this.insertString(e,n,r),this.insertUInt8(0,n+e.length),this}writeStringNT(e,t,n){return this.writeString(e,t,n),this.writeUInt8(0,typeof t==`number`?t+e.length:this.writeOffset),this}readBuffer(e){e!==void 0&&t.checkLengthValue(e);let n=typeof e==`number`?e:this.length,r=Math.min(this.length,this._readOffset+n),i=this._buff.slice(this._readOffset,r);return this._readOffset=r,i}insertBuffer(e,n){return t.checkOffsetValue(n),this._handleBuffer(e,!0,n)}writeBuffer(e,t){return this._handleBuffer(e,!1,t)}readBufferNT(){let e=this.length;for(let t=this._readOffset;t<this.length;t++)if(this._buff[t]===0){e=t;break}let t=this._buff.slice(this._readOffset,e);return this._readOffset=e+1,t}insertBufferNT(e,n){return t.checkOffsetValue(n),this.insertBuffer(e,n),this.insertUInt8(0,n+e.length),this}writeBufferNT(e,n){return n!==void 0&&t.checkOffsetValue(n),this.writeBuffer(e,n),this.writeUInt8(0,typeof n==`number`?n+e.length:this._writeOffset),this}clear(){return this._writeOffset=0,this._readOffset=0,this.length=0,this}remaining(){return this.length-this._readOffset}get readOffset(){return this._readOffset}set readOffset(e){t.checkOffsetValue(e),t.checkTargetOffset(e,this),this._readOffset=e}get writeOffset(){return this._writeOffset}set writeOffset(e){t.checkOffsetValue(e),t.checkTargetOffset(e,this),this._writeOffset=e}get encoding(){return this._encoding}set encoding(e){t.checkEncoding(e),this._encoding=e}get internalBuffer(){return this._buff}toBuffer(){return this._buff.slice(0,this.length)}toString(e){let n=typeof e==`string`?e:this._encoding;return t.checkEncoding(n),this._buff.toString(n,0,this.length)}destroy(){return this.clear(),this}_handleString(e,n,r,i){let a=this._writeOffset,o=this._encoding;typeof r==`number`?a=r:typeof r==`string`&&(t.checkEncoding(r),o=r),typeof i==`string`&&(t.checkEncoding(i),o=i);let s=Buffer.byteLength(e,o);return n?this.ensureInsertable(s,a):this._ensureWriteable(s,a),this._buff.write(e,a,s,o),n?this._writeOffset+=s:typeof r==`number`?this._writeOffset=Math.max(this._writeOffset,a+s):this._writeOffset+=s,this}_handleBuffer(e,t,n){let r=typeof n==`number`?n:this._writeOffset;return t?this.ensureInsertable(e.length,r):this._ensureWriteable(e.length,r),e.copy(this._buff,r),t?this._writeOffset+=e.length:typeof n==`number`?this._writeOffset=Math.max(this._writeOffset,r+e.length):this._writeOffset+=e.length,this}ensureReadable(e,n){let r=this._readOffset;if(n!==void 0&&(t.checkOffsetValue(n),r=n),r<0||r+e>this.length)throw Error(t.ERRORS.INVALID_READ_BEYOND_BOUNDS)}ensureInsertable(e,n){t.checkOffsetValue(n),this._ensureCapacity(this.length+e),n<this.length&&this._buff.copy(this._buff,n+e,n,this._buff.length),n+e>this.length?this.length=n+e:this.length+=e}_ensureWriteable(e,t){let n=typeof t==`number`?t:this._writeOffset;this._ensureCapacity(n+e),n+e>this.length&&(this.length=n+e)}_ensureCapacity(e){let t=this._buff.length;if(e>t){let n=this._buff,r=t*3/2+1;r<e&&(r=e),this._buff=Buffer.allocUnsafe(r),n.copy(this._buff,0,0,t)}}_readNumberValue(e,t,n){this.ensureReadable(t,n);let r=e.call(this._buff,typeof n==`number`?n:this._readOffset);return n===void 0&&(this._readOffset+=t),r}_insertNumberValue(e,n,r,i){return t.checkOffsetValue(i),this.ensureInsertable(n,i),e.call(this._buff,r,i),this._writeOffset+=n,this}_writeNumberValue(e,n,r,i){if(typeof i==`number`){if(i<0)throw Error(t.ERRORS.INVALID_WRITE_BEYOND_BOUNDS);t.checkOffsetValue(i)}let a=typeof i==`number`?i:this._writeOffset;return this._ensureWriteable(n,a),e.call(this._buff,r,a),typeof i==`number`?this._writeOffset=Math.max(this._writeOffset,a+n):this._writeOffset+=n,this}}})),Rc=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SOCKS5_NO_ACCEPTABLE_AUTH=e.SOCKS5_CUSTOM_AUTH_END=e.SOCKS5_CUSTOM_AUTH_START=e.SOCKS_INCOMING_PACKET_SIZES=e.SocksClientState=e.Socks5Response=e.Socks5HostType=e.Socks5Auth=e.Socks4Response=e.SocksCommand=e.ERRORS=e.DEFAULT_TIMEOUT=void 0,e.DEFAULT_TIMEOUT=3e4,e.ERRORS={InvalidSocksCommand:`An invalid SOCKS command was provided. Valid options are connect, bind, and associate.`,InvalidSocksCommandForOperation:`An invalid SOCKS command was provided. Only a subset of commands are supported for this operation.`,InvalidSocksCommandChain:`An invalid SOCKS command was provided. Chaining currently only supports the connect command.`,InvalidSocksClientOptionsDestination:`An invalid destination host was provided.`,InvalidSocksClientOptionsExistingSocket:`An invalid existing socket was provided. This should be an instance of stream.Duplex.`,InvalidSocksClientOptionsProxy:`Invalid SOCKS proxy details were provided.`,InvalidSocksClientOptionsTimeout:`An invalid timeout value was provided. Please enter a value above 0 (in ms).`,InvalidSocksClientOptionsProxiesLength:`At least two socks proxies must be provided for chaining.`,InvalidSocksClientOptionsCustomAuthRange:`Custom auth must be a value between 0x80 and 0xFE.`,InvalidSocksClientOptionsCustomAuthOptions:`When a custom_auth_method is provided, custom_auth_request_handler, custom_auth_response_size, and custom_auth_response_handler must also be provided and valid.`,NegotiationError:`Negotiation error`,SocketClosed:`Socket closed`,ProxyConnectionTimedOut:`Proxy connection timed out`,InternalError:`SocksClient internal error (this should not happen)`,InvalidSocks4HandshakeResponse:`Received invalid Socks4 handshake response`,Socks4ProxyRejectedConnection:`Socks4 Proxy rejected connection`,InvalidSocks4IncomingConnectionResponse:`Socks4 invalid incoming connection response`,Socks4ProxyRejectedIncomingBoundConnection:`Socks4 Proxy rejected incoming bound connection`,InvalidSocks5InitialHandshakeResponse:`Received invalid Socks5 initial handshake response`,InvalidSocks5IntiailHandshakeSocksVersion:`Received invalid Socks5 initial handshake (invalid socks version)`,InvalidSocks5InitialHandshakeNoAcceptedAuthType:`Received invalid Socks5 initial handshake (no accepted authentication type)`,InvalidSocks5InitialHandshakeUnknownAuthType:`Received invalid Socks5 initial handshake (unknown authentication type)`,Socks5AuthenticationFailed:`Socks5 Authentication failed`,InvalidSocks5FinalHandshake:`Received invalid Socks5 final handshake response`,InvalidSocks5FinalHandshakeRejected:`Socks5 proxy rejected connection`,InvalidSocks5IncomingConnectionResponse:`Received invalid Socks5 incoming connection response`,Socks5ProxyRejectedIncomingBoundConnection:`Socks5 Proxy rejected incoming bound connection`},e.SOCKS_INCOMING_PACKET_SIZES={Socks5InitialHandshakeResponse:2,Socks5UserPassAuthenticationResponse:2,Socks5ResponseHeader:5,Socks5ResponseIPv4:10,Socks5ResponseIPv6:22,Socks5ResponseHostname:e=>e+7,Socks4Response:8};var t;(function(e){e[e.connect=1]=`connect`,e[e.bind=2]=`bind`,e[e.associate=3]=`associate`})(t||(e.SocksCommand=t={}));var n;(function(e){e[e.Granted=90]=`Granted`,e[e.Failed=91]=`Failed`,e[e.Rejected=92]=`Rejected`,e[e.RejectedIdent=93]=`RejectedIdent`})(n||(e.Socks4Response=n={}));var r;(function(e){e[e.NoAuth=0]=`NoAuth`,e[e.GSSApi=1]=`GSSApi`,e[e.UserPass=2]=`UserPass`})(r||(e.Socks5Auth=r={})),e.SOCKS5_CUSTOM_AUTH_START=128,e.SOCKS5_CUSTOM_AUTH_END=254,e.SOCKS5_NO_ACCEPTABLE_AUTH=255;var i;(function(e){e[e.Granted=0]=`Granted`,e[e.Failure=1]=`Failure`,e[e.NotAllowed=2]=`NotAllowed`,e[e.NetworkUnreachable=3]=`NetworkUnreachable`,e[e.HostUnreachable=4]=`HostUnreachable`,e[e.ConnectionRefused=5]=`ConnectionRefused`,e[e.TTLExpired=6]=`TTLExpired`,e[e.CommandNotSupported=7]=`CommandNotSupported`,e[e.AddressNotSupported=8]=`AddressNotSupported`})(i||(e.Socks5Response=i={}));var a;(function(e){e[e.IPv4=1]=`IPv4`,e[e.Hostname=3]=`Hostname`,e[e.IPv6=4]=`IPv6`})(a||(e.Socks5HostType=a={}));var o;(function(e){e[e.Created=0]=`Created`,e[e.Connecting=1]=`Connecting`,e[e.Connected=2]=`Connected`,e[e.SentInitialHandshake=3]=`SentInitialHandshake`,e[e.ReceivedInitialHandshakeResponse=4]=`ReceivedInitialHandshakeResponse`,e[e.SentAuthentication=5]=`SentAuthentication`,e[e.ReceivedAuthenticationResponse=6]=`ReceivedAuthenticationResponse`,e[e.SentFinalHandshake=7]=`SentFinalHandshake`,e[e.ReceivedFinalResponse=8]=`ReceivedFinalResponse`,e[e.BoundWaitingForConnection=9]=`BoundWaitingForConnection`,e[e.Established=10]=`Established`,e[e.Disconnected=11]=`Disconnected`,e[e.Error=99]=`Error`})(o||(e.SocksClientState=o={}))})),zc=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.shuffleArray=e.SocksClientError=void 0,e.SocksClientError=class extends Error{constructor(e,t){super(e),this.options=t}};function t(e){for(let t=e.length-1;t>0;t--){let n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}}e.shuffleArray=t})),Bc=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AddressError=void 0,e.AddressError=class extends Error{constructor(e,t){super(e),this.name=`AddressError`,this.parseMessage=t}}})),Vc=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isInSubnet=n,e.isCorrect=r,e.prefixLengthFromMask=i,e.numberToPaddedHex=a,e.stringToPaddedHex=o,e.testBit=s;var t=Bc();function n(e){return this.subnetMask<e.subnetMask?!1:this.mask(e.subnetMask)===e.mask()}function r(e){return function(){return this.addressMinusSuffix===this.correctForm()?this.subnetMask===e&&!this.parsedSubnet?!0:this.parsedSubnet===String(this.subnetMask):!1}}function i(e,n){let r=e.toString(2).padStart(n,`0`);if(r.length>n)throw new t.AddressError(`Invalid subnet mask.`);let i=r.indexOf(`0`);if(i===-1)return n;if(r.slice(i).includes(`1`))throw new t.AddressError(`Invalid subnet mask.`);return i}function a(e){return e.toString(16).padStart(2,`0`)}function o(e){return a(parseInt(e,10))}function s(e,t){let{length:n}=e;if(t>n)return!1;let r=n-t;return e.substring(r,r+1)===`1`}})),Hc=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RE_SUBNET_STRING=e.RE_ADDRESS=e.GROUPS=e.BITS=void 0,e.BITS=32,e.GROUPS=4,e.RE_ADDRESS=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g,e.RE_SUBNET_STRING=/\/\d{1,2}$/})),Uc=s((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.Address4=void 0;var i=r(Vc()),a=r(Hc()),o=Bc(),s=i.isCorrect(a.BITS),c=class e{constructor(e){this.groups=a.GROUPS,this.parsedAddress=[],this.parsedSubnet=``,this.subnet=`/32`,this.subnetMask=32,this.v4=!0,this.isCorrect=s,this.isInSubnet=i.isInSubnet,this.address=e;let t=a.RE_SUBNET_STRING.exec(e);if(t){if(this.parsedSubnet=t[0].replace(`/`,``),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,this.subnetMask<0||this.subnetMask>a.BITS)throw new o.AddressError(`Invalid subnet mask.`);e=e.replace(a.RE_SUBNET_STRING,``)}this.addressMinusSuffix=e,this.parsedAddress=this.parse(e)}static isValid(t){try{return new e(t),!0}catch{return!1}}parse(e){let t=e.split(`.`);if(!e.match(a.RE_ADDRESS))throw new o.AddressError(`Invalid IPv4 address.`);return t}correctForm(){return this.parsedAddress.map(e=>parseInt(e,10)).join(`.`)}static fromAddressAndMask(t,n){return new e(`${t}/${i.prefixLengthFromMask(new e(n).bigInt(),a.BITS)}`)}static fromAddressAndWildcardMask(t,n){let r=new e(n).bigInt()^(BigInt(1)<<BigInt(a.BITS))-BigInt(1);return new e(`${t}/${i.prefixLengthFromMask(r,a.BITS)}`)}static fromWildcard(t){let n=t.split(`.`);if(n.length!==a.GROUPS)throw new o.AddressError(`Wildcard pattern must have 4 octets`);let r=-1;for(let e=0;e<n.length;e++)if(n[e]===`*`)r===-1&&(r=e);else if(r!==-1)throw new o.AddressError("Wildcard `*` must only appear in trailing octets (e.g. `192.168.0.*`)");let i=r===-1?0:n.length-r,s=n.map(e=>e===`*`?`0`:e),c=a.BITS-i*8;return new e(`${s.join(`.`)}/${c}`)}static fromHex(t){let n=t.replace(/:/g,``);if(!/^[0-9a-fA-F]{8}$/.test(n))throw new o.AddressError(`IPv4 hex must be exactly 8 hex digits`);let r=[];for(let e=0;e<8;e+=2)r.push(parseInt(n.slice(e,e+2),16));return new e(r.join(`.`))}static fromInteger(t){if(!Number.isInteger(t)||t<0||t>4294967295)throw new o.AddressError(`IPv4 integer must be in the range 0 to 2**32 - 1`);return e.fromHex(t.toString(16).padStart(8,`0`))}static fromArpa(t){return new e(t.replace(/(\.in-addr\.arpa)?\.$/,``).split(`.`).reverse().join(`.`))}toHex(){return this.parsedAddress.map(e=>i.stringToPaddedHex(e)).join(`:`)}toArray(){return this.parsedAddress.map(e=>parseInt(e,10))}toGroup6(){let e=[],t;for(t=0;t<a.GROUPS;t+=2)e.push(`${i.stringToPaddedHex(this.parsedAddress[t])}${i.stringToPaddedHex(this.parsedAddress[t+1])}`);return e.join(`:`)}bigInt(){return BigInt(`0x${this.parsedAddress.map(e=>i.stringToPaddedHex(e)).join(``)}`)}_startAddress(){return BigInt(`0b${this.mask()+`0`.repeat(a.BITS-this.subnetMask)}`)}startAddress(){return e.fromBigInt(this._startAddress())}startAddressExclusive(){let t=BigInt(`1`);return e.fromBigInt(this._startAddress()+t)}_endAddress(){return BigInt(`0b${this.mask()+`1`.repeat(a.BITS-this.subnetMask)}`)}endAddress(){return e.fromBigInt(this._endAddress())}endAddressExclusive(){let t=BigInt(`1`);return e.fromBigInt(this._endAddress()-t)}subnetMaskAddress(){return e.fromBigInt(BigInt(`0b${`1`.repeat(this.subnetMask)}${`0`.repeat(a.BITS-this.subnetMask)}`))}wildcardMask(){return e.fromBigInt(BigInt(`0b${`0`.repeat(this.subnetMask)}${`1`.repeat(a.BITS-this.subnetMask)}`))}networkForm(){return`${this.startAddress().correctForm()}/${this.subnetMask}`}static fromBigInt(t){if(t<0n||t>4294967295n)throw new o.AddressError(`IPv4 BigInt must be in the range 0 to 2**32 - 1`);return e.fromHex(t.toString(16).padStart(8,`0`))}static fromByteArray(e){if(e.length!==4)throw new o.AddressError(`IPv4 addresses require exactly 4 bytes`);for(let t=0;t<e.length;t++)if(!Number.isInteger(e[t])||e[t]<0||e[t]>255)throw new o.AddressError(`All bytes must be integers between 0 and 255`);return this.fromUnsignedByteArray(e)}static fromUnsignedByteArray(t){if(t.length!==4)throw new o.AddressError(`IPv4 addresses require exactly 4 bytes`);return new e(t.join(`.`))}mask(e){return e===void 0&&(e=this.subnetMask),this.getBitsBase2(0,e)}getBitsBase2(e,t){return this.binaryZeroPad().slice(e,t)}reverseForm(e){e||={};let t=this.correctForm().split(`.`).reverse().join(`.`);return e.omitSuffix?t:`${t}.in-addr.arpa.`}isMulticast(){return this.isInSubnet(l)}isPrivate(){return u.some(e=>this.isInSubnet(e))}isLoopback(){return this.isInSubnet(d)}isLinkLocal(){return this.isInSubnet(f)}isUnspecified(){return this.isInSubnet(p)}isBroadcast(){return this.isInSubnet(m)}isCGNAT(){return this.isInSubnet(h)}binaryZeroPad(){return this._binaryZeroPad===void 0&&(this._binaryZeroPad=this.bigInt().toString(2).padStart(a.BITS,`0`)),this._binaryZeroPad}groupForV6(){let e=this.parsedAddress;return this.address.replace(a.RE_ADDRESS,`<span class="hover-group group-v4 group-6">${e.slice(0,2).join(`.`)}</span>.<span class="hover-group group-v4 group-7">${e.slice(2,4).join(`.`)}</span>`)}};e.Address4=c;var l=new c(`224.0.0.0/4`),u=[new c(`10.0.0.0/8`),new c(`172.16.0.0/12`),new c(`192.168.0.0/16`)],d=new c(`127.0.0.0/8`),f=new c(`169.254.0.0/16`),p=new c(`0.0.0.0/32`),m=new c(`255.255.255.255/32`),h=new c(`100.64.0.0/10`)})),Wc=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RE_URL_WITH_PORT=e.RE_URL=e.RE_ZONE_STRING=e.RE_SUBNET_STRING=e.RE_BAD_ADDRESS=e.RE_BAD_CHARACTERS=e.TYPES=e.SCOPES=e.GROUPS=e.BITS=void 0,e.BITS=128,e.GROUPS=8,e.SCOPES={0:`Reserved`,1:`Interface local`,2:`Link local`,4:`Admin local`,5:`Site local`,8:`Organization local`,14:`Global`,15:`Reserved`},e.TYPES={"ff01::1/128":`Multicast (All nodes on this interface)`,"ff01::2/128":`Multicast (All routers on this interface)`,"ff02::1/128":`Multicast (All nodes on this link)`,"ff02::2/128":`Multicast (All routers on this link)`,"ff05::2/128":`Multicast (All routers in this site)`,"ff02::5/128":`Multicast (OSPFv3 AllSPF routers)`,"ff02::6/128":`Multicast (OSPFv3 AllDR routers)`,"ff02::9/128":`Multicast (RIP routers)`,"ff02::a/128":`Multicast (EIGRP routers)`,"ff02::d/128":`Multicast (PIM routers)`,"ff02::16/128":`Multicast (MLDv2 reports)`,"ff01::fb/128":`Multicast (mDNSv6)`,"ff02::fb/128":`Multicast (mDNSv6)`,"ff05::fb/128":`Multicast (mDNSv6)`,"ff02::1:2/128":`Multicast (All DHCP servers and relay agents on this link)`,"ff05::1:2/128":`Multicast (All DHCP servers and relay agents in this site)`,"ff02::1:3/128":`Multicast (All DHCP servers on this link)`,"ff05::1:3/128":`Multicast (All DHCP servers in this site)`,"::/128":`Unspecified`,"::1/128":`Loopback`,"ff00::/8":`Multicast`,"fe80::/10":`Link-local unicast`,"fc00::/7":`Unique local`,"2002::/16":`6to4`,"2001:db8::/32":`Documentation`,"64:ff9b::/96":`NAT64 (well-known)`,"64:ff9b:1::/48":`NAT64 (local-use)`},e.RE_BAD_CHARACTERS=/([^0-9a-f:/%])/gi,e.RE_BAD_ADDRESS=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi,e.RE_SUBNET_STRING=/\/\d{1,3}(?=%|$)/,e.RE_ZONE_STRING=/%.*$/,e.RE_URL=/^\[{0,1}([0-9a-f:]+)\]{0,1}/,e.RE_URL_WITH_PORT=/\[([0-9a-f:]+)\]:([0-9]{1,5})/})),Gc=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.escapeHtml=t,e.spanAllZeroes=n,e.spanAll=r,e.spanLeadingZeroes=a,e.simpleGroup=o;function t(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}function n(e){return t(e).replace(/(0+)/g,`<span class="zero">$1</span>`)}function r(e,r=0){return e.split(``).map((e,i)=>`<span class="digit value-${t(e)} position-${i+r}">${n(e)}</span>`).join(``)}function i(e){return t(e).replace(/^(0+)/,`<span class="zero">$1</span>`)}function a(e){return e.split(`:`).map(e=>i(e)).join(`:`)}function o(e,t=0){return e.split(`:`).map((e,n)=>/group-v4/.test(e)?e:`<span class="hover-group group-${n+t}">${i(e)}</span>`)}})),Kc=s((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.ADDRESS_BOUNDARY=void 0,e.groupPossibilities=a,e.padGroup=o,e.simpleRegularExpression=s,e.possibleElisions=c;var i=r(Wc());function a(e){return`(${e.join(`|`)})`}function o(e){return e.length<4?`0{0,${4-e.length}}${e}`:e}e.ADDRESS_BOUNDARY=`[^A-Fa-f0-9:]`;function s(e){let t=[];e.forEach((e,n)=>{parseInt(e,16)===0&&t.push(n)});let n=t.map(t=>e.map((e,n)=>{if(n===t){let t=n===0||n===i.GROUPS-1?`:`:``;return a([o(e),t])}return o(e)}).join(`:`));return n.push(e.map(o).join(`:`)),a(n)}function c(e,t,n){let r=t?``:`:`,i=n?``:`:`,o=[];!t&&!n&&o.push(`::`),t&&n&&o.push(``),(n&&!t||!n&&t)&&o.push(`:`),o.push(`${r}(:0{1,4}){1,${e-1}}`),o.push(`(0{1,4}:){1,${e-1}}${i}`),o.push(`(0{1,4}:){${e-1}}0{1,4}`);for(let t=1;t<e-1;t++)for(let n=1;n<e-t;n++)o.push(`(0{1,4}:){${n}}:(0{1,4}:){${e-n-t-1}}0{1,4}`);return a(o)}})),qc=s((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.Address6=void 0;var i=r(Vc()),a=r(Hc()),o=r(Wc()),s=r(Gc()),c=Uc(),l=Kc(),u=Bc(),d=Vc(),f=i.isCorrect(o.BITS);function p(e){if(!e)throw Error(`Assertion failed.`)}function m(e){let t=/(\d+)(\d{3})/;for(;t.test(e);)e=e.replace(t,`$1,$2`);return e}function h(e){return e=e.replace(/^(0{1,})([1-9]+)$/,`<span class="parse-error">$1</span>$2`),e=e.replace(/^(0{1,})(0)$/,`<span class="parse-error">$1</span>$2`),e}function g(e,t){let n=[],r=[],i;for(i=0;i<e.length;i++)i<t[0]?n.push(e[i]):i>t[1]&&r.push(e[i]);return n.concat([`compact`]).concat(r)}function _(e){return parseInt(e,16).toString(16).padStart(4,`0`)}function v(e){return e&255}var y=class e{constructor(e,t){this.addressMinusSuffix=``,this.parsedSubnet=``,this.subnet=`/128`,this.subnetMask=128,this.v4=!1,this.zone=``,this.isInSubnet=i.isInSubnet,this.isCorrect=f,t===void 0?this.groups=o.GROUPS:this.groups=t,this.address=e;let n=o.RE_SUBNET_STRING.exec(e);if(n){if(this.parsedSubnet=n[0].replace(`/`,``),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,Number.isNaN(this.subnetMask)||this.subnetMask<0||this.subnetMask>o.BITS)throw new u.AddressError(`Invalid subnet mask.`);e=e.replace(o.RE_SUBNET_STRING,``)}else if(/\//.test(e))throw new u.AddressError(`Invalid subnet mask.`);let r=o.RE_ZONE_STRING.exec(e);r&&(this.zone=r[0],e=e.replace(o.RE_ZONE_STRING,``)),this.addressMinusSuffix=e,this.parsedAddress=this.parse(this.addressMinusSuffix)}static isValid(t){try{return new e(t),!0}catch{return!1}}static fromBigInt(t){if(t<0n||t>(1n<<BigInt(o.BITS))-1n)throw new u.AddressError(`IPv6 BigInt must be in the range 0 to 2**128 - 1`);let n=t.toString(16).padStart(32,`0`),r=[];for(let e=0;e<o.GROUPS;e++)r.push(n.slice(e*4,(e+1)*4));return new e(r.join(`:`))}static fromURL(t){let n,r=null,i;if(t.indexOf(`[`)!==-1&&t.indexOf(`]:`)!==-1){if(i=o.RE_URL_WITH_PORT.exec(t),i===null)return{error:`failed to parse address with port`,address:null,port:null};n=i[1],r=i[2]}else if(t.indexOf(`/`)!==-1){if(t=t.replace(/^[a-z0-9]+:\/\//,``),i=o.RE_URL.exec(t),i===null)return{error:`failed to parse address from URL`,address:null,port:null};n=i[1]}else n=t;return r?(r=parseInt(r,10),(r<0||r>65536)&&(r=null)):r=null,{address:new e(n),port:r}}static fromAddressAndMask(t,n){return new e(`${t}/${i.prefixLengthFromMask(new e(n).bigInt(),o.BITS)}`)}static fromAddressAndWildcardMask(t,n){let r=new e(n).bigInt()^(BigInt(1)<<BigInt(o.BITS))-BigInt(1);return new e(`${t}/${i.prefixLengthFromMask(r,o.BITS)}`)}static fromWildcard(t){if(t.includes(`%`)||t.includes(`/`))throw new u.AddressError(`Wildcard pattern must not include a zone or CIDR suffix`);let n=t.split(`::`);if(n.length>2)throw new u.AddressError(`Wildcard pattern cannot contain more than one '::'`);let r;if(n.length===2){let e=n[0]===``?[]:n[0].split(`:`),t=n[1]===``?[]:n[1].split(`:`),i=o.GROUPS-e.length-t.length;if(i<1)throw new u.AddressError(`Wildcard pattern with '::' has too many groups`);r=[...e,...Array(i).fill(`0`),...t]}else r=t.split(`:`);if(r.length!==o.GROUPS)throw new u.AddressError(`Wildcard pattern must have 8 groups`);let i=-1;for(let e=0;e<r.length;e++)if(r[e]===`*`)i===-1&&(i=e);else if(i!==-1)throw new u.AddressError("Wildcard `*` must only appear in trailing groups (e.g. `2001:db8:*:*:*:*:*:*`)");let a=i===-1?0:r.length-i,s=r.map(e=>e===`*`?`0`:e),c=o.BITS-a*16;return new e(`${s.join(`:`)}/${c}`)}static fromAddress4(t){let n=new c.Address4(t),r=o.BITS-(a.BITS-n.subnetMask);return new e(`::ffff:${n.correctForm()}/${r}`)}static fromArpa(t){let n=t.replace(/(\.ip6\.arpa)?\.$/,``);if(n.length!==63)throw new u.AddressError(`Invalid 'ip6.arpa' form.`);let r=n.split(`.`).reverse();for(let e=7;e>0;e--){let t=e*4;r.splice(t,0,`:`)}return n=r.join(``),new e(n)}microsoftTranscription(){return`${this.correctForm().replace(/:/g,`-`)}.ipv6-literal.net`}mask(e=this.subnetMask){return this.getBitsBase2(0,e)}possibleSubnets(e=128){let t=o.BITS-this.subnetMask-Math.abs(e-o.BITS);return t<0?`0`:m((BigInt(`2`)**BigInt(t)).toString(10))}_startAddress(){return BigInt(`0b${this.mask()+`0`.repeat(o.BITS-this.subnetMask)}`)}startAddress(){return e.fromBigInt(this._startAddress())}startAddressExclusive(){let t=BigInt(`1`);return e.fromBigInt(this._startAddress()+t)}_endAddress(){return BigInt(`0b${this.mask()+`1`.repeat(o.BITS-this.subnetMask)}`)}endAddress(){return e.fromBigInt(this._endAddress())}endAddressExclusive(){let t=BigInt(`1`);return e.fromBigInt(this._endAddress()-t)}subnetMaskAddress(){return e.fromBigInt(BigInt(`0b${`1`.repeat(this.subnetMask)}${`0`.repeat(o.BITS-this.subnetMask)}`))}wildcardMask(){return e.fromBigInt(BigInt(`0b${`0`.repeat(this.subnetMask)}${`1`.repeat(o.BITS-this.subnetMask)}`))}networkForm(){return`${this.startAddress().correctForm()}/${this.subnetMask}`}getScope(){let e=this.getType();return e===`Multicast`||e.startsWith(`Multicast `)?o.SCOPES[parseInt(this.getBits(12,16).toString(10),10)]||`Unknown`:e===`Link-local unicast`||e===`Loopback`?`Link local`:e===`Unspecified`?`Unknown`:`Global`}getType(){for(let e=0;e<b.length;e++){let t=b[e];if(this.isInSubnet(t[0]))return t[1]}return`Global unicast`}getBits(e,t){return BigInt(`0b${this.getBitsBase2(e,t)}`)}getBitsBase2(e,t){return this.binaryZeroPad().slice(e,t)}getBitsBase16(e,t){let n=t-e;if(n%4!=0)throw Error(`Length of bits to retrieve must be divisible by four`);return this.getBits(e,t).toString(16).padStart(n/4,`0`)}getBitsPastSubnet(){return this.getBitsBase2(this.subnetMask,o.BITS)}reverseForm(e){e||={};let t=Math.floor(this.subnetMask/4),n=this.canonicalForm().replace(/:/g,``).split(``).slice(0,t).reverse().join(`.`);return t>0?e.omitSuffix?n:`${n}.ip6.arpa.`:e.omitSuffix?``:`ip6.arpa.`}correctForm(){let e,t=[],n=0,r=[];for(e=0;e<this.parsedAddress.length;e++){let t=parseInt(this.parsedAddress[e],16);t===0&&n++,t!==0&&n>0&&(n>1&&r.push([e-n,e-1]),n=0)}n>1&&r.push([this.parsedAddress.length-n,this.parsedAddress.length-1]);let i=r.map(e=>e[1]-e[0]+1);if(r.length>0){let e=i.indexOf(Math.max(...i));t=g(this.parsedAddress,r[e])}else t=this.parsedAddress;for(e=0;e<t.length;e++)t[e]!==`compact`&&(t[e]=parseInt(t[e],16).toString(16));let a=t.join(`:`);return a=a.replace(/^compact$/,`::`),a=a.replace(/(^compact)|(compact$)/,`:`),a=a.replace(/compact/,``),a}binaryZeroPad(){return this._binaryZeroPad===void 0&&(this._binaryZeroPad=this.bigInt().toString(2).padStart(o.BITS,`0`)),this._binaryZeroPad}parse4in6(e){if(e.indexOf(`.`)===-1)return e;let t=e.split(`:`),n=t.slice(-1)[0].match(a.RE_ADDRESS);if(n){this.parsedAddress4=n[0],this.address4=new c.Address4(this.parsedAddress4);for(let e=0;e<this.address4.groups;e++)if(/^0[0-9]+/.test(this.address4.parsedAddress[e])){let e=this.address4.parsedAddress.map(h).join(`.`),n=t.slice(0,-1).map(s.escapeHtml).join(`:`),r=t.length>1?`:`:``;throw new u.AddressError(`IPv4 addresses can't have leading zeroes.`,`${n}${r}${e}`)}this.v4=!0,t[t.length-1]=this.address4.toGroup6(),e=t.join(`:`)}return e}parse(e){e=this.parse4in6(e);let t=e.match(o.RE_BAD_CHARACTERS);if(t)throw new u.AddressError(`Bad character${t.length>1?`s`:``} detected in address: ${t.join(``)}`,e.replace(o.RE_BAD_CHARACTERS,`<span class="parse-error">$1</span>`));let n=e.match(o.RE_BAD_ADDRESS);if(n)throw new u.AddressError(`Address failed regex: ${n.join(``)}`,e.replace(o.RE_BAD_ADDRESS,`<span class="parse-error">$1</span>`));let r=[],i=e.split(`::`);if(i.length===2){let e=i[0].split(`:`),t=i[1].split(`:`);e.length===1&&e[0]===``&&(e=[]),t.length===1&&t[0]===``&&(t=[]);let n=this.groups-(e.length+t.length);if(!n)throw new u.AddressError(`Error parsing groups`);this.elidedGroups=n,this.elisionBegin=e.length,this.elisionEnd=e.length+this.elidedGroups,r=r.concat(e);for(let e=0;e<n;e++)r.push(`0`);r=r.concat(t)}else if(i.length===1)r=e.split(`:`),this.elidedGroups=0;else throw new u.AddressError(`Too many :: groups found`);if(r=r.map(e=>parseInt(e,16).toString(16)),r.length!==this.groups)throw new u.AddressError(`Incorrect number of groups found`);return r}canonicalForm(){return this.parsedAddress.map(_).join(`:`)}decimal(){return this.parsedAddress.map(e=>parseInt(e,16).toString(10).padStart(5,`0`)).join(`:`)}bigInt(){return BigInt(`0x${this.parsedAddress.map(_).join(``)}`)}to4(){let e=this.binaryZeroPad().split(``);return c.Address4.fromHex(BigInt(`0b${e.slice(96,128).join(``)}`).toString(16).padStart(8,`0`))}to4in6(){let t=this.to4(),n=new e(this.parsedAddress.slice(0,6).join(`:`),6).correctForm(),r=``;return/:$/.test(n)||(r=`:`),n+r+t.address}inspectTeredo(){let e=this.getBitsBase16(0,32),t=(this.getBits(80,96)^BigInt(`0xffff`)).toString(),n=c.Address4.fromHex(this.getBitsBase16(32,64)),r=this.getBits(96,128),i=c.Address4.fromHex((r^BigInt(`0xffffffff`)).toString(16).padStart(8,`0`)),a=this.getBitsBase2(64,80),o=(0,d.testBit)(a,15),s=(0,d.testBit)(a,14),l=(0,d.testBit)(a,8),u=(0,d.testBit)(a,9),f=BigInt(`0b${a.slice(2,6)+a.slice(8,16)}`).toString(10);return{prefix:`${e.slice(0,4)}:${e.slice(4,8)}`,server4:n.address,client4:i.address,flags:a,coneNat:o,microsoft:{reserved:s,universalLocal:u,groupIndividual:l,nonce:f},udpPort:t}}inspect6to4(){let e=this.getBitsBase16(0,16),t=c.Address4.fromHex(this.getBitsBase16(16,48));return{prefix:e.slice(0,4),gateway:t.address}}to6to4(){return this.is4()?new e([`2002`,this.getBitsBase16(96,112),this.getBitsBase16(112,128),``,`/16`].join(`:`)):null}static fromAddress4Nat64(t,n=`64:ff9b::/96`){let r=new c.Address4(t),i=new e(n),a=i.subnetMask;if(a!==32&&a!==40&&a!==48&&a!==56&&a!==64&&a!==96)throw new u.AddressError(`NAT64 prefix length must be 32, 40, 48, 56, 64, or 96`);let o=i.binaryZeroPad(),s=r.binaryZeroPad(),l;if(a===96)l=o.slice(0,96)+s;else{let e=64-a;l=o.slice(0,a)+s.slice(0,e)+`00000000`+s.slice(e)+`0`.repeat(56-(32-e))}let d=BigInt(`0b${l}`).toString(16).padStart(32,`0`),f=[];for(let e=0;e<8;e++)f.push(d.slice(e*4,(e+1)*4));return new e(f.join(`:`))}toAddress4Nat64(t=`64:ff9b::/96`){let n=new e(t),r=n.subnetMask;if(r!==32&&r!==40&&r!==48&&r!==56&&r!==64&&r!==96)throw new u.AddressError(`NAT64 prefix length must be 32, 40, 48, 56, 64, or 96`);if(!this.isInSubnet(n))return null;let i=this.binaryZeroPad(),a;if(r===96)a=i.slice(96,128);else{let e=64-r;a=i.slice(r,r+e)+i.slice(72,72+(32-e))}let o=[];for(let e=0;e<4;e++)o.push(parseInt(a.slice(e*8,(e+1)*8),2).toString());return new c.Address4(o.join(`.`))}toByteArray(){let e=this.bigInt().toString(16),t=`${`0`.repeat(e.length%2)}${e}`,n=[];for(let e=0,r=t.length;e<r;e+=2)n.push(parseInt(t.substring(e,e+2),16));return n}toUnsignedByteArray(){return this.toByteArray().map(v)}static fromByteArray(e){return this.fromUnsignedByteArray(e.map(v))}static fromUnsignedByteArray(t){let n=BigInt(`256`),r=BigInt(`0`),i=BigInt(`1`);for(let e=t.length-1;e>=0;e--)r+=i*BigInt(t[e].toString(10)),i*=n;return e.fromBigInt(r)}isCanonical(){return this.addressMinusSuffix===this.canonicalForm()}isLinkLocal(){return this.getBitsBase2(0,64)===`1111111010000000000000000000000000000000000000000000000000000000`}isMulticast(){let e=this.getType();return e===`Multicast`||e.startsWith(`Multicast `)}is4(){return this.v4}isMapped4(){return this.isInSubnet(T)}isTeredo(){return this.isInSubnet(x)}is6to4(){return this.isInSubnet(S)}isLoopback(){return this.getType()===`Loopback`}isULA(){return this.isInSubnet(C)}isUnspecified(){return this.getType()===`Unspecified`}isDocumentation(){return this.isInSubnet(w)}href(e){return e=e===void 0?``:`:${e}`,`http://[${this.correctForm()}]${e}/`}link(e){e||={},e.className===void 0&&(e.className=``),e.prefix===void 0&&(e.prefix=`/#address=`),e.v4===void 0&&(e.v4=!1);let t=this.correctForm;e.v4&&(t=this.to4in6);let n=t.call(this),r=s.escapeHtml(`${e.prefix}${n}`),i=s.escapeHtml(n);return e.className?`<a href="${r}" class="${s.escapeHtml(e.className)}">${i}</a>`:`<a href="${r}">${i}</a>`}group(){if(this.elidedGroups===0)return s.simpleGroup(this.addressMinusSuffix).join(`:`);p(typeof this.elidedGroups==`number`),p(typeof this.elisionBegin==`number`);let e=[],[t,n]=this.addressMinusSuffix.split(`::`);t.length?e.push(...s.simpleGroup(t)):e.push(``);let r=[`hover-group`];for(let e=this.elisionBegin;e<this.elisionBegin+this.elidedGroups;e++)r.push(`group-${e}`);return e.push(`<span class="${r.join(` `)}"></span>`),n.length?e.push(...s.simpleGroup(n,this.elisionEnd)):e.push(``),this.is4()&&(p(this.address4 instanceof c.Address4),e.pop(),e.push(this.address4.groupForV6())),e.join(`:`)}regularExpressionString(t=!1){let n=[],r=new e(this.correctForm());if(r.elidedGroups===0)n.push((0,l.simpleRegularExpression)(r.parsedAddress));else if(r.elidedGroups===o.GROUPS)n.push((0,l.possibleElisions)(o.GROUPS));else{let e=r.address.split(`::`);e[0].length&&n.push((0,l.simpleRegularExpression)(e[0].split(`:`))),p(typeof r.elidedGroups==`number`),n.push((0,l.possibleElisions)(r.elidedGroups,e[0].length!==0,e[1].length!==0)),e[1].length&&n.push((0,l.simpleRegularExpression)(e[1].split(`:`))),n=[n.join(`:`)]}return t||(n=[`(?=^|`,l.ADDRESS_BOUNDARY,`|[^\\w\\:])(`,...n,`)(?=[^\\w\\:]|`,l.ADDRESS_BOUNDARY,`|$)`]),n.join(``)}regularExpression(e=!1){return new RegExp(this.regularExpressionString(e),`i`)}};e.Address6=y;var b=Object.keys(o.TYPES).map(e=>[new y(e),o.TYPES[e]]),x=new y(`2001::/32`),S=new y(`2002::/16`),C=new y(`fc00::/7`),w=new y(`2001:db8::/32`),T=new y(`::ffff:0:0/96`)})),Jc=s((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.v6=e.AddressError=e.Address6=e.Address4=void 0;var i=Uc();Object.defineProperty(e,"Address4",{enumerable:!0,get:function(){return i.Address4}});var a=qc();Object.defineProperty(e,"Address6",{enumerable:!0,get:function(){return a.Address6}});var o=Bc();Object.defineProperty(e,"AddressError",{enumerable:!0,get:function(){return o.AddressError}}),e.v6={helpers:r(Gc())}})),Yc=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ipToBuffer=e.int32ToIpv4=e.ipv4ToInt32=e.validateSocksClientChainOptions=e.validateSocksClientOptions=void 0;var t=zc(),n=Rc(),r=require("stream"),i=Jc(),a=require("net");function o(e,i=[`connect`,`bind`,`associate`]){if(!n.SocksCommand[e.command])throw new t.SocksClientError(n.ERRORS.InvalidSocksCommand,e);if(i.indexOf(e.command)===-1)throw new t.SocksClientError(n.ERRORS.InvalidSocksCommandForOperation,e);if(!l(e.destination))throw new t.SocksClientError(n.ERRORS.InvalidSocksClientOptionsDestination,e);if(!u(e.proxy))throw new t.SocksClientError(n.ERRORS.InvalidSocksClientOptionsProxy,e);if(c(e.proxy,e),e.timeout&&!d(e.timeout))throw new t.SocksClientError(n.ERRORS.InvalidSocksClientOptionsTimeout,e);if(e.existing_socket&&!(e.existing_socket instanceof r.Duplex))throw new t.SocksClientError(n.ERRORS.InvalidSocksClientOptionsExistingSocket,e)}e.validateSocksClientOptions=o;function s(e){if(e.command!==`connect`)throw new t.SocksClientError(n.ERRORS.InvalidSocksCommandChain,e);if(!l(e.destination))throw new t.SocksClientError(n.ERRORS.InvalidSocksClientOptionsDestination,e);if(!(e.proxies&&Array.isArray(e.proxies)&&e.proxies.length>=2))throw new t.SocksClientError(n.ERRORS.InvalidSocksClientOptionsProxiesLength,e);if(e.proxies.forEach(r=>{if(!u(r))throw new t.SocksClientError(n.ERRORS.InvalidSocksClientOptionsProxy,e);c(r,e)}),e.timeout&&!d(e.timeout))throw new t.SocksClientError(n.ERRORS.InvalidSocksClientOptionsTimeout,e)}e.validateSocksClientChainOptions=s;function c(e,r){if(e.custom_auth_method!==void 0){if(e.custom_auth_method<n.SOCKS5_CUSTOM_AUTH_START||e.custom_auth_method>n.SOCKS5_CUSTOM_AUTH_END)throw new t.SocksClientError(n.ERRORS.InvalidSocksClientOptionsCustomAuthRange,r);if(e.custom_auth_request_handler===void 0||typeof e.custom_auth_request_handler!=`function`||e.custom_auth_response_size===void 0||e.custom_auth_response_handler===void 0||typeof e.custom_auth_response_handler!=`function`)throw new t.SocksClientError(n.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,r)}}function l(e){return e&&typeof e.host==`string`&&Buffer.byteLength(e.host)<256&&typeof e.port==`number`&&e.port>=0&&e.port<=65535}function u(e){return e&&(typeof e.host==`string`||typeof e.ipaddress==`string`)&&typeof e.port==`number`&&e.port>=0&&e.port<=65535&&(e.type===4||e.type===5)}function d(e){return typeof e==`number`&&e>0}function f(e){return new i.Address4(e).toArray().reduce((e,t)=>(e<<8)+t,0)>>>0}e.ipv4ToInt32=f;function p(e){return[e>>>24&255,e>>>16&255,e>>>8&255,e&255].join(`.`)}e.int32ToIpv4=p;function m(e){if(a.isIPv4(e)){let t=new i.Address4(e);return Buffer.from(t.toArray())}else if(a.isIPv6(e)){let t=new i.Address6(e);return Buffer.from(t.canonicalForm().split(`:`).map(e=>e.padStart(4,`0`)).join(``),`hex`)}else throw Error(`Invalid IP address format`)}e.ipToBuffer=m})),Xc=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ReceiveBuffer=void 0,e.ReceiveBuffer=class{constructor(e=4096){this.buffer=Buffer.allocUnsafe(e),this.offset=0,this.originalSize=e}get length(){return this.offset}append(e){if(!Buffer.isBuffer(e))throw Error(`Attempted to append a non-buffer instance to ReceiveBuffer.`);if(this.offset+e.length>=this.buffer.length){let t=this.buffer;this.buffer=Buffer.allocUnsafe(Math.max(this.buffer.length+this.originalSize,this.buffer.length+e.length)),t.copy(this.buffer)}return e.copy(this.buffer,this.offset),this.offset+=e.length}peek(e){if(e>this.offset)throw Error(`Attempted to read beyond the bounds of the managed internal data.`);return this.buffer.slice(0,e)}get(e){if(e>this.offset)throw Error(`Attempted to read beyond the bounds of the managed internal data.`);let t=Buffer.allocUnsafe(e);return this.buffer.slice(0,e).copy(t),this.buffer.copyWithin(0,e,e+this.offset-e),this.offset-=e,t}}})),Zc=s((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.SocksClientError=e.SocksClient=void 0;var n=require("events"),r=require("net"),i=Lc(),a=Rc(),o=Yc(),s=Xc(),c=zc();Object.defineProperty(e,"SocksClientError",{enumerable:!0,get:function(){return c.SocksClientError}});var l=Jc();e.SocksClient=class e extends n.EventEmitter{constructor(e){super(),this.options=Object.assign({},e),(0,o.validateSocksClientOptions)(e),this.setState(a.SocksClientState.Created)}static createConnection(t,n){return new Promise((r,i)=>{try{(0,o.validateSocksClientOptions)(t,[`connect`])}catch(e){return typeof n==`function`?(n(e),r(e)):i(e)}let a=new e(t);a.connect(t.existing_socket),a.once(`established`,e=>{a.removeAllListeners(),typeof n==`function`&&n(null,e),r(e)}),a.once(`error`,e=>{a.removeAllListeners(),typeof n==`function`?(n(e),r(e)):i(e)})})}static createConnectionChain(n,r){return new Promise((i,a)=>t(this,void 0,void 0,function*(){try{(0,o.validateSocksClientChainOptions)(n)}catch(e){return typeof r==`function`?(r(e),i(e)):a(e)}n.randomizeChain&&(0,c.shuffleArray)(n.proxies);try{let t;for(let r=0;r<n.proxies.length;r++){let i=n.proxies[r],a=r===n.proxies.length-1?n.destination:{host:n.proxies[r+1].host||n.proxies[r+1].ipaddress,port:n.proxies[r+1].port},o=yield e.createConnection({command:`connect`,proxy:i,destination:a,existing_socket:t});t||=o.socket}typeof r==`function`&&r(null,{socket:t}),i({socket:t})}catch(e){typeof r==`function`?(r(e),i(e)):a(e)}}))}static createUDPFrame(e){let t=new i.SmartBuffer;return t.writeUInt16BE(0),t.writeUInt8(e.frameNumber||0),r.isIPv4(e.remoteHost.host)?(t.writeUInt8(a.Socks5HostType.IPv4),t.writeUInt32BE((0,o.ipv4ToInt32)(e.remoteHost.host))):r.isIPv6(e.remoteHost.host)?(t.writeUInt8(a.Socks5HostType.IPv6),t.writeBuffer((0,o.ipToBuffer)(e.remoteHost.host))):(t.writeUInt8(a.Socks5HostType.Hostname),t.writeUInt8(Buffer.byteLength(e.remoteHost.host)),t.writeString(e.remoteHost.host)),t.writeUInt16BE(e.remoteHost.port),t.writeBuffer(e.data),t.toBuffer()}static parseUDPFrame(e){let t=i.SmartBuffer.fromBuffer(e);t.readOffset=2;let n=t.readUInt8(),r=t.readUInt8(),s;s=r===a.Socks5HostType.IPv4?(0,o.int32ToIpv4)(t.readUInt32BE()):r===a.Socks5HostType.IPv6?l.Address6.fromByteArray(Array.from(t.readBuffer(16))).canonicalForm():t.readString(t.readUInt8());let c=t.readUInt16BE();return{frameNumber:n,remoteHost:{host:s,port:c},data:t.readBuffer()}}setState(e){this.state!==a.SocksClientState.Error&&(this.state=e)}connect(e){this.onDataReceived=e=>this.onDataReceivedHandler(e),this.onClose=()=>this.onCloseHandler(),this.onError=e=>this.onErrorHandler(e),this.onConnect=()=>this.onConnectHandler();let t=setTimeout(()=>this.onEstablishedTimeout(),this.options.timeout||a.DEFAULT_TIMEOUT);t.unref&&typeof t.unref==`function`&&t.unref(),e?this.socket=e:this.socket=new r.Socket,this.socket.once(`close`,this.onClose),this.socket.once(`error`,this.onError),this.socket.once(`connect`,this.onConnect),this.socket.on(`data`,this.onDataReceived),this.setState(a.SocksClientState.Connecting),this.receiveBuffer=new s.ReceiveBuffer,e?this.socket.emit(`connect`):(this.socket.connect(this.getSocketOptions()),this.options.set_tcp_nodelay!==void 0&&this.options.set_tcp_nodelay!==null&&this.socket.setNoDelay(!!this.options.set_tcp_nodelay)),this.prependOnceListener(`established`,e=>{setImmediate(()=>{if(this.receiveBuffer.length>0){let t=this.receiveBuffer.get(this.receiveBuffer.length);e.socket.emit(`data`,t)}e.socket.resume()})})}getSocketOptions(){return Object.assign(Object.assign({},this.options.socket_options),{host:this.options.proxy.host||this.options.proxy.ipaddress,port:this.options.proxy.port})}onEstablishedTimeout(){this.state!==a.SocksClientState.Established&&this.state!==a.SocksClientState.BoundWaitingForConnection&&this.closeSocket(a.ERRORS.ProxyConnectionTimedOut)}onConnectHandler(){this.setState(a.SocksClientState.Connected),this.options.proxy.type===4?this.sendSocks4InitialHandshake():this.sendSocks5InitialHandshake(),this.setState(a.SocksClientState.SentInitialHandshake)}onDataReceivedHandler(e){this.receiveBuffer.append(e),this.processData()}processData(){for(;this.state!==a.SocksClientState.Established&&this.state!==a.SocksClientState.Error&&this.receiveBuffer.length>=this.nextRequiredPacketBufferSize;)if(this.state===a.SocksClientState.SentInitialHandshake)this.options.proxy.type===4?this.handleSocks4FinalHandshakeResponse():this.handleInitialSocks5HandshakeResponse();else if(this.state===a.SocksClientState.SentAuthentication)this.handleInitialSocks5AuthenticationHandshakeResponse();else if(this.state===a.SocksClientState.SentFinalHandshake)this.handleSocks5FinalHandshakeResponse();else if(this.state===a.SocksClientState.BoundWaitingForConnection)this.options.proxy.type===4?this.handleSocks4IncomingConnectionResponse():this.handleSocks5IncomingConnectionResponse();else{this.closeSocket(a.ERRORS.InternalError);break}}onCloseHandler(){this.closeSocket(a.ERRORS.SocketClosed)}onErrorHandler(e){this.closeSocket(e.message)}removeInternalSocketHandlers(){this.socket.pause(),this.socket.removeListener(`data`,this.onDataReceived),this.socket.removeListener(`close`,this.onClose),this.socket.removeListener(`error`,this.onError),this.socket.removeListener(`connect`,this.onConnect)}closeSocket(e){this.state!==a.SocksClientState.Error&&(this.setState(a.SocksClientState.Error),this.socket.destroy(),this.removeInternalSocketHandlers(),this.emit(`error`,new c.SocksClientError(e,this.options)))}sendSocks4InitialHandshake(){let e=this.options.proxy.userId||``,t=new i.SmartBuffer;t.writeUInt8(4),t.writeUInt8(a.SocksCommand[this.options.command]),t.writeUInt16BE(this.options.destination.port),r.isIPv4(this.options.destination.host)?(t.writeBuffer((0,o.ipToBuffer)(this.options.destination.host)),t.writeStringNT(e)):(t.writeUInt8(0),t.writeUInt8(0),t.writeUInt8(0),t.writeUInt8(1),t.writeStringNT(e),t.writeStringNT(this.options.destination.host)),this.nextRequiredPacketBufferSize=a.SOCKS_INCOMING_PACKET_SIZES.Socks4Response,this.socket.write(t.toBuffer())}handleSocks4FinalHandshakeResponse(){let e=this.receiveBuffer.get(8);if(e[1]!==a.Socks4Response.Granted)this.closeSocket(`${a.ERRORS.Socks4ProxyRejectedConnection} - (${a.Socks4Response[e[1]]})`);else if(a.SocksCommand[this.options.command]===a.SocksCommand.bind){let t=i.SmartBuffer.fromBuffer(e);t.readOffset=2;let n={port:t.readUInt16BE(),host:(0,o.int32ToIpv4)(t.readUInt32BE())};n.host===`0.0.0.0`&&(n.host=this.options.proxy.ipaddress),this.setState(a.SocksClientState.BoundWaitingForConnection),this.emit(`bound`,{remoteHost:n,socket:this.socket})}else this.setState(a.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit(`established`,{socket:this.socket})}handleSocks4IncomingConnectionResponse(){let e=this.receiveBuffer.get(8);if(e[1]!==a.Socks4Response.Granted)this.closeSocket(`${a.ERRORS.Socks4ProxyRejectedIncomingBoundConnection} - (${a.Socks4Response[e[1]]})`);else{let t=i.SmartBuffer.fromBuffer(e);t.readOffset=2;let n={port:t.readUInt16BE(),host:(0,o.int32ToIpv4)(t.readUInt32BE())};this.setState(a.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit(`established`,{remoteHost:n,socket:this.socket})}}sendSocks5InitialHandshake(){let e=new i.SmartBuffer,t=[a.Socks5Auth.NoAuth];(this.options.proxy.userId||this.options.proxy.password)&&t.push(a.Socks5Auth.UserPass),this.options.proxy.custom_auth_method!==void 0&&t.push(this.options.proxy.custom_auth_method),e.writeUInt8(5),e.writeUInt8(t.length);for(let n of t)e.writeUInt8(n);this.nextRequiredPacketBufferSize=a.SOCKS_INCOMING_PACKET_SIZES.Socks5InitialHandshakeResponse,this.socket.write(e.toBuffer()),this.setState(a.SocksClientState.SentInitialHandshake)}handleInitialSocks5HandshakeResponse(){let e=this.receiveBuffer.get(2);e[0]===5?e[1]===a.SOCKS5_NO_ACCEPTABLE_AUTH?this.closeSocket(a.ERRORS.InvalidSocks5InitialHandshakeNoAcceptedAuthType):e[1]===a.Socks5Auth.NoAuth?(this.socks5ChosenAuthType=a.Socks5Auth.NoAuth,this.sendSocks5CommandRequest()):e[1]===a.Socks5Auth.UserPass?(this.socks5ChosenAuthType=a.Socks5Auth.UserPass,this.sendSocks5UserPassAuthentication()):e[1]===this.options.proxy.custom_auth_method?(this.socks5ChosenAuthType=this.options.proxy.custom_auth_method,this.sendSocks5CustomAuthentication()):this.closeSocket(a.ERRORS.InvalidSocks5InitialHandshakeUnknownAuthType):this.closeSocket(a.ERRORS.InvalidSocks5IntiailHandshakeSocksVersion)}sendSocks5UserPassAuthentication(){let e=this.options.proxy.userId||``,t=this.options.proxy.password||``,n=new i.SmartBuffer;n.writeUInt8(1),n.writeUInt8(Buffer.byteLength(e)),n.writeString(e),n.writeUInt8(Buffer.byteLength(t)),n.writeString(t),this.nextRequiredPacketBufferSize=a.SOCKS_INCOMING_PACKET_SIZES.Socks5UserPassAuthenticationResponse,this.socket.write(n.toBuffer()),this.setState(a.SocksClientState.SentAuthentication)}sendSocks5CustomAuthentication(){return t(this,void 0,void 0,function*(){this.nextRequiredPacketBufferSize=this.options.proxy.custom_auth_response_size,this.socket.write(yield this.options.proxy.custom_auth_request_handler()),this.setState(a.SocksClientState.SentAuthentication)})}handleSocks5CustomAuthHandshakeResponse(e){return t(this,void 0,void 0,function*(){return yield this.options.proxy.custom_auth_response_handler(e)})}handleSocks5AuthenticationNoAuthHandshakeResponse(e){return t(this,void 0,void 0,function*(){return e[1]===0})}handleSocks5AuthenticationUserPassHandshakeResponse(e){return t(this,void 0,void 0,function*(){return e[1]===0})}handleInitialSocks5AuthenticationHandshakeResponse(){return t(this,void 0,void 0,function*(){this.setState(a.SocksClientState.ReceivedAuthenticationResponse);let e=!1;this.socks5ChosenAuthType===a.Socks5Auth.NoAuth?e=yield this.handleSocks5AuthenticationNoAuthHandshakeResponse(this.receiveBuffer.get(2)):this.socks5ChosenAuthType===a.Socks5Auth.UserPass?e=yield this.handleSocks5AuthenticationUserPassHandshakeResponse(this.receiveBuffer.get(2)):this.socks5ChosenAuthType===this.options.proxy.custom_auth_method&&(e=yield this.handleSocks5CustomAuthHandshakeResponse(this.receiveBuffer.get(this.options.proxy.custom_auth_response_size))),e?this.sendSocks5CommandRequest():this.closeSocket(a.ERRORS.Socks5AuthenticationFailed)})}sendSocks5CommandRequest(){let e=new i.SmartBuffer;e.writeUInt8(5),e.writeUInt8(a.SocksCommand[this.options.command]),e.writeUInt8(0),r.isIPv4(this.options.destination.host)?(e.writeUInt8(a.Socks5HostType.IPv4),e.writeBuffer((0,o.ipToBuffer)(this.options.destination.host))):r.isIPv6(this.options.destination.host)?(e.writeUInt8(a.Socks5HostType.IPv6),e.writeBuffer((0,o.ipToBuffer)(this.options.destination.host))):(e.writeUInt8(a.Socks5HostType.Hostname),e.writeUInt8(this.options.destination.host.length),e.writeString(this.options.destination.host)),e.writeUInt16BE(this.options.destination.port),this.nextRequiredPacketBufferSize=a.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader,this.socket.write(e.toBuffer()),this.setState(a.SocksClientState.SentFinalHandshake)}handleSocks5FinalHandshakeResponse(){let e=this.receiveBuffer.peek(5);if(e[0]!==5||e[1]!==a.Socks5Response.Granted)this.closeSocket(`${a.ERRORS.InvalidSocks5FinalHandshakeRejected} - ${a.Socks5Response[e[1]]}`);else{let t=e[3],n,r;if(t===a.Socks5HostType.IPv4){let e=a.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;if(this.receiveBuffer.length<e){this.nextRequiredPacketBufferSize=e;return}r=i.SmartBuffer.fromBuffer(this.receiveBuffer.get(e).slice(4)),n={host:(0,o.int32ToIpv4)(r.readUInt32BE()),port:r.readUInt16BE()},n.host===`0.0.0.0`&&(n.host=this.options.proxy.ipaddress)}else if(t===a.Socks5HostType.Hostname){let t=e[4],o=a.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(t);if(this.receiveBuffer.length<o){this.nextRequiredPacketBufferSize=o;return}r=i.SmartBuffer.fromBuffer(this.receiveBuffer.get(o).slice(5)),n={host:r.readString(t),port:r.readUInt16BE()}}else if(t===a.Socks5HostType.IPv6){let e=a.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;if(this.receiveBuffer.length<e){this.nextRequiredPacketBufferSize=e;return}r=i.SmartBuffer.fromBuffer(this.receiveBuffer.get(e).slice(4)),n={host:l.Address6.fromByteArray(Array.from(r.readBuffer(16))).canonicalForm(),port:r.readUInt16BE()}}this.setState(a.SocksClientState.ReceivedFinalResponse),a.SocksCommand[this.options.command]===a.SocksCommand.connect?(this.setState(a.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit(`established`,{remoteHost:n,socket:this.socket})):a.SocksCommand[this.options.command]===a.SocksCommand.bind?(this.setState(a.SocksClientState.BoundWaitingForConnection),this.nextRequiredPacketBufferSize=a.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader,this.emit(`bound`,{remoteHost:n,socket:this.socket})):a.SocksCommand[this.options.command]===a.SocksCommand.associate&&(this.setState(a.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit(`established`,{remoteHost:n,socket:this.socket}))}}handleSocks5IncomingConnectionResponse(){let e=this.receiveBuffer.peek(5);if(e[0]!==5||e[1]!==a.Socks5Response.Granted)this.closeSocket(`${a.ERRORS.Socks5ProxyRejectedIncomingBoundConnection} - ${a.Socks5Response[e[1]]}`);else{let t=e[3],n,r;if(t===a.Socks5HostType.IPv4){let e=a.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;if(this.receiveBuffer.length<e){this.nextRequiredPacketBufferSize=e;return}r=i.SmartBuffer.fromBuffer(this.receiveBuffer.get(e).slice(4)),n={host:(0,o.int32ToIpv4)(r.readUInt32BE()),port:r.readUInt16BE()},n.host===`0.0.0.0`&&(n.host=this.options.proxy.ipaddress)}else if(t===a.Socks5HostType.Hostname){let t=e[4],o=a.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(t);if(this.receiveBuffer.length<o){this.nextRequiredPacketBufferSize=o;return}r=i.SmartBuffer.fromBuffer(this.receiveBuffer.get(o).slice(5)),n={host:r.readString(t),port:r.readUInt16BE()}}else if(t===a.Socks5HostType.IPv6){let e=a.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;if(this.receiveBuffer.length<e){this.nextRequiredPacketBufferSize=e;return}r=i.SmartBuffer.fromBuffer(this.receiveBuffer.get(e).slice(4)),n={host:l.Address6.fromByteArray(Array.from(r.readBuffer(16))).canonicalForm(),port:r.readUInt16BE()}}this.setState(a.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit(`established`,{remoteHost:n,socket:this.socket})}}get socksClientOptions(){return Object.assign({},this.options)}}})),Qc=s((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(Zc(),e)})),$c=s((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.SocksProxyAgent=void 0;var a=Qc(),o=Mc(),s=i(Ac()),c=r(require("dns")),l=r(require("net")),u=r(require("tls")),d=require("url"),f=(0,s.default)(`socks-proxy-agent`),p=e=>e.servername===void 0&&e.host&&!l.isIP(e.host)?{...e,servername:e.host}:e;function m(e){let t=!1,n=5,r=e.hostname,i=parseInt(e.port,10)||1080;switch(e.protocol.replace(`:`,``)){case`socks4`:t=!0,n=4;break;case`socks4a`:n=4;break;case`socks5`:t=!0,n=5;break;case`socks`:n=5;break;case`socks5h`:n=5;break;default:throw TypeError(`A "socks" protocol must be specified! Got: ${String(e.protocol)}`)}let a={host:r,port:i,type:n};return e.username&&Object.defineProperty(a,"userId",{value:decodeURIComponent(e.username),enumerable:!1}),e.password!=null&&Object.defineProperty(a,"password",{value:decodeURIComponent(e.password),enumerable:!1}),{lookup:t,proxy:a}}var h=class extends o.Agent{constructor(e,t){super(t);let{proxy:n,lookup:r}=m(typeof e==`string`?new d.URL(e):e);this.shouldLookup=r,this.proxy=n,this.timeout=t?.timeout??null,this.socketOptions=t?.socketOptions??null}async connect(e,t){let{shouldLookup:n,proxy:r,timeout:i}=this;if(!t.host)throw Error("No `host` defined!");let{host:o}=t,{port:s,lookup:l=c.lookup}=t;n&&(o=await new Promise((e,t)=>{l(o,{},(n,r)=>{n?t(n):e(r)})}));let d={proxy:r,destination:{host:o,port:typeof s==`number`?s:parseInt(s,10)},command:`connect`,timeout:i??void 0,socket_options:this.socketOptions??void 0},m=t=>{e.destroy(),h.destroy(),t&&t.destroy()};f(`Creating socks proxy connection: %o`,d);let{socket:h}=await a.SocksClient.createConnection(d);if(f(`Successfully created socks proxy connection`),i!==null&&(h.setTimeout(i),h.on(`timeout`,()=>m())),t.secureEndpoint){f(`Upgrading socket connection to TLS`);let e=u.connect({...g(p(t),`host`,`path`,`port`),socket:h});return e.once(`error`,t=>{f(`Socket TLS error`,t.message),m(e)}),e}return h}};h.protocols=[`socks`,`socks4`,`socks4a`,`socks5`,`socks5h`],e.SocksProxyAgent=h;function g(e,...t){let n={},r;for(r in e)t.includes(r)||(n[r]=e[r]);return n}})),el=s(((e,t)=>{t.exports={InvalidProxyProtocolError:class extends Error{constructor(e){super(`Invalid protocol \`${e.protocol}\` connecting to proxy \`${e.host}\``),this.code=`EINVALIDPROXY`,this.proxy=e}},ConnectionTimeoutError:class extends Error{constructor(e){super(`Timeout connecting to host \`${e}\``),this.code=`ECONNECTIONTIMEOUT`,this.host=e}},IdleTimeoutError:class extends Error{constructor(e){super(`Idle timeout reached for host \`${e}\``),this.code=`EIDLETIMEOUT`,this.host=e}},ResponseTimeoutError:class extends Error{constructor(e,t){let n=`Response timeout `;t&&(n+=`from proxy \`${t.host}\` `),n+=`connecting to host \`${e.host}\``,super(n),this.code=`ERESPONSETIMEOUT`,this.proxy=t,this.request=e}},TransferTimeoutError:class extends Error{constructor(e,t){let n=`Transfer timeout `;t&&(n+=`from proxy \`${t.host}\` `),n+=`for \`${e.host}\``,super(n),this.code=`ETRANSFERTIMEOUT`,this.proxy=t,this.request=e}}}})),tl=s(((e,t)=>{var{HttpProxyAgent:n}=Nc(),{HttpsProxyAgent:r}=Fc(),{SocksProxyAgent:i}=$c(),{LRUCache:a}=zn(),{InvalidProxyProtocolError:o}=el(),s=new a({max:20}),c=new Set(i.protocols),l=new Set([`https_proxy`,`http_proxy`,`proxy`,`no_proxy`]),u=Object.entries(process.env).reduce((e,[t,n])=>(t=t.toLowerCase(),l.has(t)&&(e[t]=n),e),{}),d=e=>{e=new URL(e);let t=e.protocol.slice(0,-1);if(c.has(t))return i;if(t===`https`||t===`http`)return[n,r];throw new o(e)},f=(e,t)=>{if(typeof t==`string`&&(t=t.split(`,`).map(e=>e.trim()).filter(Boolean)),!t||!t.length)return!1;let n=e.hostname.split(`.`).reverse();return t.some(e=>{let t=e.split(`.`).filter(Boolean).reverse();if(!t.length)return!1;for(let e=0;e<t.length;e++)if(n[e]!==t[e])return!1;return!0})};t.exports={getProxyAgent:d,getProxy:(e,{proxy:t,noProxy:n})=>(e=new URL(e),t||=e.protocol===`https:`?u.https_proxy:u.https_proxy||u.http_proxy||u.proxy,n||=u.no_proxy,!t||f(e,n)?null:new URL(t)),proxyCache:s}})),nl=s(((e,t)=>{var n=require("net"),r=require("tls"),{once:i}=require("events"),a=require("timers/promises"),{normalizeOptions:o,cacheOptions:s}=Cc(),{getProxy:c,getProxyAgent:l,proxyCache:u}=tl(),d=el(),{Agent:f}=Mc();t.exports=class extends f{#e;#t;#n;#r;#i;constructor(e={}){let{timeouts:t,proxy:n,noProxy:r,...i}=o(e);super(i),this.#e=i,this.#t=t,n&&(this.#n=new URL(n),this.#r=r,this.#i=l(n))}get proxy(){return this.#n?{url:this.#n}:{}}#a(e){if(!this.#n)return;let t=c(`${e.protocol}//${e.host}:${e.port}`,{proxy:this.#n,noProxy:this.#r});if(!t)return;let n=s({...e,...this.#e,timeouts:this.#t,proxy:t});if(u.has(n))return u.get(n);let r=this.#i;Array.isArray(r)&&(r=this.isSecureEndpoint(e)?r[1]:r[0]);let i=new r(t,{...this.#e,socketOptions:{family:this.#e.family}});return u.set(n,i),i}async#o({promises:e,options:t,timeout:n},r=new AbortController){if(n){let i=a.setTimeout(n,null,{signal:r.signal}).then(()=>{throw new d.ConnectionTimeoutError(`${t.host}:${t.port}`)}).catch(e=>{if(e.name!==`AbortError`)throw e});e.push(i)}let i;try{i=await Promise.race(e),r.abort()}catch(e){throw r.abort(),e}return i}async connect(e,t){t.lookup??=this.#e.lookup;let a,o=this.#t.connection,s=this.isSecureEndpoint(t),c=this.#a(t);if(c){let n=Date.now();a=await this.#o({options:t,timeout:o,promises:[c.connect(e,t)]}),o&&(o-=Date.now()-n)}else a=(s?r:n).connect(t);a.setKeepAlive(this.keepAlive,this.keepAliveMsecs),a.setNoDelay(this.keepAlive);let l=new AbortController,{signal:u}=l,f=a[s?`secureConnecting`:`connecting`]?i(a,s?`secureConnect`:`connect`,{signal:u}):Promise.resolve();return await this.#o({options:t,timeout:o,promises:[f,i(a,`error`,{signal:u}).then(e=>{throw e[0]})]},l),this.#t.idle&&a.setTimeout(this.#t.idle,()=>{a.destroy(new d.IdleTimeoutError(`${t.host}:${t.port}`))}),a}addRequest(e,t){let n=this.#a(t);return n?.setRequestProps&&n.setRequestProps(e,t),e.setHeader(`connection`,this.keepAlive?`keep-alive`:`close`),this.#t.response&&(e.once(`finish`,()=>{setTimeout(()=>{e.destroy(new d.ResponseTimeoutError(e,this.#n))},this.#t.response)}),e.once(`response`,()=>{clearTimeout(void 0)})),this.#t.transfer&&e.once(`response`,t=>{setTimeout(()=>{t.destroy(new d.TransferTimeoutError(e,this.#n))},this.#t.transfer),t.once(`close`,()=>{clearTimeout(void 0)})}),super.addRequest(e,t)}}})),rl=s(((e,t)=>{var{LRUCache:n}=zn(),{normalizeOptions:r,cacheOptions:i}=Cc(),{getProxy:a,proxyCache:o}=tl(),s=Sc(),c=nl(),l=new n({max:20});t.exports={getAgent:(e,{agent:t,proxy:n,noProxy:o,...s}={})=>{if(t!=null)return t;e=new URL(e);let u=a(e,{proxy:n,noProxy:o}),d={...r(s),proxy:u},f=i({...d,secureEndpoint:e.protocol===`https:`});if(l.has(f))return l.get(f);let p=new c(d);return l.set(f,p),p},Agent:c,HttpAgent:c,HttpsAgent:c,cache:{proxy:o,agent:l,dns:s.cache,clear:()=>{o.clear(),l.clear(),s.cache.clear()}}}})),il=c({author:()=>pl,default:()=>yl,dependencies:()=>ml,description:()=>sl,devDependencies:()=>hl,engines:()=>gl,files:()=>ll,keywords:()=>fl,license:()=>`ISC`,main:()=>cl,name:()=>al,repository:()=>dl,scripts:()=>ul,tap:()=>_l,templateOSS:()=>vl,version:()=>ol}),al,ol,sl,cl,ll,ul,dl,fl,pl,ml,hl,gl,_l,vl,yl,bl=o((()=>{al=`make-fetch-happen`,ol=`15.0.5`,sl=`Opinionated, caching, retrying fetch client`,cl=`lib/index.js`,ll=[`bin/`,`lib/`],ul={test:`tap`,posttest:`npm run lint`,eslint:`eslint "**/*.{js,cjs,ts,mjs,jsx,tsx}"`,lint:`npm run eslint`,lintfix:`npm run eslint -- --fix`,postlint:`template-oss-check`,snap:`tap`,"template-oss-apply":`template-oss-apply --force`},dl={type:`git`,url:`git+https://github.com/npm/make-fetch-happen.git`},fl=[`http`,`request`,`fetch`,`mean girls`,`caching`,`cache`,`subresource integrity`],pl=`GitHub Inc.`,ml={"@gar/promise-retry":`^1.0.0`,"@npmcli/agent":`^4.0.0`,"@npmcli/redact":`^4.0.0`,cacache:`^20.0.1`,"http-cache-semantics":`^4.1.1`,minipass:`^7.0.2`,"minipass-fetch":`^5.0.0`,"minipass-flush":`^1.0.5`,"minipass-pipeline":`^1.2.4`,negotiator:`^1.0.0`,"proc-log":`^6.0.0`,ssri:`^13.0.0`},hl={"@npmcli/eslint-config":`^5.0.0`,"@npmcli/template-oss":`4.25.0`,nock:`^13.2.4`,"safe-buffer":`^5.2.1`,"standard-version":`^9.3.2`,tap:`^16.0.0`},gl={node:`^20.17.0 || >=22.9.0`},_l={color:1,files:`test/*.js`,"check-coverage":!0,timeout:60,"nyc-arg":[`--exclude`,`tap-snapshots/**`]},vl={"//@npmcli/template-oss":`This file is partially managed by @npmcli/template-oss. Edits may be overwritten.`,version:`4.25.0`,publish:`true`},yl={name:al,version:ol,description:sl,main:cl,files:ll,scripts:ul,repository:dl,keywords:fl,author:pl,license:`ISC`,dependencies:ml,devDependencies:hl,engines:gl,tap:_l,templateOSS:vl}})),xl=s(((e,t)=>{var{Minipass:n}=Ca(),r=Bo(),{promiseRetry:i}=xc(),a=Ss(),{log:o}=is(),{redact:s}=ss(),c=vc(),{getAgent:l}=rl(),u=(bl(),d(il).default),f=`${u.name}/${u.version} (+https://npm.im/${u.name})`,p=[`ECONNRESET`,`ECONNREFUSED`,`EADDRINUSE`,`ETIMEDOUT`,`ECONNECTIONTIMEOUT`,`EIDLETIMEOUT`,`ERESPONSETIMEOUT`,`ETRANSFERTIMEOUT`],m=[`request-timeout`];t.exports=(e,t)=>{let u=l(e.url,{...t,signal:void 0});e.headers.has(`connection`)||e.headers.set(`connection`,u?`keep-alive`:`close`),e.headers.has(`user-agent`)||e.headers.set(`user-agent`,f);let d={...t,agent:u,redirect:`manual`};return i(async(i,l)=>{let u=new r.Request(e,d),f=s(u.url);try{let e=await r(u,d);if(d.integrity&&e.status===200){let t=a.integrityStream({algorithms:d.algorithms,integrity:d.integrity,size:d.size}),n=new c({events:[`integrity`,`size`]},e.body,t);t.on(`integrity`,e=>n.emit(`integrity`,e)),t.on(`size`,e=>n.emit(`size`,e)),e=new r.Response(n,e),e.body.hasIntegrityEmitter=!0}e.headers.set(`x-fetch-attempts`,l);let s=n.isStream(u.body);return u.method!==`POST`&&!s&&([408,420,429].includes(e.status)||e.status>=500)?(typeof t.onRetry==`function`&&t.onRetry(e),o.http(`fetch`,`${u.method} ${f} attempt ${l} failed with ${e.status}`),i(e)):e}catch(e){let n=e.code===`EPROMISERETRY`?e.retried.code:e.code,a=e.retried instanceof r.Response||p.includes(n)&&m.includes(e.type);if(u.method===`POST`||a)throw e;return typeof t.onRetry==`function`&&t.onRetry(e),o.http(`fetch`,`${u.method} ${f} attempt ${l} failed with ${e.code}`),i(e)}},t.retry).catch(e=>{if(e.status>=400&&e.type!==`system`)return e;throw e})}})),Sl=s(((e,t)=>{var{Request:n,Response:r}=Bo(),{Minipass:i}=Ca(),a=Es(),o=_c(),s=require("url"),c=vc(),l=Cs(),u=yc(),d=xl(),f=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),p=[`accept-charset`,`accept-encoding`,`accept-language`,`accept`,`cache-control`],m=[`cache-control`,`content-encoding`,`content-language`,`content-type`,`date`,`etag`,`expires`,`last-modified`,`link`,`location`,`pragma`,`vary`],h=(e,t,n)=>{let r={time:Date.now(),url:e.url,reqHeaders:{},resHeaders:{},options:{compress:n.compress==null?e.compress:n.compress}};t.status!==200&&t.status!==304&&(r.status=t.status);for(let t of p)e.headers.has(t)&&(r.reqHeaders[t]=e.headers.get(t));let i=e.headers.get(`host`),a=new s.URL(e.url);if(i&&a.host!==i&&(r.reqHeaders.host=i),t.headers.has(`vary`)){let n=t.headers.get(`vary`);if(n!==`*`){let t=n.trim().toLowerCase().split(/\s*,\s*/);for(let n of t)e.headers.has(n)&&(r.reqHeaders[n]=e.headers.get(n))}}for(let e of m)t.headers.has(e)&&(r.resHeaders[e]=t.headers.get(e));for(let e of n.cacheAdditionalHeaders)t.headers.has(e)&&(r.resHeaders[e]=t.headers.get(e));return r},g=Symbol(`request`),_=Symbol(`response`),v=Symbol(`policy`);t.exports=class e{constructor({entry:e,request:t,response:n,options:r}){e?(this.key=e.key,this.entry=e,this.entry.metadata.time=this.entry.metadata.time||this.entry.time):this.key=u(t),this.options=r,this[g]=t,this[_]=n,this[v]=null}static async find(t,n){try{var r=await o.index.compact(n.cachePath,u(t),(t,r)=>{let i=new e({entry:t,options:n}),a=new e({entry:r,options:n});return i.policy.satisfies(a.request)},{validateEntry:e=>e.metadata&&e.metadata.resHeaders&&e.metadata.resHeaders[`content-encoding`]===null?!1:e.integrity===null?!!(e.metadata&&e.metadata.status):!0})}catch{return}if(n.cache===`reload`)return;let i;for(let a of r){let r=new e({entry:a,options:n});if(r.policy.satisfies(t)){i=r;break}}return i}static async invalidate(e,t){let n=u(e);try{await o.rm.entry(t.cachePath,n,{removeFully:!0})}catch{}}get request(){return this[g]||(this[g]=new n(this.entry.metadata.url,{method:`GET`,headers:this.entry.metadata.reqHeaders,...this.entry.metadata.options})),this[g]}get response(){return this[_]||(this[_]=new r(null,{url:this.entry.metadata.url,counter:this.options.counter,status:this.entry.metadata.status||200,headers:{...this.entry.metadata.resHeaders,"content-length":this.entry.size}})),this[_]}get policy(){return this[v]||(this[v]=new l({entry:this.entry,request:this.request,response:this.response,options:this.options})),this[v]}async store(e){if(this.request.method!==`GET`||![200,301,308].includes(this.response.status)||!this.policy.storable())return this.response.headers.set(`x-local-cache-status`,`skip`),this.response;let t=this.response.headers.get(`content-length`),n={algorithms:this.options.algorithms,metadata:h(this.request,this.response,this.options),size:t,integrity:this.options.integrity,integrityEmitter:this.response.body.hasIntegrityEmitter&&this.response.body},s=null;if(this.response.status===200){let e,t,r=new Promise((n,r)=>{e=n,t=r}).catch(e=>{s.emit(`error`,e)});s=new c({events:[`integrity`,`size`]},new a({flush(){return r}})),s.hasIntegrityEmitter=!0;let l=()=>{let r=new i,a=o.put.stream(this.options.cachePath,this.key,n);a.on(`integrity`,e=>s.emit(`integrity`,e)),a.on(`size`,e=>s.emit(`size`,e)),r.pipe(a),a.promise().then(e,t),s.unshift(r),s.unshift(this.response.body)};s.once(`resume`,l),s.once(`end`,()=>s.removeListener(`resume`,l))}else await o.index.insert(this.options.cachePath,this.key,null,n);return this.response.headers.set(`x-local-cache`,encodeURIComponent(this.options.cachePath)),this.response.headers.set(`x-local-cache-key`,encodeURIComponent(this.key)),this.response.headers.set(`x-local-cache-mode`,`stream`),this.response.headers.set(`x-local-cache-status`,e),this.response.headers.set(`x-local-cache-time`,new Date().toISOString()),new r(s,{url:this.response.url,status:this.response.status,headers:this.response.headers,counter:this.options.counter})}async respond(t,n,a){let s;if(t===`HEAD`||[301,308].includes(this.response.status))s=this.response;else{let t=new i,a={...this.policy.responseHeaders()},c=()=>{let n=o.get.stream.byDigest(this.options.cachePath,this.entry.integrity,{memoize:this.options.memoize});n.on(`error`,async r=>{n.pause(),r.code===`EINTEGRITY`&&await o.rm.content(this.options.cachePath,this.entry.integrity,{memoize:this.options.memoize}),(r.code===`ENOENT`||r.code===`EINTEGRITY`)&&await e.invalidate(this.request,this.options),t.emit(`error`,r),n.resume()}),t.emit(`integrity`,this.entry.integrity),t.emit(`size`,Number(a[`content-length`])),n.pipe(t)};t.once(`resume`,c),t.once(`end`,()=>t.removeListener(`resume`,c)),s=new r(t,{url:this.entry.metadata.url,counter:n.counter,status:200,headers:a})}return s.headers.set(`x-local-cache`,encodeURIComponent(this.options.cachePath)),s.headers.set(`x-local-cache-hash`,encodeURIComponent(this.entry.integrity)),s.headers.set(`x-local-cache-key`,encodeURIComponent(this.key)),s.headers.set(`x-local-cache-mode`,`stream`),s.headers.set(`x-local-cache-status`,a),s.headers.set(`x-local-cache-time`,new Date(this.entry.metadata.time).toUTCString()),s}async revalidate(t,r){let i=new n(t,{headers:this.policy.revalidationHeaders(t)});try{var a=await d(i,{...r,headers:void 0})}catch(e){if(!this.policy.mustRevalidate)return this.respond(t.method,r,`stale`);throw e}if(this.policy.revalidated(i,a)){let e=h(t,a,r);for(let t of m)!f(e.resHeaders,t)&&f(this.entry.metadata.resHeaders,t)&&(e.resHeaders[t]=this.entry.metadata.resHeaders[t]);for(let t of r.cacheAdditionalHeaders){let n=f(e.resHeaders,t),r=f(this.entry.metadata.resHeaders,t),i=f(this.policy.response.headers,t);!n&&r&&(e.resHeaders[t]=this.entry.metadata.resHeaders[t]),!i&&n&&(this.policy.response.headers[t]=e.resHeaders[t])}try{await o.index.insert(r.cachePath,this.key,this.entry.integrity,{size:this.entry.size,metadata:e})}catch{}return this.respond(t.method,r,`revalidated`)}return new e({request:t,response:a,options:r}).store(`updated`)}}})),Cl=s(((e,t)=>{var{NotCachedError:n}=ws(),r=Sl(),i=xl(),a=async(e,t)=>{let a=await r.find(e,t);if(!a){if(t.cache===`only-if-cached`)throw new n(e.url);return new r({request:e,response:await i(e,t),options:t}).store(`miss`)}if(t.cache===`no-cache`)return a.revalidate(e,t);let o=a.policy.needsRevalidation(e);return t.cache===`force-cache`||t.cache===`only-if-cached`||!o?a.respond(e.method,t,o?`stale`:`hit`):a.revalidate(e,t)};a.invalidate=async(e,t)=>{if(t.cachePath)return r.invalidate(e,t)},t.exports=a})),wl=s(((e,t)=>{var{FetchError:n,Request:r,isRedirect:i}=Bo(),a=require("url"),o=Cs(),s=Cl(),c=xl(),l=(e,t,r)=>{if(!i(t.status)||r.redirect===`manual`)return!1;if(r.redirect===`error`)throw new n(`redirect mode is set to error: ${e.url}`,`no-redirect`,{code:`ENOREDIRECT`});if(!t.headers.has(`location`))throw new n(`redirect location header missing for: ${e.url}`,`no-location`,{code:`EINVALIDREDIRECT`});if(e.counter>=e.follow)throw new n(`maximum redirect reached at: ${e.url}`,`max-redirect`,{code:`EMAXREDIRECT`});return!0},u=(e,t,n)=>{let i={...n},o=t.headers.get(`location`),s=new a.URL(o,/^https?:/.test(o)?void 0:e.url);return new a.URL(e.url).hostname!==s.hostname&&(e.headers.delete(`authorization`),e.headers.delete(`cookie`)),(t.status===303||e.method===`POST`&&[301,302].includes(t.status))&&(i.method=`GET`,i.body=null,e.headers.delete(`content-length`)),i.headers={},e.headers.forEach((e,t)=>{i.headers[t]=e}),i.counter=++e.counter,{request:new r(a.format(s),i),options:i}},d=async(e,t)=>{let n=o.storable(e,t)?await s(e,t):await c(e,t);if(![`GET`,`HEAD`].includes(e.method)&&n.status>=200&&n.status<=399&&await s.invalidate(e,t),!l(e,n,t))return n;let r=u(e,n,t);return d(r.request,r.options)};t.exports=d})),Tl=s(((e,t)=>{var{FetchError:n,Headers:r,Request:i,Response:a}=Bo(),o=hs(),s=wl(),c=(e,t)=>{let n=o(t);return s(new i(e,n),n)};c.defaults=(e,t={},n=c)=>{typeof e==`object`&&(t=e,e=null);let r=(r,i={})=>n(r||e,{...t,...i,headers:{...t.headers,...i.headers}});return r.defaults=(e,t={})=>c.defaults(e,t,r),r},t.exports=c,t.exports.FetchError=n,t.exports.Headers=r,t.exports.Request=i,t.exports.Response=a})),El=s(((e,t)=>{var n={},r=n.LEFT_BRACE=1,i=n.RIGHT_BRACE=2,a=n.LEFT_BRACKET=3,o=n.RIGHT_BRACKET=4,s=n.COLON=5,c=n.COMMA=6,l=n.TRUE=7,u=n.FALSE=8,d=n.NULL=9,f=n.STRING=10,p=n.NUMBER=11,m=n.START=17,h=n.STOP=18,g=n.TRUE1=33,_=n.TRUE2=34,v=n.TRUE3=35,y=n.FALSE1=49,b=n.FALSE2=50,x=n.FALSE3=51,S=n.FALSE4=52,C=n.NULL1=65,w=n.NULL2=66,T=n.NULL3=67,E=n.NUMBER1=81,D=n.NUMBER3=83,O=n.STRING1=97,k=n.STRING2=98,A=n.STRING3=99,j=n.STRING4=100,M=n.STRING5=101,ee=n.STRING6=102,N=n.VALUE=113,P=n.KEY=114,F=n.OBJECT=129,I=n.ARRAY=130,L=92,R=47,te=8,z=12,B=10,V=13,ne=9,H=64*1024;function U(){this.tState=m,this.value=void 0,this.string=void 0,this.stringBuffer=Buffer.alloc?Buffer.alloc(H):new Buffer(H),this.stringBufferOffset=0,this.unicode=void 0,this.highSurrogate=void 0,this.key=void 0,this.mode=void 0,this.stack=[],this.state=N,this.bytes_remaining=0,this.bytes_in_sequence=0,this.temp_buffs={2:new Buffer(2),3:new Buffer(3),4:new Buffer(4)},this.offset=-1}U.toknam=function(e){for(var t=Object.keys(n),r=0,i=t.length;r<i;r++){var a=t[r];if(n[a]===e)return a}return e&&`0x`+e.toString(16)};var W=U.prototype;W.onError=function(e){throw e},W.charError=function(e,t){this.tState=h,this.onError(Error(`Unexpected `+JSON.stringify(String.fromCharCode(e[t]))+` at position `+t+` in state `+U.toknam(this.tState)))},W.appendStringChar=function(e){this.stringBufferOffset>=H&&(this.string+=this.stringBuffer.toString(`utf8`),this.stringBufferOffset=0),this.stringBuffer[this.stringBufferOffset++]=e},W.appendStringBuf=function(e,t,n){var r=e.length;typeof t==`number`&&(r=typeof n==`number`?n<0?e.length-t+n:n-t:e.length-t),r<0&&(r=0),this.stringBufferOffset+r>H&&(this.string+=this.stringBuffer.toString(`utf8`,0,this.stringBufferOffset),this.stringBufferOffset=0),e.copy(this.stringBuffer,this.stringBufferOffset,t,n),this.stringBufferOffset+=r},W.write=function(e){typeof e==`string`&&(e=new Buffer(e));for(var t,n=0,h=e.length;n<h;n++)if(this.tState===m){if(t=e[n],this.offset++,t===123)this.onToken(r,`{`);else if(t===125)this.onToken(i,`}`);else if(t===91)this.onToken(a,`[`);else if(t===93)this.onToken(o,`]`);else if(t===58)this.onToken(s,`:`);else if(t===44)this.onToken(c,`,`);else if(t===116)this.tState=g;else if(t===102)this.tState=y;else if(t===110)this.tState=C;else if(t===34)this.string=``,this.stringBufferOffset=0,this.tState=O;else if(t===45)this.string=`-`,this.tState=E;else if(t>=48&&t<64)this.string=String.fromCharCode(t),this.tState=D;else if(!(t===32||t===9||t===10||t===13))return this.charError(e,n)}else if(this.tState===O)if(t=e[n],this.bytes_remaining>0){for(var N=0;N<this.bytes_remaining;N++)this.temp_buffs[this.bytes_in_sequence][this.bytes_in_sequence-this.bytes_remaining+N]=e[N];this.appendStringBuf(this.temp_buffs[this.bytes_in_sequence]),this.bytes_in_sequence=this.bytes_remaining=0,n=n+N-1}else if(this.bytes_remaining===0&&t>=128){if(t<=193||t>244)return this.onError(Error(`Invalid UTF-8 character at position `+n+` in state `+U.toknam(this.tState)));if(t>=194&&t<=223&&(this.bytes_in_sequence=2),t>=224&&t<=239&&(this.bytes_in_sequence=3),t>=240&&t<=244&&(this.bytes_in_sequence=4),this.bytes_in_sequence+n>e.length){for(var P=0;P<=e.length-1-n;P++)this.temp_buffs[this.bytes_in_sequence][P]=e[n+P];this.bytes_remaining=n+this.bytes_in_sequence-e.length,n=e.length-1}else this.appendStringBuf(e,n,n+this.bytes_in_sequence),n=n+this.bytes_in_sequence-1}else if(t===34)this.tState=m,this.string+=this.stringBuffer.toString(`utf8`,0,this.stringBufferOffset),this.stringBufferOffset=0,this.onToken(f,this.string),this.offset+=Buffer.byteLength(this.string,`utf8`)+1,this.string=void 0;else if(t===92)this.tState=k;else if(t>=32)this.appendStringChar(t);else return this.charError(e,n);else if(this.tState===k)if(t=e[n],t===34)this.appendStringChar(t),this.tState=O;else if(t===92)this.appendStringChar(L),this.tState=O;else if(t===47)this.appendStringChar(R),this.tState=O;else if(t===98)this.appendStringChar(te),this.tState=O;else if(t===102)this.appendStringChar(z),this.tState=O;else if(t===110)this.appendStringChar(B),this.tState=O;else if(t===114)this.appendStringChar(V),this.tState=O;else if(t===116)this.appendStringChar(ne),this.tState=O;else if(t===117)this.unicode=``,this.tState=A;else return this.charError(e,n);else if(this.tState===A||this.tState===j||this.tState===M||this.tState===ee)if(t=e[n],t>=48&&t<64||t>64&&t<=70||t>96&&t<=102){if(this.unicode+=String.fromCharCode(t),this.tState++===ee){var F=parseInt(this.unicode,16);this.unicode=void 0,this.highSurrogate!==void 0&&F>=56320&&F<57344?(this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate,F))),this.highSurrogate=void 0):this.highSurrogate===void 0&&F>=55296&&F<56320?this.highSurrogate=F:(this.highSurrogate!==void 0&&(this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate))),this.highSurrogate=void 0),this.appendStringBuf(new Buffer(String.fromCharCode(F)))),this.tState=O}}else return this.charError(e,n);else if(this.tState===E||this.tState===D)switch(t=e[n],t){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 46:case 101:case 69:case 43:case 45:this.string+=String.fromCharCode(t),this.tState=D;break;default:this.tState=m;var I=Number(this.string);if(isNaN(I))return this.charError(e,n);this.string.match(/[0-9]+/)==this.string&&I.toString()!=this.string?this.onToken(f,this.string):this.onToken(p,I),this.offset+=this.string.length-1,this.string=void 0,n--;break}else if(this.tState===g)if(e[n]===114)this.tState=_;else return this.charError(e,n);else if(this.tState===_)if(e[n]===117)this.tState=v;else return this.charError(e,n);else if(this.tState===v)if(e[n]===101)this.tState=m,this.onToken(l,!0),this.offset+=3;else return this.charError(e,n);else if(this.tState===y)if(e[n]===97)this.tState=b;else return this.charError(e,n);else if(this.tState===b)if(e[n]===108)this.tState=x;else return this.charError(e,n);else if(this.tState===x)if(e[n]===115)this.tState=S;else return this.charError(e,n);else if(this.tState===S)if(e[n]===101)this.tState=m,this.onToken(u,!1),this.offset+=4;else return this.charError(e,n);else if(this.tState===C)if(e[n]===117)this.tState=w;else return this.charError(e,n);else if(this.tState===w)if(e[n]===108)this.tState=T;else return this.charError(e,n);else if(this.tState===T)if(e[n]===108)this.tState=m,this.onToken(d,null),this.offset+=3;else return this.charError(e,n)},W.onToken=function(e,t){},W.parseError=function(e,t){this.tState=h,this.onError(Error(`Unexpected `+U.toknam(e)+(t?`(`+JSON.stringify(t)+`)`:``)+` in state `+U.toknam(this.state)))},W.push=function(){this.stack.push({value:this.value,key:this.key,mode:this.mode})},W.pop=function(){var e=this.value,t=this.stack.pop();this.value=t.value,this.key=t.key,this.mode=t.mode,this.emit(e),this.mode||(this.state=N)},W.emit=function(e){this.mode&&(this.state=c),this.onValue(e)},W.onValue=function(e){},W.onToken=function(e,t){if(this.state===N)if(e===f||e===p||e===l||e===u||e===d)this.value&&(this.value[this.key]=t),this.emit(t);else if(e===r)this.push(),this.value?this.value=this.value[this.key]={}:this.value={},this.key=void 0,this.state=P,this.mode=F;else if(e===a)this.push(),this.value?this.value=this.value[this.key]=[]:this.value=[],this.key=0,this.mode=I,this.state=N;else if(e===i)if(this.mode===F)this.pop();else return this.parseError(e,t);else if(e===o)if(this.mode===I)this.pop();else return this.parseError(e,t);else return this.parseError(e,t);else if(this.state===P)if(e===f)this.key=t,this.state=s;else if(e===i)this.pop();else return this.parseError(e,t);else if(this.state===s)if(e===s)this.state=N;else return this.parseError(e,t);else if(this.state===c)if(e===c)this.mode===I?(this.key++,this.state=N):this.mode===F&&(this.state=P);else if(e===o&&this.mode===I||e===i&&this.mode===F)this.pop();else return this.parseError(e,t);else return this.parseError(e,t)},U.C=n,t.exports=U})),Dl=s(((e,t)=>{var n=El(),{Minipass:r}=Ca(),i=class extends Error{constructor(e,t){super(e.message),Error.captureStackTrace(this,t||this.constructor)}get name(){return`JSONStreamError`}},a=(e,t)=>typeof e==`string`?String(t)===e:e&&typeof e.test==`function`?e.test(t):typeof e==`boolean`||typeof e==`object`?e:typeof e==`function`?e(t):!1;t.exports=class e extends r{#e=0;#t=!1;#n=null;#r=null;#i=null;#a;#o;#s=null;#c=null;constructor(e){super({...e,objectMode:!0});let t=this.#o=new n;t.onValue=e=>this.#f(e),this.#a=t.onToken,t.onToken=(e,t)=>this.#d(e,t),t.onError=e=>this.#u(e),this.#s=typeof e.path==`string`?e.path.split(`.`).map(e=>e===`$*`?{emitKey:!0}:e===`*`?!0:e===``?{recurse:!0}:e):Array.isArray(e.path)&&e.path.length?e.path:null,typeof e.map==`function`&&(this.#i=e.map)}#l(e,t){this.#r!==!1&&(this.#r=this.#r||{},this.#r[e]=t),this.#n!==!1&&this.#r===!1&&(this.#n=this.#n||{},this.#n[e]=t)}#u(e){let t=this.#t?this.end:this.write;return this.#t=!1,this.emit(`error`,new i(e,t))}#d(e,t){let n=this.#o;if(this.#a.call(this.#o,e,t),n.stack.length===0&&this.#c){let e=this.#c;this.#s||super.write(e),this.#c=null,this.#e=0}}#f(e){let t=this.#o;if(this.#c=e,!this.#s)return;let n=0,r=0,i=!1;for(;n<this.#s.length;){let o=this.#s[n];if(r++,o&&!o.recurse){let s=r===t.stack.length?t:t.stack[r];if(!s)return;if(!a(o,s.key)){this.#l(s.key,e);return}i=!!o.emitKey,n++}else{if(n++,n>=this.#s.length)return;let i=this.#s[n];if(!i)return;for(;;){let o=r===t.stack.length?t:t.stack[r];if(!o)return;if(a(i,o.key)){n++,Object.isFrozen(t.stack[r])||(t.stack[r].value=null);break}else this.#l(o.key,e);r++}}}if(this.#r){let e=this.#r;this.#r=!1,this.emit(`header`,e)}if(r!==t.stack.length)return;this.#e++;let o=t.stack.slice(1).map(e=>e.key).concat([t.key]);if(e!=null){let n=this.#i?this.#i(e,o):e;if(n!=null){let e=i?{value:n}:n;i&&(e.key=t.key),super.write(e)}}t.value&&delete t.value[t.key];for(let e of t.stack)e.value=null}write(e,t){if(typeof e==`string`)e=Buffer.from(e,t);else if(!Buffer.isBuffer(e))return this.emit(`error`,TypeError(`Can only parse JSON from string or buffer input`));return this.#o.write(e),this.flowing}end(e,t){this.#t=!0,e&&this.write(e,t);let n=this.#r;this.#r=null;let r=this.#n;return this.#n=null,n&&this.emit(`header`,n),r&&this.emit(`footer`,r),super.end()}static get JSONStreamError(){return i}static parse(t,n){return new e({path:t,map:n})}}})),Ol=s(((e,t)=>{var{HttpErrorAuthOTP:n}=Sa(),r=cs(),i=ms(),a=Tl(),o=Dl(),s=ps(),c=require("querystring"),l=require("url"),u=Ta(),{Minipass:d}=Ca(),f=rs(),p=e=>{try{return!!new l.URL(e)}catch{return!1}};t.exports=m;function m(e,t={}){let o={...f,...t},s=p(e),h=o.registry||f.registry;s||(h=o.registry=o.spec&&_(o.spec,o)||o.registry||h,e=`${h.trim().replace(/\/?$/g,``)}/${e.trim().replace(/^\//,``)}`,new l.URL(e));let g=o.method||`GET`,b=Date.now(),x=i(e,o),S=y(e,x,o),C=o.body,w=d.isStream(C),T=C&&typeof C==`object`&&typeof C.then==`function`;if(C&&!w&&!T&&typeof C!=`string`&&!Buffer.isBuffer(C)?(S[`content-type`]=S[`content-type`]||`application/json`,C=JSON.stringify(C)):C&&!S[`content-type`]&&(S[`content-type`]=`application/octet-stream`),o.gzip)if(S[`content-encoding`]=`gzip`,w){let e=new u.Gzip;C.on(`error`,t=>e.emit(`error`,t)),C=C.pipe(e)}else T||(C=new u.Gzip().end(C).concat());let E=new l.URL(e);if(o.query){let t=typeof o.query==`string`?c.parse(o.query):o.query;Object.keys(t).forEach(e=>{t[e]!==void 0&&E.searchParams.set(e,t[e])}),e=l.format(E)}return E.searchParams.get(`write`)===`true`&&g===`GET`&&(o.offline=!1,o.preferOffline=!1,o.preferOnline=!0),Promise.resolve(C).then(async t=>{let i=a(e,{agent:o.agent,algorithms:o.algorithms,body:t,cache:v(o),cachePath:o.cache,ca:o.ca,cert:x.cert||o.cert,headers:S,integrity:o.integrity,key:x.key||o.key,localAddress:o.localAddress,maxSockets:o.maxSockets,memoize:o.memoize,method:g,noProxy:o.noProxy,proxy:o.httpsProxy||o.proxy,retry:o.retry?o.retry:{retries:o.fetchRetries,factor:o.fetchRetryFactor,minTimeout:o.fetchRetryMintimeout,maxTimeout:o.fetchRetryMaxtimeout},strictSSL:o.strictSSL,timeout:o.timeout||30*1e3,signal:o.signal}).then(t=>r({method:g,uri:e,res:t,registry:h,startTime:b,auth:x,opts:o}));return typeof o.otpPrompt==`function`?i.catch(async t=>{if(t instanceof n){let n;try{n=await o.otpPrompt()}catch{}if(!n)throw t;return m(e,{...o,otp:n})}throw t}):i})}t.exports.getAuth=i,t.exports.json=h;function h(e,t){return m(e,t).then(e=>e.json())}t.exports.json.stream=g;function g(e,t,n={}){let r={...f,...n},i=o.parse(t,r.mapJSON);return m(e,r).then(e=>e.body.on(`error`,e=>i.emit(`error`,e)).pipe(i)).catch(e=>i.emit(`error`,e)),i}t.exports.pickRegistry=_;function _(e,t={}){e=s(e);let n=e.scope&&t[e.scope.replace(/^@?/,`@`)+`:registry`];return!n&&t.scope&&(n=t[t.scope.replace(/^@?/,`@`)+`:registry`]),n||=t.registry||f.registry,n}function v(e){return e.offline?`only-if-cached`:e.preferOffline?`force-cache`:e.preferOnline?`no-cache`:`default`}function y(e,t,n){let r=Object.assign({"user-agent":n.userAgent},n.headers||{});return n.authType&&(r[`npm-auth-type`]=n.authType),n.scope&&(r[`npm-scope`]=n.scope),n.npmSession&&(r[`npm-session`]=n.npmSession),n.npmCommand&&(r[`npm-command`]=n.npmCommand),t.token?r.authorization=`Bearer ${t.token}`:t.auth&&(r.authorization=`Basic ${t.auth}`),n.otp&&(r[`npm-otp`]=n.otp),r}})),kl=u(ba(),1),Al=u(xa(),1),jl=u(Ol(),1),Ml,Nl;function Pl(e){if(typeof e!=`string`)throw TypeError(`Expected a string, got ${typeof e}`);if(Ml===void 0&&(Ml=v.default.homedir()),Ml&&/^~(?=$|\/|\\)/.test(e))return e.replace(/^~/,Ml);let t=e.match(/^~([^/\\]+)(.*)/);if(t&&(Nl===void 0&&(Nl=v.default.userInfo().username),Nl)){let e=t[1],n=t[2];if(e===Nl)return Ml+n}return e}var Fl=class{value;next;constructor(e){this.value=e}},Il=class{#e;#t;#n;constructor(){this.clear()}enqueue(e){let t=new Fl(e);this.#e?(this.#t.next=t,this.#t=t):(this.#e=t,this.#t=t),this.#n++}dequeue(){let e=this.#e;if(e)return this.#e=this.#e.next,this.#n--,this.#e||(this.#t=void 0),e.value}peek(){if(this.#e)return this.#e.value}clear(){this.#e=void 0,this.#t=void 0,this.#n=0}get size(){return this.#n}*[Symbol.iterator](){let e=this.#e;for(;e;)yield e.value,e=e.next}*drain(){for(;this.#e;)yield this.dequeue()}};function Ll(e){if(!((Number.isInteger(e)||e===1/0)&&e>0))throw TypeError("Expected `concurrency` to be a number from 1 and up");let t=new Il,n=0,r=()=>{n--,t.size>0&&t.dequeue()()},i=async(e,t,i)=>{n++;let a=(async()=>e(...i))();t(a);try{await a}catch{}r()},a=(r,a,o)=>{t.enqueue(i.bind(void 0,r,a,o)),(async()=>{await Promise.resolve(),n<e&&t.size>0&&t.dequeue()()})()},o=(e,...t)=>new Promise(n=>{a(e,n,t)});return Object.defineProperties(o,{activeCount:{get:()=>n},pendingCount:{get:()=>t.size},clearQueue:{value:()=>{t.clear()}}}),o}var Rl=class extends Error{constructor(e){super(),this.value=e}},zl=async(e,t)=>t(await e),Bl=async e=>{let t=await Promise.all(e);if(t[1]===!0)throw new Rl(t[0]);return!1};async function Vl(e,t,{concurrency:n=1/0,preserveOrder:r=!0}={}){let i=Ll(n),a=[...e].map(e=>[e,i(zl,e,t)]),o=Ll(r?1:1/0);try{await Promise.all(a.map(e=>o(Bl,e)))}catch(e){if(e instanceof Rl)return e.value;throw e}}var Hl={directory:`isDirectory`,file:`isFile`};function Ul(e){if(!(e===`both`||Object.hasOwn(Hl,e)))throw Error(`Invalid type specified: ${e}`)}var Wl=(e,t)=>e===`both`?t.isFile()||t.isDirectory():t[Hl[e]](),Gl=e=>e instanceof URL?(0,C.fileURLToPath)(e):e;async function Kl(e,{cwd:t=_.default.cwd(),type:n=`file`,allowSymlinks:r=!0,concurrency:i,preserveOrder:a}={}){Ul(n),t=Gl(t);let o=r?T.promises.stat:T.promises.lstat;return Vl(e,async e=>{try{return Wl(n,await o(S.default.resolve(t,e)))}catch{return!1}},{concurrency:i,preserveOrder:a})}function ql(e,{cwd:t=_.default.cwd(),type:n=`file`,allowSymlinks:r=!0}={}){Ul(n),t=Gl(t);let i=r?T.default.statSync:T.default.lstatSync;for(let r of e)try{let e=i(S.default.resolve(t,r),{throwIfNoEntry:!1});if(!e)continue;if(Wl(n,e))return r}catch{}}(0,w.promisify)(E.execFile);function Jl(e){return e instanceof URL?(0,C.fileURLToPath)(e):e}var Yl=Symbol(`findUpStop`);async function Xl(e,t={}){let n=S.default.resolve(Jl(t.cwd)??``),{root:r}=S.default.parse(n),i=S.default.resolve(n,Jl(t.stopAt)??r),a=t.limit??1/0,o=[e].flat(),s=async t=>{if(typeof e!=`function`)return Kl(o,t);let n=await e(t.cwd);return typeof n==`string`?Kl([n],t):n},c=[];for(;;){let e=await s({...t,cwd:n});if(e===Yl||(e&&c.push(S.default.resolve(n,e)),n===i||c.length>=a))break;n=S.default.dirname(n)}return c}function Zl(e,t={}){let n=S.default.resolve(Jl(t.cwd)??``),{root:r}=S.default.parse(n),i=S.default.resolve(n,Jl(t.stopAt)??r),a=t.limit??1/0,o=[e].flat(),s=t=>{if(typeof e!=`function`)return ql(o,t);let n=e(t.cwd);return typeof n==`string`?ql([n],t):n},c=[];for(;;){let e=s({...t,cwd:n});if(e===Yl||(e&&c.push(S.default.resolve(n,e)),n===i||c.length>=a))break;n=S.default.dirname(n)}return c}async function Ql(e,t={}){return(await Xl(e,{...t,limit:1}))[0]}function $l(e,t={}){return Zl(e,{...t,limit:1})[0]}var eu=class e{constructor(e,t,n){this.__specs=e||{},this.__opts=t||{},this.__providers=au(n.filter(e=>typeof e==`object`&&!!e)),this.__isFiggyPudding=!0}get(e){return tu(this,e,!0)}toJSON(){let e={};return this.forEach((t,n)=>{e[n]=t}),e}forEach(e,t=this){for(let[n,r]of this.entries())e.call(t,r,n,this)}*entries(e){for(let e of Object.keys(this.__specs))yield[e,this.get(e)];let t=e||this.__opts.other;if(t){let e=new Set;for(let n of this.__providers){let r=n.entries?n.entries(t):ou(n);for(let[n,i]of r)t(n)&&!e.has(n)&&(e.add(n),yield[n,i])}}}concat(...t){return new Proxy(new e(this.__specs,this.__opts,au(this.__providers).concat(t)),ru)}};function tu(e,t,n){let r=e.__specs[t];r||={};let i;for(let n of e.__providers)if(i=nu(t,n),i!==void 0)break;return i===void 0&&r.default!==void 0?typeof r.default==`function`?r.default(e):r.default:i}function nu(e,t){let n;return n=t.__isFiggyPudding?tu(t,e,!1):t[e],n}var ru={get(e,t){return typeof t==`symbol`||t.slice(0,2)===`__`||t in eu.prototype?e[t]:e.get(t)}};function iu(e,t){function n(...n){return new Proxy(new eu(e,t,n),ru)}return n}function au(e){let t=[];return e.forEach(e=>t.unshift(e)),t}function ou(e){return Object.keys(e).map(t=>[t,e[t]])}var su=iu({},{other(){return!0}}),cu=iu({cache:{default:S.default.join(process.env.HOME||v.default.homedir(),`.npm`)},configNames:{default:[`npmrc`,`.npmrc`]},envPrefix:{default:/^npm_config_/i},cwd:{default:()=>process.cwd()},globalconfig:{default:()=>S.default.join(du(),`etc`,`npmrc`)},userconfig:{default:S.default.join(process.env.HOME||v.default.homedir(),`.npmrc`)}});function lu(e,t){let n=cu(t),r={};Object.keys(process.env).forEach(e=>{if(!e.match(n.envPrefix))return;let t=e.toLowerCase().replace(n.envPrefix,``).replace(/(?!^)_/g,`-`);r[t]=process.env[e]});let i=su(e),a=n.userconfig||i.userconfig||r.userconfig,o=a&&uu(a),s=n.globalconfig||i.globalconfig||r.globalconfig,c=s&&uu(s),l=$l(n.configNames,{cwd:n.cwd}),u={};l&&l!==a&&(u=uu(l));let d=su(n,c,o,u,r,i);return d.cache?d.concat({cache:S.default.resolve(i.cache||r.cache?n.cwd:u.cache?S.default.dirname(l):o.cache?S.default.dirname(a):c.cache?S.default.dirname(s):S.default.dirname(a),d.cache)}):d}function uu(e){let t;try{t=T.default.readFileSync(e,`utf8`)}catch(e){if(e.code===`ENOENT`)return``;throw e}return Al.default.parse(t)}function du(){if(process.env.PREFIX)return process.env.PREFIX;if(process.platform===`win32`)return S.default.dirname(process.execPath);{let e=S.default.dirname(S.default.dirname(process.execPath));return process.env.DESTDIR&&(e=S.default.join(process.env.DESTDIR,e)),e}}var fu=(e,t=process.platform)=>t===`win32`&&e!==`bun`?[`${e}.cmd`,e]:[e];async function pu(e,t,n,r){let i=fu(e);for(let[e,a]of i.entries())try{return await(0,Wi.default)(a,t,n,r)}catch(t){if(t.code!==`ENOENT`||e===i.length-1)throw t}throw Error(`No spawn commands available for ${e}`)}function mu(e,t){return t.deprecated||!e.deprecated}function hu(e,t){return t.pre?!0:!e.version||!Tr(e.version)}function gu(e,t){if(!t)return!0;let n=q.default.minVersion(t)?.version;if(!n)return!0;let r=e?.engines?.node;return!r||q.default.satisfies(n,r)}function _u(e,t){return t?Object.values(t).every(t=>t[e.name]===void 0||q.default.satisfies(e.version,t[e.name])):!0}var vu=(e,t,n,r)=>{if(!t)return!1;if(!r||!n)return!0;let i=new Date(n),a=typeof r==`function`?r(e??``)??0:r,o=typeof a==`string`?ui(a)??0:a;return Date.now()-i.getTime()>=o*864e5};function yu(e){let t=[t=>mu(t,e),t=>hu(t,e),e.enginesNode?t=>gu(t,e.nodeEngineVersion):null,e.peerDependencies?t=>_u(t,e.peerDependencies):null];return e=>t.every(t=>t?t(e):!0)}var bu=c({default:()=>Fu,defaultPrefix:()=>Iu,distTag:()=>Vu,getEngines:()=>zu,getPeerDependencies:()=>Ru,greatest:()=>Lu,latest:()=>Hu,list:()=>Bu,minor:()=>Wu,newest:()=>Uu,normalizeNpmConfig:()=>Du,npmApi:()=>Ou,packageAuthorChanged:()=>ju,parseJson:()=>Au,patch:()=>Gu,semver:()=>Ku}),xu=new Set([`-`,`||`,`&&`,`<`,`<=`,`>`,`>=`]),Su=e=>(0,$n.parseRange)(e).some(e=>xu.has(e.operator||``)),Cu=e=>e&&(!q.default.validRange(e)||mr(e)),wu=async(e,t,n,r={},i)=>{let a=jl.default.pickRegistry(e,r),o={"user-agent":r.userAgent||`npm-check-updates/${ge.version} node/${process.version}`,"ncu-version":ge.version,"ncu-pkg-id":`registry:${e}`,accept:r.fullMetadata?`application/json`:`application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*`,...r.headers},s=new URL(encodeURIComponent(e),a.endsWith(`/`)?a:`${a}/`);i&&(s.pathname+=`/${i}`);let c={...r,headers:o,spec:e};try{if(r.fullMetadata)return jl.default.json(s.href,c);{n||=`latest`;let r=await(0,jl.default)(s.href,c),i=new oa({paths:[`$.*`],keepStack:!1}),a={name:e},o=!1,l=null;i.onValue=({key:e,value:n})=>{if(o||e===void 0)return;let r=e;t.includes(r)&&(a[r]=n,Object.keys(a).length===t.length+1&&(o=!0))},i.onError=e=>{l=e};for await(let e of r.body){if(i.write(e),l)throw l;if(o)break}return a}}catch(a){if(a.code!==`E404`||r.fullMetadata)throw a;return wu(e,t,n,{...r,fullMetadata:!0},i)}},Tu=({packageName:e,currentVersion:t,options:n,versions:r,time:i,filter:a=()=>!0,compare:o=xr})=>{let s=yu(n),c=q.default.validRange(t)?q.default.minVersion(t)?.version:null;if(!c)return{targetVersion:null,fallbackVersion:null,targetBlockedByCooldown:!1};let l=!vu(e,c,i?.[c],n.cooldown),u=r.reduce((t,r)=>{let c=r.version;if(!c||o(c,t.fallbackVersion)<=0||!s({...r,name:e})||!a?.(c))return t;let l=i?.[c],u=n.cooldown?vu(e,c,l,n.cooldown):!0;return o(c,t.targetVersion)>0&&(t.targetVersion=c,t.targetBlockedByCooldown=!u),u&&(t.fallbackVersion=c),t},{targetVersion:c,fallbackVersion:c,targetBlockedByCooldown:l}),d=u.targetVersion,f=u.fallbackVersion;return f===u.targetVersion&&(f=null),f&&!q.default.gt(f,c)&&(f=null),l&&d===c&&(u.targetBlockedByCooldown=!1),{...u,targetVersion:d,fallbackVersion:f}},Eu=({packageName:e,currentVersion:t,options:n,time:r,targetVersion:i,fallbackVersion:a,targetBlockedByCooldown:o})=>{let s={version:i,...i&&r?.[i]?{time:r[i]}:null};if(n.cooldown&&i&&o){let n=q.default.validRange(t)?q.default.minVersion(t)?.version:null,i={name:e,currentVersion:t,...n?{currentVersionTime:r?.[n]}:null,...s};if(a){let e=r?.[a];return i.fallbackVersion=a,{version:a,...e?{time:e}:null,cooldownInfo:i}}return{cooldownInfo:i}}return s},Du=(e,t)=>{let n={cafile:e=>{if(!e)return;let n=p.default.readFileSync(f.default.resolve(t||``,Pl(e)),`utf8`),r=`-----END CERTIFICATE-----`;return{ca:n.split(r).filter(e=>!!e.trim()).map(e=>`${e.trimStart()}${r}`)}},maxsockets:`maxSockets`,"strict-ssl":`strictSSL`},r={all:`boolean`,allowsameversion:`boolean`,audit:`boolean`,binlinks:`boolean`,color:`boolean`,commithooks:`boolean`,description:`boolean`,dev:`boolean`,diffignoreallspace:`boolean`,diffnameonly:`boolean`,diffnoprefix:`boolean`,difftext:`boolean`,dryrun:`boolean`,enginestrict:`boolean`,force:`boolean`,foregroundscripts:`boolean`,formatpackagelock:`boolean`,fund:`boolean`,gittagversion:`boolean`,global:`boolean`,globalstyle:`boolean`,ifpresent:`boolean`,ignorescripts:`boolean`,includestaged:`boolean`,includeworkspaceroot:`boolean`,installlinks:`boolean`,json:`boolean`,legacybundling:`boolean`,legacypeerdeps:`boolean`,link:`boolean`,long:`boolean`,offline:`boolean`,omitlockfileregistryresolved:`boolean`,packagelock:`boolean`,packagelockonly:`boolean`,parseable:`boolean`,preferoffline:`boolean`,preferonline:`boolean`,progress:`boolean`,readonly:`boolean`,rebuildbundle:`boolean`,save:`boolean`,savebundle:`boolean`,savedev:`boolean`,saveexact:`boolean`,saveoptional:`boolean`,savepeer:`boolean`,saveprod:`boolean`,shrinkwrap:`boolean`,signgitcommit:`boolean`,signgittag:`boolean`,strictpeerdeps:`boolean`,strictssl:`boolean`,timing:`boolean`,unicode:`boolean`,updatenotifier:`boolean`,usage:`boolean`,version:`boolean`,versions:`boolean`,workspacesupdate:`boolean`,diffunified:`number`,fetchretries:`number`,fetchretryfactor:`number`,fetchretrymaxtimeout:`number`,fetchretrymintimeout:`number`,fetchtimeout:`number`,logsmax:`number`,maxsockets:`number`,searchlimit:`number`,searchstaleness:`number`,ssopollfrequency:`number`,timeout:`number`},i=e=>!!e&&e!==`false`&&e!==`0`,a=e=>parseInt(e)||0;return Dn(e,(e,t)=>{let o=typeof t==`string`?r[e.replace(/-/g,``).toLowerCase()]===`boolean`?i(t):r[e.replace(/-/g,``).toLowerCase()]===`number`?a(t):t.replace(/\${([^}]+)}/,(e,t)=>process.env[t]):t,{[e]:s}=n;return typeof s==`string`?{[s]:o}:typeof s==`function`?{...s(o.toString())}:{[e.match(/^[a-z]/i)?ya(e):e]:o}})},Ou={};Ou.findNpmConfig=(0,kl.default)(e=>{let t;if(e)try{t=Al.default.parse(p.default.readFileSync(e,`utf-8`))}catch(e){if(e.code===`ENOENT`)return null;throw e}else t={...lu(null,{userconfig:process.env.npm_config_userconfig||process.env.NPM_CONFIG_USERCONFIG}).toJSON(),cache:!1};return Du(t,e)});var ku=Ou.findNpmConfig();function Au(e,t){let n;try{n=JSON.parse(e)}catch(n){throw Error(`Expected JSON from "${t.command}".${t.packageName?` There could be problems with the ${t.packageName} package.`:``} ${e?`Instead received: `+e:`Received empty response.`}`,{cause:n})}return n}async function ju(e,t,n,r={},i){let a=await wu(e,[`versions`],null,{...i,...ku,fullMetadata:!0,...r.registry?{registry:r.registry,silent:!0}:null});if(a.versions){let e=Object.keys(a.versions),r=q.default.minSatisfying(e,t),i=q.default.maxSatisfying(e,n);if(r&&i&&a.versions[r]._npmUser&&a.versions[i]._npmUser)return a.versions[r]._npmUser?.name!==a.versions[i]._npmUser?.name}return!1}var Mu=e=>!!(e&&(e.name||e.engines||e.version||e.versions));Ou.mockFetchUpgradedPackument=e=>(t,n,r,i)=>{let a=typeof e==`function`?e(i)?.[t]:typeof e==`string`||Mu(e)?e:e[t],o=Mu(a)?a.version:a;if(!o)throw Error(`fetchUpgradedPackument is mocked, but no mock version was supplied for ${t}. Make sure that all dependencies are mocked. `);let s=Mu(a)&&a.time?a.time?.[o]:new Date().toISOString(),c={name:t,"dist-tags":{[i.distTag||`latest`]:o},engines:{node:``},time:{[o]:s},version:o,versions:{},...Mu(a)?a:null},{versions:l,...u}=c;return Promise.resolve({...c,versions:{...Mu(a)&&a.versions||{[o]:u}}})};var Nu=(0,kl.default)(({npmConfigLocal:e,npmConfigUser:t,npmConfigWorkspaceProject:n},r)=>{let i=r.packageFile?f.default.join(r.packageFile,`../.npmrc`):null,a=r.packageFile?Ou.findNpmConfig(i||void 0):null,o=r.cwd?f.default.join(r.cwd,`.npmrc`):null,s=r.cwd?Ou.findNpmConfig(o):null;if(n&&Object.keys(n).length>0){Y(r,`
452
452
  npm config (workspace project):`,`verbose`);let{cache:e,...t}=n;Kr(r,t,`verbose`)}if(t&&Object.keys(t).length>0){Y(r,`
453
453
  npm config (user):`,`verbose`);let{cache:e,...n}=t;Kr(r,n,`verbose`)}if(e&&Object.keys(e).length>0){Y(r,`
454
454
  npm config (local override):`,`verbose`);let{cache:t,...n}=e;Kr(r,n,`verbose`)}if(a&&Object.keys(a).length>0){Y(r,`\nnpm config (project: ${i}):`,`verbose`);let{cache:e,...t}=a;Kr(r,t,`verbose`)}if(s&&Object.keys(s).length>0){Y(r,`\nnpm config (cwd: ${o}):`,`verbose`);let{cache:e,...t}=s;Kr(r,t,`verbose`)}let c={...n,...t,...e,...a,...s,...r.registry?{registry:r.registry,silent:!0}:null,...r.timeout?{timeout:r.timeout}:null};if(n||e||a||s){Y(r,`
@@ -633,42 +633,42 @@ Merged yarn config in npm format:`,`verbose`),Y(e,l,`verbose`)),l}),Kf=(0,kl.def
633
633
 
634
634
  `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=kp,s=!hp.jitless,c=s&&Ap.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?Bh([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function Uh(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Wp(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Jp(e,r,gp())))}),t)}var Wh=Q(`$ZodUnion`,(e,t)=>{ah.init(e,t),Cp(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),Cp(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),Cp(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Cp(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>xp(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Uh(t,r,e,i)):Uh(o,r,e,i)}}),Gh=Q(`$ZodIntersection`,(e,t)=>{ah.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>qh(e,t,n)):qh(e,i,a)}});function Kh(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(jp(e)&&jp(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Kh(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Kh(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function qh(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),Wp(e))return e;let o=Kh(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Jh=Q(`$ZodRecord`,(e,t)=>{ah.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!jp(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>Jp(e,r,gp())),input:c,path:[c],inst:e});continue}let l=o.value,u=t.valueType._zod.run({value:i[c],issues:[]},r);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...Kp(c,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...Kp(c,u.issues)),n.value[l]=u.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&Hm.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>Jp(e,r,gp())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...Kp(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...Kp(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Yh=Q(`$ZodEnum`,(e,t)=>{ah.init(e,t);let n=_p(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Np.has(typeof e)).map(e=>typeof e==`string`?Pp(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Xh=Q(`$ZodTransform`,(e,t)=>{ah.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new mp(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new pp;return n.value=i,n.fallback=!0,n}});function Zh(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Qh=Q(`$ZodOptional`,(e,t)=>{ah.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,Cp(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Cp(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${xp(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>Zh(e,r)):Zh(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),$h=Q(`$ZodExactOptional`,(e,t)=>{Qh.init(e,t),Cp(e._zod,`values`,()=>t.innerType._zod.values),Cp(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),eg=Q(`$ZodNullable`,(e,t)=>{ah.init(e,t),Cp(e._zod,`optin`,()=>t.innerType._zod.optin),Cp(e._zod,`optout`,()=>t.innerType._zod.optout),Cp(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${xp(e.source)}|null)$`):void 0}),Cp(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),tg=Q(`$ZodDefault`,(e,t)=>{ah.init(e,t),e._zod.optin=`optional`,Cp(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>ng(e,t)):ng(r,t)}});function ng(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var rg=Q(`$ZodPrefault`,(e,t)=>{ah.init(e,t),e._zod.optin=`optional`,Cp(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),ig=Q(`$ZodNonOptional`,(e,t)=>{ah.init(e,t),Cp(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>ag(t,e)):ag(i,e)}});function ag(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var og=Q(`$ZodCatch`,(e,t)=>{ah.init(e,t),e._zod.optin=`optional`,Cp(e._zod,`optout`,()=>t.innerType._zod.optout),Cp(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Jp(e,n,gp()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Jp(e,n,gp()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),sg=Q(`$ZodPipe`,(e,t)=>{ah.init(e,t),Cp(e._zod,`values`,()=>t.in._zod.values),Cp(e._zod,`optin`,()=>t.in._zod.optin),Cp(e._zod,`optout`,()=>t.out._zod.optout),Cp(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>cg(e,t.in,n)):cg(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>cg(e,t.out,n)):cg(r,t.out,n)}});function cg(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var lg=Q(`$ZodReadonly`,(e,t)=>{ah.init(e,t),Cp(e._zod,`propValues`,()=>t.innerType._zod.propValues),Cp(e._zod,`values`,()=>t.innerType._zod.values),Cp(e._zod,`optin`,()=>t.innerType?._zod?.optin),Cp(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(ug):ug(r)}});function ug(e){return e.value=Object.freeze(e.value),e}var dg=Q(`$ZodCustom`,(e,t)=>{Gm.init(e,t),ah.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>fg(t,n,r,e));fg(i,n,r,e)}});function fg(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Xp(e))}}var pg,mg=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function hg(){return new mg}(pg=globalThis).__zod_globalRegistry??(pg.__zod_globalRegistry=hg());var gg=globalThis.__zod_globalRegistry;function _g(e,t){return new e({type:`string`,...$(t)})}function vg(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...$(t)})}function yg(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...$(t)})}function bg(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...$(t)})}function xg(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...$(t)})}function Sg(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...$(t)})}function Cg(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...$(t)})}function wg(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...$(t)})}function Tg(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...$(t)})}function Eg(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...$(t)})}function Dg(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...$(t)})}function Og(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...$(t)})}function kg(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...$(t)})}function Ag(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...$(t)})}function jg(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...$(t)})}function Mg(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...$(t)})}function Ng(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...$(t)})}function Pg(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...$(t)})}function Fg(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...$(t)})}function Ig(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...$(t)})}function Lg(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...$(t)})}function Rg(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...$(t)})}function zg(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...$(t)})}function Bg(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...$(t)})}function Vg(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...$(t)})}function Hg(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...$(t)})}function Ug(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...$(t)})}function Wg(e){return new e({type:`unknown`})}function Gg(e,t){return new e({type:`never`,...$(t)})}function Kg(e,t){return new Km({check:`max_length`,...$(t),maximum:e})}function qg(e,t){return new qm({check:`min_length`,...$(t),minimum:e})}function Jg(e,t){return new Jm({check:`length_equals`,...$(t),length:e})}function Yg(e,t){return new Xm({check:`string_format`,format:`regex`,...$(t),pattern:e})}function Xg(e){return new Zm({check:`string_format`,format:`lowercase`,...$(e)})}function Zg(e){return new Qm({check:`string_format`,format:`uppercase`,...$(e)})}function Qg(e,t){return new $m({check:`string_format`,format:`includes`,...$(t),includes:e})}function $g(e,t){return new eh({check:`string_format`,format:`starts_with`,...$(t),prefix:e})}function e_(e,t){return new th({check:`string_format`,format:`ends_with`,...$(t),suffix:e})}function t_(e){return new nh({check:`overwrite`,tx:e})}function n_(e){return t_(t=>t.normalize(e))}function r_(){return t_(e=>e.trim())}function i_(){return t_(e=>e.toLowerCase())}function a_(){return t_(e=>e.toUpperCase())}function o_(){return t_(e=>Dp(e))}function s_(e,t,n){return new e({type:`array`,element:t,...$(n)})}function c_(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...$(n)})}function l_(e,t){let n=u_(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Xp(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Xp(r))}},e(t.value,t)),t);return n}function u_(e,t){let n=new Gm({check:`custom`,...$(t)});return n._zod.check=e,n}function d_(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??gg,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function f_(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,f_(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&h_(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function p_(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
635
635
 
636
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function m_(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:__(t,`input`,e.processors),output:__(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function h_(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return h_(r.element,n);if(r.type===`set`)return h_(r.valueType,n);if(r.type===`lazy`)return h_(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return h_(r.innerType,n);if(r.type===`intersection`)return h_(r.left,n)||h_(r.right,n);if(r.type===`record`||r.type===`map`)return h_(r.keyType,n)||h_(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:h_(r.in,n)||h_(r.out,n);if(r.type===`object`){for(let e in r.shape)if(h_(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(h_(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(h_(e,n))return!0;return!!(r.rest&&h_(r.rest,n))}return!1}var g_=(e,t={})=>n=>{let r=d_({...n,processors:t});return f_(e,r),p_(r,e),m_(r,e)},__=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=d_({...i??{},target:a,io:t,processors:n});return f_(e,o),p_(o,e),m_(o,e)},v_={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},y_=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=v_[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},b_=(e,t,n,r)=>{n.not={}},x_=(e,t,n,r)=>{let i=e._zod.def,a=_p(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},S_=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},C_=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},w_=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=f_(a.element,t,{...r,path:[...r.path,`items`]})},T_=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=f_(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=f_(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},E_=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>f_(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},D_=(e,t,n,r)=>{let i=e._zod.def,a=f_(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=f_(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},O_=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=f_(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=f_(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=f_(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},k_=(e,t,n,r)=>{let i=e._zod.def,a=f_(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},A_=(e,t,n,r)=>{let i=e._zod.def;f_(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},j_=(e,t,n,r)=>{let i=e._zod.def;f_(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},M_=(e,t,n,r)=>{let i=e._zod.def;f_(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},N_=(e,t,n,r)=>{let i=e._zod.def;f_(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},P_=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;f_(o,t,r);let s=t.seen.get(e);s.ref=o},F_=(e,t,n,r)=>{let i=e._zod.def;f_(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},I_=(e,t,n,r)=>{let i=e._zod.def;f_(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},L_=Q(`ZodISODateTime`,(e,t)=>{yh.init(e,t),uv.init(e,t)});function R_(e){return Bg(L_,e)}var z_=Q(`ZodISODate`,(e,t)=>{bh.init(e,t),uv.init(e,t)});function B_(e){return Vg(z_,e)}var V_=Q(`ZodISOTime`,(e,t)=>{xh.init(e,t),uv.init(e,t)});function H_(e){return Hg(V_,e)}var U_=Q(`ZodISODuration`,(e,t)=>{Sh.init(e,t),uv.init(e,t)});function W_(e){return Ug(U_,e)}var G_=Q(`ZodError`,(e,t)=>{Qp.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>tm(e,t)},flatten:{value:t=>em(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,vp,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,vp,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),K_=nm(G_),q_=rm(G_),J_=im(G_),Y_=om(G_),X_=cm(G_),Z_=lm(G_),Q_=um(G_),$_=dm(G_),ev=fm(G_),tv=pm(G_),nv=mm(G_),rv=hm(G_),iv=new WeakMap;function av(e,t,n){let r=Object.getPrototypeOf(e),i=iv.get(r);if(i||(i=new Set,iv.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var ov=Q(`ZodType`,(e,t)=>(ah.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:__(e,`input`),output:__(e,`output`)}}),e.toJSONSchema=g_(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>K_(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>J_(e,t,n),e.parseAsync=async(t,n)=>q_(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Y_(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>X_(e,t,n),e.decode=(t,n)=>Z_(e,t,n),e.encodeAsync=async(t,n)=>Q_(e,t,n),e.decodeAsync=async(t,n)=>$_(e,t,n),e.safeEncode=(t,n)=>ev(e,t,n),e.safeDecode=(t,n)=>tv(e,t,n),e.safeEncodeAsync=async(t,n)=>nv(e,t,n),e.safeDecodeAsync=async(t,n)=>rv(e,t,n),av(e,`ZodType`,{check(...e){let t=this.def;return this.clone(Tp(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Fp(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(py(e,t))},superRefine(e,t){return this.check(my(e,t))},overwrite(e){return this.check(t_(e))},optional(){return Yv(this)},exactOptional(){return Zv(this)},nullable(){return $v(this)},nullish(){return Yv($v(this))},nonoptional(e){return ay(this,e)},array(){return Fv(this)},or(e){return zv([this,e])},and(e){return Vv(this,e)},transform(e){return ly(this,qv(e))},default(e){return ty(this,e)},prefault(e){return ry(this,e)},catch(e){return sy(this,e)},pipe(e){return ly(this,e)},readonly(){return dy(this)},describe(e){let t=this.clone();return gg.add(t,{description:e}),t},meta(...e){if(e.length===0)return gg.get(this);let t=this.clone();return gg.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return gg.get(e)?.description},configurable:!0}),e)),sv=Q(`_ZodString`,(e,t)=>{oh.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>y_(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,av(e,`_ZodString`,{regex(...e){return this.check(Yg(...e))},includes(...e){return this.check(Qg(...e))},startsWith(...e){return this.check($g(...e))},endsWith(...e){return this.check(e_(...e))},min(...e){return this.check(qg(...e))},max(...e){return this.check(Kg(...e))},length(...e){return this.check(Jg(...e))},nonempty(...e){return this.check(qg(1,...e))},lowercase(e){return this.check(Xg(e))},uppercase(e){return this.check(Zg(e))},trim(){return this.check(r_())},normalize(...e){return this.check(n_(...e))},toLowerCase(){return this.check(i_())},toUpperCase(){return this.check(a_())},slugify(){return this.check(o_())}})}),cv=Q(`ZodString`,(e,t)=>{oh.init(e,t),sv.init(e,t),e.email=t=>e.check(vg(dv,t)),e.url=t=>e.check(wg(mv,t)),e.jwt=t=>e.check(zg(kv,t)),e.emoji=t=>e.check(Tg(hv,t)),e.guid=t=>e.check(yg(fv,t)),e.uuid=t=>e.check(bg(pv,t)),e.uuidv4=t=>e.check(xg(pv,t)),e.uuidv6=t=>e.check(Sg(pv,t)),e.uuidv7=t=>e.check(Cg(pv,t)),e.nanoid=t=>e.check(Eg(gv,t)),e.guid=t=>e.check(yg(fv,t)),e.cuid=t=>e.check(Dg(_v,t)),e.cuid2=t=>e.check(Og(vv,t)),e.ulid=t=>e.check(kg(yv,t)),e.base64=t=>e.check(Ig(Ev,t)),e.base64url=t=>e.check(Lg(Dv,t)),e.xid=t=>e.check(Ag(bv,t)),e.ksuid=t=>e.check(jg(xv,t)),e.ipv4=t=>e.check(Mg(Sv,t)),e.ipv6=t=>e.check(Ng(Cv,t)),e.cidrv4=t=>e.check(Pg(wv,t)),e.cidrv6=t=>e.check(Fg(Tv,t)),e.e164=t=>e.check(Rg(Ov,t)),e.datetime=t=>e.check(R_(t)),e.date=t=>e.check(B_(t)),e.time=t=>e.check(H_(t)),e.duration=t=>e.check(W_(t))});function lv(e){return _g(cv,e)}var uv=Q(`ZodStringFormat`,(e,t)=>{sh.init(e,t),sv.init(e,t)}),dv=Q(`ZodEmail`,(e,t)=>{uh.init(e,t),uv.init(e,t)}),fv=Q(`ZodGUID`,(e,t)=>{ch.init(e,t),uv.init(e,t)}),pv=Q(`ZodUUID`,(e,t)=>{lh.init(e,t),uv.init(e,t)}),mv=Q(`ZodURL`,(e,t)=>{dh.init(e,t),uv.init(e,t)}),hv=Q(`ZodEmoji`,(e,t)=>{fh.init(e,t),uv.init(e,t)}),gv=Q(`ZodNanoID`,(e,t)=>{ph.init(e,t),uv.init(e,t)}),_v=Q(`ZodCUID`,(e,t)=>{mh.init(e,t),uv.init(e,t)}),vv=Q(`ZodCUID2`,(e,t)=>{hh.init(e,t),uv.init(e,t)}),yv=Q(`ZodULID`,(e,t)=>{gh.init(e,t),uv.init(e,t)}),bv=Q(`ZodXID`,(e,t)=>{_h.init(e,t),uv.init(e,t)}),xv=Q(`ZodKSUID`,(e,t)=>{vh.init(e,t),uv.init(e,t)}),Sv=Q(`ZodIPv4`,(e,t)=>{Ch.init(e,t),uv.init(e,t)}),Cv=Q(`ZodIPv6`,(e,t)=>{wh.init(e,t),uv.init(e,t)}),wv=Q(`ZodCIDRv4`,(e,t)=>{Th.init(e,t),uv.init(e,t)}),Tv=Q(`ZodCIDRv6`,(e,t)=>{Eh.init(e,t),uv.init(e,t)}),Ev=Q(`ZodBase64`,(e,t)=>{Oh.init(e,t),uv.init(e,t)}),Dv=Q(`ZodBase64URL`,(e,t)=>{Ah.init(e,t),uv.init(e,t)}),Ov=Q(`ZodE164`,(e,t)=>{jh.init(e,t),uv.init(e,t)}),kv=Q(`ZodJWT`,(e,t)=>{Nh.init(e,t),uv.init(e,t)}),Av=Q(`ZodUnknown`,(e,t)=>{Ph.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function jv(){return Wg(Av)}var Mv=Q(`ZodNever`,(e,t)=>{Fh.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>b_(e,t,n,r)});function Nv(e){return Gg(Mv,e)}var Pv=Q(`ZodArray`,(e,t)=>{Lh.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>w_(e,t,n,r),e.element=t.element,av(e,`ZodArray`,{min(e,t){return this.check(qg(e,t))},nonempty(e){return this.check(qg(1,e))},max(e,t){return this.check(Kg(e,t))},length(e,t){return this.check(Jg(e,t))},unwrap(){return this.element}})});function Fv(e,t){return s_(Pv,e,t)}var Iv=Q(`ZodObject`,(e,t)=>{Hh.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>T_(e,t,n,r),Cp(e,`shape`,()=>t.shape),av(e,`ZodObject`,{keyof(){return Gv(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:jv()})},loose(){return this.clone({...this._zod.def,catchall:jv()})},strict(){return this.clone({...this._zod.def,catchall:Nv()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return zp(this,e)},safeExtend(e){return Bp(this,e)},merge(e){return Vp(this,e)},pick(e){return Lp(this,e)},omit(e){return Rp(this,e)},partial(...e){return Hp(Jv,this,e[0])},required(...e){return Up(iy,this,e[0])}})});function Lv(e,t){return new Iv({type:`object`,shape:e??{},...$(t)})}var Rv=Q(`ZodUnion`,(e,t)=>{Wh.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>E_(e,t,n,r),e.options=t.options});function zv(e,t){return new Rv({type:`union`,options:e,...$(t)})}var Bv=Q(`ZodIntersection`,(e,t)=>{Gh.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>D_(e,t,n,r)});function Vv(e,t){return new Bv({type:`intersection`,left:e,right:t})}var Hv=Q(`ZodRecord`,(e,t)=>{Jh.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>O_(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Uv(e,t,n){return!t||!t._zod?new Hv({type:`record`,keyType:lv(),valueType:e,...$(t)}):new Hv({type:`record`,keyType:e,valueType:t,...$(n)})}var Wv=Q(`ZodEnum`,(e,t)=>{Yh.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>x_(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Wv({...t,checks:[],...$(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Wv({...t,checks:[],...$(r),entries:i})}});function Gv(e,t){return new Wv({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...$(t)})}var Kv=Q(`ZodTransform`,(e,t)=>{Xh.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>C_(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new mp(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Xp(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(Xp(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function qv(e){return new Kv({type:`transform`,transform:e})}var Jv=Q(`ZodOptional`,(e,t)=>{Qh.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>I_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Yv(e){return new Jv({type:`optional`,innerType:e})}var Xv=Q(`ZodExactOptional`,(e,t)=>{$h.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>I_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Zv(e){return new Xv({type:`optional`,innerType:e})}var Qv=Q(`ZodNullable`,(e,t)=>{eg.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>k_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $v(e){return new Qv({type:`nullable`,innerType:e})}var ey=Q(`ZodDefault`,(e,t)=>{tg.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>j_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ty(e,t){return new ey({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Mp(t)}})}var ny=Q(`ZodPrefault`,(e,t)=>{rg.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>M_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ry(e,t){return new ny({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Mp(t)}})}var iy=Q(`ZodNonOptional`,(e,t)=>{ig.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>A_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ay(e,t){return new iy({type:`nonoptional`,innerType:e,...$(t)})}var oy=Q(`ZodCatch`,(e,t)=>{og.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>N_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function sy(e,t){return new oy({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var cy=Q(`ZodPipe`,(e,t)=>{sg.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>P_(e,t,n,r),e.in=t.in,e.out=t.out});function ly(e,t){return new cy({type:`pipe`,in:e,out:t})}var uy=Q(`ZodReadonly`,(e,t)=>{lg.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>F_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function dy(e){return new uy({type:`readonly`,innerType:e})}var fy=Q(`ZodCustom`,(e,t)=>{dg.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>S_(e,t,n,r)});function py(e,t={}){return c_(fy,e,t)}function my(e,t){return l_(e,t)}var hy={catalog:Yv(Uv(lv(),lv())),catalogs:Yv(Uv(lv(),Uv(lv(),lv()))).catch(void 0)},gy=Lv({...hy,workspaces:Yv(zv([Fv(lv()),Lv(hy).passthrough()])).catch(void 0)}),_y={dev:`devDependencies`,peer:`peerDependencies`,prod:`dependencies`,optional:`optionalDependencies`},vy=e=>(e?typeof e==`string`?e.split(`,`):e:Ci.dep.default).map(e=>_y[e]||e);function yy(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)}async function by(e,t,n){let r=await g.default.readFile(e,`utf-8`);return Object.entries(n).filter(([e])=>t[e]).reduce((e,[n,r])=>{let i=t[n],a=`("${yy(n)}"\\s*:\\s*")(${yy(i)})(")`,o=new RegExp(a,`g`);return e.replace(o,`$1${r}$3`)},r)}function xy(e,{options:t,filePath:n}){let r=e instanceof Error?e.message:String(e),i=`Invalid YAML syntax${n?` in ${n}`:``}. Unable to read catalog dependencies.\n${r}`;throw t&&up(t,i),Error(i)}function Sy(e,t,{newName:n,newValue:r}){let i=t.slice(0,-1),a=t.at(-1),o=e.getIn(i);if(!o||!(0,_f.isCollection)(o))return!1;let s=o.items.find(e=>(0,_f.isPair)(e)&&(0,_f.isScalar)(e.key)&&e.key.value===a);if(!s||!(0,_f.isPair)(s))return!1;if(n&&_f.CST.setScalarValue(s.srcToken.key,n),r){if(!_f.CST.isScalar(s.srcToken?.value))return!1;_f.CST.setScalarValue(s.srcToken.value,r)}return!0}function Cy({fileContent:e,upgrade:t,options:n,filePath:r}){let{path:i}=t;if(!(i.length>1)&&i[0]!==`catalog`&&i[0]!==`catalogs`)return null;let{newValue:a}=t,o,s;try{o=(0,_f.parseDocument)(e,{keepSourceTokens:!0})}catch(e){xy(e,{options:n,filePath:r})}o.errors.length>0&&xy(o.errors[0],{options:n,filePath:r});try{s=gy.parse(o.toJSON())}catch{return null}let c=s.workspaces&&!Array.isArray(s.workspaces)?s.workspaces:void 0;return(i[0]===`catalog`?s.catalog?.[i[1]]:i[0]===`catalogs`?s.catalogs?.[i[1]]?.[i[2]]:i[0]===`workspaces`&&i[1]===`catalog`?c?.catalog?.[i[2]]:i[0]===`workspaces`&&i[1]===`catalogs`?c?.catalogs?.[i[2]]?.[i[3]]:void 0)===a?e:Sy(o,i,{newValue:a,newName:t.path.at(-1)})?_f.CST.stringify(o.contents.srcToken):null}function wy(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)}async function Ty(e,t,n,r,i){if(i){let a=f.default.basename(i),o=f.default.extname(i);if(i.includes(`#catalog`)){let e=i.replace(`#catalog`,``);if(f.default.extname(e)===`.json`)return by(e,t,n)}if(a===`pnpm-workspace.yaml`||a===`.yarnrc.yml`){let e=await g.default.readFile(i,`utf-8`),t=gy.parse((0,_f.parseDocument)(e).toJSON()),a=[];if(t.catalogs)for(let[e,r]of Object.entries(t.catalogs))for(let[t,i]of Object.entries(n))r[t]&&a.push({path:[`catalogs`,e,t],newValue:i});if(t.catalog)for(let[e,r]of Object.entries(n))t.catalog?.[e]&&a.push({path:[`catalog`,e],newValue:r});let o=t.workspaces;if(o&&!Array.isArray(o)){if(o.catalogs)for(let[e,t]of Object.entries(o.catalogs))for(let[r,i]of Object.entries(n))t[r]&&a.push({path:[`workspaces`,`catalogs`,e,r],newValue:i});if(o.catalog)for(let[e,t]of Object.entries(n))o.catalog?.[e]&&a.push({path:[`workspaces`,`catalog`,e],newValue:t})}let s=e;for(let e of a){let t=Cy({fileContent:s,upgrade:e,options:r,filePath:i});t&&(s=t)}return s}if(o===`.json`){let r=JSON.parse(e),a=r.catalog||r.catalogs,o=r.workspaces&&!Array.isArray(r.workspaces)&&(r.workspaces.catalog||r.workspaces.catalogs);if(a||o)return by(i,t,n)}}let a=[...vy(r.dep),`overrides`],o=RegExp(`"(${a.join(`|`)})"s*:[^}]*`,`g`),s=e.replace(o,e=>Object.entries(n).reduce((e,[r])=>{let i=`"${r}"\\s*:\\s*("|{\\s*"."\\s*:\\s*")(${wy(t[r])})"`,a=new RegExp(i,`g`);return e.replace(a,(e,t)=>`"${r}${t?`": ${t}`:`: `}${n[r]}"`)},e));if(a.includes(`packageManager`)){let t=JSON.parse(e);if(t.packageManager){let[e]=t.packageManager.split(`@`);n[e]&&(s=s.replace(/"packageManager"\s*:\s*".*?@[^"]*"/,`"packageManager": "${e}@${n[e]}"`))}}return s}var Ey=(e,t,n,{spawnOptions:r,spawnPleaseOptions:i}={})=>{n&&console.log(J.blue([t.packageManager,...e].join(` `)));let a={cwd:t.cwd||process.cwd(),env:{...process.env,...t.packageManager===`pnpm`?null:{CI:`1`},FORCE_COLOR:`1`,...r?.env},...r},o={...t.global?{global:!0}:null,...t.prefix?{prefix:t.prefix}:null};return(t.packageManager===`pnpm`?Pf:t.packageManager===`yarn`?Yf:t.packageManager===`bun`?Ju:Fu)(e,o,i,a)},Dy=async e=>{(e.packageData||e.packageFile)&&(console.error(`--packageData and --packageFile are not allowed with --doctor. You must execute "ncu --doctor" in a directory with a package file so it can install dependencies and test them.`),process.exit(1));let t;try{t=await dp(e,`package.json`)}catch{console.error(`Missing or invalid package.json`),process.exit(1)}return!e.doctorTest&&!t.pkg.scripts?.test&&(console.error(`No npm "test" script defined. You must define a "test" script in the "scripts" section of your package.json to use --doctor.`),process.exit(1)),t},Oy=async(e,t)=>{await Mn();let n=t.packageManager===`yarn`?`yarn.lock`:t.packageManager===`pnpm`?`pnpm-lock.yaml`:t.packageManager===`bun`?`bun.lock`:`package-lock.json`,{pkg:r,pkgFile:i}=await Dy(t),a={...r.dependencies,...r.devDependencies,...r.optionalDependencies},o=async()=>{if(t.doctorInstall){let[e,...n]=t.doctorInstall.split(` `);console.log(J.blue(t.doctorInstall)),await(0,Wi.default)(e,n)}else await Ey([`install`],{packageManager:t.packageManager},!0)},s=async()=>{let e={stderr:e=>{console.error(J.red(e.toString()))},stdout:e=>{process.stdout.write(e.toString())}};if(t.doctorTest){let n=t.doctorTest.matchAll(/"(.+?)"|'(.+?)'|[^ ]+/g),r=[];for(let e of n)r=[...r,e[2]||e[1]||e[0]];let[i,...a]=r;console.log(J.blue(t.doctorTest)),await(0,Wi.default)(i,a,e)}else await Ey([`run`,`test`],{packageManager:t.packageManager},!0,{spawnPleaseOptions:e})};console.log(`Running tests before upgrading`),await o();let c=``;try{c=await g.default.readFile(n,`utf-8`)}catch{if(t.packageManager===`bun`){n=`bun.lockb`;try{c=await g.default.readFile(n,`utf-8`)}catch{}}}try{await s()}catch{console.error(`Tests failed before we even got started!`),process.exit(1)}t.interactive||console.log(`Upgrading all dependencies and re-running tests`),console.log(J.blue(`ncu `+process.argv.slice(2).filter(e=>e!==`--doctor`).join(` `))),process.env.NCU_DOCTOR=`1`;let l=await e({...t,silent:!0,doctor:!1});if(Object.keys(l||{}).length===0){console.log(`All dependencies are up-to-date `+J.green.bold(`:)`));return}let u=!1;try{await o(),u=!0,await s(),console.log(`${J.green(`✓`)} Tests pass`),await ei(t,{current:a,upgraded:l,total:Object.keys(l||{}).length}),console.log(`\n${t.interactive?`Chosen`:`All`} dependencies upgraded and installed ${J.green(`:)`)}`)}catch{console.error(J.red(u?`Tests failed`:`Install failed`)),console.log(`Identifying broken dependencies`),await g.default.writeFile(`package.json`,i),c?await g.default.writeFile(n,c):await g.default.rm(n,{recursive:!0,force:!0});let e=i;if(u)try{await o()}catch(e){let n=(t.packageManager||`npm`)+` install`;throw Error(`Error: Doctor mode was about to test individual upgrades, but ${J.cyan(n)} failed after rolling back to your existing package and lock files. This is unexpected since the initial install before any upgrades succeeded. Either npm failed to revert a partial install, or failed anomalously on the second run. Please check your internet connection and retry. If doctor mode fails consistently, report a bug with your complete list of dependency versions at https://github.com/raineorshine/npm-check-updates/issues.`,{cause:e})}let d,f;for([d,f]of Object.entries(l))try{if(await Ey([...t.packageManager===`yarn`||t.packageManager===`pnpm`||t.packageManager===`bun`?[`add`]:[`install`,`--no-save`],`${d}@${f}`],{packageManager:t.packageManager},!0),r.scripts?.prepare)try{await Ey([`run`,`prepare`],{packageManager:t.packageManager},!0)}catch(e){throw console.error(J.red(`Prepare script failed`)),e}await s(),console.log(` ${J.green(`✓`)} ${d} ${a[d]} → ${f}`),e=await Ty(e,{[d]:a[d]},{[d]:f},t),c=await g.default.readFile(n,`utf-8`)}catch(r){console.error(` ${J.red(`✗`)} ${d} ${a[d]} → ${f}\n`),console.error(J.red(r)),await g.default.writeFile(n,c),(t.packageManager===`yarn`||t.packageManager===`pnpm`||t.packageManager===`bun`)&&await g.default.writeFile(`package.json`,e)}e!==i&&(console.log(`Saving partially upgraded package.json`),await g.default.writeFile(`package.json`,e)),await o()}};async function ky(e){let t,n=null,r=e.packageFile||`package.json`;async function i(t,n){if(t!=null){let n=f.default.resolve(t);Y(e,`${e.upgrade?`Upgrading`:`Checking`} ${n}`)}else up(e,`${J.red(`No ${n}`)}\n\nPlease add a ${n} to the current directory, specify the ${J.cyan(`--packageFile`)} or ${J.cyan(`--packageData`)} options, or pipe a ${n} to stdin and specify ${J.cyan(`--stdin`)}.`,{color:!1});try{return await g.default.readFile(t,`utf-8`)}catch(t){up(e,t)}}if(Y(e,`Running in local mode`,`verbose`),Y(e,`Finding package file data`,`verbose`),e.packageData)n=null,t=Promise.resolve(e.packageData);else if(e.packageFile)n=e.packageFile,t=i(n,r);else if(e.stdin){Y(e,`Waiting for package data on stdin`,`verbose`);let a=await(0,D.text)(process.stdin),o=a.trim().length>0?a:null;n=o||!r?null:await Ql(r),t=o||i(await n,r)}else n=r?await Ql(!e.packageFile&&e.packageManager===`deno`?[`deno.json`,`deno.jsonc`]:r,{cwd:e.cwd||process.cwd()}):null,t=i(n,r);return{pkgData:await t,pkgFile:n||null,pkgPath:r}}var Ay=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.splitWhen=e.flatten=void 0;function t(e){return e.reduce((e,t)=>[].concat(e,t),[])}e.flatten=t;function n(e,t){let n=[[]],r=0;for(let i of e)t(i)?(r++,n[r]=[]):n[r].push(i);return n}e.splitWhen=n})),jy=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isEnoentCodeError=void 0;function t(e){return e.code===`ENOENT`}e.isEnoentCodeError=t})),My=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createDirentFromStats=void 0;var t=class{constructor(e,t){this.name=e,this.isBlockDevice=t.isBlockDevice.bind(t),this.isCharacterDevice=t.isCharacterDevice.bind(t),this.isDirectory=t.isDirectory.bind(t),this.isFIFO=t.isFIFO.bind(t),this.isFile=t.isFile.bind(t),this.isSocket=t.isSocket.bind(t),this.isSymbolicLink=t.isSymbolicLink.bind(t)}};function n(e,n){return new t(e,n)}e.createDirentFromStats=n})),Ny=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.convertPosixPathToPattern=e.convertWindowsPathToPattern=e.convertPathToPattern=e.escapePosixPath=e.escapeWindowsPath=e.escape=e.removeLeadingDotSegment=e.makeAbsolute=e.unixify=void 0;var t=require("os"),n=require("path"),r=t.platform()===`win32`,i=2,a=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,o=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,s=/^\\\\([.?])/,c=/\\(?![!()+@[\]{}])/g;function l(e){return e.replace(/\\/g,`/`)}e.unixify=l;function u(e,t){return n.resolve(e,t)}e.makeAbsolute=u;function d(e){if(e.charAt(0)===`.`){let t=e.charAt(1);if(t===`/`||t===`\\`)return e.slice(i)}return e}e.removeLeadingDotSegment=d,e.escape=r?f:p;function f(e){return e.replace(o,`\\$2`)}e.escapeWindowsPath=f;function p(e){return e.replace(a,`\\$2`)}e.escapePosixPath=p,e.convertPathToPattern=r?m:h;function m(e){return f(e).replace(s,`//$1`).replace(c,`/`)}e.convertWindowsPathToPattern=m;function h(e){return p(e)}e.convertPosixPathToPattern=h})),Py=s(((e,t)=>{t.exports=function(e){if(typeof e!=`string`||e===``)return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1}})),Fy=s(((e,t)=>{var n=Py(),r={"{":`}`,"(":`)`,"[":`]`},i=function(e){if(e[0]===`!`)return!0;for(var t=0,n=-2,i=-2,a=-2,o=-2,s=-2;t<e.length;){if(e[t]===`*`||e[t+1]===`?`&&/[\].+)]/.test(e[t])||i!==-1&&e[t]===`[`&&e[t+1]!==`]`&&(i<t&&(i=e.indexOf(`]`,t)),i>t&&(s===-1||s>i||(s=e.indexOf(`\\`,t),s===-1||s>i)))||a!==-1&&e[t]===`{`&&e[t+1]!==`}`&&(a=e.indexOf(`}`,t),a>t&&(s=e.indexOf(`\\`,t),s===-1||s>a))||o!==-1&&e[t]===`(`&&e[t+1]===`?`&&/[:!=]/.test(e[t+2])&&e[t+3]!==`)`&&(o=e.indexOf(`)`,t),o>t&&(s=e.indexOf(`\\`,t),s===-1||s>o))||n!==-1&&e[t]===`(`&&e[t+1]!==`|`&&(n<t&&(n=e.indexOf(`|`,t)),n!==-1&&e[n+1]!==`)`&&(o=e.indexOf(`)`,n),o>n&&(s=e.indexOf(`\\`,n),s===-1||s>o))))return!0;if(e[t]===`\\`){var c=e[t+1];t+=2;var l=r[c];if(l){var u=e.indexOf(l,t);u!==-1&&(t=u+1)}if(e[t]===`!`)return!0}else t++}return!1},a=function(e){if(e[0]===`!`)return!0;for(var t=0;t<e.length;){if(/[*?{}()[\]]/.test(e[t]))return!0;if(e[t]===`\\`){var n=e[t+1];t+=2;var i=r[n];if(i){var a=e.indexOf(i,t);a!==-1&&(t=a+1)}if(e[t]===`!`)return!0}else t++}return!1};t.exports=function(e,t){if(typeof e!=`string`||e===``)return!1;if(n(e))return!0;var r=i;return t&&t.strict===!1&&(r=a),r(e)}})),Iy=s(((e,t)=>{var n=Fy(),r=require("path").posix.dirname,i=require("os").platform()===`win32`,a=`/`,o=/\\/g,s=/[\{\[].*[\}\]]$/,c=/(^|[^\\])([\{\[]|\([^\)]+$)/,l=/\\([\!\*\?\|\[\]\(\)\{\}])/g;t.exports=function(e,t){Object.assign({flipBackslashes:!0},t).flipBackslashes&&i&&e.indexOf(a)<0&&(e=e.replace(o,a)),s.test(e)&&(e+=a),e+=`a`;do e=r(e);while(n(e)||c.test(e));return e.replace(l,`$1`)}})),Ly=s((e=>{e.isInteger=e=>typeof e==`number`?Number.isInteger(e):typeof e==`string`&&e.trim()!==``?Number.isInteger(Number(e)):!1,e.find=(e,t)=>e.nodes.find(e=>e.type===t),e.exceedsLimit=(t,n,r=1,i)=>i===!1||!e.isInteger(t)||!e.isInteger(n)?!1:(Number(n)-Number(t))/Number(r)>=i,e.escapeNode=(e,t=0,n)=>{let r=e.nodes[t];r&&(n&&r.type===n||r.type===`open`||r.type===`close`)&&r.escaped!==!0&&(r.value=`\\`+r.value,r.escaped=!0)},e.encloseBrace=e=>e.type===`brace`?e.commas>>0+e.ranges>>0?!1:(e.invalid=!0,!0):!1,e.isInvalidBrace=e=>e.type===`brace`?e.invalid===!0||e.dollar?!0:!(e.commas>>0+e.ranges>>0)||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1:!1,e.isOpenOrClose=e=>e.type===`open`||e.type===`close`?!0:e.open===!0||e.close===!0,e.reduce=e=>e.reduce((e,t)=>(t.type===`text`&&e.push(t.value),t.type===`range`&&(t.type=`text`),e),[]),e.flatten=(...e)=>{let t=[],n=e=>{for(let r=0;r<e.length;r++){let i=e[r];if(Array.isArray(i)){n(i);continue}i!==void 0&&t.push(i)}return t};return n(e),t}})),Ry=s(((e,t)=>{var n=Ly();t.exports=(e,t={})=>{let r=(e,i={})=>{let a=t.escapeInvalid&&n.isInvalidBrace(i),o=e.invalid===!0&&t.escapeInvalid===!0,s=``;if(e.value)return(a||o)&&n.isOpenOrClose(e)?`\\`+e.value:e.value;if(e.value)return e.value;if(e.nodes)for(let t of e.nodes)s+=r(t);return s};return r(e)}})),zy=s(((e,t)=>{t.exports=function(e){return typeof e==`number`?e-e===0:typeof e==`string`&&e.trim()!==``?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}})),By=s(((e,t)=>{var n=zy(),r=(e,t,a)=>{if(n(e)===!1)throw TypeError(`toRegexRange: expected the first argument to be a number`);if(t===void 0||e===t)return String(e);if(n(t)===!1)throw TypeError(`toRegexRange: expected the second argument to be a number.`);let o={relaxZeros:!0,...a};typeof o.strictZeros==`boolean`&&(o.relaxZeros=o.strictZeros===!1);let c=String(o.relaxZeros),l=String(o.shorthand),u=String(o.capture),d=String(o.wrap),f=e+`:`+t+`=`+c+l+u+d;if(r.cache.hasOwnProperty(f))return r.cache[f].result;let p=Math.min(e,t),m=Math.max(e,t);if(Math.abs(p-m)===1){let n=e+`|`+t;return o.capture?`(${n})`:o.wrap===!1?n:`(?:${n})`}let h=g(e)||g(t),_={min:e,max:t,a:p,b:m},v=[],y=[];return h&&(_.isPadded=h,_.maxLen=String(_.max).length),p<0&&(y=s(m<0?Math.abs(m):1,Math.abs(p),_,o),p=_.a=0),m>=0&&(v=s(p,m,_,o)),_.negatives=y,_.positives=v,_.result=i(y,v,o),o.capture===!0?_.result=`(${_.result})`:o.wrap!==!1&&v.length+y.length>1&&(_.result=`(?:${_.result})`),r.cache[f]=_,_.result};function i(e,t,n){let r=c(e,t,`-`,!1,n)||[],i=c(t,e,``,!1,n)||[],a=c(e,t,`-?`,!0,n)||[];return r.concat(a).concat(i).join(`|`)}function a(e,t){let n=1,r=1,i=f(e,n),a=new Set([t]);for(;e<=i&&i<=t;)a.add(i),n+=1,i=f(e,n);for(i=p(t+1,r)-1;e<i&&i<=t;)a.add(i),r+=1,i=p(t+1,r)-1;return a=[...a],a.sort(u),a}function o(e,t,n){if(e===t)return{pattern:e,count:[],digits:0};let r=l(e,t),i=r.length,a=``,o=0;for(let e=0;e<i;e++){let[t,i]=r[e];t===i?a+=t:t!==`0`||i!==`9`?a+=h(t,i,n):o++}return o&&(a+=n.shorthand===!0?`\\d`:`[0-9]`),{pattern:a,count:[o],digits:i}}function s(e,t,n,r){let i=a(e,t),s=[],c=e,l;for(let e=0;e<i.length;e++){let t=i[e],a=o(String(c),String(t),r),u=``;if(!n.isPadded&&l&&l.pattern===a.pattern){l.count.length>1&&l.count.pop(),l.count.push(a.count[0]),l.string=l.pattern+m(l.count),c=t+1;continue}n.isPadded&&(u=_(t,n,r)),a.string=u+a.pattern+m(a.count),s.push(a),c=t+1,l=a}return s}function c(e,t,n,r,i){let a=[];for(let i of e){let{string:e}=i;!r&&!d(t,`string`,e)&&a.push(n+e),r&&d(t,`string`,e)&&a.push(n+e)}return a}function l(e,t){let n=[];for(let r=0;r<e.length;r++)n.push([e[r],t[r]]);return n}function u(e,t){return e>t?1:t>e?-1:0}function d(e,t,n){return e.some(e=>e[t]===n)}function f(e,t){return Number(String(e).slice(0,-t)+`9`.repeat(t))}function p(e,t){return e-e%10**t}function m(e){let[t=0,n=``]=e;return n||t>1?`{${t+(n?`,`+n:``)}}`:``}function h(e,t,n){return`[${e}${t-e===1?``:`-`}${t}]`}function g(e){return/^-?(0+)\d/.test(e)}function _(e,t,n){if(!t.isPadded)return e;let r=Math.abs(t.maxLen-String(e).length),i=n.relaxZeros!==!1;switch(r){case 0:return``;case 1:return i?`0?`:`0`;case 2:return i?`0{0,2}`:`00`;default:return i?`0{0,${r}}`:`0{${r}}`}}r.cache={},r.clearCache=()=>r.cache={},t.exports=r})),Vy=s(((e,t)=>{var n=require("util"),r=By(),i=e=>typeof e==`object`&&!!e&&!Array.isArray(e),a=e=>t=>e===!0?Number(t):String(t),o=e=>typeof e==`number`||typeof e==`string`&&e!==``,s=e=>Number.isInteger(+e),c=e=>{let t=`${e}`,n=-1;if(t[0]===`-`&&(t=t.slice(1)),t===`0`)return!1;for(;t[++n]===`0`;);return n>0},l=(e,t,n)=>typeof e==`string`||typeof t==`string`?!0:n.stringify===!0,u=(e,t,n)=>{if(t>0){let n=e[0]===`-`?`-`:``;n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,`0`)}return n===!1?String(e):e},d=(e,t)=>{let n=e[0]===`-`?`-`:``;for(n&&(e=e.slice(1),t--);e.length<t;)e=`0`+e;return n?`-`+e:e},f=(e,t,n)=>{e.negatives.sort((e,t)=>e<t?-1:+(e>t)),e.positives.sort((e,t)=>e<t?-1:+(e>t));let r=t.capture?``:`?:`,i=``,a=``,o;return e.positives.length&&(i=e.positives.map(e=>d(String(e),n)).join(`|`)),e.negatives.length&&(a=`-(${r}${e.negatives.map(e=>d(String(e),n)).join(`|`)})`),o=i&&a?`${i}|${a}`:i||a,t.wrap?`(${r}${o})`:o},p=(e,t,n,i)=>{if(n)return r(e,t,{wrap:!1,...i});let a=String.fromCharCode(e);return e===t?a:`[${a}-${String.fromCharCode(t)}]`},m=(e,t,n)=>{if(Array.isArray(e)){let t=n.wrap===!0,r=n.capture?``:`?:`;return t?`(${r}${e.join(`|`)})`:e.join(`|`)}return r(e,t,n)},h=(...e)=>RangeError(`Invalid range arguments: `+n.inspect(...e)),g=(e,t,n)=>{if(n.strictRanges===!0)throw h([e,t]);return[]},_=(e,t)=>{if(t.strictRanges===!0)throw TypeError(`Expected step "${e}" to be a number`);return[]},v=(e,t,n=1,r={})=>{let i=Number(e),o=Number(t);if(!Number.isInteger(i)||!Number.isInteger(o)){if(r.strictRanges===!0)throw h([e,t]);return[]}i===0&&(i=0),o===0&&(o=0);let s=i>o,g=String(e),_=String(t),v=String(n);n=Math.max(Math.abs(n),1);let y=c(g)||c(_)||c(v),b=y?Math.max(g.length,_.length,v.length):0,x=y===!1&&l(e,t,r)===!1,S=r.transform||a(x);if(r.toRegex&&n===1)return p(d(e,b),d(t,b),!0,r);let C={negatives:[],positives:[]},w=e=>C[e<0?`negatives`:`positives`].push(Math.abs(e)),T=[],E=0;for(;s?i>=o:i<=o;)r.toRegex===!0&&n>1?w(i):T.push(u(S(i,E),b,x)),i=s?i-n:i+n,E++;return r.toRegex===!0?n>1?f(C,r,b):m(T,null,{wrap:!1,...r}):T},y=(e,t,n=1,r={})=>{if(!s(e)&&e.length>1||!s(t)&&t.length>1)return g(e,t,r);let i=r.transform||(e=>String.fromCharCode(e)),a=`${e}`.charCodeAt(0),o=`${t}`.charCodeAt(0),c=a>o,l=Math.min(a,o),u=Math.max(a,o);if(r.toRegex&&n===1)return p(l,u,!1,r);let d=[],f=0;for(;c?a>=o:a<=o;)d.push(i(a,f)),a=c?a-n:a+n,f++;return r.toRegex===!0?m(d,null,{wrap:!1,options:r}):d},b=(e,t,n,r={})=>{if(t==null&&o(e))return[e];if(!o(e)||!o(t))return g(e,t,r);if(typeof n==`function`)return b(e,t,1,{transform:n});if(i(n))return b(e,t,0,n);let a={...r};return a.capture===!0&&(a.wrap=!0),n=n||a.step||1,s(n)?s(e)&&s(t)?v(e,t,n,a):y(e,t,Math.max(Math.abs(n),1),a):n!=null&&!i(n)?_(n,a):b(e,t,1,n)};t.exports=b})),Hy=s(((e,t)=>{var n=Vy(),r=Ly();t.exports=(e,t={})=>{let i=(e,a={})=>{let o=r.isInvalidBrace(a),s=e.invalid===!0&&t.escapeInvalid===!0,c=o===!0||s===!0,l=t.escapeInvalid===!0?`\\`:``,u=``;if(e.isOpen===!0)return l+e.value;if(e.isClose===!0)return console.log(`node.isClose`,l,e.value),l+e.value;if(e.type===`open`)return c?l+e.value:`(`;if(e.type===`close`)return c?l+e.value:`)`;if(e.type===`comma`)return e.prev.type===`comma`?``:c?e.value:`|`;if(e.value)return e.value;if(e.nodes&&e.ranges>0){let i=r.reduce(e.nodes),a=n(...i,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(a.length!==0)return i.length>1&&a.length>1?`(${a})`:a}if(e.nodes)for(let t of e.nodes)u+=i(t,e);return u};return i(e)}})),Uy=s(((e,t)=>{var n=Vy(),r=Ry(),i=Ly(),a=(e=``,t=``,n=!1)=>{let r=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return n?i.flatten(t).map(e=>`{${e}}`):t;for(let i of e)if(Array.isArray(i))for(let e of i)r.push(a(e,t,n));else for(let e of t)n===!0&&typeof e==`string`&&(e=`{${e}}`),r.push(Array.isArray(e)?a(i,e,n):i+e);return i.flatten(r)};t.exports=(e,t={})=>{let o=t.rangeLimit===void 0?1e3:t.rangeLimit,s=(e,c={})=>{e.queue=[];let l=c,u=c.queue;for(;l.type!==`brace`&&l.type!==`root`&&l.parent;)l=l.parent,u=l.queue;if(e.invalid||e.dollar){u.push(a(u.pop(),r(e,t)));return}if(e.type===`brace`&&e.invalid!==!0&&e.nodes.length===2){u.push(a(u.pop(),[`{}`]));return}if(e.nodes&&e.ranges>0){let s=i.reduce(e.nodes);if(i.exceedsLimit(...s,t.step,o))throw RangeError(`expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.`);let c=n(...s,t);c.length===0&&(c=r(e,t)),u.push(a(u.pop(),c)),e.nodes=[];return}let d=i.encloseBrace(e),f=e.queue,p=e;for(;p.type!==`brace`&&p.type!==`root`&&p.parent;)p=p.parent,f=p.queue;for(let t=0;t<e.nodes.length;t++){let n=e.nodes[t];if(n.type===`comma`&&e.type===`brace`){t===1&&f.push(``),f.push(``);continue}if(n.type===`close`){u.push(a(u.pop(),f,d));continue}if(n.value&&n.type!==`open`){f.push(a(f.pop(),n.value));continue}n.nodes&&s(n,e)}return f};return i.flatten(s(e))}})),Wy=s(((e,t)=>{t.exports={MAX_LENGTH:1e4,CHAR_0:`0`,CHAR_9:`9`,CHAR_UPPERCASE_A:`A`,CHAR_LOWERCASE_A:`a`,CHAR_UPPERCASE_Z:`Z`,CHAR_LOWERCASE_Z:`z`,CHAR_LEFT_PARENTHESES:`(`,CHAR_RIGHT_PARENTHESES:`)`,CHAR_ASTERISK:`*`,CHAR_AMPERSAND:`&`,CHAR_AT:`@`,CHAR_BACKSLASH:`\\`,CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:`\r`,CHAR_CIRCUMFLEX_ACCENT:`^`,CHAR_COLON:`:`,CHAR_COMMA:`,`,CHAR_DOLLAR:`$`,CHAR_DOT:`.`,CHAR_DOUBLE_QUOTE:`"`,CHAR_EQUAL:`=`,CHAR_EXCLAMATION_MARK:`!`,CHAR_FORM_FEED:`\f`,CHAR_FORWARD_SLASH:`/`,CHAR_HASH:`#`,CHAR_HYPHEN_MINUS:`-`,CHAR_LEFT_ANGLE_BRACKET:`<`,CHAR_LEFT_CURLY_BRACE:`{`,CHAR_LEFT_SQUARE_BRACKET:`[`,CHAR_LINE_FEED:`
637
- `,CHAR_NO_BREAK_SPACE:`\xA0`,CHAR_PERCENT:`%`,CHAR_PLUS:`+`,CHAR_QUESTION_MARK:`?`,CHAR_RIGHT_ANGLE_BRACKET:`>`,CHAR_RIGHT_CURLY_BRACE:`}`,CHAR_RIGHT_SQUARE_BRACKET:`]`,CHAR_SEMICOLON:`;`,CHAR_SINGLE_QUOTE:`'`,CHAR_SPACE:` `,CHAR_TAB:` `,CHAR_UNDERSCORE:`_`,CHAR_VERTICAL_LINE:`|`,CHAR_ZERO_WIDTH_NOBREAK_SPACE:``}})),Gy=s(((e,t)=>{var n=Ry(),{MAX_LENGTH:r,CHAR_BACKSLASH:i,CHAR_BACKTICK:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_LEFT_PARENTHESES:c,CHAR_RIGHT_PARENTHESES:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_RIGHT_CURLY_BRACE:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_RIGHT_SQUARE_BRACKET:p,CHAR_DOUBLE_QUOTE:m,CHAR_SINGLE_QUOTE:h,CHAR_NO_BREAK_SPACE:g,CHAR_ZERO_WIDTH_NOBREAK_SPACE:_}=Wy();t.exports=(e,t={})=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);let v=t||{},y=typeof v.maxLength==`number`?Math.min(r,v.maxLength):r;if(e.length>y)throw SyntaxError(`Input length (${e.length}), exceeds max characters (${y})`);let b={type:`root`,input:e,nodes:[]},x=[b],S=b,C=b,w=0,T=e.length,E=0,D=0,O,k=()=>e[E++],A=e=>{if(e.type===`text`&&C.type===`dot`&&(C.type=`text`),C&&C.type===`text`&&e.type===`text`){C.value+=e.value;return}return S.nodes.push(e),e.parent=S,e.prev=C,C=e,e};for(A({type:`bos`});E<T;)if(S=x[x.length-1],O=k(),!(O===_||O===g)){if(O===i){A({type:`text`,value:(t.keepEscaping?O:``)+k()});continue}if(O===p){A({type:`text`,value:`\\`+O});continue}if(O===f){w++;let e;for(;E<T&&(e=k());){if(O+=e,e===f){w++;continue}if(e===i){O+=k();continue}if(e===p&&(w--,w===0))break}A({type:`text`,value:O});continue}if(O===c){S=A({type:`paren`,nodes:[]}),x.push(S),A({type:`text`,value:O});continue}if(O===l){if(S.type!==`paren`){A({type:`text`,value:O});continue}S=x.pop(),A({type:`text`,value:O}),S=x[x.length-1];continue}if(O===m||O===h||O===a){let e=O,n;for(t.keepQuotes!==!0&&(O=``);E<T&&(n=k());){if(n===i){O+=n+k();continue}if(n===e){t.keepQuotes===!0&&(O+=n);break}O+=n}A({type:`text`,value:O});continue}if(O===u){D++,S=A({type:`brace`,open:!0,close:!1,dollar:C.value&&C.value.slice(-1)===`$`||S.dollar===!0,depth:D,commas:0,ranges:0,nodes:[]}),x.push(S),A({type:`open`,value:O});continue}if(O===d){if(S.type!==`brace`){A({type:`text`,value:O});continue}S=x.pop(),S.close=!0,A({type:`close`,value:O}),D--,S=x[x.length-1];continue}if(O===o&&D>0){if(S.ranges>0){S.ranges=0;let e=S.nodes.shift();S.nodes=[e,{type:`text`,value:n(S)}]}A({type:`comma`,value:O}),S.commas++;continue}if(O===s&&D>0&&S.commas===0){let e=S.nodes;if(D===0||e.length===0){A({type:`text`,value:O});continue}if(C.type===`dot`){if(S.range=[],C.value+=O,C.type=`range`,S.nodes.length!==3&&S.nodes.length!==5){S.invalid=!0,S.ranges=0,C.type=`text`;continue}S.ranges++,S.args=[];continue}if(C.type===`range`){e.pop();let t=e[e.length-1];t.value+=C.value+O,C=t,S.ranges--;continue}A({type:`dot`,value:O});continue}A({type:`text`,value:O})}do if(S=x.pop(),S.type!==`root`){S.nodes.forEach(e=>{e.nodes||(e.type===`open`&&(e.isOpen=!0),e.type===`close`&&(e.isClose=!0),e.nodes||(e.type=`text`),e.invalid=!0)});let e=x[x.length-1],t=e.nodes.indexOf(S);e.nodes.splice(t,1,...S.nodes)}while(x.length>0);return A({type:`eos`}),b}})),Ky=s(((e,t)=>{var n=Ry(),r=Hy(),i=Uy(),a=Gy(),o=(e,t={})=>{let n=[];if(Array.isArray(e))for(let r of e){let e=o.create(r,t);Array.isArray(e)?n.push(...e):n.push(e)}else n=[].concat(o.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(n=[...new Set(n)]),n};o.parse=(e,t={})=>a(e,t),o.stringify=(e,t={})=>n(typeof e==`string`?o.parse(e,t):e,t),o.compile=(e,t={})=>(typeof e==`string`&&(e=o.parse(e,t)),r(e,t)),o.expand=(e,t={})=>{typeof e==`string`&&(e=o.parse(e,t));let n=i(e,t);return t.noempty===!0&&(n=n.filter(Boolean)),t.nodupes===!0&&(n=[...new Set(n)]),n},o.create=(e,t={})=>e===``||e.length<3?[e]:t.expand===!0?o.expand(e,t):o.compile(e,t),t.exports=o})),qy=s(((e,t)=>{var n=require("path"),r=`\\\\/`,i=`[^${r}]`,a=0,o=`\\.`,s=`\\+`,c=`\\?`,l=`\\/`,u=`(?=.)`,d=`[^/]`,f=`(?:${l}|$)`,p=`(?:^|${l})`,m=`${o}{1,2}${f}`,h={DOT_LITERAL:o,PLUS_LITERAL:s,QMARK_LITERAL:c,SLASH_LITERAL:l,ONE_CHAR:u,QMARK:d,END_ANCHOR:f,DOTS_SLASH:m,NO_DOT:`(?!${o})`,NO_DOTS:`(?!${p}${m})`,NO_DOT_SLASH:`(?!${o}{0,1}${f})`,NO_DOTS_SLASH:`(?!${m})`,QMARK_NO_DOT:`[^.${l}]`,STAR:`${d}*?`,START_ANCHOR:p},g={...h,SLASH_LITERAL:`[${r}]`,QMARK:i,STAR:`${i}*?`,DOTS_SLASH:`${o}{1,2}(?:[${r}]|$)`,NO_DOT:`(?!${o})`,NO_DOTS:`(?!(?:^|[${r}])${o}{1,2}(?:[${r}]|$))`,NO_DOT_SLASH:`(?!${o}{0,1}(?:[${r}]|$))`,NO_DOTS_SLASH:`(?!${o}{1,2}(?:[${r}]|$))`,QMARK_NO_DOT:`[^.${r}]`,START_ANCHOR:`(?:^|[${r}])`,END_ANCHOR:`(?:[${r}]|$)`};t.exports={DEFAULT_MAX_EXTGLOB_RECURSION:a,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:{__proto__:null,alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:n.sep,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?g:h}}})),Jy=s((e=>{var t=require("path"),n=process.platform===`win32`,{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_GLOBAL:o}=qy();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>a.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(o,`\\$1`),e.toPosixSlashes=e=>e.replace(r,`/`),e.removeBackslashes=e=>e.replace(i,e=>e===`\\`?``:e),e.supportsLookbehinds=()=>{let e=process.version.slice(1).split(`.`).map(Number);return e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10},e.isWindows=e=>e&&typeof e.windows==`boolean`?e.windows:n===!0||t.sep===`\\`,e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r}})),Yy=s(((e,t)=>{var n=Jy(),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:_}=qy(),v=e=>e===l||e===a,y=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let b=t||{},x=e.length-1,S=b.parts===!0||b.scanToEnd===!0,C=[],w=[],T=[],E=e,D=-1,O=0,k=0,A=!1,j=!1,M=!1,ee=!1,N=!1,P=!1,F=!1,I=!1,L=!1,R=!1,te=0,z,B,V={value:``,depth:0,isGlob:!1},ne=()=>D>=x,H=()=>E.charCodeAt(D+1),U=()=>(z=B,E.charCodeAt(++D));for(;D<x;){B=U();let e;if(B===a){F=V.backslashes=!0,B=U(),B===u&&(P=!0);continue}if(P===!0||B===u){for(te++;ne()!==!0&&(B=U());){if(B===a){F=V.backslashes=!0,U();continue}if(B===u){te++;continue}if(P!==!0&&B===s&&(B=U())===s){if(A=V.isBrace=!0,M=V.isGlob=!0,R=!0,S===!0)continue;break}if(P!==!0&&B===o){if(A=V.isBrace=!0,M=V.isGlob=!0,R=!0,S===!0)continue;break}if(B===h&&(te--,te===0)){P=!1,A=V.isBrace=!0,R=!0;break}}if(S===!0)continue;break}if(B===l){if(C.push(D),w.push(V),V={value:``,depth:0,isGlob:!1},R===!0)continue;if(z===s&&D===O+1){O+=2;continue}k=D+1;continue}if(b.noext!==!0&&(B===p||B===i||B===r||B===m||B===c)&&H()===d){if(M=V.isGlob=!0,ee=V.isExtglob=!0,R=!0,B===c&&D===O&&(L=!0),S===!0){for(;ne()!==!0&&(B=U());){if(B===a){F=V.backslashes=!0,B=U();continue}if(B===g){M=V.isGlob=!0,R=!0;break}}continue}break}if(B===r){if(z===r&&(N=V.isGlobstar=!0),M=V.isGlob=!0,R=!0,S===!0)continue;break}if(B===m){if(M=V.isGlob=!0,R=!0,S===!0)continue;break}if(B===f){for(;ne()!==!0&&(e=U());){if(e===a){F=V.backslashes=!0,U();continue}if(e===_){j=V.isBracket=!0,M=V.isGlob=!0,R=!0;break}}if(S===!0)continue;break}if(b.nonegate!==!0&&B===c&&D===O){I=V.negated=!0,O++;continue}if(b.noparen!==!0&&B===d){if(M=V.isGlob=!0,S===!0){for(;ne()!==!0&&(B=U());){if(B===d){F=V.backslashes=!0,B=U();continue}if(B===g){R=!0;break}}continue}break}if(M===!0){if(R=!0,S===!0)continue;break}}b.noext===!0&&(ee=!1,M=!1);let W=E,re=``,ie=``;O>0&&(re=E.slice(0,O),E=E.slice(O),k-=O),W&&M===!0&&k>0?(W=E.slice(0,k),ie=E.slice(k)):M===!0?(W=``,ie=E):W=E,W&&W!==``&&W!==`/`&&W!==E&&v(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),b.unescape===!0&&(ie&&=n.removeBackslashes(ie),W&&F===!0&&(W=n.removeBackslashes(W)));let ae={prefix:re,input:e,start:O,base:W,glob:ie,isBrace:A,isBracket:j,isGlob:M,isExtglob:ee,isGlobstar:N,negated:I,negatedExtglob:L};if(b.tokens===!0&&(ae.maxDepth=0,v(B)||w.push(V),ae.tokens=w),b.parts===!0||b.tokens===!0){let t;for(let n=0;n<C.length;n++){let r=t?t+1:O,i=C[n],a=e.slice(r,i);b.tokens&&(n===0&&O!==0?(w[n].isPrefix=!0,w[n].value=re):w[n].value=a,y(w[n]),ae.maxDepth+=w[n].depth),(n!==0||a!==``)&&T.push(a),t=i}if(t&&t+1<e.length){let n=e.slice(t+1);T.push(n),b.tokens&&(w[w.length-1].value=n,y(w[w.length-1]),ae.maxDepth+=w[w.length-1].depth)}ae.slashes=C,ae.parts=T}return ae}})),Xy=s(((e,t)=>{var n=qy(),r=Jy(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:c}=n,l=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>r.escapeRegex(e)).join(`..`)}return n},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=e=>{let t=[],n=0,r=0,i=0,a=``,o=!1;for(let s of e){if(o===!0){a+=s,o=!1;continue}if(s===`\\`){a+=s,o=!0;continue}if(s===`"`){i=i===1?0:1,a+=s;continue}if(i===0){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(n===0){if(s===`(`)r++;else if(s===`)`&&r>0)r--;else if(s===`|`&&r===0){t.push(a),a=``;continue}}}a+=s}return t.push(a),t},f=e=>{let t=!1;for(let n of e){if(t===!0){t=!1;continue}if(n===`\\`){t=!0;continue}if(/[?*+@!()[\]{}]/.test(n))return!1}return!0},p=e=>{let t=e.trim(),n=!0;for(;n===!0;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),n=!0);if(f(t))return t.replace(/\\(.)/g,`$1`)},m=e=>{let t=e.map(p).filter(Boolean);for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){let r=t[e],i=t[n],a=r[0];if(!(!a||r!==a.repeat(r.length)||i!==a.repeat(i.length))&&(r===i||r.startsWith(i)||i.startsWith(r)))return!0}return!1},h=(e,t=!0)=>{if(e[0]!==`+`&&e[0]!==`*`||e[1]!==`(`)return;let n=0,r=0,i=0,a=!1;for(let o=1;o<e.length;o++){let s=e[o];if(a===!0){a=!1;continue}if(s===`\\`){a=!0;continue}if(s===`"`){i=i===1?0:1;continue}if(i!==1){if(s===`[`){n++;continue}if(s===`]`&&n>0){n--;continue}if(!(n>0)){if(s===`(`){r++;continue}if(s===`)`&&(r--,r===0))return t===!0&&o!==e.length-1?void 0:{type:e[0],body:e.slice(2,o),end:o}}}}},g=e=>{let t=0,n=[];for(;t<e.length;){let r=h(e.slice(t),!1);if(!r||r.type!==`*`)return;let i=d(r.body).map(e=>e.trim());if(i.length!==1)return;let a=p(i[0]);if(!a||a.length!==1)return;n.push(a),t+=r.end+1}if(!(n.length<1))return`${n.length===1?r.escapeRegex(n[0]):`[${n.map(e=>r.escapeRegex(e)).join(``)}]`}*`},_=e=>{let t=0,n=e.trim(),r=h(n);for(;r;)t++,n=r.body.trim(),r=h(n);return t},v=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion==`number`?t.maxExtglobRecursion:n.DEFAULT_MAX_EXTGLOB_RECURSION,i=d(e).map(e=>e.trim());if(i.length>1&&(i.some(e=>e===``)||i.some(e=>/^[*?]+$/.test(e))||m(i)))return{risky:!0};for(let e of i){let t=g(e);if(t)return{risky:!0,safeOutput:t};if(_(e)>r)return{risky:!0}}return{risky:!1}},y=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=c[e]||e;let d={...t},f=typeof d.maxLength==`number`?Math.min(i,d.maxLength):i,p=e.length;if(p>f)throw SyntaxError(`Input length: ${p}, exceeds maximum allowed length: ${f}`);let m={type:`bos`,value:``,output:d.prepend||``},h=[m],g=d.capture?``:`?:`,_=r.isWindows(t),b=n.globChars(_),x=n.extglobChars(b),{DOT_LITERAL:S,PLUS_LITERAL:C,SLASH_LITERAL:w,ONE_CHAR:T,DOTS_SLASH:E,NO_DOT:D,NO_DOT_SLASH:O,NO_DOTS_SLASH:k,QMARK:A,QMARK_NO_DOT:j,STAR:M,START_ANCHOR:ee}=b,N=e=>`(${g}(?:(?!${ee}${e.dot?E:S}).)*?)`,P=d.dot?``:D,F=d.dot?A:j,I=d.bash===!0?N(d):M;d.capture&&(I=`(${I})`),typeof d.noext==`boolean`&&(d.noextglob=d.noext);let L={input:e,index:-1,start:0,dot:d.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:h};e=r.removePrefix(e,L),p=e.length;let R=[],te=[],z=[],B=m,V,ne=()=>L.index===p-1,H=L.peek=(t=1)=>e[L.index+t],U=L.advance=()=>e[++L.index]||``,W=()=>e.slice(L.index+1),re=(e=``,t=0)=>{L.consumed+=e,L.index+=t},ie=e=>{L.output+=e.output==null?e.value:e.output,re(e.value)},ae=()=>{let e=1;for(;H()===`!`&&(H(2)!==`(`||H(3)===`?`);)U(),L.start++,e++;return e%2==0?!1:(L.negated=!0,L.start++,!0)},oe=e=>{L[e]++,z.push(e)},G=e=>{L[e]--,z.pop()},K=e=>{if(B.type===`globstar`){let t=L.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||R.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(L.output=L.output.slice(0,-B.output.length),B.type=`star`,B.value=`*`,B.output=I,L.output+=B.output)}if(R.length&&e.type!==`paren`&&(R[R.length-1].inner+=e.value),(e.value||e.output)&&ie(e),B&&B.type===`text`&&e.type===`text`){B.value+=e.value,B.output=(B.output||``)+e.value;return}e.prev=B,h.push(e),B=e},se=(e,t)=>{let n={...x[t],conditions:1,inner:``};n.prev=B,n.parens=L.parens,n.output=L.output,n.startIndex=L.index,n.tokensIndex=h.length;let r=(d.capture?`(`:``)+n.open;oe(`parens`),K({type:e,value:t,output:L.output?``:T}),K({type:`paren`,extglob:!0,value:U(),output:r}),R.push(n)},ce=n=>{let i=e.slice(n.startIndex,L.index+1),a=v(e.slice(n.startIndex+2,L.index),d);if((n.type===`plus`||n.type===`star`)&&a.risky){let e=a.safeOutput?(n.output?``:T)+(d.capture?`(${a.safeOutput})`:a.safeOutput):void 0,t=h[n.tokensIndex];t.type=`text`,t.value=i,t.output=e||r.escapeRegex(i);for(let e=n.tokensIndex+1;e<h.length;e++)h[e].value=``,h[e].output=``,delete h[e].suffix;L.output=n.output+t.output,L.backtrack=!0,K({type:`paren`,extglob:!0,value:V,output:``}),G(`parens`);return}let o=n.close+(d.capture?`)`:``),s;if(n.type===`negate`){let e=I;n.inner&&n.inner.length>1&&n.inner.includes(`/`)&&(e=N(d)),(e!==I||ne()||/^\)+$/.test(W()))&&(o=n.close=`)$))${e}`),n.inner.includes(`*`)&&(s=W())&&/^\.[^\\/.]+$/.test(s)&&(o=n.close=`)${y(s,{...t,fastpaths:!1}).output})${e})`),n.prev.type===`bos`&&(L.negatedExtglob=!0)}K({type:`paren`,extglob:!0,value:V,output:o}),G(`parens`)};if(d.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?A.repeat(a.length):``):o===0?F+(a?A.repeat(a.length):``):A.repeat(r.length):i===`.`?S.repeat(r.length):i===`*`?t?t+i+(a?I:``):I:t?e:`\\${e}`);return n===!0&&(i=d.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&d.contains===!0?(L.output=e,L):(L.output=r.wrapOutput(i,L,t),L)}for(;!ne();){if(V=U(),V===`\0`)continue;if(V===`\\`){let e=H();if(e===`/`&&d.bash!==!0||e===`.`||e===`;`)continue;if(!e){V+=`\\`,K({type:`text`,value:V});continue}let t=/^\\+/.exec(W()),n=0;if(t&&t[0].length>2&&(n=t[0].length,L.index+=n,n%2!=0&&(V+=`\\`)),d.unescape===!0?V=U():V+=U(),L.brackets===0){K({type:`text`,value:V});continue}}if(L.brackets>0&&(V!==`]`||B.value===`[`||B.value===`[^`)){if(d.posix!==!1&&V===`:`){let e=B.value.slice(1);if(e.includes(`[`)&&(B.posix=!0,e.includes(`:`))){let e=B.value.lastIndexOf(`[`),t=B.value.slice(0,e),n=a[B.value.slice(e+2)];if(n){B.value=t+n,L.backtrack=!0,U(),!m.output&&h.indexOf(B)===1&&(m.output=T);continue}}}(V===`[`&&H()!==`:`||V===`-`&&H()===`]`)&&(V=`\\${V}`),V===`]`&&(B.value===`[`||B.value===`[^`)&&(V=`\\${V}`),d.posix===!0&&V===`!`&&B.value===`[`&&(V=`^`),B.value+=V,ie({value:V});continue}if(L.quotes===1&&V!==`"`){V=r.escapeRegex(V),B.value+=V,ie({value:V});continue}if(V===`"`){L.quotes=L.quotes===1?0:1,d.keepQuotes===!0&&K({type:`text`,value:V});continue}if(V===`(`){oe(`parens`),K({type:`paren`,value:V});continue}if(V===`)`){if(L.parens===0&&d.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=R[R.length-1];if(e&&L.parens===e.parens+1){ce(R.pop());continue}K({type:`paren`,value:V,output:L.parens?`)`:`\\)`}),G(`parens`);continue}if(V===`[`){if(d.nobracket===!0||!W().includes(`]`)){if(d.nobracket!==!0&&d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));V=`\\${V}`}else oe(`brackets`);K({type:`bracket`,value:V});continue}if(V===`]`){if(d.nobracket===!0||B&&B.type===`bracket`&&B.value.length===1){K({type:`text`,value:V,output:`\\${V}`});continue}if(L.brackets===0){if(d.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));K({type:`text`,value:V,output:`\\${V}`});continue}G(`brackets`);let e=B.value.slice(1);if(B.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(V=`/${V}`),B.value+=V,ie({value:V}),d.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(B.value);if(L.output=L.output.slice(0,-B.value.length),d.literalBrackets===!0){L.output+=t,B.value=t;continue}B.value=`(${g}${t}|${B.value})`,L.output+=B.value;continue}if(V===`{`&&d.nobrace!==!0){oe(`braces`);let e={type:`brace`,value:V,output:`(`,outputIndex:L.output.length,tokensIndex:L.tokens.length};te.push(e),K(e);continue}if(V===`}`){let e=te[te.length-1];if(d.nobrace===!0||!e){K({type:`text`,value:V,output:V});continue}let t=`)`;if(e.dots===!0){let e=h.slice(),n=[];for(let t=e.length-1;t>=0&&(h.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&n.unshift(e[t].value);t=l(n,d),L.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=L.output.slice(0,e.outputIndex),r=L.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,V=t=`\\}`,L.output=n;for(let e of r)L.output+=e.output||e.value}K({type:`brace`,value:V,output:t}),G(`braces`),te.pop();continue}if(V===`|`){R.length>0&&R[R.length-1].conditions++,K({type:`text`,value:V});continue}if(V===`,`){let e=V,t=te[te.length-1];t&&z[z.length-1]===`braces`&&(t.comma=!0,e=`|`),K({type:`comma`,value:V,output:e});continue}if(V===`/`){if(B.type===`dot`&&L.index===L.start+1){L.start=L.index+1,L.consumed=``,L.output=``,h.pop(),B=m;continue}K({type:`slash`,value:V,output:w});continue}if(V===`.`){if(L.braces>0&&B.type===`dot`){B.value===`.`&&(B.output=S);let e=te[te.length-1];B.type=`dots`,B.output+=V,B.value+=V,e.dots=!0;continue}if(L.braces+L.parens===0&&B.type!==`bos`&&B.type!==`slash`){K({type:`text`,value:V,output:S});continue}K({type:`dot`,value:V,output:S});continue}if(V===`?`){if(!(B&&B.value===`(`)&&d.noextglob!==!0&&H()===`(`&&H(2)!==`?`){se(`qmark`,V);continue}if(B&&B.type===`paren`){let e=H(),t=V;if(e===`<`&&!r.supportsLookbehinds())throw Error(`Node.js v10 or higher is required for regex lookbehinds`);(B.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(W()))&&(t=`\\${V}`),K({type:`text`,value:V,output:t});continue}if(d.dot!==!0&&(B.type===`slash`||B.type===`bos`)){K({type:`qmark`,value:V,output:j});continue}K({type:`qmark`,value:V,output:A});continue}if(V===`!`){if(d.noextglob!==!0&&H()===`(`&&(H(2)!==`?`||!/[!=<:]/.test(H(3)))){se(`negate`,V);continue}if(d.nonegate!==!0&&L.index===0){ae();continue}}if(V===`+`){if(d.noextglob!==!0&&H()===`(`&&H(2)!==`?`){se(`plus`,V);continue}if(B&&B.value===`(`||d.regex===!1){K({type:`plus`,value:V,output:C});continue}if(B&&(B.type===`bracket`||B.type===`paren`||B.type===`brace`)||L.parens>0){K({type:`plus`,value:V});continue}K({type:`plus`,value:C});continue}if(V===`@`){if(d.noextglob!==!0&&H()===`(`&&H(2)!==`?`){K({type:`at`,extglob:!0,value:V,output:``});continue}K({type:`text`,value:V});continue}if(V!==`*`){(V===`$`||V===`^`)&&(V=`\\${V}`);let e=o.exec(W());e&&(V+=e[0],L.index+=e[0].length),K({type:`text`,value:V});continue}if(B&&(B.type===`globstar`||B.star===!0)){B.type=`star`,B.star=!0,B.value+=V,B.output=I,L.backtrack=!0,L.globstar=!0,re(V);continue}let t=W();if(d.noextglob!==!0&&/^\([^?]/.test(t)){se(`star`,V);continue}if(B.type===`star`){if(d.noglobstar===!0){re(V);continue}let n=B.prev,r=n.prev,i=n.type===`slash`||n.type===`bos`,a=r&&(r.type===`star`||r.type===`globstar`);if(d.bash===!0&&(!i||t[0]&&t[0]!==`/`)){K({type:`star`,value:V,output:``});continue}let o=L.braces>0&&(n.type===`comma`||n.type===`brace`),s=R.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){K({type:`star`,value:V,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[L.index+4];if(n&&n!==`/`)break;t=t.slice(3),re(`/**`,3)}if(n.type===`bos`&&ne()){B.type=`globstar`,B.value+=V,B.output=N(d),L.output=B.output,L.globstar=!0,re(V);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&ne()){L.output=L.output.slice(0,-(n.output+B.output).length),n.output=`(?:${n.output}`,B.type=`globstar`,B.output=N(d)+(d.strictSlashes?`)`:`|$)`),B.value+=V,L.globstar=!0,L.output+=n.output+B.output,re(V);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;L.output=L.output.slice(0,-(n.output+B.output).length),n.output=`(?:${n.output}`,B.type=`globstar`,B.output=`${N(d)}${w}|${w}${e})`,B.value+=V,L.output+=n.output+B.output,L.globstar=!0,re(V+U()),K({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){B.type=`globstar`,B.value+=V,B.output=`(?:^|${w}|${N(d)}${w})`,L.output=B.output,L.globstar=!0,re(V+U()),K({type:`slash`,value:`/`,output:``});continue}L.output=L.output.slice(0,-B.output.length),B.type=`globstar`,B.output=N(d),B.value+=V,L.output+=B.output,L.globstar=!0,re(V);continue}let n={type:`star`,value:V,output:I};if(d.bash===!0){n.output=`.*?`,(B.type===`bos`||B.type===`slash`)&&(n.output=P+n.output),K(n);continue}if(B&&(B.type===`bracket`||B.type===`paren`)&&d.regex===!0){n.output=V,K(n);continue}(L.index===L.start||B.type===`slash`||B.type===`dot`)&&(B.type===`dot`?(L.output+=O,B.output+=O):d.dot===!0?(L.output+=k,B.output+=k):(L.output+=P,B.output+=P),H()!==`*`&&(L.output+=T,B.output+=T)),K(n)}for(;L.brackets>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));L.output=r.escapeLast(L.output,`[`),G(`brackets`)}for(;L.parens>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));L.output=r.escapeLast(L.output,`(`),G(`parens`)}for(;L.braces>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));L.output=r.escapeLast(L.output,`{`),G(`braces`)}if(d.strictSlashes!==!0&&(B.type===`star`||B.type===`bracket`)&&K({type:`maybe_slash`,value:``,output:`${w}?`}),L.backtrack===!0){L.output=``;for(let e of L.tokens)L.output+=e.output==null?e.value:e.output,e.suffix&&(L.output+=e.suffix)}return L};y.fastpaths=(e,t)=>{let a={...t},o=typeof a.maxLength==`number`?Math.min(i,a.maxLength):i,s=e.length;if(s>o)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${o}`);e=c[e]||e;let l=r.isWindows(t),{DOT_LITERAL:u,SLASH_LITERAL:d,ONE_CHAR:f,DOTS_SLASH:p,NO_DOT:m,NO_DOTS:h,NO_DOTS_SLASH:g,STAR:_,START_ANCHOR:v}=n.globChars(l),y=a.dot?h:m,b=a.dot?g:m,x=a.capture?``:`?:`,S={negated:!1,prefix:``},C=a.bash===!0?`.*?`:_;a.capture&&(C=`(${C})`);let w=e=>e.noglobstar===!0?C:`(${x}(?:(?!${v}${e.dot?p:u}).)*?)`,T=e=>{switch(e){case`*`:return`${y}${f}${C}`;case`.*`:return`${u}${f}${C}`;case`*.*`:return`${y}${C}${u}${f}${C}`;case`*/*`:return`${y}${C}${d}${f}${b}${C}`;case`**`:return y+w(a);case`**/*`:return`(?:${y}${w(a)}${d})?${b}${f}${C}`;case`**/*.*`:return`(?:${y}${w(a)}${d})?${b}${C}${u}${f}${C}`;case`**/.*`:return`(?:${y}${w(a)}${d})?${u}${f}${C}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=T(t[1]);return n?n+u+t[2]:void 0}}},E=T(r.removePrefix(e,S));return E&&a.strictSlashes!==!0&&(E+=`${d}?`),E},t.exports=y})),Zy=s(((e,t)=>{var n=require("path"),r=Yy(),i=Xy(),a=Jy(),o=qy(),s=e=>e&&typeof e==`object`&&!Array.isArray(e),c=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>c(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=s(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},o=a.isWindows(t),l=r?c.compileRe(e,t):c.makeRe(e,t,!1,!0),u=l.state;delete l.state;let d=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};d=c(i.ignore,e,n)}let f=(n,r=!1)=>{let{isMatch:a,match:s,output:f}=c.test(n,l,t,{glob:e,posix:o}),p={glob:e,state:u,regex:l,posix:o,input:n,output:f,match:s,isMatch:a};return typeof i.onResult==`function`&&i.onResult(p),a===!1?(p.isMatch=!1,r?p:!1):d(n)?(typeof i.onIgnore==`function`&&i.onIgnore(p),p.isMatch=!1,r?p:!1):(typeof i.onMatch==`function`&&i.onMatch(p),r?p:!0)};return n&&(f.state=u),f};c.test=(e,t,n,{glob:r,posix:i}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let o=n||{},s=o.format||(i?a.toPosixSlashes:null),l=e===r,u=l&&s?s(e):e;return l===!1&&(u=s?s(e):e,l=u===r),(l===!1||o.capture===!0)&&(l=o.matchBase===!0||o.basename===!0?c.matchBase(e,t,n,i):t.exec(u)),{isMatch:!!l,match:l,output:u}},c.matchBase=(e,t,r,i=a.isWindows(r))=>(t instanceof RegExp?t:c.makeRe(t,r)).test(n.basename(e)),c.isMatch=(e,t,n)=>c(t,n)(e),c.parse=(e,t)=>Array.isArray(e)?e.map(e=>c.parse(e,t)):i(e,{...t,fastpaths:!1}),c.scan=(e,t)=>r(e,t),c.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,s=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(s=`^(?!${s}).*$`);let l=c.toRegex(s,t);return r===!0&&(l.state=e),l},c.makeRe=(e,t={},n=!1,r=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let a={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(a.output=i.fastpaths(e,t)),a.output||(a=i(e,t)),c.compileRe(a,t,n,r)},c.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},c.constants=o,t.exports=c})),Qy=s(((e,t)=>{t.exports=Zy()})),$y=s(((e,t)=>{var n=require("util"),r=Ky(),i=Qy(),a=Jy(),o=e=>e===``||e===`./`,s=e=>{let t=e.indexOf(`{`);return t>-1&&e.indexOf(`}`,t)>-1},c=(e,t,n)=>{t=[].concat(t),e=[].concat(e);let r=new Set,a=new Set,o=new Set,s=0,c=e=>{o.add(e.output),n&&n.onResult&&n.onResult(e)};for(let o=0;o<t.length;o++){let l=i(String(t[o]),{...n,onResult:c},!0),u=l.state.negated||l.state.negatedExtglob;u&&s++;for(let t of e){let e=l(t,!0);(u?!e.isMatch:e.isMatch)&&(u?r.add(e.output):(r.delete(e.output),a.add(e.output)))}}let l=(s===t.length?[...o]:[...a]).filter(e=>!r.has(e));if(n&&l.length===0){if(n.failglob===!0)throw Error(`No matches found for "${t.join(`, `)}"`);if(n.nonull===!0||n.nullglob===!0)return n.unescape?t.map(e=>e.replace(/\\/g,``)):t}return l};c.match=c,c.matcher=(e,t)=>i(e,t),c.isMatch=(e,t,n)=>i(t,n)(e),c.any=c.isMatch,c.not=(e,t,n={})=>{t=[].concat(t).map(String);let r=new Set,i=[],a=e=>{n.onResult&&n.onResult(e),i.push(e.output)},o=new Set(c(e,t,{...n,onResult:a}));for(let e of i)o.has(e)||r.add(e);return[...r]},c.contains=(e,t,r)=>{if(typeof e!=`string`)throw TypeError(`Expected a string: "${n.inspect(e)}"`);if(Array.isArray(t))return t.some(t=>c.contains(e,t,r));if(typeof t==`string`){if(o(e)||o(t))return!1;if(e.includes(t)||e.startsWith(`./`)&&e.slice(2).includes(t))return!0}return c.isMatch(e,t,{...r,contains:!0})},c.matchKeys=(e,t,n)=>{if(!a.isObject(e))throw TypeError(`Expected the first argument to be an object`);let r=c(Object.keys(e),t,n),i={};for(let t of r)i[t]=e[t];return i},c.some=(e,t,n)=>{let r=[].concat(e);for(let e of[].concat(t)){let t=i(String(e),n);if(r.some(e=>t(e)))return!0}return!1},c.every=(e,t,n)=>{let r=[].concat(e);for(let e of[].concat(t)){let t=i(String(e),n);if(!r.every(e=>t(e)))return!1}return!0},c.all=(e,t,r)=>{if(typeof e!=`string`)throw TypeError(`Expected a string: "${n.inspect(e)}"`);return[].concat(t).every(t=>i(t,r)(e))},c.capture=(e,t,n)=>{let r=a.isWindows(n),o=i.makeRe(String(e),{...n,capture:!0}).exec(r?a.toPosixSlashes(t):t);if(o)return o.slice(1).map(e=>e===void 0?``:e)},c.makeRe=(...e)=>i.makeRe(...e),c.scan=(...e)=>i.scan(...e),c.parse=(e,t)=>{let n=[];for(let a of[].concat(e||[]))for(let e of r(String(a),t))n.push(i.parse(e,t));return n},c.braces=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);return t&&t.nobrace===!0||!s(e)?[e]:r(e,t)},c.braceExpand=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);return c.braces(e,{...t,expand:!0})},c.hasBraces=s,t.exports=c})),eb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isAbsolute=e.partitionAbsoluteAndRelative=e.removeDuplicateSlashes=e.matchAny=e.convertPatternsToRe=e.makeRe=e.getPatternParts=e.expandBraceExpansion=e.expandPatternsWithBraceExpansion=e.isAffectDepthOfReadingPattern=e.endsWithSlashGlobStar=e.hasGlobStar=e.getBaseDirectory=e.isPatternRelatedToParentDirectory=e.getPatternsOutsideCurrentDirectory=e.getPatternsInsideCurrentDirectory=e.getPositivePatterns=e.getNegativePatterns=e.isPositivePattern=e.isNegativePattern=e.convertToNegativePattern=e.convertToPositivePattern=e.isDynamicPattern=e.isStaticPattern=void 0;var t=require("path"),n=Iy(),r=$y(),i=`**`,a=`\\`,o=/[*?]|^!/,s=/\[[^[]*]/,c=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,l=/[!*+?@]\([^(]*\)/,u=/,|\.\./,d=/(?!^)\/{2,}/g;function f(e,t={}){return!p(e,t)}e.isStaticPattern=f;function p(e,t={}){return e===``?!1:!!(t.caseSensitiveMatch===!1||e.includes(a)||o.test(e)||s.test(e)||c.test(e)||t.extglob!==!1&&l.test(e)||t.braceExpansion!==!1&&m(e))}e.isDynamicPattern=p;function m(e){let t=e.indexOf(`{`);if(t===-1)return!1;let n=e.indexOf(`}`,t+1);if(n===-1)return!1;let r=e.slice(t,n);return u.test(r)}function h(e){return _(e)?e.slice(1):e}e.convertToPositivePattern=h;function g(e){return`!`+e}e.convertToNegativePattern=g;function _(e){return e.startsWith(`!`)&&e[1]!==`(`}e.isNegativePattern=_;function v(e){return!_(e)}e.isPositivePattern=v;function y(e){return e.filter(_)}e.getNegativePatterns=y;function b(e){return e.filter(v)}e.getPositivePatterns=b;function x(e){return e.filter(e=>!C(e))}e.getPatternsInsideCurrentDirectory=x;function S(e){return e.filter(C)}e.getPatternsOutsideCurrentDirectory=S;function C(e){return e.startsWith(`..`)||e.startsWith(`./..`)}e.isPatternRelatedToParentDirectory=C;function w(e){return n(e,{flipBackslashes:!1})}e.getBaseDirectory=w;function T(e){return e.includes(i)}e.hasGlobStar=T;function E(e){return e.endsWith(`/**`)}e.endsWithSlashGlobStar=E;function D(e){let n=t.basename(e);return E(e)||f(n)}e.isAffectDepthOfReadingPattern=D;function O(e){return e.reduce((e,t)=>e.concat(k(t)),[])}e.expandPatternsWithBraceExpansion=O;function k(e){let t=r.braces(e,{expand:!0,nodupes:!0,keepEscaping:!0});return t.sort((e,t)=>e.length-t.length),t.filter(e=>e!==``)}e.expandBraceExpansion=k;function A(e,t){let{parts:n}=r.scan(e,Object.assign(Object.assign({},t),{parts:!0}));return n.length===0&&(n=[e]),n[0].startsWith(`/`)&&(n[0]=n[0].slice(1),n.unshift(``)),n}e.getPatternParts=A;function j(e,t){return r.makeRe(e,t)}e.makeRe=j;function M(e,t){return e.map(e=>j(e,t))}e.convertPatternsToRe=M;function ee(e,t){return t.some(t=>t.test(e))}e.matchAny=ee;function N(e){return e.replace(d,`/`)}e.removeDuplicateSlashes=N;function P(e){let t=[],n=[];for(let r of e)F(r)?t.push(r):n.push(r);return[t,n]}e.partitionAbsoluteAndRelative=P;function F(e){return t.isAbsolute(e)}e.isAbsolute=F})),tb=s(((e,t)=>{var n=require("stream").PassThrough,r=Array.prototype.slice;t.exports=i;function i(){let e=[],t=r.call(arguments),i=!1,o=t[t.length-1];o&&!Array.isArray(o)&&o.pipe==null?t.pop():o={};let s=o.end!==!1,c=o.pipeError===!0;o.objectMode??=!0,o.highWaterMark??=64*1024;let l=n(o);function u(){for(let t=0,n=arguments.length;t<n;t++)e.push(a(arguments[t],o));return d(),this}function d(){if(i)return;i=!0;let t=e.shift();if(!t){process.nextTick(f);return}Array.isArray(t)||(t=[t]);let n=t.length+1;function r(){--n>0||(i=!1,d())}function a(e){function t(){e.removeListener(`merge2UnpipeEnd`,t),e.removeListener(`end`,t),c&&e.removeListener(`error`,n),r()}function n(e){l.emit(`error`,e)}if(e._readableState.endEmitted)return r();e.on(`merge2UnpipeEnd`,t),e.on(`end`,t),c&&e.on(`error`,n),e.pipe(l,{end:!1}),e.resume()}for(let e=0;e<t.length;e++)a(t[e]);r()}function f(){i=!1,l.emit(`queueDrain`),s&&l.end()}return l.setMaxListeners(0),l.add=u,l.on(`unpipe`,function(e){e.emit(`merge2UnpipeEnd`)}),t.length&&u.apply(null,t),l}function a(e,t){if(Array.isArray(e))for(let n=0,r=e.length;n<r;n++)e[n]=a(e[n],t);else{if(!e._readableState&&e.pipe&&(e=e.pipe(n(t))),!e._readableState||!e.pause||!e.pipe)throw Error(`Only readable stream can be merged.`);e.pause()}return e}})),nb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.merge=void 0;var t=tb();function n(e){let n=t(e);return e.forEach(e=>{e.once(`error`,e=>n.emit(`error`,e))}),n.once(`close`,()=>r(e)),n.once(`end`,()=>r(e)),n}e.merge=n;function r(e){e.forEach(e=>e.emit(`close`))}})),rb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isEmpty=e.isString=void 0;function t(e){return typeof e==`string`}e.isString=t;function n(e){return e===``}e.isEmpty=n})),ib=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.string=e.stream=e.pattern=e.path=e.fs=e.errno=e.array=void 0,e.array=Ay(),e.errno=jy(),e.fs=My(),e.path=Ny(),e.pattern=eb(),e.stream=nb(),e.string=rb()})),ab=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.convertPatternGroupToTask=e.convertPatternGroupsToTasks=e.groupPatternsByBaseDirectory=e.getNegativePatternsAsPositive=e.getPositivePatterns=e.convertPatternsToTasks=e.generate=void 0;var t=ib();function n(e,n){let s=r(e,n),c=r(n.ignore,n),l=a(s),u=o(s,c),d=l.filter(e=>t.pattern.isStaticPattern(e,n)),f=l.filter(e=>t.pattern.isDynamicPattern(e,n)),p=i(d,u,!1),m=i(f,u,!0);return p.concat(m)}e.generate=n;function r(e,n){let r=e;return n.braceExpansion&&(r=t.pattern.expandPatternsWithBraceExpansion(r)),n.baseNameMatch&&(r=r.map(e=>e.includes(`/`)?e:`**/${e}`)),r.map(e=>t.pattern.removeDuplicateSlashes(e))}function i(e,n,r){let i=[],a=t.pattern.getPatternsOutsideCurrentDirectory(e),o=t.pattern.getPatternsInsideCurrentDirectory(e),u=s(a),d=s(o);return i.push(...c(u,n,r)),`.`in d?i.push(l(`.`,o,n,r)):i.push(...c(d,n,r)),i}e.convertPatternsToTasks=i;function a(e){return t.pattern.getPositivePatterns(e)}e.getPositivePatterns=a;function o(e,n){return t.pattern.getNegativePatterns(e).concat(n).map(t.pattern.convertToPositivePattern)}e.getNegativePatternsAsPositive=o;function s(e){return e.reduce((e,n)=>{let r=t.pattern.getBaseDirectory(n);return r in e?e[r].push(n):e[r]=[n],e},{})}e.groupPatternsByBaseDirectory=s;function c(e,t,n){return Object.keys(e).map(r=>l(r,e[r],t,n))}e.convertPatternGroupsToTasks=c;function l(e,n,r,i){return{dynamic:i,positive:n,negative:r,base:e,patterns:[].concat(n,r.map(t.pattern.convertToNegativePattern))}}e.convertPatternGroupToTask=l})),ob=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.read=void 0;function t(e,t,i){t.fs.lstat(e,(a,o)=>{if(a!==null){n(i,a);return}if(!o.isSymbolicLink()||!t.followSymbolicLink){r(i,o);return}t.fs.stat(e,(e,a)=>{if(e!==null){if(t.throwErrorOnBrokenSymbolicLink){n(i,e);return}r(i,o);return}t.markSymbolicLink&&(a.isSymbolicLink=()=>!0),r(i,a)})})}e.read=t;function n(e,t){e(t)}function r(e,t){e(null,t)}})),sb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.read=void 0;function t(e,t){let n=t.fs.lstatSync(e);if(!n.isSymbolicLink()||!t.followSymbolicLink)return n;try{let n=t.fs.statSync(e);return t.markSymbolicLink&&(n.isSymbolicLink=()=>!0),n}catch(e){if(!t.throwErrorOnBrokenSymbolicLink)return n;throw e}}e.read=t})),cb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;var t=require("fs");e.FILE_SYSTEM_ADAPTER={lstat:t.lstat,stat:t.stat,lstatSync:t.lstatSync,statSync:t.statSync};function n(t){return t===void 0?e.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},e.FILE_SYSTEM_ADAPTER),t)}e.createFileSystemAdapter=n})),lb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=cb();e.default=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=t.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,t){return e??t}}})),ub=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.statSync=e.stat=e.Settings=void 0;var t=ob(),n=sb(),r=lb();e.Settings=r.default;function i(e,n,r){if(typeof n==`function`){t.read(e,o(),n);return}t.read(e,o(n),r)}e.stat=i;function a(e,t){let r=o(t);return n.read(e,r)}e.statSync=a;function o(e={}){return e instanceof r.default?e:new r.default(e)}})),db=s(((e,t)=>{var n;t.exports=typeof queueMicrotask==`function`?queueMicrotask.bind(typeof window<`u`?window:global):e=>(n||=Promise.resolve()).then(e).catch(e=>setTimeout(()=>{throw e},0))})),fb=s(((e,t)=>{t.exports=r;var n=db();function r(e,t){let r,i,a,o=!0;Array.isArray(e)?(r=[],i=e.length):(a=Object.keys(e),r={},i=a.length);function s(e){function i(){t&&t(e,r),t=null}o?n(i):i()}function c(e,t,n){r[e]=n,(--i===0||t)&&s(t)}i?a?a.forEach(function(t){e[t](function(e,n){c(t,e,n)})}):e.forEach(function(e,t){e(function(e,n){c(t,e,n)})}):s(null),o=!1}})),pb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var t=process.versions.node.split(`.`);if(t[0]===void 0||t[1]===void 0)throw Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var n=Number.parseInt(t[0],10),r=Number.parseInt(t[1],10),i=10;e.IS_SUPPORT_READDIR_WITH_FILE_TYPES=n>i||n===i&&r>=10})),mb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createDirentFromStats=void 0;var t=class{constructor(e,t){this.name=e,this.isBlockDevice=t.isBlockDevice.bind(t),this.isCharacterDevice=t.isCharacterDevice.bind(t),this.isDirectory=t.isDirectory.bind(t),this.isFIFO=t.isFIFO.bind(t),this.isFile=t.isFile.bind(t),this.isSocket=t.isSocket.bind(t),this.isSymbolicLink=t.isSymbolicLink.bind(t)}};function n(e,n){return new t(e,n)}e.createDirentFromStats=n})),hb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.fs=void 0,e.fs=mb()})),gb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.joinPathSegments=void 0;function t(e,t,n){return e.endsWith(n)?e+t:e+n+t}e.joinPathSegments=t})),_b=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.readdir=e.readdirWithFileTypes=e.read=void 0;var t=ub(),n=fb(),r=pb(),i=hb(),a=gb();function o(e,t,n){if(!t.stats&&r.IS_SUPPORT_READDIR_WITH_FILE_TYPES){s(e,t,n);return}l(e,t,n)}e.read=o;function s(e,t,r){t.fs.readdir(e,{withFileTypes:!0},(i,o)=>{if(i!==null){u(r,i);return}let s=o.map(n=>({dirent:n,name:n.name,path:a.joinPathSegments(e,n.name,t.pathSegmentSeparator)}));if(!t.followSymbolicLinks){d(r,s);return}n(s.map(e=>c(e,t)),(e,t)=>{if(e!==null){u(r,e);return}d(r,t)})})}e.readdirWithFileTypes=s;function c(e,t){return n=>{if(!e.dirent.isSymbolicLink()){n(null,e);return}t.fs.stat(e.path,(r,a)=>{if(r!==null){if(t.throwErrorOnBrokenSymbolicLink){n(r);return}n(null,e);return}e.dirent=i.fs.createDirentFromStats(e.name,a),n(null,e)})}}function l(e,r,o){r.fs.readdir(e,(s,c)=>{if(s!==null){u(o,s);return}n(c.map(n=>{let o=a.joinPathSegments(e,n,r.pathSegmentSeparator);return e=>{t.stat(o,r.fsStatSettings,(t,a)=>{if(t!==null){e(t);return}let s={name:n,path:o,dirent:i.fs.createDirentFromStats(n,a)};r.stats&&(s.stats=a),e(null,s)})}}),(e,t)=>{if(e!==null){u(o,e);return}d(o,t)})})}e.readdir=l;function u(e,t){e(t)}function d(e,t){e(null,t)}})),vb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.readdir=e.readdirWithFileTypes=e.read=void 0;var t=ub(),n=pb(),r=hb(),i=gb();function a(e,t){return!t.stats&&n.IS_SUPPORT_READDIR_WITH_FILE_TYPES?o(e,t):s(e,t)}e.read=a;function o(e,t){return t.fs.readdirSync(e,{withFileTypes:!0}).map(n=>{let a={dirent:n,name:n.name,path:i.joinPathSegments(e,n.name,t.pathSegmentSeparator)};if(a.dirent.isSymbolicLink()&&t.followSymbolicLinks)try{let e=t.fs.statSync(a.path);a.dirent=r.fs.createDirentFromStats(a.name,e)}catch(e){if(t.throwErrorOnBrokenSymbolicLink)throw e}return a})}e.readdirWithFileTypes=o;function s(e,n){return n.fs.readdirSync(e).map(a=>{let o=i.joinPathSegments(e,a,n.pathSegmentSeparator),s=t.statSync(o,n.fsStatSettings),c={name:a,path:o,dirent:r.fs.createDirentFromStats(a,s)};return n.stats&&(c.stats=s),c})}e.readdir=s})),yb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;var t=require("fs");e.FILE_SYSTEM_ADAPTER={lstat:t.lstat,stat:t.stat,lstatSync:t.lstatSync,statSync:t.statSync,readdir:t.readdir,readdirSync:t.readdirSync};function n(t){return t===void 0?e.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},e.FILE_SYSTEM_ADAPTER),t)}e.createFileSystemAdapter=n})),bb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=require("path"),n=ub(),r=yb();e.default=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=r.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,t.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new n.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return e??t}}})),xb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Settings=e.scandirSync=e.scandir=void 0;var t=_b(),n=vb(),r=bb();e.Settings=r.default;function i(e,n,r){if(typeof n==`function`){t.read(e,o(),n);return}t.read(e,o(n),r)}e.scandir=i;function a(e,t){let r=o(t);return n.read(e,r)}e.scandirSync=a;function o(e={}){return e instanceof r.default?e:new r.default(e)}})),Sb=s(((e,t)=>{function n(e){var t=new e,n=t;function r(){var r=t;return r.next?t=r.next:(t=new e,n=t),r.next=null,r}function i(e){n.next=e,n=e}return{get:r,release:i}}t.exports=n})),Cb=s(((e,t)=>{var n=Sb();function r(e,t,r){if(typeof e==`function`&&(r=t,t=e,e=null),!(r>=1))throw Error(`fastqueue concurrency must be equal to or greater than 1`);var o=n(a),s=null,c=null,l=0,u=null,d={push:v,drain:i,saturated:i,pause:p,paused:!1,get concurrency(){return r},set concurrency(e){if(!(e>=1))throw Error(`fastqueue concurrency must be equal to or greater than 1`);if(r=e,!d.paused)for(;s&&l<r;)l++,b()},running:f,resume:g,idle:_,length:m,getQueue:h,unshift:y,empty:i,kill:x,killAndDrain:S,error:w,abort:C};return d;function f(){return l}function p(){d.paused=!0}function m(){for(var e=s,t=0;e;)e=e.next,t++;return t}function h(){for(var e=s,t=[];e;)t.push(e.value),e=e.next;return t}function g(){if(d.paused){if(d.paused=!1,s===null){l++,b();return}for(;s&&l<r;)l++,b()}}function _(){return l===0&&d.length()===0}function v(n,a){var f=o.get();f.context=e,f.release=b,f.value=n,f.callback=a||i,f.errorHandler=u,l>=r||d.paused?c?(c.next=f,c=f):(s=f,c=f,d.saturated()):(l++,t.call(e,f.value,f.worked))}function y(n,a){var f=o.get();f.context=e,f.release=b,f.value=n,f.callback=a||i,f.errorHandler=u,l>=r||d.paused?s?(f.next=s,s=f):(s=f,c=f,d.saturated()):(l++,t.call(e,f.value,f.worked))}function b(n){n&&o.release(n);var i=s;i&&l<=r?d.paused?l--:(c===s&&(c=null),s=i.next,i.next=null,t.call(e,i.value,i.worked),c===null&&d.empty()):--l===0&&d.drain()}function x(){s=null,c=null,d.drain=i}function S(){s=null,c=null,d.drain(),d.drain=i}function C(){var e=s;for(s=null,c=null;e;){var t=e.next,n=e.callback,r=e.errorHandler,a=e.value,o=e.context;e.value=null,e.callback=i,e.errorHandler=null,r&&r(Error(`abort`),a),n.call(o,Error(`abort`)),e.release(e),e=t}d.drain=i}function w(e){u=e}}function i(){}function a(){this.value=null,this.callback=i,this.next=null,this.release=i,this.context=null,this.errorHandler=null;var e=this;this.worked=function(t,n){var r=e.callback,a=e.errorHandler,o=e.value;e.value=null,e.callback=i,e.errorHandler&&a(t,o),r.call(e.context,t,n),e.release(e)}}function o(e,t,n){typeof e==`function`&&(n=t,t=e,e=null);function a(e,n){t.call(this,e).then(function(e){n(null,e)},n)}var o=r(e,a,n),s=o.push,c=o.unshift;return o.push=l,o.unshift=u,o.drained=d,o;function l(e){var t=new Promise(function(t,n){s(e,function(e,r){if(e){n(e);return}t(r)})});return t.catch(i),t}function u(e){var t=new Promise(function(t,n){c(e,function(e,r){if(e){n(e);return}t(r)})});return t.catch(i),t}function d(){return new Promise(function(e){process.nextTick(function(){if(o.idle())e();else{var t=o.drain;o.drain=function(){typeof t==`function`&&t(),e(),o.drain=t}}})})}}t.exports=r,t.exports.promise=o})),wb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.joinPathSegments=e.replacePathSegmentSeparator=e.isAppliedFilter=e.isFatalError=void 0;function t(e,t){return e.errorFilter===null?!0:!e.errorFilter(t)}e.isFatalError=t;function n(e,t){return e===null||e(t)}e.isAppliedFilter=n;function r(e,t){return e.split(/[/\\]/).join(t)}e.replacePathSegmentSeparator=r;function i(e,t,n){return e===``?t:e.endsWith(n)?e+t:e+n+t}e.joinPathSegments=i})),Tb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=wb();e.default=class{constructor(e,n){this._root=e,this._settings=n,this._root=t.replacePathSegmentSeparator(e,n.pathSegmentSeparator)}}})),Eb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=require("events"),n=xb(),r=Cb(),i=wb(),a=Tb();e.default=class extends a.default{constructor(e,i){super(e,i),this._settings=i,this._scandir=n.scandir,this._emitter=new t.EventEmitter,this._queue=r(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit(`end`)}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw Error(`The reader is already destroyed`);this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on(`entry`,e)}onError(e){this._emitter.once(`error`,e)}onEnd(e){this._emitter.once(`end`,e)}_pushToQueue(e,t){let n={directory:e,base:t};this._queue.push(n,e=>{e!==null&&this._handleError(e)})}_worker(e,t){this._scandir(e.directory,this._settings.fsScandirSettings,(n,r)=>{if(n!==null){t(n,void 0);return}for(let t of r)this._handleEntry(t,e.base);t(null,void 0)})}_handleError(e){this._isDestroyed||!i.isFatalError(this._settings,e)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit(`error`,e))}_handleEntry(e,t){if(this._isDestroyed||this._isFatalError)return;let n=e.path;t!==void 0&&(e.path=i.joinPathSegments(t,e.name,this._settings.pathSegmentSeparator)),i.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&i.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,t===void 0?void 0:e.path)}_emitEntry(e){this._emitter.emit(`entry`,e)}}})),Db=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Eb();e.default=class{constructor(e,n){this._root=e,this._settings=n,this._reader=new t.default(this._root,this._settings),this._storage=[]}read(e){this._reader.onError(t=>{n(e,t)}),this._reader.onEntry(e=>{this._storage.push(e)}),this._reader.onEnd(()=>{r(e,this._storage)}),this._reader.read()}};function n(e,t){e(t)}function r(e,t){e(null,t)}})),Ob=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=require("stream"),n=Eb();e.default=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new n.default(this._root,this._settings),this._stream=new t.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(e=>{this._stream.emit(`error`,e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}}})),kb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=xb(),n=wb(),r=Tb();e.default=class extends r.default{constructor(){super(...arguments),this._scandir=t.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(e,t){this._queue.add({directory:e,base:t})}_handleQueue(){for(let e of this._queue.values())this._handleDirectory(e.directory,e.base)}_handleDirectory(e,t){try{let n=this._scandir(e,this._settings.fsScandirSettings);for(let e of n)this._handleEntry(e,t)}catch(e){this._handleError(e)}}_handleError(e){if(n.isFatalError(this._settings,e))throw e}_handleEntry(e,t){let r=e.path;t!==void 0&&(e.path=n.joinPathSegments(t,e.name,this._settings.pathSegmentSeparator)),n.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&n.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(r,t===void 0?void 0:e.path)}_pushToStorage(e){this._storage.push(e)}}})),Ab=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=kb();e.default=class{constructor(e,n){this._root=e,this._settings=n,this._reader=new t.default(this._root,this._settings)}read(){return this._reader.read()}}})),jb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=require("path"),n=xb();e.default=class{constructor(e={}){this._options=e,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,1/0),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,t.sep),this.fsScandirSettings=new n.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return e??t}}})),Mb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Settings=e.walkStream=e.walkSync=e.walk=void 0;var t=Db(),n=Ob(),r=Ab(),i=jb();e.Settings=i.default;function a(e,n,r){if(typeof n==`function`){new t.default(e,c()).read(n);return}new t.default(e,c(n)).read(r)}e.walk=a;function o(e,t){let n=c(t);return new r.default(e,n).read()}e.walkSync=o;function s(e,t){let r=c(t);return new n.default(e,r).read()}e.walkStream=s;function c(e={}){return e instanceof i.default?e:new i.default(e)}})),Nb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=require("path"),n=ub(),r=ib();e.default=class{constructor(e){this._settings=e,this._fsStatSettings=new n.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return t.resolve(this._settings.cwd,e)}_makeEntry(e,t){let n={name:t,path:t,dirent:r.fs.createDirentFromStats(t,e)};return this._settings.stats&&(n.stats=e),n}_isFatalError(e){return!r.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}}})),Pb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=require("stream"),n=ub(),r=Mb(),i=Nb();e.default=class extends i.default{constructor(){super(...arguments),this._walkStream=r.walkStream,this._stat=n.stat}dynamic(e,t){return this._walkStream(e,t)}static(e,n){let r=e.map(this._getFullEntryPath,this),i=new t.PassThrough({objectMode:!0});i._write=(t,a,o)=>this._getEntry(r[t],e[t],n).then(e=>{e!==null&&n.entryFilter(e)&&i.push(e),t===r.length-1&&i.end(),o()}).catch(o);for(let e=0;e<r.length;e++)i.write(e);return i}_getEntry(e,t,n){return this._getStat(e).then(e=>this._makeEntry(e,t)).catch(e=>{if(n.errorFilter(e))return null;throw e})}_getStat(e){return new Promise((t,n)=>{this._stat(e,this._fsStatSettings,(e,r)=>e===null?t(r):n(e))})}}})),Fb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Mb(),n=Nb(),r=Pb();e.default=class extends n.default{constructor(){super(...arguments),this._walkAsync=t.walk,this._readerStream=new r.default(this._settings)}dynamic(e,t){return new Promise((n,r)=>{this._walkAsync(e,t,(e,t)=>{e===null?n(t):r(e)})})}async static(e,t){let n=[],r=this._readerStream.static(e,t);return new Promise((e,t)=>{r.once(`error`,t),r.on(`data`,e=>n.push(e)),r.once(`end`,()=>e(n))})}}})),Ib=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=ib();e.default=class{constructor(e,t,n){this._patterns=e,this._settings=t,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){for(let e of this._patterns){let t=this._getPatternSegments(e),n=this._splitSegmentsIntoSections(t);this._storage.push({complete:n.length<=1,pattern:e,segments:t,sections:n})}}_getPatternSegments(e){return t.pattern.getPatternParts(e,this._micromatchOptions).map(e=>t.pattern.isDynamicPattern(e,this._settings)?{dynamic:!0,pattern:e,patternRe:t.pattern.makeRe(e,this._micromatchOptions)}:{dynamic:!1,pattern:e})}_splitSegmentsIntoSections(e){return t.array.splitWhen(e,e=>e.dynamic&&t.pattern.hasGlobStar(e.pattern))}}})),Lb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Ib();e.default=class extends t.default{match(e){let t=e.split(`/`),n=t.length,r=this._storage.filter(e=>!e.complete||e.segments.length>n);for(let e of r){let r=e.sections[0];if(!e.complete&&n>r.length||t.every((t,n)=>{let r=e.segments[n];return!!(r.dynamic&&r.patternRe.test(t)||!r.dynamic&&r.pattern===t)}))return!0}return!1}}})),Rb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=ib(),n=Lb();e.default=class{constructor(e,t){this._settings=e,this._micromatchOptions=t}getFilter(e,t,n){let r=this._getMatcher(t),i=this._getNegativePatternsRe(n);return t=>this._filter(e,t,r,i)}_getMatcher(e){return new n.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){let n=e.filter(t.pattern.isAffectDepthOfReadingPattern);return t.pattern.convertPatternsToRe(n,this._micromatchOptions)}_filter(e,n,r,i){if(this._isSkippedByDeep(e,n.path)||this._isSkippedSymbolicLink(n))return!1;let a=t.path.removeLeadingDotSegment(n.path);return this._isSkippedByPositivePatterns(a,r)?!1:this._isSkippedByNegativePatterns(a,i)}_isSkippedByDeep(e,t){return this._settings.deep===1/0?!1:this._getEntryLevel(e,t)>=this._settings.deep}_getEntryLevel(e,t){let n=t.split(`/`).length;return e===``?n:n-e.split(`/`).length}_isSkippedSymbolicLink(e){return!this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(e,t){return!this._settings.baseNameMatch&&!t.match(e)}_isSkippedByNegativePatterns(e,n){return!t.pattern.matchAny(e,n)}}})),zb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=ib();e.default=class{constructor(e,t){this._settings=e,this._micromatchOptions=t,this.index=new Map}getFilter(e,n){let[r,i]=t.pattern.partitionAbsoluteAndRelative(n),a={positive:{all:t.pattern.convertPatternsToRe(e,this._micromatchOptions)},negative:{absolute:t.pattern.convertPatternsToRe(r,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:t.pattern.convertPatternsToRe(i,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return e=>this._filter(e,a)}_filter(e,n){let r=t.path.removeLeadingDotSegment(e.path);if(this._settings.unique&&this._isDuplicateEntry(r)||this._onlyFileFilter(e)||this._onlyDirectoryFilter(e))return!1;let i=this._isMatchToPatternsSet(r,n,e.dirent.isDirectory());return this._settings.unique&&i&&this._createIndexRecord(r),i}_isDuplicateEntry(e){return this.index.has(e)}_createIndexRecord(e){this.index.set(e,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isMatchToPatternsSet(e,t,n){return!(!this._isMatchToPatterns(e,t.positive.all,n)||this._isMatchToPatterns(e,t.negative.relative,n)||this._isMatchToAbsoluteNegative(e,t.negative.absolute,n))}_isMatchToAbsoluteNegative(e,n,r){if(n.length===0)return!1;let i=t.path.makeAbsolute(this._settings.cwd,e);return this._isMatchToPatterns(i,n,r)}_isMatchToPatterns(e,n,r){if(n.length===0)return!1;let i=t.pattern.matchAny(e,n);return!i&&r?t.pattern.matchAny(e+`/`,n):i}}})),Bb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=ib();e.default=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return t.errno.isEnoentCodeError(e)||this._settings.suppressErrors}}})),Vb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=ib();e.default=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let n=e.path;return this._settings.absolute&&(n=t.path.makeAbsolute(this._settings.cwd,n),n=t.path.unixify(n)),this._settings.markDirectories&&e.dirent.isDirectory()&&(n+=`/`),this._settings.objectMode?Object.assign(Object.assign({},e),{path:n}):n}}})),Hb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=require("path"),n=Rb(),r=zb(),i=Bb(),a=Vb();e.default=class{constructor(e){this._settings=e,this.errorFilter=new i.default(this._settings),this.entryFilter=new r.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new n.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new a.default(this._settings)}_getRootDirectory(e){return t.resolve(this._settings.cwd,e.base)}_getReaderOptions(e){let t=e.base===`.`?``:e.base;return{basePath:t,pathSegmentSeparator:`/`,concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(t,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}}})),Ub=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Fb(),n=Hb();e.default=class extends n.default{constructor(){super(...arguments),this._reader=new t.default(this._settings)}async read(e){let t=this._getRootDirectory(e),n=this._getReaderOptions(e);return(await this.api(t,e,n)).map(e=>n.transform(e))}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}})),Wb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=require("stream"),n=Pb(),r=Hb();e.default=class extends r.default{constructor(){super(...arguments),this._reader=new n.default(this._settings)}read(e){let n=this._getRootDirectory(e),r=this._getReaderOptions(e),i=this.api(n,e,r),a=new t.Readable({objectMode:!0,read:()=>{}});return i.once(`error`,e=>a.emit(`error`,e)).on(`data`,e=>a.emit(`data`,r.transform(e))).once(`end`,()=>a.emit(`end`)),a.once(`close`,()=>i.destroy()),a}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}})),Gb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=ub(),n=Mb(),r=Nb();e.default=class extends r.default{constructor(){super(...arguments),this._walkSync=n.walkSync,this._statSync=t.statSync}dynamic(e,t){return this._walkSync(e,t)}static(e,t){let n=[];for(let r of e){let e=this._getFullEntryPath(r),i=this._getEntry(e,r,t);i===null||!t.entryFilter(i)||n.push(i)}return n}_getEntry(e,t,n){try{let n=this._getStat(e);return this._makeEntry(n,t)}catch(e){if(n.errorFilter(e))return null;throw e}}_getStat(e){return this._statSync(e,this._fsStatSettings)}}})),Kb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Gb(),n=Hb();e.default=class extends n.default{constructor(){super(...arguments),this._reader=new t.default(this._settings)}read(e){let t=this._getRootDirectory(e),n=this._getReaderOptions(e);return this.api(t,e,n).map(n.transform)}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}})),qb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var t=require("fs"),n=require("os"),r=Math.max(n.cpus().length,1);e.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:t.lstat,lstatSync:t.lstatSync,stat:t.stat,statSync:t.statSync,readdir:t.readdir,readdirSync:t.readdirSync},e.default=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,r),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(e,t){return e===void 0?t:e}_getFileSystemMethods(t={}){return Object.assign(Object.assign({},e.DEFAULT_FILE_SYSTEM_ADAPTER),t)}}})),Jb=u(s(((e,t)=>{var n=ab(),r=Ub(),i=Wb(),a=Kb(),o=qb(),s=ib();async function c(e,t){u(e);let n=l(e,r.default,t),i=await Promise.all(n);return s.array.flatten(i)}(function(e){e.glob=e,e.globSync=t,e.globStream=r,e.async=e;function t(e,t){u(e);let n=l(e,a.default,t);return s.array.flatten(n)}e.sync=t;function r(e,t){u(e);let n=l(e,i.default,t);return s.stream.merge(n)}e.stream=r;function c(e,t){u(e);let r=[].concat(e),i=new o.default(t);return n.generate(r,i)}e.generateTasks=c;function d(e,t){u(e);let n=new o.default(t);return s.pattern.isDynamicPattern(e,n)}e.isDynamicPattern=d;function f(e){return u(e),s.path.escape(e)}e.escapePath=f;function p(e){return u(e),s.path.convertPathToPattern(e)}e.convertPathToPattern=p,(function(e){function t(e){return u(e),s.path.escapePosixPath(e)}e.escapePath=t;function n(e){return u(e),s.path.convertPosixPathToPattern(e)}e.convertPathToPattern=n})(e.posix||={}),(function(e){function t(e){return u(e),s.path.escapeWindowsPath(e)}e.escapePath=t;function n(e){return u(e),s.path.convertWindowsPathToPattern(e)}e.convertPathToPattern=n})(e.win32||={})})(c||={});function l(e,t,r){let i=[].concat(e),a=new o.default(r),s=n.generate(i,a),c=new t(a);return s.map(c.read,c)}function u(e){if(![].concat(e).every(e=>s.string.isString(e)&&!s.string.isEmpty(e)))throw TypeError(`Patterns must be a string (non empty) or an array of strings`)}t.exports=c}))(),1),Yb={ignore:[`**/node_modules/**`,`**/.pnpm-store/**`]},Xb=async e=>{let t=f.default.join(f.default.dirname(e),`pnpm-workspace.yaml`),n;try{n=await g.default.readFile(t,`utf-8`)}catch{return null}return(0,_f.parse)(n)},Zb=async e=>{let t=f.default.join(f.default.dirname(e),`.yarnrc.yml`),n;try{n=await g.default.readFile(t,`utf-8`)}catch{return null}return(0,_f.parse)(n)},Qb=async(e,t)=>{let n={};if(e.packageManager===`pnpm`){let e=await Xb(t);e&&!Array.isArray(e)&&(e.catalog&&Object.assign(n,e.catalog),e.catalogs&&Object.assign(n,...Object.values(e.catalogs)),e.workspaces&&!Array.isArray(e.workspaces)&&(e.workspaces.catalog&&Object.assign(n,e.workspaces.catalog),e.workspaces.catalogs&&Object.assign(n,...Object.values(e.workspaces.catalogs))))}if(e.packageManager===`yarn`){let e=await Zb(t);e&&(e.catalog&&Object.assign(n,e.catalog),e.catalogs&&Object.assign(n,...Object.values(e.catalogs)))}let r=JSON.parse(await g.default.readFile(t,`utf-8`));return Object.assign(n,r.catalog,...Object.values(r.catalogs??{})),r.workspaces&&!Array.isArray(r.workspaces)&&Object.assign(n,r.workspaces.catalog,...Object.values(r.workspaces.catalogs??{})),Object.keys(n).length>0?n:null};async function $b(e,t,n,r){let{pkgData:i,pkgPath:a}=await ky({...e,packageFile:n,loglevel:`silent`}),o=(typeof i==`string`?JSON.parse(i):i).workspaces||await Xb(a||``),s=Array.isArray(o)?o:o?.packages;s||up(e,`workspaces property missing from package.json. --workspace${e.workspaces?`s`:``} only works when you specify a "workspaces" property in your package.json.`);let c=e.packageFile?f.default.dirname(f.default.resolve(e.packageFile)):r,l=(s||[]).map(e=>f.default.join(c,e,`package.json`).replace(/\\/g,`/`)),u=Jb.default.sync(l,Yb),d=await Promise.all(u.map(async t=>{let n=await dp(e,t);return n.name=n.pkg.name||t.split(`/`).slice(-2)[0],n})),p=d.map(e=>e.name||``);return e.workspaces===!0?[d,p]:[d.filter(n=>e.workspace?.some(e=>s?.some(r=>n.name===e||n.filepath===f.default.join(c,f.default.dirname(r),e,t).replace(/\\/g,`/`)))),p]}async function ex(e,t){if(!t)return null;let n=await Qb(e,t);if(!n)return null;let r={name:`catalog-dependencies`,version:`1.0.0`,dependencies:n};return{filepath:e.packageManager===`pnpm`?f.default.join(f.default.dirname(t),`pnpm-workspace.yaml`):e.packageManager===`yarn`?f.default.join(f.default.dirname(t),`.yarnrc.yml`):`${t}#catalog`,pkg:r,pkgFile:JSON.stringify(r,null,2),name:`catalogs`}}async function tx(e){let t=e.packageFile||`package.json`,n=e.cwd?Pl(e.cwd):`./`,r=e.packageFile||(e.cwd?f.default.join(n,`package.json`):`package.json`),i=e.workspaces===!0||e.workspace!==void 0&&e.workspace.length!==0,a=[];if(!i||e.root===!0){let t=r.replace(/\\/g,`/`),n=Jb.default.sync(t,Yb),i=await Promise.all(n.map(async t=>await dp(e,t)));a=[...a,...i]}if(!i)return[a,[]];let o=null;if(i){let{pkgPath:t}=await ky({...e,packageFile:r,loglevel:`silent`});t&&(o=await ex(e,t))}let[s,c]=await $b(e,t,r,n);return a=[...a,...s],o&&(a=[...a,o]),[a,c]}var nx=s(((e,t)=>{var n=require("path"),r=require("fs"),i=require("os"),a=require("url"),o=r.promises.readFile;function s(e,t){return[`package.json`,`.${e}rc.json`,`.${e}rc.js`,`.${e}rc.cjs`,...t?[]:[`.${e}rc.mjs`],`.config/${e}rc`,`.config/${e}rc.json`,`.config/${e}rc.js`,`.config/${e}rc.cjs`,...t?[]:[`.config/${e}rc.mjs`],`${e}.config.js`,`${e}.config.cjs`,...t?[]:[`${e}.config.mjs`]]}function c(e){return n.dirname(e)||n.sep}var l=(e,t)=>JSON.parse(t),u=typeof __webpack_require__==`function`?__non_webpack_require__:require,d=Object.freeze({".js":u,".json":u,".cjs":u,noExt:l});t.exports.defaultLoadersSync=d;var f=async e=>{try{return(await import(a.pathToFileURL(e).href)).default}catch(t){try{return u(e)}catch(e){throw e.code===`ERR_REQUIRE_ESM`||e instanceof SyntaxError&&e.toString().includes(`Cannot use import statement outside a module`)?t:e}}},p=Object.freeze({".js":f,".mjs":f,".cjs":f,".json":l,noExt:l});t.exports.defaultLoaders=p;function m(e,t,r){let a={stopDir:i.homedir(),searchPlaces:s(e,r),ignoreEmptySearchPlaces:!0,cache:!0,transform:e=>e,packageProp:[e],...t,loaders:{...r?d:p,...t.loaders}};return a.searchPlaces.forEach(e=>{let t=n.extname(e)||`noExt`,r=a.loaders[t];if(!r)throw Error(`Missing loader for extension "${e}"`);if(typeof r!=`function`)throw Error(`Loader for extension "${e}" is not a function: Received ${typeof r}.`)}),a}function h(e,t){return typeof e==`string`&&e in t?t[e]:(Array.isArray(e)?e:e.split(`.`)).reduce((e,t)=>e===void 0?e:e[t],t)||null}function g(e){if(!e)throw Error(`load must pass a non-empty string`)}function _(e,t){if(!e)throw Error(`No loader specified for extension "${t}"`);if(typeof e!=`function`)throw Error(`loader is not a function`)}var v=e=>(t,n,r)=>(e&&t.set(n,r),r);t.exports.lilconfig=function(e,t){let{ignoreEmptySearchPlaces:i,loaders:a,packageProp:s,searchPlaces:l,stopDir:u,transform:d,cache:f}=m(e,t??{},!1),p=new Map,y=new Map,b=v(f);return{async search(e=process.cwd()){let t={config:null,filepath:``},m=new Set,g=e;dirLoop:for(;;){if(f){let e=p.get(g);if(e!==void 0){for(let t of m)p.set(t,e);return e}m.add(g)}for(let e of l){let c=n.join(g,e);try{await r.promises.access(c)}catch{continue}let l=String(await o(c)),u=n.extname(e)||`noExt`,d=a[u];if(e===`package.json`){let e=h(s,await d(c,l));if(e!=null){t.config=e,t.filepath=c;break dirLoop}continue}let f=l.trim()===``;if(!(f&&i)){f?(t.isEmpty=!0,t.config=void 0):(_(d,u),t.config=await d(c,l)),t.filepath=c;break dirLoop}}if(g===u||g===c(g))break dirLoop;g=c(g)}let v=t.filepath===``&&t.config===null?d(null):d(t);if(f)for(let e of m)p.set(e,v);return v},async load(e){g(e);let t=n.resolve(process.cwd(),e);if(f&&y.has(t))return y.get(t);let{base:r,ext:c}=n.parse(t),l=c||`noExt`,u=a[l];_(u,l);let p=String(await o(t));if(r===`package.json`)return b(y,t,d({config:h(s,await u(t,p)),filepath:t}));let m={config:null,filepath:t},v=p.trim()===``;return v&&i?b(y,t,d({config:void 0,filepath:t,isEmpty:!0})):(m.config=v?void 0:await u(t,p),b(y,t,d(v?{...m,isEmpty:v,config:void 0}:m)))},clearLoadCache(){f&&y.clear()},clearSearchCache(){f&&p.clear()},clearCaches(){f&&(y.clear(),p.clear())}}},t.exports.lilconfigSync=function(e,t){let{ignoreEmptySearchPlaces:i,loaders:a,packageProp:o,searchPlaces:s,stopDir:l,transform:u,cache:d}=m(e,t??{},!0),f=new Map,p=new Map,y=v(d);return{search(e=process.cwd()){let t={config:null,filepath:``},p=new Set,m=e;dirLoop:for(;;){if(d){let e=f.get(m);if(e!==void 0){for(let t of p)f.set(t,e);return e}p.add(m)}for(let e of s){let s=n.join(m,e);try{r.accessSync(s)}catch{continue}let c=n.extname(e)||`noExt`,l=a[c],u=String(r.readFileSync(s));if(e===`package.json`){let e=h(o,l(s,u));if(e!=null){t.config=e,t.filepath=s;break dirLoop}continue}let d=u.trim()===``;if(!(d&&i)){d?(t.isEmpty=!0,t.config=void 0):(_(l,c),t.config=l(s,u)),t.filepath=s;break dirLoop}}if(m===l||m===c(m))break dirLoop;m=c(m)}let g=t.filepath===``&&t.config===null?u(null):u(t);if(d)for(let e of p)f.set(e,g);return g},load(e){g(e);let t=n.resolve(process.cwd(),e);if(d&&p.has(t))return p.get(t);let{base:s,ext:c}=n.parse(t),l=c||`noExt`,f=a[l];_(f,l);let m=String(r.readFileSync(t));if(s===`package.json`)return u({config:h(o,f(t,m)),filepath:t});let v={config:null,filepath:t},b=m.trim()===``;return b&&i?y(p,t,u({filepath:t,config:void 0,isEmpty:!0})):(v.config=b?void 0:f(t,m),y(p,t,u(b?{...v,isEmpty:b,config:void 0}:v)))},clearLoadCache(){d&&p.clear()},clearSearchCache(){d&&f.clear()},clearCaches(){d&&(p.clear(),f.clear())}}}}))(),rx=(e,t)=>{try{return(0,_f.parse)(t)}catch(t){throw Error(`YAML Error in ${e}:\n${t.message}`,{cause:t})}};function ix(e,t){let n=f.default.basename(t),r=e.includes(`__filename is not defined`)||e.includes(`__dirname is not defined`)||e.includes(`require is not defined`)||e.includes(`module is not defined`)||e.includes(`exports is not defined`),i=e.includes(`Cannot use import statement outside a module`)||e.includes(`Unexpected token 'export'`)||e.includes(`Unexpected token 'import'`)||e.includes(`SyntaxError: export `)||e.includes(`SyntaxError`)&&e.includes(`import`),a=t.endsWith(`.js`)&&!t.endsWith(`.cjs`)&&!t.endsWith(`.mjs`);return r&&a?`${n} uses CommonJS syntax (require/module.exports) but your package.json has "type": "module".\n\nRecommended: Convert to ESM syntax:\n import { ... } from '...'\n export default { ... }\n\nAlternative: Rename to ${n.replace(`.js`,`.cjs`)} to keep CommonJS syntax.`:i&&a?`${n} uses ESM syntax (import/export) but your package.json has "type": "commonjs".\n\nRecommended: Add "type": "module" to your package.json to use ESM throughout your project.\n\nAlternative: Rename to ${n.replace(`.js`,`.mjs`)} to keep CommonJS in package.json.`:null}async function ax({configFileName:e,configFilePath:t,packageFile:n,global:r,options:i}){let a=jn(i?.color),o=(0,nx.lilconfig)(`ncu`,{searchPlaces:[`.ncurc`,`.ncurc.json`,`.ncurc.yaml`,`.ncurc.yml`,`.ncurc.mjs`,`.ncurc.cjs`,`.ncurc.js`],loaders:{noExt:rx,".yaml":rx,".yml":rx}}),s=t||(r?m.default.homedir():n?f.default.dirname(n):process.cwd()),c=null,l;try{e?(l=f.default.isAbsolute(e)?e:f.default.join(s,e),c=await o.load(l)):(c=await o.search(s),l=c?.filepath)}catch(t){let n=t.message||``,r=l||e||`.ncurc.js`;e&&(t.code===`ENOENT`||n.includes(`no such file or directory`))&&up(i,`Config file ${e} not found in ${s}`);let a=ix(n,r);a&&up(i,a),up(i,`Config file error: ${n}`)}let u=c?.filepath,{$schema:d,...p}=c?.config||{},h=p||{};typeof h.format==`string`&&(h.format=Ci.format.parse(h.format));let g=Object.keys(h).filter(e=>!Ci[e]);return g.length>0&&(console.error(a.red(`Unknown option${g.length===1?``:`s`} found in config file:`),a.gray(g.join(`, `))),console.info(`Using config file `+u),console.info(`You can change the config file path with ${a.blue(`--configFilePath`)}`)),{filePath:u,args:Object.entries(h).flatMap(([e,t])=>typeof t==`boolean`||Ci[e]?.type===`boolean`?t?[`--${e}`]:[]:[`--${e}`,t]),config:h}}var ox=s(((e,t)=>{var n=`\\\\/`,r=`[^${n}]`,i=0,a=`\\.`,o=`\\+`,s=`\\?`,c=`\\/`,l=`(?=.)`,u=`[^/]`,d=`(?:${c}|$)`,f=`(?:^|${c})`,p=`${a}{1,2}${d}`,m={DOT_LITERAL:a,PLUS_LITERAL:o,QMARK_LITERAL:s,SLASH_LITERAL:c,ONE_CHAR:l,QMARK:u,END_ANCHOR:d,DOTS_SLASH:p,NO_DOT:`(?!${a})`,NO_DOTS:`(?!${f}${p})`,NO_DOT_SLASH:`(?!${a}{0,1}${d})`,NO_DOTS_SLASH:`(?!${p})`,QMARK_NO_DOT:`[^.${c}]`,STAR:`${u}*?`,START_ANCHOR:f,SEP:`/`},h={...m,SLASH_LITERAL:`[${n}]`,QMARK:r,STAR:`${r}*?`,DOTS_SLASH:`${a}{1,2}(?:[${n}]|$)`,NO_DOT:`(?!${a})`,NO_DOTS:`(?!(?:^|[${n}])${a}{1,2}(?:[${n}]|$))`,NO_DOT_SLASH:`(?!${a}{0,1}(?:[${n}]|$))`,NO_DOTS_SLASH:`(?!${a}{1,2}(?:[${n}]|$))`,QMARK_NO_DOT:`[^.${n}]`,START_ANCHOR:`(?:^|[${n}])`,END_ANCHOR:`(?:[${n}]|$)`,SEP:`\\`};t.exports={DEFAULT_MAX_EXTGLOB_RECURSION:i,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:{__proto__:null,alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?h:m}}})),sx=s((e=>{var{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=ox();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(i,`\\$1`),e.toPosixSlashes=e=>e.replace(t,`/`),e.isWindows=()=>{if(typeof navigator<`u`&&navigator.platform){let e=navigator.platform.toLowerCase();return e===`win32`||e===`windows`}return typeof process<`u`&&process.platform?process.platform===`win32`:!1},e.removeBackslashes=e=>e.replace(n,e=>e===`\\`?``:e),e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{let n=e.split(t?/[\\/]/:`/`),r=n[n.length-1];return r===``?n[n.length-2]:r}})),cx=s(((e,t)=>{var n=sx(),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:_}=ox(),v=e=>e===l||e===a,y=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let b=t||{},x=e.length-1,S=b.parts===!0||b.scanToEnd===!0,C=[],w=[],T=[],E=e,D=-1,O=0,k=0,A=!1,j=!1,M=!1,ee=!1,N=!1,P=!1,F=!1,I=!1,L=!1,R=!1,te=0,z,B,V={value:``,depth:0,isGlob:!1},ne=()=>D>=x,H=()=>E.charCodeAt(D+1),U=()=>(z=B,E.charCodeAt(++D));for(;D<x;){B=U();let e;if(B===a){F=V.backslashes=!0,B=U(),B===u&&(P=!0);continue}if(P===!0||B===u){for(te++;ne()!==!0&&(B=U());){if(B===a){F=V.backslashes=!0,U();continue}if(B===u){te++;continue}if(P!==!0&&B===s&&(B=U())===s){if(A=V.isBrace=!0,M=V.isGlob=!0,R=!0,S===!0)continue;break}if(P!==!0&&B===o){if(A=V.isBrace=!0,M=V.isGlob=!0,R=!0,S===!0)continue;break}if(B===h&&(te--,te===0)){P=!1,A=V.isBrace=!0,R=!0;break}}if(S===!0)continue;break}if(B===l){if(C.push(D),w.push(V),V={value:``,depth:0,isGlob:!1},R===!0)continue;if(z===s&&D===O+1){O+=2;continue}k=D+1;continue}if(b.noext!==!0&&(B===p||B===i||B===r||B===m||B===c)&&H()===d){if(M=V.isGlob=!0,ee=V.isExtglob=!0,R=!0,B===c&&D===O&&(L=!0),S===!0){for(;ne()!==!0&&(B=U());){if(B===a){F=V.backslashes=!0,B=U();continue}if(B===g){M=V.isGlob=!0,R=!0;break}}continue}break}if(B===r){if(z===r&&(N=V.isGlobstar=!0),M=V.isGlob=!0,R=!0,S===!0)continue;break}if(B===m){if(M=V.isGlob=!0,R=!0,S===!0)continue;break}if(B===f){for(;ne()!==!0&&(e=U());){if(e===a){F=V.backslashes=!0,U();continue}if(e===_){j=V.isBracket=!0,M=V.isGlob=!0,R=!0;break}}if(S===!0)continue;break}if(b.nonegate!==!0&&B===c&&D===O){I=V.negated=!0,O++;continue}if(b.noparen!==!0&&B===d){if(M=V.isGlob=!0,S===!0){for(;ne()!==!0&&(B=U());){if(B===d){F=V.backslashes=!0,B=U();continue}if(B===g){R=!0;break}}continue}break}if(M===!0){if(R=!0,S===!0)continue;break}}b.noext===!0&&(ee=!1,M=!1);let W=E,re=``,ie=``;O>0&&(re=E.slice(0,O),E=E.slice(O),k-=O),W&&M===!0&&k>0?(W=E.slice(0,k),ie=E.slice(k)):M===!0?(W=``,ie=E):W=E,W&&W!==``&&W!==`/`&&W!==E&&v(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),b.unescape===!0&&(ie&&=n.removeBackslashes(ie),W&&F===!0&&(W=n.removeBackslashes(W)));let ae={prefix:re,input:e,start:O,base:W,glob:ie,isBrace:A,isBracket:j,isGlob:M,isExtglob:ee,isGlobstar:N,negated:I,negatedExtglob:L};if(b.tokens===!0&&(ae.maxDepth=0,v(B)||w.push(V),ae.tokens=w),b.parts===!0||b.tokens===!0){let t;for(let n=0;n<C.length;n++){let r=t?t+1:O,i=C[n],a=e.slice(r,i);b.tokens&&(n===0&&O!==0?(w[n].isPrefix=!0,w[n].value=re):w[n].value=a,y(w[n]),ae.maxDepth+=w[n].depth),(n!==0||a!==``)&&T.push(a),t=i}if(t&&t+1<e.length){let n=e.slice(t+1);T.push(n),b.tokens&&(w[w.length-1].value=n,y(w[w.length-1]),ae.maxDepth+=w[w.length-1].depth)}ae.slashes=C,ae.parts=T}return ae}})),lx=s(((e,t)=>{var n=ox(),r=sx(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:c}=n,l=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>r.escapeRegex(e)).join(`..`)}return n},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=e=>{let t=[],n=0,r=0,i=0,a=``,o=!1;for(let s of e){if(o===!0){a+=s,o=!1;continue}if(s===`\\`){a+=s,o=!0;continue}if(s===`"`){i=i===1?0:1,a+=s;continue}if(i===0){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(n===0){if(s===`(`)r++;else if(s===`)`&&r>0)r--;else if(s===`|`&&r===0){t.push(a),a=``;continue}}}a+=s}return t.push(a),t},f=e=>{let t=!1;for(let n of e){if(t===!0){t=!1;continue}if(n===`\\`){t=!0;continue}if(/[?*+@!()[\]{}]/.test(n))return!1}return!0},p=e=>{let t=e.trim(),n=!0;for(;n===!0;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),n=!0);if(f(t))return t.replace(/\\(.)/g,`$1`)},m=e=>{let t=e.map(p).filter(Boolean);for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){let r=t[e],i=t[n],a=r[0];if(!(!a||r!==a.repeat(r.length)||i!==a.repeat(i.length))&&(r===i||r.startsWith(i)||i.startsWith(r)))return!0}return!1},h=(e,t=!0)=>{if(e[0]!==`+`&&e[0]!==`*`||e[1]!==`(`)return;let n=0,r=0,i=0,a=!1;for(let o=1;o<e.length;o++){let s=e[o];if(a===!0){a=!1;continue}if(s===`\\`){a=!0;continue}if(s===`"`){i=i===1?0:1;continue}if(i!==1){if(s===`[`){n++;continue}if(s===`]`&&n>0){n--;continue}if(!(n>0)){if(s===`(`){r++;continue}if(s===`)`&&(r--,r===0))return t===!0&&o!==e.length-1?void 0:{type:e[0],body:e.slice(2,o),end:o}}}}},g=e=>{let t=0,n=[];for(;t<e.length;){let r=h(e.slice(t),!1);if(!r||r.type!==`*`)return;let i=d(r.body).map(e=>e.trim());if(i.length!==1)return;let a=p(i[0]);if(!a||a.length!==1)return;n.push(a),t+=r.end+1}if(!(n.length<1))return`${n.length===1?r.escapeRegex(n[0]):`[${n.map(e=>r.escapeRegex(e)).join(``)}]`}*`},_=e=>{let t=0,n=e.trim(),r=h(n);for(;r;)t++,n=r.body.trim(),r=h(n);return t},v=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion==`number`?t.maxExtglobRecursion:n.DEFAULT_MAX_EXTGLOB_RECURSION,i=d(e).map(e=>e.trim());if(i.length>1&&(i.some(e=>e===``)||i.some(e=>/^[*?]+$/.test(e))||m(i)))return{risky:!0};for(let e of i){let t=g(e);if(t)return{risky:!0,safeOutput:t};if(_(e)>r)return{risky:!0}}return{risky:!1}},y=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=c[e]||e;let d={...t},f=typeof d.maxLength==`number`?Math.min(i,d.maxLength):i,p=e.length;if(p>f)throw SyntaxError(`Input length: ${p}, exceeds maximum allowed length: ${f}`);let m={type:`bos`,value:``,output:d.prepend||``},h=[m],g=d.capture?``:`?:`,_=n.globChars(d.windows),b=n.extglobChars(_),{DOT_LITERAL:x,PLUS_LITERAL:S,SLASH_LITERAL:C,ONE_CHAR:w,DOTS_SLASH:T,NO_DOT:E,NO_DOT_SLASH:D,NO_DOTS_SLASH:O,QMARK:k,QMARK_NO_DOT:A,STAR:j,START_ANCHOR:M}=_,ee=e=>`(${g}(?:(?!${M}${e.dot?T:x}).)*?)`,N=d.dot?``:E,P=d.dot?k:A,F=d.bash===!0?ee(d):j;d.capture&&(F=`(${F})`),typeof d.noext==`boolean`&&(d.noextglob=d.noext);let I={input:e,index:-1,start:0,dot:d.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:h};e=r.removePrefix(e,I),p=e.length;let L=[],R=[],te=[],z=m,B,V=()=>I.index===p-1,ne=I.peek=(t=1)=>e[I.index+t],H=I.advance=()=>e[++I.index]||``,U=()=>e.slice(I.index+1),W=(e=``,t=0)=>{I.consumed+=e,I.index+=t},re=e=>{I.output+=e.output==null?e.value:e.output,W(e.value)},ie=()=>{let e=1;for(;ne()===`!`&&(ne(2)!==`(`||ne(3)===`?`);)H(),I.start++,e++;return e%2==0?!1:(I.negated=!0,I.start++,!0)},ae=e=>{I[e]++,te.push(e)},oe=e=>{I[e]--,te.pop()},G=e=>{if(z.type===`globstar`){let t=I.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||L.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(I.output=I.output.slice(0,-z.output.length),z.type=`star`,z.value=`*`,z.output=F,I.output+=z.output)}if(L.length&&e.type!==`paren`&&(L[L.length-1].inner+=e.value),(e.value||e.output)&&re(e),z&&z.type===`text`&&e.type===`text`){z.output=(z.output||z.value)+e.value,z.value+=e.value;return}e.prev=z,h.push(e),z=e},K=(e,t)=>{let n={...b[t],conditions:1,inner:``};n.prev=z,n.parens=I.parens,n.output=I.output,n.startIndex=I.index,n.tokensIndex=h.length;let r=(d.capture?`(`:``)+n.open;ae(`parens`),G({type:e,value:t,output:I.output?``:w}),G({type:`paren`,extglob:!0,value:H(),output:r}),L.push(n)},se=n=>{let i=e.slice(n.startIndex,I.index+1),a=v(e.slice(n.startIndex+2,I.index),d);if((n.type===`plus`||n.type===`star`)&&a.risky){let e=a.safeOutput?(n.output?``:w)+(d.capture?`(${a.safeOutput})`:a.safeOutput):void 0,t=h[n.tokensIndex];t.type=`text`,t.value=i,t.output=e||r.escapeRegex(i);for(let e=n.tokensIndex+1;e<h.length;e++)h[e].value=``,h[e].output=``,delete h[e].suffix;I.output=n.output+t.output,I.backtrack=!0,G({type:`paren`,extglob:!0,value:B,output:``}),oe(`parens`);return}let o=n.close+(d.capture?`)`:``),s;if(n.type===`negate`){let e=F;n.inner&&n.inner.length>1&&n.inner.includes(`/`)&&(e=ee(d)),(e!==F||V()||/^\)+$/.test(U()))&&(o=n.close=`)$))${e}`),n.inner.includes(`*`)&&(s=U())&&/^\.[^\\/.]+$/.test(s)&&(o=n.close=`)${y(s,{...t,fastpaths:!1}).output})${e})`),n.prev.type===`bos`&&(I.negatedExtglob=!0)}G({type:`paren`,extglob:!0,value:B,output:o}),oe(`parens`)};if(d.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?k.repeat(a.length):``):o===0?P+(a?k.repeat(a.length):``):k.repeat(r.length):i===`.`?x.repeat(r.length):i===`*`?t?t+i+(a?F:``):F:t?e:`\\${e}`);return n===!0&&(i=d.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&d.contains===!0?(I.output=e,I):(I.output=r.wrapOutput(i,I,t),I)}for(;!V();){if(B=H(),B===`\0`)continue;if(B===`\\`){let e=ne();if(e===`/`&&d.bash!==!0||e===`.`||e===`;`)continue;if(!e){B+=`\\`,G({type:`text`,value:B});continue}let t=/^\\+/.exec(U()),n=0;if(t&&t[0].length>2&&(n=t[0].length,I.index+=n,n%2!=0&&(B+=`\\`)),d.unescape===!0?B=H():B+=H(),I.brackets===0){G({type:`text`,value:B});continue}}if(I.brackets>0&&(B!==`]`||z.value===`[`||z.value===`[^`)){if(d.posix!==!1&&B===`:`){let e=z.value.slice(1);if(e.includes(`[`)&&(z.posix=!0,e.includes(`:`))){let e=z.value.lastIndexOf(`[`),t=z.value.slice(0,e),n=a[z.value.slice(e+2)];if(n){z.value=t+n,I.backtrack=!0,H(),!m.output&&h.indexOf(z)===1&&(m.output=w);continue}}}(B===`[`&&ne()!==`:`||B===`-`&&ne()===`]`)&&(B=`\\${B}`),B===`]`&&(z.value===`[`||z.value===`[^`)&&(B=`\\${B}`),d.posix===!0&&B===`!`&&z.value===`[`&&(B=`^`),z.value+=B,re({value:B});continue}if(I.quotes===1&&B!==`"`){B=r.escapeRegex(B),z.value+=B,re({value:B});continue}if(B===`"`){I.quotes=I.quotes===1?0:1,d.keepQuotes===!0&&G({type:`text`,value:B});continue}if(B===`(`){ae(`parens`),G({type:`paren`,value:B});continue}if(B===`)`){if(I.parens===0&&d.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=L[L.length-1];if(e&&I.parens===e.parens+1){se(L.pop());continue}G({type:`paren`,value:B,output:I.parens?`)`:`\\)`}),oe(`parens`);continue}if(B===`[`){if(d.nobracket===!0||!U().includes(`]`)){if(d.nobracket!==!0&&d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));B=`\\${B}`}else ae(`brackets`);G({type:`bracket`,value:B});continue}if(B===`]`){if(d.nobracket===!0||z&&z.type===`bracket`&&z.value.length===1){G({type:`text`,value:B,output:`\\${B}`});continue}if(I.brackets===0){if(d.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));G({type:`text`,value:B,output:`\\${B}`});continue}oe(`brackets`);let e=z.value.slice(1);if(z.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(B=`/${B}`),z.value+=B,re({value:B}),d.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(z.value);if(I.output=I.output.slice(0,-z.value.length),d.literalBrackets===!0){I.output+=t,z.value=t;continue}z.value=`(${g}${t}|${z.value})`,I.output+=z.value;continue}if(B===`{`&&d.nobrace!==!0){ae(`braces`);let e={type:`brace`,value:B,output:`(`,outputIndex:I.output.length,tokensIndex:I.tokens.length};R.push(e),G(e);continue}if(B===`}`){let e=R[R.length-1];if(d.nobrace===!0||!e){G({type:`text`,value:B,output:B});continue}let t=`)`;if(e.dots===!0){let e=h.slice(),n=[];for(let t=e.length-1;t>=0&&(h.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&n.unshift(e[t].value);t=l(n,d),I.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=I.output.slice(0,e.outputIndex),r=I.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,B=t=`\\}`,I.output=n;for(let e of r)I.output+=e.output||e.value}G({type:`brace`,value:B,output:t}),oe(`braces`),R.pop();continue}if(B===`|`){L.length>0&&L[L.length-1].conditions++,G({type:`text`,value:B});continue}if(B===`,`){let e=B,t=R[R.length-1];t&&te[te.length-1]===`braces`&&(t.comma=!0,e=`|`),G({type:`comma`,value:B,output:e});continue}if(B===`/`){if(z.type===`dot`&&I.index===I.start+1){I.start=I.index+1,I.consumed=``,I.output=``,h.pop(),z=m;continue}G({type:`slash`,value:B,output:C});continue}if(B===`.`){if(I.braces>0&&z.type===`dot`){z.value===`.`&&(z.output=x);let e=R[R.length-1];z.type=`dots`,z.output+=B,z.value+=B,e.dots=!0;continue}if(I.braces+I.parens===0&&z.type!==`bos`&&z.type!==`slash`){G({type:`text`,value:B,output:x});continue}G({type:`dot`,value:B,output:x});continue}if(B===`?`){if(!(z&&z.value===`(`)&&d.noextglob!==!0&&ne()===`(`&&ne(2)!==`?`){K(`qmark`,B);continue}if(z&&z.type===`paren`){let e=ne(),t=B;(z.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(U()))&&(t=`\\${B}`),G({type:`text`,value:B,output:t});continue}if(d.dot!==!0&&(z.type===`slash`||z.type===`bos`)){G({type:`qmark`,value:B,output:A});continue}G({type:`qmark`,value:B,output:k});continue}if(B===`!`){if(d.noextglob!==!0&&ne()===`(`&&(ne(2)!==`?`||!/[!=<:]/.test(ne(3)))){K(`negate`,B);continue}if(d.nonegate!==!0&&I.index===0){ie();continue}}if(B===`+`){if(d.noextglob!==!0&&ne()===`(`&&ne(2)!==`?`){K(`plus`,B);continue}if(z&&z.value===`(`||d.regex===!1){G({type:`plus`,value:B,output:S});continue}if(z&&(z.type===`bracket`||z.type===`paren`||z.type===`brace`)||I.parens>0){G({type:`plus`,value:B});continue}G({type:`plus`,value:S});continue}if(B===`@`){if(d.noextglob!==!0&&ne()===`(`&&ne(2)!==`?`){G({type:`at`,extglob:!0,value:B,output:``});continue}G({type:`text`,value:B});continue}if(B!==`*`){(B===`$`||B===`^`)&&(B=`\\${B}`);let e=o.exec(U());e&&(B+=e[0],I.index+=e[0].length),G({type:`text`,value:B});continue}if(z&&(z.type===`globstar`||z.star===!0)){z.type=`star`,z.star=!0,z.value+=B,z.output=F,I.backtrack=!0,I.globstar=!0,W(B);continue}let t=U();if(d.noextglob!==!0&&/^\([^?]/.test(t)){K(`star`,B);continue}if(z.type===`star`){if(d.noglobstar===!0){W(B);continue}let n=z.prev,r=n.prev,i=n.type===`slash`||n.type===`bos`,a=r&&(r.type===`star`||r.type===`globstar`);if(d.bash===!0&&(!i||t[0]&&t[0]!==`/`)){G({type:`star`,value:B,output:``});continue}let o=I.braces>0&&(n.type===`comma`||n.type===`brace`),s=L.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){G({type:`star`,value:B,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[I.index+4];if(n&&n!==`/`)break;t=t.slice(3),W(`/**`,3)}if(n.type===`bos`&&V()){z.type=`globstar`,z.value+=B,z.output=ee(d),I.output=z.output,I.globstar=!0,W(B);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&V()){I.output=I.output.slice(0,-(n.output+z.output).length),n.output=`(?:${n.output}`,z.type=`globstar`,z.output=ee(d)+(d.strictSlashes?`)`:`|$)`),z.value+=B,I.globstar=!0,I.output+=n.output+z.output,W(B);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;I.output=I.output.slice(0,-(n.output+z.output).length),n.output=`(?:${n.output}`,z.type=`globstar`,z.output=`${ee(d)}${C}|${C}${e})`,z.value+=B,I.output+=n.output+z.output,I.globstar=!0,W(B+H()),G({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){z.type=`globstar`,z.value+=B,z.output=`(?:^|${C}|${ee(d)}${C})`,I.output=z.output,I.globstar=!0,W(B+H()),G({type:`slash`,value:`/`,output:``});continue}I.output=I.output.slice(0,-z.output.length),z.type=`globstar`,z.output=ee(d),z.value+=B,I.output+=z.output,I.globstar=!0,W(B);continue}let n={type:`star`,value:B,output:F};if(d.bash===!0){n.output=`.*?`,(z.type===`bos`||z.type===`slash`)&&(n.output=N+n.output),G(n);continue}if(z&&(z.type===`bracket`||z.type===`paren`)&&d.regex===!0){n.output=B,G(n);continue}(I.index===I.start||z.type===`slash`||z.type===`dot`)&&(z.type===`dot`?(I.output+=D,z.output+=D):d.dot===!0?(I.output+=O,z.output+=O):(I.output+=N,z.output+=N),ne()!==`*`&&(I.output+=w,z.output+=w)),G(n)}for(;I.brackets>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));I.output=r.escapeLast(I.output,`[`),oe(`brackets`)}for(;I.parens>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));I.output=r.escapeLast(I.output,`(`),oe(`parens`)}for(;I.braces>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));I.output=r.escapeLast(I.output,`{`),oe(`braces`)}if(d.strictSlashes!==!0&&(z.type===`star`||z.type===`bracket`)&&G({type:`maybe_slash`,value:``,output:`${C}?`}),I.backtrack===!0){I.output=``;for(let e of I.tokens)I.output+=e.output==null?e.value:e.output,e.suffix&&(I.output+=e.suffix)}return I};y.fastpaths=(e,t)=>{let a={...t},o=typeof a.maxLength==`number`?Math.min(i,a.maxLength):i,s=e.length;if(s>o)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${o}`);e=c[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:u,ONE_CHAR:d,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:m,NO_DOTS_SLASH:h,STAR:g,START_ANCHOR:_}=n.globChars(a.windows),v=a.dot?m:p,y=a.dot?h:p,b=a.capture?``:`?:`,x={negated:!1,prefix:``},S=a.bash===!0?`.*?`:g;a.capture&&(S=`(${S})`);let C=e=>e.noglobstar===!0?S:`(${b}(?:(?!${_}${e.dot?f:l}).)*?)`,w=e=>{switch(e){case`*`:return`${v}${d}${S}`;case`.*`:return`${l}${d}${S}`;case`*.*`:return`${v}${S}${l}${d}${S}`;case`*/*`:return`${v}${S}${u}${d}${y}${S}`;case`**`:return v+C(a);case`**/*`:return`(?:${v}${C(a)}${u})?${y}${d}${S}`;case`**/*.*`:return`(?:${v}${C(a)}${u})?${y}${S}${l}${d}${S}`;case`**/.*`:return`(?:${v}${C(a)}${u})?${l}${d}${S}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=w(t[1]);return n?n+l+t[2]:void 0}}},T=w(r.removePrefix(e,x));return T&&a.strictSlashes!==!0&&(T+=`${u}?`),T},t.exports=y})),ux=s(((e,t)=>{var n=cx(),r=lx(),i=sx(),a=ox(),o=e=>e&&typeof e==`object`&&!Array.isArray(e),s=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>s(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=o(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},a=i.windows,c=r?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=c.state;delete c.state;let u=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=s(i.ignore,e,n)}let d=(n,r=!1)=>{let{isMatch:o,match:d,output:f}=s.test(n,c,t,{glob:e,posix:a}),p={glob:e,state:l,regex:c,posix:a,input:n,output:f,match:d,isMatch:o};return typeof i.onResult==`function`&&i.onResult(p),o===!1?(p.isMatch=!1,r?p:!1):u(n)?(typeof i.onIgnore==`function`&&i.onIgnore(p),p.isMatch=!1,r?p:!1):(typeof i.onMatch==`function`&&i.onMatch(p),r?p:!0)};return n&&(d.state=l),d};s.test=(e,t,n,{glob:r,posix:a}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let o=n||{},c=o.format||(a?i.toPosixSlashes:null),l=e===r,u=l&&c?c(e):e;return l===!1&&(u=c?c(e):e,l=u===r),(l===!1||o.capture===!0)&&(l=o.matchBase===!0||o.basename===!0?s.matchBase(e,t,n,a):t.exec(u)),{isMatch:!!l,match:l,output:u}},s.matchBase=(e,t,n)=>(t instanceof RegExp?t:s.makeRe(t,n)).test(i.basename(e)),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map(e=>s.parse(e,t)):r(e,{...t,fastpaths:!1}),s.scan=(e,t)=>n(e,t),s.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,c=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(c=`^(?!${c}).*$`);let l=s.toRegex(c,t);return r===!0&&(l.state=e),l},s.makeRe=(e,t={},n=!1,i=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let a={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(a.output=r.fastpaths(e,t)),a.output||(a=r(e,t)),s.compileRe(a,t,n,i)},s.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},s.constants=a,t.exports=s})),dx=u(s(((e,t)=>{var n=ux(),r=sx();function i(e,t,i=!1){return t&&(t.windows===null||t.windows===void 0)&&(t={...t,windows:r.isWindows()}),n(e,t,i)}Object.assign(i,n),t.exports=i}))(),1),fx=c({greatest:()=>_x,greatestLevel:()=>vx,latest:()=>gx,minor:()=>yx,newest:()=>Sx,patch:()=>bx,semver:()=>xx}),px=(0,w.promisify)(E.default.execFile);async function mx(e){let t=(await px(`git`,[`ls-remote`,`--tags`,e])).stdout,n={};for(let e of t.trim().split(`
638
- `)){let t=e.split(` `);n[t[1].replace(/^refs\/tags\/|\^{}$/g,``)]=t[0]}return n}async function hx(e,t,n){t=t.replace(/^github:/,``);let{auth:r,protocol:i,host:a,path:o}=(0,Qn.default)(t),s;try{if(i!==null)s=await mx(`${i?i.replace(`git+`,``):`https:`}//${r?r+`@`:``}${a}/${o?.replace(/^:/,``)}`);else try{s=await mx(`ssh://git@${a}/${o?.replace(/^:/,``)}`)}catch{s=await mx(`https://${r?r+`@`:``}${a}/${o}`)}}catch{Y(n??{},`Invalid, private repo, or no tags for ${e}: ${t}`,`verbose`);return}return Object.keys(s).map(jr).filter(e=>(0,q.valid)(e)).sort(xr)}var gx=async(e,t,n)=>{let r=await hx(e,t,n);if(!r)return{version:null};let i=n?.pre?r:r.filter(e=>!Tr(e)),a=i[i.length-1];return{version:a?Vr(t,a):null}},_x=async(e,t,n)=>{let r=await hx(e,t,n);if(!r)return{version:null};let i=r[r.length-1];return{version:i?Vr(t,i):null}},vx=e=>async(t,n,r={})=>{let i=decodeURIComponent((0,Qn.default)(n).branch).replace(/^semver:/,``),a=await hx(t,n,r);if(!a)return{version:null};let o=Sr(a.map(e=>e.replace(/^v/,``)),i,e);return{version:o?Vr(n,o):null}},yx=vx(`minor`),bx=vx(`patch`),xx=async(e,t,n)=>({version:null}),Sx=_x,Cx=c({latest:()=>Ex}),wx=e=>e&&e.startsWith(`http://`)||e.startsWith(`https://`),Tx=(0,kl.default)(async e=>{let t=e.registry,n;if(wx(t))n=await(await fetch(t)).text();else try{n=await g.default.readFile(t,`utf8`)}catch{up(e,`\nThe specified static registry file does not exist: ${e.registry}`)}return JSON.parse(n)}),Ex=async(e,t,n)=>({version:(await Tx(n||{}))[e]||null}),Dx={npm:bu,pnpm:gf,yarn:zf,bun:qu,gitTags:fx,staticRegistry:Cx};function Ox(e){if(typeof e==`string`)return e.trim();if(Array.isArray(e)&&(e.length===0||typeof e[0]==`string`)){let t=e.map(e=>typeof e==`string`?e.trim():e).filter(e=>e);return t.length>0?t:void 0}else return e}function kx(e){try{return new URL(e),!0}catch{return!1}}var Ax=(e,t=Math.round(e*10)/10)=>`${t} day${t===1?``:`s`}`;async function jx(e,{cli:t}={}){let n=jn(e.color),r;if(!t){r={...e};let t=wi.reduce((e,t)=>({...e,...t.default==null?null:{[t.long]:t.default}}),{}),n={jsonUpgraded:!0,silent:e.silent||e.loglevel===void 0&&!e.verbose,args:[]};e={...t,...n,...e}}let i={...e,...e.packageData&&typeof e.packageData!=`string`?{packageData:JSON.stringify(e.packageData,null,2)}:null,cli:t,...t?null:{raw:r}},a=i.silent||i.format?.includes(`lines`)?`silent`:i.verbose?`verbose`:i.loglevel,o=Object.keys(i).filter(e=>e.startsWith(`json`)).some(e=>i[e]);!o&&a!==`silent`&&i.rcConfigPath&&!i.doctor&&Y(i,`Using config file ${i.rcConfigPath}`);let s=wi.filter(({long:e,deprecated:t})=>t&&i[e]||e===`packageManager`&&i.packageManager===`staticRegistry`);if(s.length>0){for(let{long:e,description:t}of s){let r=e===`packageManager`?`--packageManager staticRegistry is deprecated. Use --registryType json.`:`--${e}: ${t}`;Y(i,n.yellow(r),`warn`)}Y(i,``,`warn`)}for(let{long:e,choices:t}of wi){if(!t||t.length===0)continue;let n=i[e],r=Array.isArray(n)?n:[n];r.length!==0&&r.every(e=>!t.includes(e))&&up(i,`Invalid option value: --${e} ${n}. Valid values are: ${t.join(`, `)}.`)}i.cwd&&!await Fn(i.cwd)&&up(i,`No such directory: ${i.cwd}`);let c=Ox(i.args),l=Ox(i.filter),u=Ox(i.filterVersion),d=Ox(i.reject),f=Ox(i.rejectVersion),p=i.registryType||(i.registry?.endsWith(`.json`)?`json`:`npm`);i.filter&&c&&c.join(` `)!==(Array.isArray(l)?l.join(` `):l)?up(i,`Cannot specify a filter using both --filter and args. Did you forget to quote an argument?
639
- See: https://github.com/raineorshine/npm-check-updates/issues/759#issuecomment-723587297`):i.packageFile&&i.deep?up(i,`Cannot specify both --packageFile and --deep. --deep is an alias for --packageFile '**/package.json'`):i.format?.includes(`lines`)&&i.jsonUpgraded?up(i,`Cannot specify both --format lines and --jsonUpgraded.`):i.format?.includes(`lines`)&&i.jsonAll?up(i,`Cannot specify both --format lines and --jsonAll.`):i.format?.includes(`lines`)&&i.format.length>1?up(i,`Cannot use --format lines with other formatting options.`):i.workspace?.length&&i.workspaces?up(i,`Cannot specify both --workspace and --workspaces.`):i.deep&&(i.workspace?.length||i.workspaces)?up(i,`Cannot specify both --deep and --workspace${i.workspaces?`s`:``}.`):i.doctor&&(i.workspace?.length||i.workspaces)?up(i,`Doctor mode is not currently supported with --workspace${i.workspaces?`s`:``}.`):i.packageManager===`staticRegistry`&&!i.registry?up(i,`When --package-manager staticRegistry is specified, you must provide the path for the registry file with --registry.`):i.registryType===`json`&&!i.registry?up(i,`When --registryType json is specified, you must provide the path for the registry file with --registry. Run "ncu --help registryType" for details.`):p!==`json`&&i.registry&&!kx(i.registry)&&up(i,`--registry must be a valid URL. Invalid value: "${i.registry}"`);let m=await Ai(i);if(i.cooldown!=null){if(typeof i.cooldown==`string`){let e=ui(i.cooldown);e===null?up(i,`Invalid cooldown value: "${i.cooldown}". Use a number (days) or a string like "7d", "12h", or "30m".`):i.cooldown=e}let e=typeof i.cooldown==`number`&&!isNaN(i.cooldown)&&i.cooldown>=0,t=typeof i.cooldown==`function`;!e&&!t&&up(i,`Cooldown must be a non-negative number (days), a string like "7d", "12h", or "30m", or a predicate function.`)}else{let e=Ou.findNpmConfig(),t=e?.minReleaseAge;if(t!=null){let n=typeof t==`string`?ui(t)??parseInt(t,10):typeof t==`number`?t:null;if(n!=null&&!isNaN(n)){let t=e?.minReleaseAgeExclude,r=[...new Set((Array.isArray(t)?t:typeof t==`string`?[t]:[]).flatMap(e=>e.split(`,`)).map(e=>e.trim()).filter(e=>e))];if(r.length>0){let e=r.map(e=>({pattern:e,match:(0,dx.default)(e,{nonegate:!0,noext:!0})}));i.cooldown=t=>e.some(({pattern:e,match:n})=>t===e||n(t))?null:n,Y({...i,json:o},`Using min-release-age from .npmrc: ${Ax(n)} (${r.length} excluded pattern${r.length===1?``:`s`})`)}else i.cooldown=n,Y({...i,json:o},`Using min-release-age from .npmrc: ${Ax(n)}`)}}else if(m===`pnpm`){let e=await Ff.getPnpmWorkspaceMinimumReleaseAge();if(e!=null){let{minimumReleaseAge:t,minimumReleaseAgeExclude:n}=e,r=t/1440;if(n.length>0){let e=n.map(e=>(0,dx.default)(e));i.cooldown=t=>e.some(e=>e(t))?null:r,Y({...i,json:o},`Using minimumReleaseAge from pnpm-workspace.yaml: ${Ax(r)} (${n.length} excluded pattern${n.length===1?``:`s`})`)}else i.cooldown=r,Y({...i,json:o},`Using minimumReleaseAge from pnpm-workspace.yaml: ${Ax(r)}`)}}else if(m===`yarn`){let e=await lp.getYarnMinimalAgeGate(i);if(e!=null){let{npmMinimalAgeGate:t,npmPreapprovedPackages:n}=e,r=t/1440;if(n.length>0){let e=n.map(e=>(0,dx.default)(e));i.cooldown=t=>e.some(e=>e(t))?null:r,Y({...i,json:o},`Using npmMinimalAgeGate from .yarnrc.yml: ${r} day${r===1?``:`s`} (${n.length} pre-approved package${n.length===1?``:`s`})`)}else i.cooldown=r,Y({...i,json:o},`Using npmMinimalAgeGate from .yarnrc.yml: ${Ax(r)}`)}}}let h=i.target||`latest`,g=h===`newest`||h===`greatest`,_={...i,...i.deep?{packageFile:`**/package.json`}:null,...m===`deno`?{dep:[`imports`]}:null,...i.format&&i.format.length>0?{format:i.format}:null,filter:c||l,filterVersion:u,json:o,loglevel:a,minimal:i.minimal===void 0?!1:i.minimal,...i.pre!=null||g?{pre:i.pre==null?g:!!i.pre}:null,reject:d,rejectVersion:f,target:h,...i.interactive&&i.upgrade===void 0?{upgrade:!o}:null,packageManager:m,...i.prefix?{prefix:await(Dx[m||``]?.defaultPrefix||Dx.npm.defaultPrefix)(i)}:null,registryType:p};_.cacher=await li(_);let v=Dn(_,(e,t)=>t===void 0?null:{[e]:t});return!i.packageManager&&m!==`npm`&&Y(v,`Using ${m}`),v}function Mx(e,t){return Array.from(new Set([...e||[],...t||[]]))}function Nx(e,t){let n=e||{},r=t||{},i={...n,...r};for(let e of Object.keys(i))Array.isArray(n[e])&&Array.isArray(r[e])&&(i[e]=Mx(n[e],r[e]));return i}var Px=s(((e,t)=>{var n=e=>typeof e==`function`?e:()=>e,r=(...e)=>(...t)=>e.length===0||!!n(e[0])(...t)&&r(...e.slice(1))(...t),i=(...e)=>(...t)=>e.length>0&&(!!n(e[0])(...t)||i(...e.slice(1))(...t));t.exports={and:r,or:i}}))();function Fx(e){let t;if(!e)t=()=>!0;else if(typeof e==`string`)if(e[0]===`/`&&e.at(-1)===`/`){let n=new RegExp(e.slice(1,-1));t=e=>n.test(e)}else{let n=e.split(/[\s,]+/);t=e=>n.some((0,Px.or)(t=>(0,dx.default)(t)(e),t=>!t.includes(`/`)&&e.includes(`/`)&&(0,dx.default)(t)(e.replace(/\//g,`_`))))}else if(Array.isArray(e))t=(t,n)=>e.some(e=>Fx(e)(t,n));else if(e instanceof RegExp)t=t=>e.test(t);else if(typeof e==`function`)t=(t,n)=>e(t,(0,$n.parseRange)(n??t));else throw TypeError(`Invalid filter. Must be a RegExp, array, or comma-or-space-delimited list.`);return t}function Ix(e,t,n,r){return(0,Px.and)((n,r)=>(0,Px.and)(e?Fx(e):!0,t?(...e)=>!Fx(t)(...e):!0)(n,r),(e,t)=>(0,Px.and)(n?Fx(n):!0,r?(...e)=>!Fx(r)(...e):!0)(t))}function Lx(e,t){return!t||t===`deno`?Dx.npm:e.registryType===`json`?Dx.staticRegistry:(Dx[t]||up(e,`Invalid package manager: ${t}`),Dx[t])}async function Rx(e={}){let t=await Lx(e,e.packageManager).list?.({cwd:e.cwd,prefix:e.prefix,global:e.global});t||up(e,`Unable to retrieve package list`);let n=Ix(e.filter,e.reject,e.filterVersion,e.rejectVersion),r={};try{r=Pn(t,(e,t)=>!!t&&!hr(t)&&n(e,t))}catch(t){up(e,`Invalid filter: `+t.message||t)}return r}var zx=e=>/^@[^/]*\./.test(e)?`"${e}"`:e,Bx=c({default:()=>Vx,pMapSkip:()=>Hx});async function Vx(e,t,{concurrency:n=1/0,stopOnError:r=!0,signal:i}={}){return new Promise((a,o)=>{if(e[Symbol.iterator]===void 0&&e[Symbol.asyncIterator]===void 0)throw TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof e})`);if(typeof t!=`function`)throw TypeError(`Mapper function is required`);if(!(Number.isSafeInteger(n)&&n>=1||n===1/0))throw TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${n}\` (${typeof n})`);let s=[],c=[],l=new Map,u=!1,d=!1,f=!1,p=0,m=0,h=e[Symbol.iterator]===void 0?e[Symbol.asyncIterator]():e[Symbol.iterator](),g=()=>{y(i.reason)},_=()=>{i?.removeEventListener(`abort`,g)},v=e=>{a(e),_()},y=e=>{u=!0,d=!0,o(e),_()};i&&(i.aborted&&y(i.reason),i.addEventListener(`abort`,g,{once:!0}));let b=async()=>{if(d)return;let e=await h.next(),n=m;if(m++,e.done){if(f=!0,p===0&&!d){if(!r&&c.length>0){y(AggregateError(c));return}if(d=!0,l.size===0){v(s);return}let e=[];for(let[t,n]of s.entries())l.get(t)!==Hx&&e.push(n);v(e)}return}p++,(async()=>{try{let r=await e.value;if(d)return;let i=await t(r,n);i===Hx&&l.set(n,i),s[n]=i,p--,await b()}catch(e){if(r)y(e);else{c.push(e),p--;try{await b()}catch(e){y(e)}}}})()};(async()=>{for(let e=0;e<n;e++){try{await b()}catch(e){y(e);break}if(f||u)break}})()})}var Hx,Ux=o((()=>{Hx=Symbol(`skip`)})),Wx=s(((e,t)=>{e=t.exports=n;function n(e,t){if(this.stream=t.stream||process.stderr,typeof t==`number`){var n=t;t={},t.total=n}else{if(t||={},typeof e!=`string`)throw Error(`format required`);if(typeof t.total!=`number`)throw Error(`total required`)}this.fmt=e,this.curr=t.curr||0,this.total=t.total,this.width=t.width||this.total,this.clear=t.clear,this.chars={complete:t.complete||`=`,incomplete:t.incomplete||`-`,head:t.head||t.complete||`=`},this.renderThrottle=t.renderThrottle===0?0:t.renderThrottle||16,this.lastRender=-1/0,this.callback=t.callback||function(){},this.tokens={},this.lastDraw=``}n.prototype.tick=function(e,t){if(e!==0&&(e||=1),typeof e==`object`&&(t=e,e=1),t&&(this.tokens=t),this.curr==0&&(this.start=new Date),this.curr+=e,this.render(),this.curr>=this.total){this.render(void 0,!0),this.complete=!0,this.terminate(),this.callback(this);return}},n.prototype.render=function(e,t){if(t=t===void 0?!1:t,e&&(this.tokens=e),this.stream.isTTY){var n=Date.now(),r=n-this.lastRender;if(!(!t&&r<this.renderThrottle)){this.lastRender=n;var i=this.curr/this.total;i=Math.min(Math.max(i,0),1);var a=Math.floor(i*100),o,s,c,l=new Date-this.start,u=a==100?0:l*(this.total/this.curr-1),d=this.curr/(l/1e3),f=this.fmt.replace(`:current`,this.curr).replace(`:total`,this.total).replace(`:elapsed`,isNaN(l)?`0.0`:(l/1e3).toFixed(1)).replace(`:eta`,isNaN(u)||!isFinite(u)?`0.0`:(u/1e3).toFixed(1)).replace(`:percent`,a.toFixed(0)+`%`).replace(`:rate`,Math.round(d)),p=Math.max(0,this.stream.columns-f.replace(`:bar`,``).length);p&&process.platform===`win32`&&--p;var m=Math.min(this.width,p);if(c=Math.round(m*i),s=Array(Math.max(0,c+1)).join(this.chars.complete),o=Array(Math.max(0,m-c+1)).join(this.chars.incomplete),c>0&&(s=s.slice(0,-1)+this.chars.head),f=f.replace(`:bar`,s+o),this.tokens)for(var h in this.tokens)f=f.replace(`:`+h,this.tokens[h]);this.lastDraw!==f&&(this.stream.cursorTo(0),this.stream.write(f),this.stream.clearLine(1),this.lastDraw=f)}}},n.prototype.update=function(e,t){var n=Math.floor(e*this.total)-this.curr;this.tick(n,t)},n.prototype.interrupt=function(e){this.stream.clearLine(),this.stream.cursorTo(0),this.stream.write(e),this.stream.write(`
636
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function m_(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:__(t,`input`,e.processors),output:__(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function h_(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return h_(r.element,n);if(r.type===`set`)return h_(r.valueType,n);if(r.type===`lazy`)return h_(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return h_(r.innerType,n);if(r.type===`intersection`)return h_(r.left,n)||h_(r.right,n);if(r.type===`record`||r.type===`map`)return h_(r.keyType,n)||h_(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:h_(r.in,n)||h_(r.out,n);if(r.type===`object`){for(let e in r.shape)if(h_(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(h_(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(h_(e,n))return!0;return!!(r.rest&&h_(r.rest,n))}return!1}var g_=(e,t={})=>n=>{let r=d_({...n,processors:t});return f_(e,r),p_(r,e),m_(r,e)},__=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=d_({...i??{},target:a,io:t,processors:n});return f_(e,o),p_(o,e),m_(o,e)},v_={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},y_=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=v_[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},b_=(e,t,n,r)=>{n.not={}},x_=(e,t,n,r)=>{let i=e._zod.def,a=_p(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},S_=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},C_=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},w_=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=f_(a.element,t,{...r,path:[...r.path,`items`]})},T_=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=f_(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=f_(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},E_=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>f_(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},D_=(e,t,n,r)=>{let i=e._zod.def,a=f_(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=f_(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},O_=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=f_(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=f_(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=f_(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},k_=(e,t,n,r)=>{let i=e._zod.def,a=f_(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},A_=(e,t,n,r)=>{let i=e._zod.def;f_(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},j_=(e,t,n,r)=>{let i=e._zod.def;f_(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},M_=(e,t,n,r)=>{let i=e._zod.def;f_(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},N_=(e,t,n,r)=>{let i=e._zod.def;f_(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},P_=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;f_(o,t,r);let s=t.seen.get(e);s.ref=o},F_=(e,t,n,r)=>{let i=e._zod.def;f_(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},I_=(e,t,n,r)=>{let i=e._zod.def;f_(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},L_=Q(`ZodISODateTime`,(e,t)=>{yh.init(e,t),uv.init(e,t)});function R_(e){return Bg(L_,e)}var z_=Q(`ZodISODate`,(e,t)=>{bh.init(e,t),uv.init(e,t)});function B_(e){return Vg(z_,e)}var V_=Q(`ZodISOTime`,(e,t)=>{xh.init(e,t),uv.init(e,t)});function H_(e){return Hg(V_,e)}var U_=Q(`ZodISODuration`,(e,t)=>{Sh.init(e,t),uv.init(e,t)});function W_(e){return Ug(U_,e)}var G_=Q(`ZodError`,(e,t)=>{Qp.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>tm(e,t)},flatten:{value:t=>em(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,vp,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,vp,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),K_=nm(G_),q_=rm(G_),J_=im(G_),Y_=om(G_),X_=cm(G_),Z_=lm(G_),Q_=um(G_),$_=dm(G_),ev=fm(G_),tv=pm(G_),nv=mm(G_),rv=hm(G_),iv=new WeakMap;function av(e,t,n){let r=Object.getPrototypeOf(e),i=iv.get(r);if(i||(i=new Set,iv.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var ov=Q(`ZodType`,(e,t)=>(ah.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:__(e,`input`),output:__(e,`output`)}}),e.toJSONSchema=g_(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>K_(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>J_(e,t,n),e.parseAsync=async(t,n)=>q_(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Y_(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>X_(e,t,n),e.decode=(t,n)=>Z_(e,t,n),e.encodeAsync=async(t,n)=>Q_(e,t,n),e.decodeAsync=async(t,n)=>$_(e,t,n),e.safeEncode=(t,n)=>ev(e,t,n),e.safeDecode=(t,n)=>tv(e,t,n),e.safeEncodeAsync=async(t,n)=>nv(e,t,n),e.safeDecodeAsync=async(t,n)=>rv(e,t,n),av(e,`ZodType`,{check(...e){let t=this.def;return this.clone(Tp(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Fp(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(py(e,t))},superRefine(e,t){return this.check(my(e,t))},overwrite(e){return this.check(t_(e))},optional(){return Yv(this)},exactOptional(){return Zv(this)},nullable(){return $v(this)},nullish(){return Yv($v(this))},nonoptional(e){return ay(this,e)},array(){return Fv(this)},or(e){return zv([this,e])},and(e){return Vv(this,e)},transform(e){return ly(this,qv(e))},default(e){return ty(this,e)},prefault(e){return ry(this,e)},catch(e){return sy(this,e)},pipe(e){return ly(this,e)},readonly(){return dy(this)},describe(e){let t=this.clone();return gg.add(t,{description:e}),t},meta(...e){if(e.length===0)return gg.get(this);let t=this.clone();return gg.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return gg.get(e)?.description},configurable:!0}),e)),sv=Q(`_ZodString`,(e,t)=>{oh.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>y_(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,av(e,`_ZodString`,{regex(...e){return this.check(Yg(...e))},includes(...e){return this.check(Qg(...e))},startsWith(...e){return this.check($g(...e))},endsWith(...e){return this.check(e_(...e))},min(...e){return this.check(qg(...e))},max(...e){return this.check(Kg(...e))},length(...e){return this.check(Jg(...e))},nonempty(...e){return this.check(qg(1,...e))},lowercase(e){return this.check(Xg(e))},uppercase(e){return this.check(Zg(e))},trim(){return this.check(r_())},normalize(...e){return this.check(n_(...e))},toLowerCase(){return this.check(i_())},toUpperCase(){return this.check(a_())},slugify(){return this.check(o_())}})}),cv=Q(`ZodString`,(e,t)=>{oh.init(e,t),sv.init(e,t),e.email=t=>e.check(vg(dv,t)),e.url=t=>e.check(wg(mv,t)),e.jwt=t=>e.check(zg(kv,t)),e.emoji=t=>e.check(Tg(hv,t)),e.guid=t=>e.check(yg(fv,t)),e.uuid=t=>e.check(bg(pv,t)),e.uuidv4=t=>e.check(xg(pv,t)),e.uuidv6=t=>e.check(Sg(pv,t)),e.uuidv7=t=>e.check(Cg(pv,t)),e.nanoid=t=>e.check(Eg(gv,t)),e.guid=t=>e.check(yg(fv,t)),e.cuid=t=>e.check(Dg(_v,t)),e.cuid2=t=>e.check(Og(vv,t)),e.ulid=t=>e.check(kg(yv,t)),e.base64=t=>e.check(Ig(Ev,t)),e.base64url=t=>e.check(Lg(Dv,t)),e.xid=t=>e.check(Ag(bv,t)),e.ksuid=t=>e.check(jg(xv,t)),e.ipv4=t=>e.check(Mg(Sv,t)),e.ipv6=t=>e.check(Ng(Cv,t)),e.cidrv4=t=>e.check(Pg(wv,t)),e.cidrv6=t=>e.check(Fg(Tv,t)),e.e164=t=>e.check(Rg(Ov,t)),e.datetime=t=>e.check(R_(t)),e.date=t=>e.check(B_(t)),e.time=t=>e.check(H_(t)),e.duration=t=>e.check(W_(t))});function lv(e){return _g(cv,e)}var uv=Q(`ZodStringFormat`,(e,t)=>{sh.init(e,t),sv.init(e,t)}),dv=Q(`ZodEmail`,(e,t)=>{uh.init(e,t),uv.init(e,t)}),fv=Q(`ZodGUID`,(e,t)=>{ch.init(e,t),uv.init(e,t)}),pv=Q(`ZodUUID`,(e,t)=>{lh.init(e,t),uv.init(e,t)}),mv=Q(`ZodURL`,(e,t)=>{dh.init(e,t),uv.init(e,t)}),hv=Q(`ZodEmoji`,(e,t)=>{fh.init(e,t),uv.init(e,t)}),gv=Q(`ZodNanoID`,(e,t)=>{ph.init(e,t),uv.init(e,t)}),_v=Q(`ZodCUID`,(e,t)=>{mh.init(e,t),uv.init(e,t)}),vv=Q(`ZodCUID2`,(e,t)=>{hh.init(e,t),uv.init(e,t)}),yv=Q(`ZodULID`,(e,t)=>{gh.init(e,t),uv.init(e,t)}),bv=Q(`ZodXID`,(e,t)=>{_h.init(e,t),uv.init(e,t)}),xv=Q(`ZodKSUID`,(e,t)=>{vh.init(e,t),uv.init(e,t)}),Sv=Q(`ZodIPv4`,(e,t)=>{Ch.init(e,t),uv.init(e,t)}),Cv=Q(`ZodIPv6`,(e,t)=>{wh.init(e,t),uv.init(e,t)}),wv=Q(`ZodCIDRv4`,(e,t)=>{Th.init(e,t),uv.init(e,t)}),Tv=Q(`ZodCIDRv6`,(e,t)=>{Eh.init(e,t),uv.init(e,t)}),Ev=Q(`ZodBase64`,(e,t)=>{Oh.init(e,t),uv.init(e,t)}),Dv=Q(`ZodBase64URL`,(e,t)=>{Ah.init(e,t),uv.init(e,t)}),Ov=Q(`ZodE164`,(e,t)=>{jh.init(e,t),uv.init(e,t)}),kv=Q(`ZodJWT`,(e,t)=>{Nh.init(e,t),uv.init(e,t)}),Av=Q(`ZodUnknown`,(e,t)=>{Ph.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function jv(){return Wg(Av)}var Mv=Q(`ZodNever`,(e,t)=>{Fh.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>b_(e,t,n,r)});function Nv(e){return Gg(Mv,e)}var Pv=Q(`ZodArray`,(e,t)=>{Lh.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>w_(e,t,n,r),e.element=t.element,av(e,`ZodArray`,{min(e,t){return this.check(qg(e,t))},nonempty(e){return this.check(qg(1,e))},max(e,t){return this.check(Kg(e,t))},length(e,t){return this.check(Jg(e,t))},unwrap(){return this.element}})});function Fv(e,t){return s_(Pv,e,t)}var Iv=Q(`ZodObject`,(e,t)=>{Hh.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>T_(e,t,n,r),Cp(e,`shape`,()=>t.shape),av(e,`ZodObject`,{keyof(){return Gv(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:jv()})},loose(){return this.clone({...this._zod.def,catchall:jv()})},strict(){return this.clone({...this._zod.def,catchall:Nv()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return zp(this,e)},safeExtend(e){return Bp(this,e)},merge(e){return Vp(this,e)},pick(e){return Lp(this,e)},omit(e){return Rp(this,e)},partial(...e){return Hp(Jv,this,e[0])},required(...e){return Up(iy,this,e[0])}})});function Lv(e,t){return new Iv({type:`object`,shape:e??{},...$(t)})}var Rv=Q(`ZodUnion`,(e,t)=>{Wh.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>E_(e,t,n,r),e.options=t.options});function zv(e,t){return new Rv({type:`union`,options:e,...$(t)})}var Bv=Q(`ZodIntersection`,(e,t)=>{Gh.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>D_(e,t,n,r)});function Vv(e,t){return new Bv({type:`intersection`,left:e,right:t})}var Hv=Q(`ZodRecord`,(e,t)=>{Jh.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>O_(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Uv(e,t,n){return!t||!t._zod?new Hv({type:`record`,keyType:lv(),valueType:e,...$(t)}):new Hv({type:`record`,keyType:e,valueType:t,...$(n)})}var Wv=Q(`ZodEnum`,(e,t)=>{Yh.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>x_(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Wv({...t,checks:[],...$(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Wv({...t,checks:[],...$(r),entries:i})}});function Gv(e,t){return new Wv({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...$(t)})}var Kv=Q(`ZodTransform`,(e,t)=>{Xh.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>C_(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new mp(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Xp(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(Xp(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function qv(e){return new Kv({type:`transform`,transform:e})}var Jv=Q(`ZodOptional`,(e,t)=>{Qh.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>I_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Yv(e){return new Jv({type:`optional`,innerType:e})}var Xv=Q(`ZodExactOptional`,(e,t)=>{$h.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>I_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Zv(e){return new Xv({type:`optional`,innerType:e})}var Qv=Q(`ZodNullable`,(e,t)=>{eg.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>k_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $v(e){return new Qv({type:`nullable`,innerType:e})}var ey=Q(`ZodDefault`,(e,t)=>{tg.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>j_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ty(e,t){return new ey({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Mp(t)}})}var ny=Q(`ZodPrefault`,(e,t)=>{rg.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>M_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ry(e,t){return new ny({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Mp(t)}})}var iy=Q(`ZodNonOptional`,(e,t)=>{ig.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>A_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ay(e,t){return new iy({type:`nonoptional`,innerType:e,...$(t)})}var oy=Q(`ZodCatch`,(e,t)=>{og.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>N_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function sy(e,t){return new oy({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var cy=Q(`ZodPipe`,(e,t)=>{sg.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>P_(e,t,n,r),e.in=t.in,e.out=t.out});function ly(e,t){return new cy({type:`pipe`,in:e,out:t})}var uy=Q(`ZodReadonly`,(e,t)=>{lg.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>F_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function dy(e){return new uy({type:`readonly`,innerType:e})}var fy=Q(`ZodCustom`,(e,t)=>{dg.init(e,t),ov.init(e,t),e._zod.processJSONSchema=(t,n,r)=>S_(e,t,n,r)});function py(e,t={}){return c_(fy,e,t)}function my(e,t){return l_(e,t)}var hy={catalog:Yv(Uv(lv(),lv())),catalogs:Yv(Uv(lv(),Uv(lv(),lv()))).catch(void 0)},gy=Lv({...hy,workspaces:Yv(zv([Fv(lv()),Lv(hy).passthrough()])).catch(void 0)}),_y={dev:`devDependencies`,peer:`peerDependencies`,prod:`dependencies`,optional:`optionalDependencies`},vy=e=>(e?typeof e==`string`?e.split(`,`):e:Ci.dep.default).map(e=>_y[e]||e);async function yy(e,t,n){let r=await g.default.readFile(e,`utf-8`);return Object.entries(n).filter(([e])=>t[e]).reduce((e,[n,r])=>{let i=t[n],a=`("${er(n)}"\\s*:\\s*")(${er(i)})(")`,o=new RegExp(a,`g`);return e.replace(o,`$1${r}$3`)},r)}function by(e,{options:t,filePath:n}){let r=e instanceof Error?e.message:String(e),i=`Invalid YAML syntax${n?` in ${n}`:``}. Unable to read catalog dependencies.\n${r}`;throw t&&up(t,i),Error(i)}function xy(e,t,{newName:n,newValue:r}){let i=t.slice(0,-1),a=t.at(-1),o=e.getIn(i);if(!o||!(0,_f.isCollection)(o))return!1;let s=o.items.find(e=>(0,_f.isPair)(e)&&(0,_f.isScalar)(e.key)&&e.key.value===a);if(!s||!(0,_f.isPair)(s))return!1;if(n&&_f.CST.setScalarValue(s.srcToken.key,n),r){if(!_f.CST.isScalar(s.srcToken?.value))return!1;_f.CST.setScalarValue(s.srcToken.value,r)}return!0}function Sy({fileContent:e,upgrade:t,options:n,filePath:r}){let{path:i}=t;if(!(i.length>1)&&i[0]!==`catalog`&&i[0]!==`catalogs`)return null;let{newValue:a}=t,o,s;try{o=(0,_f.parseDocument)(e,{keepSourceTokens:!0})}catch(e){by(e,{options:n,filePath:r})}o.errors.length>0&&by(o.errors[0],{options:n,filePath:r});try{s=gy.parse(o.toJSON())}catch{return null}let c=s.workspaces&&!Array.isArray(s.workspaces)?s.workspaces:void 0;return(i[0]===`catalog`?s.catalog?.[i[1]]:i[0]===`catalogs`?s.catalogs?.[i[1]]?.[i[2]]:i[0]===`workspaces`&&i[1]===`catalog`?c?.catalog?.[i[2]]:i[0]===`workspaces`&&i[1]===`catalogs`?c?.catalogs?.[i[2]]?.[i[3]]:void 0)===a?e:xy(o,i,{newValue:a,newName:t.path.at(-1)})?_f.CST.stringify(o.contents.srcToken):null}async function Cy(e,t,n,r,i){if(i){let a=f.default.basename(i),o=f.default.extname(i);if(i.includes(`#catalog`)){let e=i.replace(`#catalog`,``);if(f.default.extname(e)===`.json`)return yy(e,t,n)}if(a===`pnpm-workspace.yaml`||a===`.yarnrc.yml`){let e=await g.default.readFile(i,`utf-8`),t=gy.parse((0,_f.parseDocument)(e).toJSON()),a=[];if(t.catalogs)for(let[e,r]of Object.entries(t.catalogs))for(let[t,i]of Object.entries(n))r[t]&&a.push({path:[`catalogs`,e,t],newValue:i});if(t.catalog)for(let[e,r]of Object.entries(n))t.catalog?.[e]&&a.push({path:[`catalog`,e],newValue:r});let o=t.workspaces;if(o&&!Array.isArray(o)){if(o.catalogs)for(let[e,t]of Object.entries(o.catalogs))for(let[r,i]of Object.entries(n))t[r]&&a.push({path:[`workspaces`,`catalogs`,e,r],newValue:i});if(o.catalog)for(let[e,t]of Object.entries(n))o.catalog?.[e]&&a.push({path:[`workspaces`,`catalog`,e],newValue:t})}let s=e;for(let e of a){let t=Sy({fileContent:s,upgrade:e,options:r,filePath:i});t&&(s=t)}return s}if(o===`.json`){let r=JSON.parse(e),a=r.catalog||r.catalogs,o=r.workspaces&&!Array.isArray(r.workspaces)&&(r.workspaces.catalog||r.workspaces.catalogs);if(a||o)return yy(i,t,n)}}let a=[...vy(r.dep),`overrides`],o=RegExp(`"(${a.join(`|`)})"s*:[^}]*`,`g`),s=e.replace(o,e=>Object.entries(n).reduce((e,[r])=>{let i=`"${er(r)}"\\s*:\\s*("|{\\s*"."\\s*:\\s*")(${er(t[r])})"`,a=new RegExp(i,`g`);return e.replace(a,(e,t)=>`"${r}${t?`": ${t}`:`: `}${n[r]}"`)},e));if(a.includes(`packageManager`)){let t=JSON.parse(e);if(t.packageManager){let[e]=t.packageManager.split(`@`);n[e]&&(s=s.replace(/"packageManager"\s*:\s*".*?@[^"]*"/,`"packageManager": "${e}@${n[e]}"`))}}return s}var wy=(e,t,n,{spawnOptions:r,spawnPleaseOptions:i}={})=>{n&&console.log(J.blue([t.packageManager,...e].join(` `)));let a={cwd:t.cwd||process.cwd(),env:{...process.env,...t.packageManager===`pnpm`?null:{CI:`1`},FORCE_COLOR:`1`,...r?.env},...r},o={...t.global?{global:!0}:null,...t.prefix?{prefix:t.prefix}:null};return(t.packageManager===`pnpm`?Pf:t.packageManager===`yarn`?Yf:t.packageManager===`bun`?Ju:Fu)(e,o,i,a)},Ty=async e=>{(e.packageData||e.packageFile)&&(console.error(`--packageData and --packageFile are not allowed with --doctor. You must execute "ncu --doctor" in a directory with a package file so it can install dependencies and test them.`),process.exit(1));let t;try{t=await dp(e,`package.json`)}catch{console.error(`Missing or invalid package.json`),process.exit(1)}return!e.doctorTest&&!t.pkg.scripts?.test&&(console.error(`No npm "test" script defined. You must define a "test" script in the "scripts" section of your package.json to use --doctor.`),process.exit(1)),t},Ey=async(e,t)=>{Mn();let n=t.packageManager===`yarn`?`yarn.lock`:t.packageManager===`pnpm`?`pnpm-lock.yaml`:t.packageManager===`bun`?`bun.lock`:`package-lock.json`,{pkg:r,pkgFile:i}=await Ty(t),a={...r.dependencies,...r.devDependencies,...r.optionalDependencies},o=async()=>{if(t.doctorInstall){let[e,...n]=t.doctorInstall.split(` `);console.log(J.blue(t.doctorInstall)),await(0,Wi.default)(e,n)}else await wy([`install`],{packageManager:t.packageManager},!0)},s=async()=>{let e={stderr:e=>{console.error(J.red(e.toString()))},stdout:e=>{process.stdout.write(e.toString())}};if(t.doctorTest){let n=t.doctorTest.matchAll(/"(.+?)"|'(.+?)'|[^ ]+/g),r=[];for(let e of n)r=[...r,e[2]||e[1]||e[0]];let[i,...a]=r;console.log(J.blue(t.doctorTest)),await(0,Wi.default)(i,a,e)}else await wy([`run`,`test`],{packageManager:t.packageManager},!0,{spawnPleaseOptions:e})};console.log(`Running tests before upgrading`),await o();let c=``;try{c=await g.default.readFile(n,`utf-8`)}catch{if(t.packageManager===`bun`){n=`bun.lockb`;try{c=await g.default.readFile(n,`utf-8`)}catch{}}}try{await s()}catch{console.error(`Tests failed before we even got started!`),process.exit(1)}t.interactive||console.log(`Upgrading all dependencies and re-running tests`),console.log(J.blue(`ncu `+process.argv.slice(2).filter(e=>e!==`--doctor`).join(` `))),process.env.NCU_DOCTOR=`1`;let l=await e({...t,silent:!0,doctor:!1});if(Object.keys(l||{}).length===0){console.log(`All dependencies are up-to-date `+J.green.bold(`:)`));return}let u=!1;try{await o(),u=!0,await s(),console.log(`${J.green(`✓`)} Tests pass`),await ei(t,{current:a,upgraded:l,total:Object.keys(l||{}).length}),console.log(`\n${t.interactive?`Chosen`:`All`} dependencies upgraded and installed ${J.green(`:)`)}`)}catch{console.error(J.red(u?`Tests failed`:`Install failed`)),console.log(`Identifying broken dependencies`),await g.default.writeFile(`package.json`,i),c?await g.default.writeFile(n,c):await g.default.rm(n,{recursive:!0,force:!0});let e=i;if(u)try{await o()}catch(e){let n=(t.packageManager||`npm`)+` install`;throw Error(`Error: Doctor mode was about to test individual upgrades, but ${J.cyan(n)} failed after rolling back to your existing package and lock files. This is unexpected since the initial install before any upgrades succeeded. Either npm failed to revert a partial install, or failed anomalously on the second run. Please check your internet connection and retry. If doctor mode fails consistently, report a bug with your complete list of dependency versions at https://github.com/raineorshine/npm-check-updates/issues.`,{cause:e})}let d,f;for([d,f]of Object.entries(l))try{if(await wy([...t.packageManager===`yarn`||t.packageManager===`pnpm`||t.packageManager===`bun`?[`add`]:[`install`,`--no-save`],`${d}@${f}`],{packageManager:t.packageManager},!0),r.scripts?.prepare)try{await wy([`run`,`prepare`],{packageManager:t.packageManager},!0)}catch(e){throw console.error(J.red(`Prepare script failed`)),e}await s(),console.log(` ${J.green(`✓`)} ${d} ${a[d]} → ${f}`),e=await Cy(e,{[d]:a[d]},{[d]:f},t),c=await g.default.readFile(n,`utf-8`)}catch(r){console.error(` ${J.red(`✗`)} ${d} ${a[d]} → ${f}\n`),console.error(J.red(r)),await g.default.writeFile(n,c),(t.packageManager===`yarn`||t.packageManager===`pnpm`||t.packageManager===`bun`)&&await g.default.writeFile(`package.json`,e)}e!==i&&(console.log(`Saving partially upgraded package.json`),await g.default.writeFile(`package.json`,e)),await o()}};async function Dy(e){let t,n=null,r=e.packageFile||`package.json`;async function i(t,n){if(t!=null){let n=f.default.resolve(t);Y(e,`${e.upgrade?`Upgrading`:`Checking`} ${n}`)}else up(e,`${J.red(`No ${n}`)}\n\nPlease add a ${n} to the current directory, specify the ${J.cyan(`--packageFile`)} or ${J.cyan(`--packageData`)} options, or pipe a ${n} to stdin and specify ${J.cyan(`--stdin`)}.`,{color:!1});try{return await g.default.readFile(t,`utf-8`)}catch(t){up(e,t)}}if(Y(e,`Running in local mode`,`verbose`),Y(e,`Finding package file data`,`verbose`),e.packageData)n=null,t=Promise.resolve(e.packageData);else if(e.packageFile)n=e.packageFile,t=i(n,r);else if(e.stdin){Y(e,`Waiting for package data on stdin`,`verbose`);let a=await(0,D.text)(process.stdin),o=a.trim().length>0?a:null;n=o||!r?null:await Ql(r),t=o||i(n,r)}else n=r?await Ql(!e.packageFile&&e.packageManager===`deno`?[`deno.json`,`deno.jsonc`]:r,{cwd:e.cwd||process.cwd()}):null,t=i(n,r);return{pkgData:await t,pkgFile:n||null,pkgPath:r}}var Oy=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.splitWhen=e.flatten=void 0;function t(e){return e.reduce((e,t)=>[].concat(e,t),[])}e.flatten=t;function n(e,t){let n=[[]],r=0;for(let i of e)t(i)?(r++,n[r]=[]):n[r].push(i);return n}e.splitWhen=n})),ky=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isEnoentCodeError=void 0;function t(e){return e.code===`ENOENT`}e.isEnoentCodeError=t})),Ay=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createDirentFromStats=void 0;var t=class{constructor(e,t){this.name=e,this.isBlockDevice=t.isBlockDevice.bind(t),this.isCharacterDevice=t.isCharacterDevice.bind(t),this.isDirectory=t.isDirectory.bind(t),this.isFIFO=t.isFIFO.bind(t),this.isFile=t.isFile.bind(t),this.isSocket=t.isSocket.bind(t),this.isSymbolicLink=t.isSymbolicLink.bind(t)}};function n(e,n){return new t(e,n)}e.createDirentFromStats=n})),jy=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.convertPosixPathToPattern=e.convertWindowsPathToPattern=e.convertPathToPattern=e.escapePosixPath=e.escapeWindowsPath=e.escape=e.removeLeadingDotSegment=e.makeAbsolute=e.unixify=void 0;var t=require("os"),n=require("path"),r=t.platform()===`win32`,i=2,a=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,o=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,s=/^\\\\([.?])/,c=/\\(?![!()+@[\]{}])/g;function l(e){return e.replace(/\\/g,`/`)}e.unixify=l;function u(e,t){return n.resolve(e,t)}e.makeAbsolute=u;function d(e){if(e.charAt(0)===`.`){let t=e.charAt(1);if(t===`/`||t===`\\`)return e.slice(i)}return e}e.removeLeadingDotSegment=d,e.escape=r?f:p;function f(e){return e.replace(o,`\\$2`)}e.escapeWindowsPath=f;function p(e){return e.replace(a,`\\$2`)}e.escapePosixPath=p,e.convertPathToPattern=r?m:h;function m(e){return f(e).replace(s,`//$1`).replace(c,`/`)}e.convertWindowsPathToPattern=m;function h(e){return p(e)}e.convertPosixPathToPattern=h})),My=s(((e,t)=>{t.exports=function(e){if(typeof e!=`string`||e===``)return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1}})),Ny=s(((e,t)=>{var n=My(),r={"{":`}`,"(":`)`,"[":`]`},i=function(e){if(e[0]===`!`)return!0;for(var t=0,n=-2,i=-2,a=-2,o=-2,s=-2;t<e.length;){if(e[t]===`*`||e[t+1]===`?`&&/[\].+)]/.test(e[t])||i!==-1&&e[t]===`[`&&e[t+1]!==`]`&&(i<t&&(i=e.indexOf(`]`,t)),i>t&&(s===-1||s>i||(s=e.indexOf(`\\`,t),s===-1||s>i)))||a!==-1&&e[t]===`{`&&e[t+1]!==`}`&&(a=e.indexOf(`}`,t),a>t&&(s=e.indexOf(`\\`,t),s===-1||s>a))||o!==-1&&e[t]===`(`&&e[t+1]===`?`&&/[:!=]/.test(e[t+2])&&e[t+3]!==`)`&&(o=e.indexOf(`)`,t),o>t&&(s=e.indexOf(`\\`,t),s===-1||s>o))||n!==-1&&e[t]===`(`&&e[t+1]!==`|`&&(n<t&&(n=e.indexOf(`|`,t)),n!==-1&&e[n+1]!==`)`&&(o=e.indexOf(`)`,n),o>n&&(s=e.indexOf(`\\`,n),s===-1||s>o))))return!0;if(e[t]===`\\`){var c=e[t+1];t+=2;var l=r[c];if(l){var u=e.indexOf(l,t);u!==-1&&(t=u+1)}if(e[t]===`!`)return!0}else t++}return!1},a=function(e){if(e[0]===`!`)return!0;for(var t=0;t<e.length;){if(/[*?{}()[\]]/.test(e[t]))return!0;if(e[t]===`\\`){var n=e[t+1];t+=2;var i=r[n];if(i){var a=e.indexOf(i,t);a!==-1&&(t=a+1)}if(e[t]===`!`)return!0}else t++}return!1};t.exports=function(e,t){if(typeof e!=`string`||e===``)return!1;if(n(e))return!0;var r=i;return t&&t.strict===!1&&(r=a),r(e)}})),Py=s(((e,t)=>{var n=Ny(),r=require("path").posix.dirname,i=require("os").platform()===`win32`,a=`/`,o=/\\/g,s=/[\{\[].*[\}\]]$/,c=/(^|[^\\])([\{\[]|\([^\)]+$)/,l=/\\([\!\*\?\|\[\]\(\)\{\}])/g;t.exports=function(e,t){Object.assign({flipBackslashes:!0},t).flipBackslashes&&i&&e.indexOf(a)<0&&(e=e.replace(o,a)),s.test(e)&&(e+=a),e+=`a`;do e=r(e);while(n(e)||c.test(e));return e.replace(l,`$1`)}})),Fy=s((e=>{e.isInteger=e=>typeof e==`number`?Number.isInteger(e):typeof e==`string`&&e.trim()!==``?Number.isInteger(Number(e)):!1,e.find=(e,t)=>e.nodes.find(e=>e.type===t),e.exceedsLimit=(t,n,r=1,i)=>i===!1||!e.isInteger(t)||!e.isInteger(n)?!1:(Number(n)-Number(t))/Number(r)>=i,e.escapeNode=(e,t=0,n)=>{let r=e.nodes[t];r&&(n&&r.type===n||r.type===`open`||r.type===`close`)&&r.escaped!==!0&&(r.value=`\\`+r.value,r.escaped=!0)},e.encloseBrace=e=>e.type===`brace`?e.commas>>0+e.ranges>>0?!1:(e.invalid=!0,!0):!1,e.isInvalidBrace=e=>e.type===`brace`?e.invalid===!0||e.dollar?!0:!(e.commas>>0+e.ranges>>0)||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1:!1,e.isOpenOrClose=e=>e.type===`open`||e.type===`close`?!0:e.open===!0||e.close===!0,e.reduce=e=>e.reduce((e,t)=>(t.type===`text`&&e.push(t.value),t.type===`range`&&(t.type=`text`),e),[]),e.flatten=(...e)=>{let t=[],n=e=>{for(let r=0;r<e.length;r++){let i=e[r];if(Array.isArray(i)){n(i);continue}i!==void 0&&t.push(i)}return t};return n(e),t}})),Iy=s(((e,t)=>{var n=Fy();t.exports=(e,t={})=>{let r=(e,i={})=>{let a=t.escapeInvalid&&n.isInvalidBrace(i),o=e.invalid===!0&&t.escapeInvalid===!0,s=``;if(e.value)return(a||o)&&n.isOpenOrClose(e)?`\\`+e.value:e.value;if(e.value)return e.value;if(e.nodes)for(let t of e.nodes)s+=r(t);return s};return r(e)}})),Ly=s(((e,t)=>{t.exports=function(e){return typeof e==`number`?e-e===0:typeof e==`string`&&e.trim()!==``?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}})),Ry=s(((e,t)=>{var n=Ly(),r=(e,t,a)=>{if(n(e)===!1)throw TypeError(`toRegexRange: expected the first argument to be a number`);if(t===void 0||e===t)return String(e);if(n(t)===!1)throw TypeError(`toRegexRange: expected the second argument to be a number.`);let o={relaxZeros:!0,...a};typeof o.strictZeros==`boolean`&&(o.relaxZeros=o.strictZeros===!1);let c=String(o.relaxZeros),l=String(o.shorthand),u=String(o.capture),d=String(o.wrap),f=e+`:`+t+`=`+c+l+u+d;if(r.cache.hasOwnProperty(f))return r.cache[f].result;let p=Math.min(e,t),m=Math.max(e,t);if(Math.abs(p-m)===1){let n=e+`|`+t;return o.capture?`(${n})`:o.wrap===!1?n:`(?:${n})`}let h=g(e)||g(t),_={min:e,max:t,a:p,b:m},v=[],y=[];return h&&(_.isPadded=h,_.maxLen=String(_.max).length),p<0&&(y=s(m<0?Math.abs(m):1,Math.abs(p),_,o),p=_.a=0),m>=0&&(v=s(p,m,_,o)),_.negatives=y,_.positives=v,_.result=i(y,v,o),o.capture===!0?_.result=`(${_.result})`:o.wrap!==!1&&v.length+y.length>1&&(_.result=`(?:${_.result})`),r.cache[f]=_,_.result};function i(e,t,n){let r=c(e,t,`-`,!1,n)||[],i=c(t,e,``,!1,n)||[],a=c(e,t,`-?`,!0,n)||[];return r.concat(a).concat(i).join(`|`)}function a(e,t){let n=1,r=1,i=f(e,n),a=new Set([t]);for(;e<=i&&i<=t;)a.add(i),n+=1,i=f(e,n);for(i=p(t+1,r)-1;e<i&&i<=t;)a.add(i),r+=1,i=p(t+1,r)-1;return a=[...a],a.sort(u),a}function o(e,t,n){if(e===t)return{pattern:e,count:[],digits:0};let r=l(e,t),i=r.length,a=``,o=0;for(let e=0;e<i;e++){let[t,i]=r[e];t===i?a+=t:t!==`0`||i!==`9`?a+=h(t,i,n):o++}return o&&(a+=n.shorthand===!0?`\\d`:`[0-9]`),{pattern:a,count:[o],digits:i}}function s(e,t,n,r){let i=a(e,t),s=[],c=e,l;for(let e=0;e<i.length;e++){let t=i[e],a=o(String(c),String(t),r),u=``;if(!n.isPadded&&l&&l.pattern===a.pattern){l.count.length>1&&l.count.pop(),l.count.push(a.count[0]),l.string=l.pattern+m(l.count),c=t+1;continue}n.isPadded&&(u=_(t,n,r)),a.string=u+a.pattern+m(a.count),s.push(a),c=t+1,l=a}return s}function c(e,t,n,r,i){let a=[];for(let i of e){let{string:e}=i;!r&&!d(t,`string`,e)&&a.push(n+e),r&&d(t,`string`,e)&&a.push(n+e)}return a}function l(e,t){let n=[];for(let r=0;r<e.length;r++)n.push([e[r],t[r]]);return n}function u(e,t){return e>t?1:t>e?-1:0}function d(e,t,n){return e.some(e=>e[t]===n)}function f(e,t){return Number(String(e).slice(0,-t)+`9`.repeat(t))}function p(e,t){return e-e%10**t}function m(e){let[t=0,n=``]=e;return n||t>1?`{${t+(n?`,`+n:``)}}`:``}function h(e,t,n){return`[${e}${t-e===1?``:`-`}${t}]`}function g(e){return/^-?(0+)\d/.test(e)}function _(e,t,n){if(!t.isPadded)return e;let r=Math.abs(t.maxLen-String(e).length),i=n.relaxZeros!==!1;switch(r){case 0:return``;case 1:return i?`0?`:`0`;case 2:return i?`0{0,2}`:`00`;default:return i?`0{0,${r}}`:`0{${r}}`}}r.cache={},r.clearCache=()=>r.cache={},t.exports=r})),zy=s(((e,t)=>{var n=require("util"),r=Ry(),i=e=>typeof e==`object`&&!!e&&!Array.isArray(e),a=e=>t=>e===!0?Number(t):String(t),o=e=>typeof e==`number`||typeof e==`string`&&e!==``,s=e=>Number.isInteger(+e),c=e=>{let t=`${e}`,n=-1;if(t[0]===`-`&&(t=t.slice(1)),t===`0`)return!1;for(;t[++n]===`0`;);return n>0},l=(e,t,n)=>typeof e==`string`||typeof t==`string`?!0:n.stringify===!0,u=(e,t,n)=>{if(t>0){let n=e[0]===`-`?`-`:``;n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,`0`)}return n===!1?String(e):e},d=(e,t)=>{let n=e[0]===`-`?`-`:``;for(n&&(e=e.slice(1),t--);e.length<t;)e=`0`+e;return n?`-`+e:e},f=(e,t,n)=>{e.negatives.sort((e,t)=>e<t?-1:+(e>t)),e.positives.sort((e,t)=>e<t?-1:+(e>t));let r=t.capture?``:`?:`,i=``,a=``,o;return e.positives.length&&(i=e.positives.map(e=>d(String(e),n)).join(`|`)),e.negatives.length&&(a=`-(${r}${e.negatives.map(e=>d(String(e),n)).join(`|`)})`),o=i&&a?`${i}|${a}`:i||a,t.wrap?`(${r}${o})`:o},p=(e,t,n,i)=>{if(n)return r(e,t,{wrap:!1,...i});let a=String.fromCharCode(e);return e===t?a:`[${a}-${String.fromCharCode(t)}]`},m=(e,t,n)=>{if(Array.isArray(e)){let t=n.wrap===!0,r=n.capture?``:`?:`;return t?`(${r}${e.join(`|`)})`:e.join(`|`)}return r(e,t,n)},h=(...e)=>RangeError(`Invalid range arguments: `+n.inspect(...e)),g=(e,t,n)=>{if(n.strictRanges===!0)throw h([e,t]);return[]},_=(e,t)=>{if(t.strictRanges===!0)throw TypeError(`Expected step "${e}" to be a number`);return[]},v=(e,t,n=1,r={})=>{let i=Number(e),o=Number(t);if(!Number.isInteger(i)||!Number.isInteger(o)){if(r.strictRanges===!0)throw h([e,t]);return[]}i===0&&(i=0),o===0&&(o=0);let s=i>o,g=String(e),_=String(t),v=String(n);n=Math.max(Math.abs(n),1);let y=c(g)||c(_)||c(v),b=y?Math.max(g.length,_.length,v.length):0,x=y===!1&&l(e,t,r)===!1,S=r.transform||a(x);if(r.toRegex&&n===1)return p(d(e,b),d(t,b),!0,r);let C={negatives:[],positives:[]},w=e=>C[e<0?`negatives`:`positives`].push(Math.abs(e)),T=[],E=0;for(;s?i>=o:i<=o;)r.toRegex===!0&&n>1?w(i):T.push(u(S(i,E),b,x)),i=s?i-n:i+n,E++;return r.toRegex===!0?n>1?f(C,r,b):m(T,null,{wrap:!1,...r}):T},y=(e,t,n=1,r={})=>{if(!s(e)&&e.length>1||!s(t)&&t.length>1)return g(e,t,r);let i=r.transform||(e=>String.fromCharCode(e)),a=`${e}`.charCodeAt(0),o=`${t}`.charCodeAt(0),c=a>o,l=Math.min(a,o),u=Math.max(a,o);if(r.toRegex&&n===1)return p(l,u,!1,r);let d=[],f=0;for(;c?a>=o:a<=o;)d.push(i(a,f)),a=c?a-n:a+n,f++;return r.toRegex===!0?m(d,null,{wrap:!1,options:r}):d},b=(e,t,n,r={})=>{if(t==null&&o(e))return[e];if(!o(e)||!o(t))return g(e,t,r);if(typeof n==`function`)return b(e,t,1,{transform:n});if(i(n))return b(e,t,0,n);let a={...r};return a.capture===!0&&(a.wrap=!0),n=n||a.step||1,s(n)?s(e)&&s(t)?v(e,t,n,a):y(e,t,Math.max(Math.abs(n),1),a):n!=null&&!i(n)?_(n,a):b(e,t,1,n)};t.exports=b})),By=s(((e,t)=>{var n=zy(),r=Fy();t.exports=(e,t={})=>{let i=(e,a={})=>{let o=r.isInvalidBrace(a),s=e.invalid===!0&&t.escapeInvalid===!0,c=o===!0||s===!0,l=t.escapeInvalid===!0?`\\`:``,u=``;if(e.isOpen===!0)return l+e.value;if(e.isClose===!0)return console.log(`node.isClose`,l,e.value),l+e.value;if(e.type===`open`)return c?l+e.value:`(`;if(e.type===`close`)return c?l+e.value:`)`;if(e.type===`comma`)return e.prev.type===`comma`?``:c?e.value:`|`;if(e.value)return e.value;if(e.nodes&&e.ranges>0){let i=r.reduce(e.nodes),a=n(...i,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(a.length!==0)return i.length>1&&a.length>1?`(${a})`:a}if(e.nodes)for(let t of e.nodes)u+=i(t,e);return u};return i(e)}})),Vy=s(((e,t)=>{var n=zy(),r=Iy(),i=Fy(),a=(e=``,t=``,n=!1)=>{let r=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return n?i.flatten(t).map(e=>`{${e}}`):t;for(let i of e)if(Array.isArray(i))for(let e of i)r.push(a(e,t,n));else for(let e of t)n===!0&&typeof e==`string`&&(e=`{${e}}`),r.push(Array.isArray(e)?a(i,e,n):i+e);return i.flatten(r)};t.exports=(e,t={})=>{let o=t.rangeLimit===void 0?1e3:t.rangeLimit,s=(e,c={})=>{e.queue=[];let l=c,u=c.queue;for(;l.type!==`brace`&&l.type!==`root`&&l.parent;)l=l.parent,u=l.queue;if(e.invalid||e.dollar){u.push(a(u.pop(),r(e,t)));return}if(e.type===`brace`&&e.invalid!==!0&&e.nodes.length===2){u.push(a(u.pop(),[`{}`]));return}if(e.nodes&&e.ranges>0){let s=i.reduce(e.nodes);if(i.exceedsLimit(...s,t.step,o))throw RangeError(`expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.`);let c=n(...s,t);c.length===0&&(c=r(e,t)),u.push(a(u.pop(),c)),e.nodes=[];return}let d=i.encloseBrace(e),f=e.queue,p=e;for(;p.type!==`brace`&&p.type!==`root`&&p.parent;)p=p.parent,f=p.queue;for(let t=0;t<e.nodes.length;t++){let n=e.nodes[t];if(n.type===`comma`&&e.type===`brace`){t===1&&f.push(``),f.push(``);continue}if(n.type===`close`){u.push(a(u.pop(),f,d));continue}if(n.value&&n.type!==`open`){f.push(a(f.pop(),n.value));continue}n.nodes&&s(n,e)}return f};return i.flatten(s(e))}})),Hy=s(((e,t)=>{t.exports={MAX_LENGTH:1e4,CHAR_0:`0`,CHAR_9:`9`,CHAR_UPPERCASE_A:`A`,CHAR_LOWERCASE_A:`a`,CHAR_UPPERCASE_Z:`Z`,CHAR_LOWERCASE_Z:`z`,CHAR_LEFT_PARENTHESES:`(`,CHAR_RIGHT_PARENTHESES:`)`,CHAR_ASTERISK:`*`,CHAR_AMPERSAND:`&`,CHAR_AT:`@`,CHAR_BACKSLASH:`\\`,CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:`\r`,CHAR_CIRCUMFLEX_ACCENT:`^`,CHAR_COLON:`:`,CHAR_COMMA:`,`,CHAR_DOLLAR:`$`,CHAR_DOT:`.`,CHAR_DOUBLE_QUOTE:`"`,CHAR_EQUAL:`=`,CHAR_EXCLAMATION_MARK:`!`,CHAR_FORM_FEED:`\f`,CHAR_FORWARD_SLASH:`/`,CHAR_HASH:`#`,CHAR_HYPHEN_MINUS:`-`,CHAR_LEFT_ANGLE_BRACKET:`<`,CHAR_LEFT_CURLY_BRACE:`{`,CHAR_LEFT_SQUARE_BRACKET:`[`,CHAR_LINE_FEED:`
637
+ `,CHAR_NO_BREAK_SPACE:`\xA0`,CHAR_PERCENT:`%`,CHAR_PLUS:`+`,CHAR_QUESTION_MARK:`?`,CHAR_RIGHT_ANGLE_BRACKET:`>`,CHAR_RIGHT_CURLY_BRACE:`}`,CHAR_RIGHT_SQUARE_BRACKET:`]`,CHAR_SEMICOLON:`;`,CHAR_SINGLE_QUOTE:`'`,CHAR_SPACE:` `,CHAR_TAB:` `,CHAR_UNDERSCORE:`_`,CHAR_VERTICAL_LINE:`|`,CHAR_ZERO_WIDTH_NOBREAK_SPACE:``}})),Uy=s(((e,t)=>{var n=Iy(),{MAX_LENGTH:r,CHAR_BACKSLASH:i,CHAR_BACKTICK:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_LEFT_PARENTHESES:c,CHAR_RIGHT_PARENTHESES:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_RIGHT_CURLY_BRACE:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_RIGHT_SQUARE_BRACKET:p,CHAR_DOUBLE_QUOTE:m,CHAR_SINGLE_QUOTE:h,CHAR_NO_BREAK_SPACE:g,CHAR_ZERO_WIDTH_NOBREAK_SPACE:_}=Hy();t.exports=(e,t={})=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);let v=t||{},y=typeof v.maxLength==`number`?Math.min(r,v.maxLength):r;if(e.length>y)throw SyntaxError(`Input length (${e.length}), exceeds max characters (${y})`);let b={type:`root`,input:e,nodes:[]},x=[b],S=b,C=b,w=0,T=e.length,E=0,D=0,O,k=()=>e[E++],A=e=>{if(e.type===`text`&&C.type===`dot`&&(C.type=`text`),C&&C.type===`text`&&e.type===`text`){C.value+=e.value;return}return S.nodes.push(e),e.parent=S,e.prev=C,C=e,e};for(A({type:`bos`});E<T;)if(S=x[x.length-1],O=k(),!(O===_||O===g)){if(O===i){A({type:`text`,value:(t.keepEscaping?O:``)+k()});continue}if(O===p){A({type:`text`,value:`\\`+O});continue}if(O===f){w++;let e;for(;E<T&&(e=k());){if(O+=e,e===f){w++;continue}if(e===i){O+=k();continue}if(e===p&&(w--,w===0))break}A({type:`text`,value:O});continue}if(O===c){S=A({type:`paren`,nodes:[]}),x.push(S),A({type:`text`,value:O});continue}if(O===l){if(S.type!==`paren`){A({type:`text`,value:O});continue}S=x.pop(),A({type:`text`,value:O}),S=x[x.length-1];continue}if(O===m||O===h||O===a){let e=O,n;for(t.keepQuotes!==!0&&(O=``);E<T&&(n=k());){if(n===i){O+=n+k();continue}if(n===e){t.keepQuotes===!0&&(O+=n);break}O+=n}A({type:`text`,value:O});continue}if(O===u){D++,S=A({type:`brace`,open:!0,close:!1,dollar:C.value&&C.value.slice(-1)===`$`||S.dollar===!0,depth:D,commas:0,ranges:0,nodes:[]}),x.push(S),A({type:`open`,value:O});continue}if(O===d){if(S.type!==`brace`){A({type:`text`,value:O});continue}S=x.pop(),S.close=!0,A({type:`close`,value:O}),D--,S=x[x.length-1];continue}if(O===o&&D>0){if(S.ranges>0){S.ranges=0;let e=S.nodes.shift();S.nodes=[e,{type:`text`,value:n(S)}]}A({type:`comma`,value:O}),S.commas++;continue}if(O===s&&D>0&&S.commas===0){let e=S.nodes;if(D===0||e.length===0){A({type:`text`,value:O});continue}if(C.type===`dot`){if(S.range=[],C.value+=O,C.type=`range`,S.nodes.length!==3&&S.nodes.length!==5){S.invalid=!0,S.ranges=0,C.type=`text`;continue}S.ranges++,S.args=[];continue}if(C.type===`range`){e.pop();let t=e[e.length-1];t.value+=C.value+O,C=t,S.ranges--;continue}A({type:`dot`,value:O});continue}A({type:`text`,value:O})}do if(S=x.pop(),S.type!==`root`){S.nodes.forEach(e=>{e.nodes||(e.type===`open`&&(e.isOpen=!0),e.type===`close`&&(e.isClose=!0),e.nodes||(e.type=`text`),e.invalid=!0)});let e=x[x.length-1],t=e.nodes.indexOf(S);e.nodes.splice(t,1,...S.nodes)}while(x.length>0);return A({type:`eos`}),b}})),Wy=s(((e,t)=>{var n=Iy(),r=By(),i=Vy(),a=Uy(),o=(e,t={})=>{let n=[];if(Array.isArray(e))for(let r of e){let e=o.create(r,t);Array.isArray(e)?n.push(...e):n.push(e)}else n=[].concat(o.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(n=[...new Set(n)]),n};o.parse=(e,t={})=>a(e,t),o.stringify=(e,t={})=>n(typeof e==`string`?o.parse(e,t):e,t),o.compile=(e,t={})=>(typeof e==`string`&&(e=o.parse(e,t)),r(e,t)),o.expand=(e,t={})=>{typeof e==`string`&&(e=o.parse(e,t));let n=i(e,t);return t.noempty===!0&&(n=n.filter(Boolean)),t.nodupes===!0&&(n=[...new Set(n)]),n},o.create=(e,t={})=>e===``||e.length<3?[e]:t.expand===!0?o.expand(e,t):o.compile(e,t),t.exports=o})),Gy=s(((e,t)=>{var n=require("path"),r=`\\\\/`,i=`[^${r}]`,a=0,o=`\\.`,s=`\\+`,c=`\\?`,l=`\\/`,u=`(?=.)`,d=`[^/]`,f=`(?:${l}|$)`,p=`(?:^|${l})`,m=`${o}{1,2}${f}`,h={DOT_LITERAL:o,PLUS_LITERAL:s,QMARK_LITERAL:c,SLASH_LITERAL:l,ONE_CHAR:u,QMARK:d,END_ANCHOR:f,DOTS_SLASH:m,NO_DOT:`(?!${o})`,NO_DOTS:`(?!${p}${m})`,NO_DOT_SLASH:`(?!${o}{0,1}${f})`,NO_DOTS_SLASH:`(?!${m})`,QMARK_NO_DOT:`[^.${l}]`,STAR:`${d}*?`,START_ANCHOR:p},g={...h,SLASH_LITERAL:`[${r}]`,QMARK:i,STAR:`${i}*?`,DOTS_SLASH:`${o}{1,2}(?:[${r}]|$)`,NO_DOT:`(?!${o})`,NO_DOTS:`(?!(?:^|[${r}])${o}{1,2}(?:[${r}]|$))`,NO_DOT_SLASH:`(?!${o}{0,1}(?:[${r}]|$))`,NO_DOTS_SLASH:`(?!${o}{1,2}(?:[${r}]|$))`,QMARK_NO_DOT:`[^.${r}]`,START_ANCHOR:`(?:^|[${r}])`,END_ANCHOR:`(?:[${r}]|$)`};t.exports={DEFAULT_MAX_EXTGLOB_RECURSION:a,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:{__proto__:null,alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:n.sep,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?g:h}}})),Ky=s((e=>{var t=require("path"),n=process.platform===`win32`,{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_GLOBAL:o}=Gy();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>a.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(o,`\\$1`),e.toPosixSlashes=e=>e.replace(r,`/`),e.removeBackslashes=e=>e.replace(i,e=>e===`\\`?``:e),e.supportsLookbehinds=()=>{let e=process.version.slice(1).split(`.`).map(Number);return e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10},e.isWindows=e=>e&&typeof e.windows==`boolean`?e.windows:n===!0||t.sep===`\\`,e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r}})),qy=s(((e,t)=>{var n=Ky(),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:_}=Gy(),v=e=>e===l||e===a,y=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let b=t||{},x=e.length-1,S=b.parts===!0||b.scanToEnd===!0,C=[],w=[],T=[],E=e,D=-1,O=0,k=0,A=!1,j=!1,M=!1,ee=!1,N=!1,P=!1,F=!1,I=!1,L=!1,R=!1,te=0,z,B,V={value:``,depth:0,isGlob:!1},ne=()=>D>=x,H=()=>E.charCodeAt(D+1),U=()=>(z=B,E.charCodeAt(++D));for(;D<x;){B=U();let e;if(B===a){F=V.backslashes=!0,B=U(),B===u&&(P=!0);continue}if(P===!0||B===u){for(te++;ne()!==!0&&(B=U());){if(B===a){F=V.backslashes=!0,U();continue}if(B===u){te++;continue}if(P!==!0&&B===s&&(B=U())===s){if(A=V.isBrace=!0,M=V.isGlob=!0,R=!0,S===!0)continue;break}if(P!==!0&&B===o){if(A=V.isBrace=!0,M=V.isGlob=!0,R=!0,S===!0)continue;break}if(B===h&&(te--,te===0)){P=!1,A=V.isBrace=!0,R=!0;break}}if(S===!0)continue;break}if(B===l){if(C.push(D),w.push(V),V={value:``,depth:0,isGlob:!1},R===!0)continue;if(z===s&&D===O+1){O+=2;continue}k=D+1;continue}if(b.noext!==!0&&(B===p||B===i||B===r||B===m||B===c)&&H()===d){if(M=V.isGlob=!0,ee=V.isExtglob=!0,R=!0,B===c&&D===O&&(L=!0),S===!0){for(;ne()!==!0&&(B=U());){if(B===a){F=V.backslashes=!0,B=U();continue}if(B===g){M=V.isGlob=!0,R=!0;break}}continue}break}if(B===r){if(z===r&&(N=V.isGlobstar=!0),M=V.isGlob=!0,R=!0,S===!0)continue;break}if(B===m){if(M=V.isGlob=!0,R=!0,S===!0)continue;break}if(B===f){for(;ne()!==!0&&(e=U());){if(e===a){F=V.backslashes=!0,U();continue}if(e===_){j=V.isBracket=!0,M=V.isGlob=!0,R=!0;break}}if(S===!0)continue;break}if(b.nonegate!==!0&&B===c&&D===O){I=V.negated=!0,O++;continue}if(b.noparen!==!0&&B===d){if(M=V.isGlob=!0,S===!0){for(;ne()!==!0&&(B=U());){if(B===d){F=V.backslashes=!0,B=U();continue}if(B===g){R=!0;break}}continue}break}if(M===!0){if(R=!0,S===!0)continue;break}}b.noext===!0&&(ee=!1,M=!1);let W=E,re=``,ie=``;O>0&&(re=E.slice(0,O),E=E.slice(O),k-=O),W&&M===!0&&k>0?(W=E.slice(0,k),ie=E.slice(k)):M===!0?(W=``,ie=E):W=E,W&&W!==``&&W!==`/`&&W!==E&&v(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),b.unescape===!0&&(ie&&=n.removeBackslashes(ie),W&&F===!0&&(W=n.removeBackslashes(W)));let ae={prefix:re,input:e,start:O,base:W,glob:ie,isBrace:A,isBracket:j,isGlob:M,isExtglob:ee,isGlobstar:N,negated:I,negatedExtglob:L};if(b.tokens===!0&&(ae.maxDepth=0,v(B)||w.push(V),ae.tokens=w),b.parts===!0||b.tokens===!0){let t;for(let n=0;n<C.length;n++){let r=t?t+1:O,i=C[n],a=e.slice(r,i);b.tokens&&(n===0&&O!==0?(w[n].isPrefix=!0,w[n].value=re):w[n].value=a,y(w[n]),ae.maxDepth+=w[n].depth),(n!==0||a!==``)&&T.push(a),t=i}if(t&&t+1<e.length){let n=e.slice(t+1);T.push(n),b.tokens&&(w[w.length-1].value=n,y(w[w.length-1]),ae.maxDepth+=w[w.length-1].depth)}ae.slashes=C,ae.parts=T}return ae}})),Jy=s(((e,t)=>{var n=Gy(),r=Ky(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:c}=n,l=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>r.escapeRegex(e)).join(`..`)}return n},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=e=>{let t=[],n=0,r=0,i=0,a=``,o=!1;for(let s of e){if(o===!0){a+=s,o=!1;continue}if(s===`\\`){a+=s,o=!0;continue}if(s===`"`){i=i===1?0:1,a+=s;continue}if(i===0){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(n===0){if(s===`(`)r++;else if(s===`)`&&r>0)r--;else if(s===`|`&&r===0){t.push(a),a=``;continue}}}a+=s}return t.push(a),t},f=e=>{let t=!1;for(let n of e){if(t===!0){t=!1;continue}if(n===`\\`){t=!0;continue}if(/[?*+@!()[\]{}]/.test(n))return!1}return!0},p=e=>{let t=e.trim(),n=!0;for(;n===!0;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),n=!0);if(f(t))return t.replace(/\\(.)/g,`$1`)},m=e=>{let t=e.map(p).filter(Boolean);for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){let r=t[e],i=t[n],a=r[0];if(!(!a||r!==a.repeat(r.length)||i!==a.repeat(i.length))&&(r===i||r.startsWith(i)||i.startsWith(r)))return!0}return!1},h=(e,t=!0)=>{if(e[0]!==`+`&&e[0]!==`*`||e[1]!==`(`)return;let n=0,r=0,i=0,a=!1;for(let o=1;o<e.length;o++){let s=e[o];if(a===!0){a=!1;continue}if(s===`\\`){a=!0;continue}if(s===`"`){i=i===1?0:1;continue}if(i!==1){if(s===`[`){n++;continue}if(s===`]`&&n>0){n--;continue}if(!(n>0)){if(s===`(`){r++;continue}if(s===`)`&&(r--,r===0))return t===!0&&o!==e.length-1?void 0:{type:e[0],body:e.slice(2,o),end:o}}}}},g=e=>{let t=0,n=[];for(;t<e.length;){let r=h(e.slice(t),!1);if(!r||r.type!==`*`)return;let i=d(r.body).map(e=>e.trim());if(i.length!==1)return;let a=p(i[0]);if(!a||a.length!==1)return;n.push(a),t+=r.end+1}if(!(n.length<1))return`${n.length===1?r.escapeRegex(n[0]):`[${n.map(e=>r.escapeRegex(e)).join(``)}]`}*`},_=e=>{let t=0,n=e.trim(),r=h(n);for(;r;)t++,n=r.body.trim(),r=h(n);return t},v=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion==`number`?t.maxExtglobRecursion:n.DEFAULT_MAX_EXTGLOB_RECURSION,i=d(e).map(e=>e.trim());if(i.length>1&&(i.some(e=>e===``)||i.some(e=>/^[*?]+$/.test(e))||m(i)))return{risky:!0};for(let e of i){let t=g(e);if(t)return{risky:!0,safeOutput:t};if(_(e)>r)return{risky:!0}}return{risky:!1}},y=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=c[e]||e;let d={...t},f=typeof d.maxLength==`number`?Math.min(i,d.maxLength):i,p=e.length;if(p>f)throw SyntaxError(`Input length: ${p}, exceeds maximum allowed length: ${f}`);let m={type:`bos`,value:``,output:d.prepend||``},h=[m],g=d.capture?``:`?:`,_=r.isWindows(t),b=n.globChars(_),x=n.extglobChars(b),{DOT_LITERAL:S,PLUS_LITERAL:C,SLASH_LITERAL:w,ONE_CHAR:T,DOTS_SLASH:E,NO_DOT:D,NO_DOT_SLASH:O,NO_DOTS_SLASH:k,QMARK:A,QMARK_NO_DOT:j,STAR:M,START_ANCHOR:ee}=b,N=e=>`(${g}(?:(?!${ee}${e.dot?E:S}).)*?)`,P=d.dot?``:D,F=d.dot?A:j,I=d.bash===!0?N(d):M;d.capture&&(I=`(${I})`),typeof d.noext==`boolean`&&(d.noextglob=d.noext);let L={input:e,index:-1,start:0,dot:d.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:h};e=r.removePrefix(e,L),p=e.length;let R=[],te=[],z=[],B=m,V,ne=()=>L.index===p-1,H=L.peek=(t=1)=>e[L.index+t],U=L.advance=()=>e[++L.index]||``,W=()=>e.slice(L.index+1),re=(e=``,t=0)=>{L.consumed+=e,L.index+=t},ie=e=>{L.output+=e.output==null?e.value:e.output,re(e.value)},ae=()=>{let e=1;for(;H()===`!`&&(H(2)!==`(`||H(3)===`?`);)U(),L.start++,e++;return e%2==0?!1:(L.negated=!0,L.start++,!0)},oe=e=>{L[e]++,z.push(e)},G=e=>{L[e]--,z.pop()},K=e=>{if(B.type===`globstar`){let t=L.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||R.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(L.output=L.output.slice(0,-B.output.length),B.type=`star`,B.value=`*`,B.output=I,L.output+=B.output)}if(R.length&&e.type!==`paren`&&(R[R.length-1].inner+=e.value),(e.value||e.output)&&ie(e),B&&B.type===`text`&&e.type===`text`){B.value+=e.value,B.output=(B.output||``)+e.value;return}e.prev=B,h.push(e),B=e},se=(e,t)=>{let n={...x[t],conditions:1,inner:``};n.prev=B,n.parens=L.parens,n.output=L.output,n.startIndex=L.index,n.tokensIndex=h.length;let r=(d.capture?`(`:``)+n.open;oe(`parens`),K({type:e,value:t,output:L.output?``:T}),K({type:`paren`,extglob:!0,value:U(),output:r}),R.push(n)},ce=n=>{let i=e.slice(n.startIndex,L.index+1),a=v(e.slice(n.startIndex+2,L.index),d);if((n.type===`plus`||n.type===`star`)&&a.risky){let e=a.safeOutput?(n.output?``:T)+(d.capture?`(${a.safeOutput})`:a.safeOutput):void 0,t=h[n.tokensIndex];t.type=`text`,t.value=i,t.output=e||r.escapeRegex(i);for(let e=n.tokensIndex+1;e<h.length;e++)h[e].value=``,h[e].output=``,delete h[e].suffix;L.output=n.output+t.output,L.backtrack=!0,K({type:`paren`,extglob:!0,value:V,output:``}),G(`parens`);return}let o=n.close+(d.capture?`)`:``),s;if(n.type===`negate`){let e=I;n.inner&&n.inner.length>1&&n.inner.includes(`/`)&&(e=N(d)),(e!==I||ne()||/^\)+$/.test(W()))&&(o=n.close=`)$))${e}`),n.inner.includes(`*`)&&(s=W())&&/^\.[^\\/.]+$/.test(s)&&(o=n.close=`)${y(s,{...t,fastpaths:!1}).output})${e})`),n.prev.type===`bos`&&(L.negatedExtglob=!0)}K({type:`paren`,extglob:!0,value:V,output:o}),G(`parens`)};if(d.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?A.repeat(a.length):``):o===0?F+(a?A.repeat(a.length):``):A.repeat(r.length):i===`.`?S.repeat(r.length):i===`*`?t?t+i+(a?I:``):I:t?e:`\\${e}`);return n===!0&&(i=d.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&d.contains===!0?(L.output=e,L):(L.output=r.wrapOutput(i,L,t),L)}for(;!ne();){if(V=U(),V===`\0`)continue;if(V===`\\`){let e=H();if(e===`/`&&d.bash!==!0||e===`.`||e===`;`)continue;if(!e){V+=`\\`,K({type:`text`,value:V});continue}let t=/^\\+/.exec(W()),n=0;if(t&&t[0].length>2&&(n=t[0].length,L.index+=n,n%2!=0&&(V+=`\\`)),d.unescape===!0?V=U():V+=U(),L.brackets===0){K({type:`text`,value:V});continue}}if(L.brackets>0&&(V!==`]`||B.value===`[`||B.value===`[^`)){if(d.posix!==!1&&V===`:`){let e=B.value.slice(1);if(e.includes(`[`)&&(B.posix=!0,e.includes(`:`))){let e=B.value.lastIndexOf(`[`),t=B.value.slice(0,e),n=a[B.value.slice(e+2)];if(n){B.value=t+n,L.backtrack=!0,U(),!m.output&&h.indexOf(B)===1&&(m.output=T);continue}}}(V===`[`&&H()!==`:`||V===`-`&&H()===`]`)&&(V=`\\${V}`),V===`]`&&(B.value===`[`||B.value===`[^`)&&(V=`\\${V}`),d.posix===!0&&V===`!`&&B.value===`[`&&(V=`^`),B.value+=V,ie({value:V});continue}if(L.quotes===1&&V!==`"`){V=r.escapeRegex(V),B.value+=V,ie({value:V});continue}if(V===`"`){L.quotes=L.quotes===1?0:1,d.keepQuotes===!0&&K({type:`text`,value:V});continue}if(V===`(`){oe(`parens`),K({type:`paren`,value:V});continue}if(V===`)`){if(L.parens===0&&d.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=R[R.length-1];if(e&&L.parens===e.parens+1){ce(R.pop());continue}K({type:`paren`,value:V,output:L.parens?`)`:`\\)`}),G(`parens`);continue}if(V===`[`){if(d.nobracket===!0||!W().includes(`]`)){if(d.nobracket!==!0&&d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));V=`\\${V}`}else oe(`brackets`);K({type:`bracket`,value:V});continue}if(V===`]`){if(d.nobracket===!0||B&&B.type===`bracket`&&B.value.length===1){K({type:`text`,value:V,output:`\\${V}`});continue}if(L.brackets===0){if(d.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));K({type:`text`,value:V,output:`\\${V}`});continue}G(`brackets`);let e=B.value.slice(1);if(B.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(V=`/${V}`),B.value+=V,ie({value:V}),d.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(B.value);if(L.output=L.output.slice(0,-B.value.length),d.literalBrackets===!0){L.output+=t,B.value=t;continue}B.value=`(${g}${t}|${B.value})`,L.output+=B.value;continue}if(V===`{`&&d.nobrace!==!0){oe(`braces`);let e={type:`brace`,value:V,output:`(`,outputIndex:L.output.length,tokensIndex:L.tokens.length};te.push(e),K(e);continue}if(V===`}`){let e=te[te.length-1];if(d.nobrace===!0||!e){K({type:`text`,value:V,output:V});continue}let t=`)`;if(e.dots===!0){let e=h.slice(),n=[];for(let t=e.length-1;t>=0&&(h.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&n.unshift(e[t].value);t=l(n,d),L.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=L.output.slice(0,e.outputIndex),r=L.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,V=t=`\\}`,L.output=n;for(let e of r)L.output+=e.output||e.value}K({type:`brace`,value:V,output:t}),G(`braces`),te.pop();continue}if(V===`|`){R.length>0&&R[R.length-1].conditions++,K({type:`text`,value:V});continue}if(V===`,`){let e=V,t=te[te.length-1];t&&z[z.length-1]===`braces`&&(t.comma=!0,e=`|`),K({type:`comma`,value:V,output:e});continue}if(V===`/`){if(B.type===`dot`&&L.index===L.start+1){L.start=L.index+1,L.consumed=``,L.output=``,h.pop(),B=m;continue}K({type:`slash`,value:V,output:w});continue}if(V===`.`){if(L.braces>0&&B.type===`dot`){B.value===`.`&&(B.output=S);let e=te[te.length-1];B.type=`dots`,B.output+=V,B.value+=V,e.dots=!0;continue}if(L.braces+L.parens===0&&B.type!==`bos`&&B.type!==`slash`){K({type:`text`,value:V,output:S});continue}K({type:`dot`,value:V,output:S});continue}if(V===`?`){if(!(B&&B.value===`(`)&&d.noextglob!==!0&&H()===`(`&&H(2)!==`?`){se(`qmark`,V);continue}if(B&&B.type===`paren`){let e=H(),t=V;if(e===`<`&&!r.supportsLookbehinds())throw Error(`Node.js v10 or higher is required for regex lookbehinds`);(B.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(W()))&&(t=`\\${V}`),K({type:`text`,value:V,output:t});continue}if(d.dot!==!0&&(B.type===`slash`||B.type===`bos`)){K({type:`qmark`,value:V,output:j});continue}K({type:`qmark`,value:V,output:A});continue}if(V===`!`){if(d.noextglob!==!0&&H()===`(`&&(H(2)!==`?`||!/[!=<:]/.test(H(3)))){se(`negate`,V);continue}if(d.nonegate!==!0&&L.index===0){ae();continue}}if(V===`+`){if(d.noextglob!==!0&&H()===`(`&&H(2)!==`?`){se(`plus`,V);continue}if(B&&B.value===`(`||d.regex===!1){K({type:`plus`,value:V,output:C});continue}if(B&&(B.type===`bracket`||B.type===`paren`||B.type===`brace`)||L.parens>0){K({type:`plus`,value:V});continue}K({type:`plus`,value:C});continue}if(V===`@`){if(d.noextglob!==!0&&H()===`(`&&H(2)!==`?`){K({type:`at`,extglob:!0,value:V,output:``});continue}K({type:`text`,value:V});continue}if(V!==`*`){(V===`$`||V===`^`)&&(V=`\\${V}`);let e=o.exec(W());e&&(V+=e[0],L.index+=e[0].length),K({type:`text`,value:V});continue}if(B&&(B.type===`globstar`||B.star===!0)){B.type=`star`,B.star=!0,B.value+=V,B.output=I,L.backtrack=!0,L.globstar=!0,re(V);continue}let t=W();if(d.noextglob!==!0&&/^\([^?]/.test(t)){se(`star`,V);continue}if(B.type===`star`){if(d.noglobstar===!0){re(V);continue}let n=B.prev,r=n.prev,i=n.type===`slash`||n.type===`bos`,a=r&&(r.type===`star`||r.type===`globstar`);if(d.bash===!0&&(!i||t[0]&&t[0]!==`/`)){K({type:`star`,value:V,output:``});continue}let o=L.braces>0&&(n.type===`comma`||n.type===`brace`),s=R.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){K({type:`star`,value:V,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[L.index+4];if(n&&n!==`/`)break;t=t.slice(3),re(`/**`,3)}if(n.type===`bos`&&ne()){B.type=`globstar`,B.value+=V,B.output=N(d),L.output=B.output,L.globstar=!0,re(V);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&ne()){L.output=L.output.slice(0,-(n.output+B.output).length),n.output=`(?:${n.output}`,B.type=`globstar`,B.output=N(d)+(d.strictSlashes?`)`:`|$)`),B.value+=V,L.globstar=!0,L.output+=n.output+B.output,re(V);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;L.output=L.output.slice(0,-(n.output+B.output).length),n.output=`(?:${n.output}`,B.type=`globstar`,B.output=`${N(d)}${w}|${w}${e})`,B.value+=V,L.output+=n.output+B.output,L.globstar=!0,re(V+U()),K({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){B.type=`globstar`,B.value+=V,B.output=`(?:^|${w}|${N(d)}${w})`,L.output=B.output,L.globstar=!0,re(V+U()),K({type:`slash`,value:`/`,output:``});continue}L.output=L.output.slice(0,-B.output.length),B.type=`globstar`,B.output=N(d),B.value+=V,L.output+=B.output,L.globstar=!0,re(V);continue}let n={type:`star`,value:V,output:I};if(d.bash===!0){n.output=`.*?`,(B.type===`bos`||B.type===`slash`)&&(n.output=P+n.output),K(n);continue}if(B&&(B.type===`bracket`||B.type===`paren`)&&d.regex===!0){n.output=V,K(n);continue}(L.index===L.start||B.type===`slash`||B.type===`dot`)&&(B.type===`dot`?(L.output+=O,B.output+=O):d.dot===!0?(L.output+=k,B.output+=k):(L.output+=P,B.output+=P),H()!==`*`&&(L.output+=T,B.output+=T)),K(n)}for(;L.brackets>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));L.output=r.escapeLast(L.output,`[`),G(`brackets`)}for(;L.parens>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));L.output=r.escapeLast(L.output,`(`),G(`parens`)}for(;L.braces>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));L.output=r.escapeLast(L.output,`{`),G(`braces`)}if(d.strictSlashes!==!0&&(B.type===`star`||B.type===`bracket`)&&K({type:`maybe_slash`,value:``,output:`${w}?`}),L.backtrack===!0){L.output=``;for(let e of L.tokens)L.output+=e.output==null?e.value:e.output,e.suffix&&(L.output+=e.suffix)}return L};y.fastpaths=(e,t)=>{let a={...t},o=typeof a.maxLength==`number`?Math.min(i,a.maxLength):i,s=e.length;if(s>o)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${o}`);e=c[e]||e;let l=r.isWindows(t),{DOT_LITERAL:u,SLASH_LITERAL:d,ONE_CHAR:f,DOTS_SLASH:p,NO_DOT:m,NO_DOTS:h,NO_DOTS_SLASH:g,STAR:_,START_ANCHOR:v}=n.globChars(l),y=a.dot?h:m,b=a.dot?g:m,x=a.capture?``:`?:`,S={negated:!1,prefix:``},C=a.bash===!0?`.*?`:_;a.capture&&(C=`(${C})`);let w=e=>e.noglobstar===!0?C:`(${x}(?:(?!${v}${e.dot?p:u}).)*?)`,T=e=>{switch(e){case`*`:return`${y}${f}${C}`;case`.*`:return`${u}${f}${C}`;case`*.*`:return`${y}${C}${u}${f}${C}`;case`*/*`:return`${y}${C}${d}${f}${b}${C}`;case`**`:return y+w(a);case`**/*`:return`(?:${y}${w(a)}${d})?${b}${f}${C}`;case`**/*.*`:return`(?:${y}${w(a)}${d})?${b}${C}${u}${f}${C}`;case`**/.*`:return`(?:${y}${w(a)}${d})?${u}${f}${C}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=T(t[1]);return n?n+u+t[2]:void 0}}},E=T(r.removePrefix(e,S));return E&&a.strictSlashes!==!0&&(E+=`${d}?`),E},t.exports=y})),Yy=s(((e,t)=>{var n=require("path"),r=qy(),i=Jy(),a=Ky(),o=Gy(),s=e=>e&&typeof e==`object`&&!Array.isArray(e),c=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>c(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=s(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},o=a.isWindows(t),l=r?c.compileRe(e,t):c.makeRe(e,t,!1,!0),u=l.state;delete l.state;let d=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};d=c(i.ignore,e,n)}let f=(n,r=!1)=>{let{isMatch:a,match:s,output:f}=c.test(n,l,t,{glob:e,posix:o}),p={glob:e,state:u,regex:l,posix:o,input:n,output:f,match:s,isMatch:a};return typeof i.onResult==`function`&&i.onResult(p),a===!1?(p.isMatch=!1,r?p:!1):d(n)?(typeof i.onIgnore==`function`&&i.onIgnore(p),p.isMatch=!1,r?p:!1):(typeof i.onMatch==`function`&&i.onMatch(p),r?p:!0)};return n&&(f.state=u),f};c.test=(e,t,n,{glob:r,posix:i}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let o=n||{},s=o.format||(i?a.toPosixSlashes:null),l=e===r,u=l&&s?s(e):e;return l===!1&&(u=s?s(e):e,l=u===r),(l===!1||o.capture===!0)&&(l=o.matchBase===!0||o.basename===!0?c.matchBase(e,t,n,i):t.exec(u)),{isMatch:!!l,match:l,output:u}},c.matchBase=(e,t,r,i=a.isWindows(r))=>(t instanceof RegExp?t:c.makeRe(t,r)).test(n.basename(e)),c.isMatch=(e,t,n)=>c(t,n)(e),c.parse=(e,t)=>Array.isArray(e)?e.map(e=>c.parse(e,t)):i(e,{...t,fastpaths:!1}),c.scan=(e,t)=>r(e,t),c.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,s=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(s=`^(?!${s}).*$`);let l=c.toRegex(s,t);return r===!0&&(l.state=e),l},c.makeRe=(e,t={},n=!1,r=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let a={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(a.output=i.fastpaths(e,t)),a.output||(a=i(e,t)),c.compileRe(a,t,n,r)},c.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},c.constants=o,t.exports=c})),Xy=s(((e,t)=>{t.exports=Yy()})),Zy=s(((e,t)=>{var n=require("util"),r=Wy(),i=Xy(),a=Ky(),o=e=>e===``||e===`./`,s=e=>{let t=e.indexOf(`{`);return t>-1&&e.indexOf(`}`,t)>-1},c=(e,t,n)=>{t=[].concat(t),e=[].concat(e);let r=new Set,a=new Set,o=new Set,s=0,c=e=>{o.add(e.output),n&&n.onResult&&n.onResult(e)};for(let o=0;o<t.length;o++){let l=i(String(t[o]),{...n,onResult:c},!0),u=l.state.negated||l.state.negatedExtglob;u&&s++;for(let t of e){let e=l(t,!0);(u?!e.isMatch:e.isMatch)&&(u?r.add(e.output):(r.delete(e.output),a.add(e.output)))}}let l=(s===t.length?[...o]:[...a]).filter(e=>!r.has(e));if(n&&l.length===0){if(n.failglob===!0)throw Error(`No matches found for "${t.join(`, `)}"`);if(n.nonull===!0||n.nullglob===!0)return n.unescape?t.map(e=>e.replace(/\\/g,``)):t}return l};c.match=c,c.matcher=(e,t)=>i(e,t),c.isMatch=(e,t,n)=>i(t,n)(e),c.any=c.isMatch,c.not=(e,t,n={})=>{t=[].concat(t).map(String);let r=new Set,i=[],a=e=>{n.onResult&&n.onResult(e),i.push(e.output)},o=new Set(c(e,t,{...n,onResult:a}));for(let e of i)o.has(e)||r.add(e);return[...r]},c.contains=(e,t,r)=>{if(typeof e!=`string`)throw TypeError(`Expected a string: "${n.inspect(e)}"`);if(Array.isArray(t))return t.some(t=>c.contains(e,t,r));if(typeof t==`string`){if(o(e)||o(t))return!1;if(e.includes(t)||e.startsWith(`./`)&&e.slice(2).includes(t))return!0}return c.isMatch(e,t,{...r,contains:!0})},c.matchKeys=(e,t,n)=>{if(!a.isObject(e))throw TypeError(`Expected the first argument to be an object`);let r=c(Object.keys(e),t,n),i={};for(let t of r)i[t]=e[t];return i},c.some=(e,t,n)=>{let r=[].concat(e);for(let e of[].concat(t)){let t=i(String(e),n);if(r.some(e=>t(e)))return!0}return!1},c.every=(e,t,n)=>{let r=[].concat(e);for(let e of[].concat(t)){let t=i(String(e),n);if(!r.every(e=>t(e)))return!1}return!0},c.all=(e,t,r)=>{if(typeof e!=`string`)throw TypeError(`Expected a string: "${n.inspect(e)}"`);return[].concat(t).every(t=>i(t,r)(e))},c.capture=(e,t,n)=>{let r=a.isWindows(n),o=i.makeRe(String(e),{...n,capture:!0}).exec(r?a.toPosixSlashes(t):t);if(o)return o.slice(1).map(e=>e===void 0?``:e)},c.makeRe=(...e)=>i.makeRe(...e),c.scan=(...e)=>i.scan(...e),c.parse=(e,t)=>{let n=[];for(let a of[].concat(e||[]))for(let e of r(String(a),t))n.push(i.parse(e,t));return n},c.braces=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);return t&&t.nobrace===!0||!s(e)?[e]:r(e,t)},c.braceExpand=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);return c.braces(e,{...t,expand:!0})},c.hasBraces=s,t.exports=c})),Qy=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isAbsolute=e.partitionAbsoluteAndRelative=e.removeDuplicateSlashes=e.matchAny=e.convertPatternsToRe=e.makeRe=e.getPatternParts=e.expandBraceExpansion=e.expandPatternsWithBraceExpansion=e.isAffectDepthOfReadingPattern=e.endsWithSlashGlobStar=e.hasGlobStar=e.getBaseDirectory=e.isPatternRelatedToParentDirectory=e.getPatternsOutsideCurrentDirectory=e.getPatternsInsideCurrentDirectory=e.getPositivePatterns=e.getNegativePatterns=e.isPositivePattern=e.isNegativePattern=e.convertToNegativePattern=e.convertToPositivePattern=e.isDynamicPattern=e.isStaticPattern=void 0;var t=require("path"),n=Py(),r=Zy(),i=`**`,a=`\\`,o=/[*?]|^!/,s=/\[[^[]*]/,c=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,l=/[!*+?@]\([^(]*\)/,u=/,|\.\./,d=/(?!^)\/{2,}/g;function f(e,t={}){return!p(e,t)}e.isStaticPattern=f;function p(e,t={}){return e===``?!1:!!(t.caseSensitiveMatch===!1||e.includes(a)||o.test(e)||s.test(e)||c.test(e)||t.extglob!==!1&&l.test(e)||t.braceExpansion!==!1&&m(e))}e.isDynamicPattern=p;function m(e){let t=e.indexOf(`{`);if(t===-1)return!1;let n=e.indexOf(`}`,t+1);if(n===-1)return!1;let r=e.slice(t,n);return u.test(r)}function h(e){return _(e)?e.slice(1):e}e.convertToPositivePattern=h;function g(e){return`!`+e}e.convertToNegativePattern=g;function _(e){return e.startsWith(`!`)&&e[1]!==`(`}e.isNegativePattern=_;function v(e){return!_(e)}e.isPositivePattern=v;function y(e){return e.filter(_)}e.getNegativePatterns=y;function b(e){return e.filter(v)}e.getPositivePatterns=b;function x(e){return e.filter(e=>!C(e))}e.getPatternsInsideCurrentDirectory=x;function S(e){return e.filter(C)}e.getPatternsOutsideCurrentDirectory=S;function C(e){return e.startsWith(`..`)||e.startsWith(`./..`)}e.isPatternRelatedToParentDirectory=C;function w(e){return n(e,{flipBackslashes:!1})}e.getBaseDirectory=w;function T(e){return e.includes(i)}e.hasGlobStar=T;function E(e){return e.endsWith(`/**`)}e.endsWithSlashGlobStar=E;function D(e){let n=t.basename(e);return E(e)||f(n)}e.isAffectDepthOfReadingPattern=D;function O(e){return e.reduce((e,t)=>e.concat(k(t)),[])}e.expandPatternsWithBraceExpansion=O;function k(e){let t=r.braces(e,{expand:!0,nodupes:!0,keepEscaping:!0});return t.sort((e,t)=>e.length-t.length),t.filter(e=>e!==``)}e.expandBraceExpansion=k;function A(e,t){let{parts:n}=r.scan(e,Object.assign(Object.assign({},t),{parts:!0}));return n.length===0&&(n=[e]),n[0].startsWith(`/`)&&(n[0]=n[0].slice(1),n.unshift(``)),n}e.getPatternParts=A;function j(e,t){return r.makeRe(e,t)}e.makeRe=j;function M(e,t){return e.map(e=>j(e,t))}e.convertPatternsToRe=M;function ee(e,t){return t.some(t=>t.test(e))}e.matchAny=ee;function N(e){return e.replace(d,`/`)}e.removeDuplicateSlashes=N;function P(e){let t=[],n=[];for(let r of e)F(r)?t.push(r):n.push(r);return[t,n]}e.partitionAbsoluteAndRelative=P;function F(e){return t.isAbsolute(e)}e.isAbsolute=F})),$y=s(((e,t)=>{var n=require("stream").PassThrough,r=Array.prototype.slice;t.exports=i;function i(){let e=[],t=r.call(arguments),i=!1,o=t[t.length-1];o&&!Array.isArray(o)&&o.pipe==null?t.pop():o={};let s=o.end!==!1,c=o.pipeError===!0;o.objectMode??=!0,o.highWaterMark??=64*1024;let l=n(o);function u(){for(let t=0,n=arguments.length;t<n;t++)e.push(a(arguments[t],o));return d(),this}function d(){if(i)return;i=!0;let t=e.shift();if(!t){process.nextTick(f);return}Array.isArray(t)||(t=[t]);let n=t.length+1;function r(){--n>0||(i=!1,d())}function a(e){function t(){e.removeListener(`merge2UnpipeEnd`,t),e.removeListener(`end`,t),c&&e.removeListener(`error`,n),r()}function n(e){l.emit(`error`,e)}if(e._readableState.endEmitted)return r();e.on(`merge2UnpipeEnd`,t),e.on(`end`,t),c&&e.on(`error`,n),e.pipe(l,{end:!1}),e.resume()}for(let e=0;e<t.length;e++)a(t[e]);r()}function f(){i=!1,l.emit(`queueDrain`),s&&l.end()}return l.setMaxListeners(0),l.add=u,l.on(`unpipe`,function(e){e.emit(`merge2UnpipeEnd`)}),t.length&&u.apply(null,t),l}function a(e,t){if(Array.isArray(e))for(let n=0,r=e.length;n<r;n++)e[n]=a(e[n],t);else{if(!e._readableState&&e.pipe&&(e=e.pipe(n(t))),!e._readableState||!e.pause||!e.pipe)throw Error(`Only readable stream can be merged.`);e.pause()}return e}})),eb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.merge=void 0;var t=$y();function n(e){let n=t(e);return e.forEach(e=>{e.once(`error`,e=>n.emit(`error`,e))}),n.once(`close`,()=>r(e)),n.once(`end`,()=>r(e)),n}e.merge=n;function r(e){e.forEach(e=>e.emit(`close`))}})),tb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isEmpty=e.isString=void 0;function t(e){return typeof e==`string`}e.isString=t;function n(e){return e===``}e.isEmpty=n})),nb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.string=e.stream=e.pattern=e.path=e.fs=e.errno=e.array=void 0,e.array=Oy(),e.errno=ky(),e.fs=Ay(),e.path=jy(),e.pattern=Qy(),e.stream=eb(),e.string=tb()})),rb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.convertPatternGroupToTask=e.convertPatternGroupsToTasks=e.groupPatternsByBaseDirectory=e.getNegativePatternsAsPositive=e.getPositivePatterns=e.convertPatternsToTasks=e.generate=void 0;var t=nb();function n(e,n){let s=r(e,n),c=r(n.ignore,n),l=a(s),u=o(s,c),d=l.filter(e=>t.pattern.isStaticPattern(e,n)),f=l.filter(e=>t.pattern.isDynamicPattern(e,n)),p=i(d,u,!1),m=i(f,u,!0);return p.concat(m)}e.generate=n;function r(e,n){let r=e;return n.braceExpansion&&(r=t.pattern.expandPatternsWithBraceExpansion(r)),n.baseNameMatch&&(r=r.map(e=>e.includes(`/`)?e:`**/${e}`)),r.map(e=>t.pattern.removeDuplicateSlashes(e))}function i(e,n,r){let i=[],a=t.pattern.getPatternsOutsideCurrentDirectory(e),o=t.pattern.getPatternsInsideCurrentDirectory(e),u=s(a),d=s(o);return i.push(...c(u,n,r)),`.`in d?i.push(l(`.`,o,n,r)):i.push(...c(d,n,r)),i}e.convertPatternsToTasks=i;function a(e){return t.pattern.getPositivePatterns(e)}e.getPositivePatterns=a;function o(e,n){return t.pattern.getNegativePatterns(e).concat(n).map(t.pattern.convertToPositivePattern)}e.getNegativePatternsAsPositive=o;function s(e){return e.reduce((e,n)=>{let r=t.pattern.getBaseDirectory(n);return r in e?e[r].push(n):e[r]=[n],e},{})}e.groupPatternsByBaseDirectory=s;function c(e,t,n){return Object.keys(e).map(r=>l(r,e[r],t,n))}e.convertPatternGroupsToTasks=c;function l(e,n,r,i){return{dynamic:i,positive:n,negative:r,base:e,patterns:[].concat(n,r.map(t.pattern.convertToNegativePattern))}}e.convertPatternGroupToTask=l})),ib=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.read=void 0;function t(e,t,i){t.fs.lstat(e,(a,o)=>{if(a!==null){n(i,a);return}if(!o.isSymbolicLink()||!t.followSymbolicLink){r(i,o);return}t.fs.stat(e,(e,a)=>{if(e!==null){if(t.throwErrorOnBrokenSymbolicLink){n(i,e);return}r(i,o);return}t.markSymbolicLink&&(a.isSymbolicLink=()=>!0),r(i,a)})})}e.read=t;function n(e,t){e(t)}function r(e,t){e(null,t)}})),ab=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.read=void 0;function t(e,t){let n=t.fs.lstatSync(e);if(!n.isSymbolicLink()||!t.followSymbolicLink)return n;try{let n=t.fs.statSync(e);return t.markSymbolicLink&&(n.isSymbolicLink=()=>!0),n}catch(e){if(!t.throwErrorOnBrokenSymbolicLink)return n;throw e}}e.read=t})),ob=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;var t=require("fs");e.FILE_SYSTEM_ADAPTER={lstat:t.lstat,stat:t.stat,lstatSync:t.lstatSync,statSync:t.statSync};function n(t){return t===void 0?e.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},e.FILE_SYSTEM_ADAPTER),t)}e.createFileSystemAdapter=n})),sb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=ob();e.default=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=t.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,t){return e??t}}})),cb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.statSync=e.stat=e.Settings=void 0;var t=ib(),n=ab(),r=sb();e.Settings=r.default;function i(e,n,r){if(typeof n==`function`){t.read(e,o(),n);return}t.read(e,o(n),r)}e.stat=i;function a(e,t){let r=o(t);return n.read(e,r)}e.statSync=a;function o(e={}){return e instanceof r.default?e:new r.default(e)}})),lb=s(((e,t)=>{var n;t.exports=typeof queueMicrotask==`function`?queueMicrotask.bind(typeof window<`u`?window:global):e=>(n||=Promise.resolve()).then(e).catch(e=>setTimeout(()=>{throw e},0))})),ub=s(((e,t)=>{t.exports=r;var n=lb();function r(e,t){let r,i,a,o=!0;Array.isArray(e)?(r=[],i=e.length):(a=Object.keys(e),r={},i=a.length);function s(e){function i(){t&&t(e,r),t=null}o?n(i):i()}function c(e,t,n){r[e]=n,(--i===0||t)&&s(t)}i?a?a.forEach(function(t){e[t](function(e,n){c(t,e,n)})}):e.forEach(function(e,t){e(function(e,n){c(t,e,n)})}):s(null),o=!1}})),db=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var t=process.versions.node.split(`.`);if(t[0]===void 0||t[1]===void 0)throw Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var n=Number.parseInt(t[0],10),r=Number.parseInt(t[1],10),i=10;e.IS_SUPPORT_READDIR_WITH_FILE_TYPES=n>i||n===i&&r>=10})),fb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createDirentFromStats=void 0;var t=class{constructor(e,t){this.name=e,this.isBlockDevice=t.isBlockDevice.bind(t),this.isCharacterDevice=t.isCharacterDevice.bind(t),this.isDirectory=t.isDirectory.bind(t),this.isFIFO=t.isFIFO.bind(t),this.isFile=t.isFile.bind(t),this.isSocket=t.isSocket.bind(t),this.isSymbolicLink=t.isSymbolicLink.bind(t)}};function n(e,n){return new t(e,n)}e.createDirentFromStats=n})),pb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.fs=void 0,e.fs=fb()})),mb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.joinPathSegments=void 0;function t(e,t,n){return e.endsWith(n)?e+t:e+n+t}e.joinPathSegments=t})),hb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.readdir=e.readdirWithFileTypes=e.read=void 0;var t=cb(),n=ub(),r=db(),i=pb(),a=mb();function o(e,t,n){if(!t.stats&&r.IS_SUPPORT_READDIR_WITH_FILE_TYPES){s(e,t,n);return}l(e,t,n)}e.read=o;function s(e,t,r){t.fs.readdir(e,{withFileTypes:!0},(i,o)=>{if(i!==null){u(r,i);return}let s=o.map(n=>({dirent:n,name:n.name,path:a.joinPathSegments(e,n.name,t.pathSegmentSeparator)}));if(!t.followSymbolicLinks){d(r,s);return}n(s.map(e=>c(e,t)),(e,t)=>{if(e!==null){u(r,e);return}d(r,t)})})}e.readdirWithFileTypes=s;function c(e,t){return n=>{if(!e.dirent.isSymbolicLink()){n(null,e);return}t.fs.stat(e.path,(r,a)=>{if(r!==null){if(t.throwErrorOnBrokenSymbolicLink){n(r);return}n(null,e);return}e.dirent=i.fs.createDirentFromStats(e.name,a),n(null,e)})}}function l(e,r,o){r.fs.readdir(e,(s,c)=>{if(s!==null){u(o,s);return}n(c.map(n=>{let o=a.joinPathSegments(e,n,r.pathSegmentSeparator);return e=>{t.stat(o,r.fsStatSettings,(t,a)=>{if(t!==null){e(t);return}let s={name:n,path:o,dirent:i.fs.createDirentFromStats(n,a)};r.stats&&(s.stats=a),e(null,s)})}}),(e,t)=>{if(e!==null){u(o,e);return}d(o,t)})})}e.readdir=l;function u(e,t){e(t)}function d(e,t){e(null,t)}})),gb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.readdir=e.readdirWithFileTypes=e.read=void 0;var t=cb(),n=db(),r=pb(),i=mb();function a(e,t){return!t.stats&&n.IS_SUPPORT_READDIR_WITH_FILE_TYPES?o(e,t):s(e,t)}e.read=a;function o(e,t){return t.fs.readdirSync(e,{withFileTypes:!0}).map(n=>{let a={dirent:n,name:n.name,path:i.joinPathSegments(e,n.name,t.pathSegmentSeparator)};if(a.dirent.isSymbolicLink()&&t.followSymbolicLinks)try{let e=t.fs.statSync(a.path);a.dirent=r.fs.createDirentFromStats(a.name,e)}catch(e){if(t.throwErrorOnBrokenSymbolicLink)throw e}return a})}e.readdirWithFileTypes=o;function s(e,n){return n.fs.readdirSync(e).map(a=>{let o=i.joinPathSegments(e,a,n.pathSegmentSeparator),s=t.statSync(o,n.fsStatSettings),c={name:a,path:o,dirent:r.fs.createDirentFromStats(a,s)};return n.stats&&(c.stats=s),c})}e.readdir=s})),_b=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;var t=require("fs");e.FILE_SYSTEM_ADAPTER={lstat:t.lstat,stat:t.stat,lstatSync:t.lstatSync,statSync:t.statSync,readdir:t.readdir,readdirSync:t.readdirSync};function n(t){return t===void 0?e.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},e.FILE_SYSTEM_ADAPTER),t)}e.createFileSystemAdapter=n})),vb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=require("path"),n=cb(),r=_b();e.default=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=r.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,t.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new n.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return e??t}}})),yb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Settings=e.scandirSync=e.scandir=void 0;var t=hb(),n=gb(),r=vb();e.Settings=r.default;function i(e,n,r){if(typeof n==`function`){t.read(e,o(),n);return}t.read(e,o(n),r)}e.scandir=i;function a(e,t){let r=o(t);return n.read(e,r)}e.scandirSync=a;function o(e={}){return e instanceof r.default?e:new r.default(e)}})),bb=s(((e,t)=>{function n(e){var t=new e,n=t;function r(){var r=t;return r.next?t=r.next:(t=new e,n=t),r.next=null,r}function i(e){n.next=e,n=e}return{get:r,release:i}}t.exports=n})),xb=s(((e,t)=>{var n=bb();function r(e,t,r){if(typeof e==`function`&&(r=t,t=e,e=null),!(r>=1))throw Error(`fastqueue concurrency must be equal to or greater than 1`);var o=n(a),s=null,c=null,l=0,u=null,d={push:v,drain:i,saturated:i,pause:p,paused:!1,get concurrency(){return r},set concurrency(e){if(!(e>=1))throw Error(`fastqueue concurrency must be equal to or greater than 1`);if(r=e,!d.paused)for(;s&&l<r;)l++,b()},running:f,resume:g,idle:_,length:m,getQueue:h,unshift:y,empty:i,kill:x,killAndDrain:S,error:w,abort:C};return d;function f(){return l}function p(){d.paused=!0}function m(){for(var e=s,t=0;e;)e=e.next,t++;return t}function h(){for(var e=s,t=[];e;)t.push(e.value),e=e.next;return t}function g(){if(d.paused){if(d.paused=!1,s===null){l++,b();return}for(;s&&l<r;)l++,b()}}function _(){return l===0&&d.length()===0}function v(n,a){var f=o.get();f.context=e,f.release=b,f.value=n,f.callback=a||i,f.errorHandler=u,l>=r||d.paused?c?(c.next=f,c=f):(s=f,c=f,d.saturated()):(l++,t.call(e,f.value,f.worked))}function y(n,a){var f=o.get();f.context=e,f.release=b,f.value=n,f.callback=a||i,f.errorHandler=u,l>=r||d.paused?s?(f.next=s,s=f):(s=f,c=f,d.saturated()):(l++,t.call(e,f.value,f.worked))}function b(n){n&&o.release(n);var i=s;i&&l<=r?d.paused?l--:(c===s&&(c=null),s=i.next,i.next=null,t.call(e,i.value,i.worked),c===null&&d.empty()):--l===0&&d.drain()}function x(){s=null,c=null,d.drain=i}function S(){s=null,c=null,d.drain(),d.drain=i}function C(){var e=s;for(s=null,c=null;e;){var t=e.next,n=e.callback,r=e.errorHandler,a=e.value,o=e.context;e.value=null,e.callback=i,e.errorHandler=null,r&&r(Error(`abort`),a),n.call(o,Error(`abort`)),e.release(e),e=t}d.drain=i}function w(e){u=e}}function i(){}function a(){this.value=null,this.callback=i,this.next=null,this.release=i,this.context=null,this.errorHandler=null;var e=this;this.worked=function(t,n){var r=e.callback,a=e.errorHandler,o=e.value;e.value=null,e.callback=i,e.errorHandler&&a(t,o),r.call(e.context,t,n),e.release(e)}}function o(e,t,n){typeof e==`function`&&(n=t,t=e,e=null);function a(e,n){t.call(this,e).then(function(e){n(null,e)},n)}var o=r(e,a,n),s=o.push,c=o.unshift;return o.push=l,o.unshift=u,o.drained=d,o;function l(e){var t=new Promise(function(t,n){s(e,function(e,r){if(e){n(e);return}t(r)})});return t.catch(i),t}function u(e){var t=new Promise(function(t,n){c(e,function(e,r){if(e){n(e);return}t(r)})});return t.catch(i),t}function d(){return new Promise(function(e){process.nextTick(function(){if(o.idle())e();else{var t=o.drain;o.drain=function(){typeof t==`function`&&t(),e(),o.drain=t}}})})}}t.exports=r,t.exports.promise=o})),Sb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.joinPathSegments=e.replacePathSegmentSeparator=e.isAppliedFilter=e.isFatalError=void 0;function t(e,t){return e.errorFilter===null?!0:!e.errorFilter(t)}e.isFatalError=t;function n(e,t){return e===null||e(t)}e.isAppliedFilter=n;function r(e,t){return e.split(/[/\\]/).join(t)}e.replacePathSegmentSeparator=r;function i(e,t,n){return e===``?t:e.endsWith(n)?e+t:e+n+t}e.joinPathSegments=i})),Cb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Sb();e.default=class{constructor(e,n){this._root=e,this._settings=n,this._root=t.replacePathSegmentSeparator(e,n.pathSegmentSeparator)}}})),wb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=require("events"),n=yb(),r=xb(),i=Sb(),a=Cb();e.default=class extends a.default{constructor(e,i){super(e,i),this._settings=i,this._scandir=n.scandir,this._emitter=new t.EventEmitter,this._queue=r(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit(`end`)}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw Error(`The reader is already destroyed`);this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on(`entry`,e)}onError(e){this._emitter.once(`error`,e)}onEnd(e){this._emitter.once(`end`,e)}_pushToQueue(e,t){let n={directory:e,base:t};this._queue.push(n,e=>{e!==null&&this._handleError(e)})}_worker(e,t){this._scandir(e.directory,this._settings.fsScandirSettings,(n,r)=>{if(n!==null){t(n,void 0);return}for(let t of r)this._handleEntry(t,e.base);t(null,void 0)})}_handleError(e){this._isDestroyed||!i.isFatalError(this._settings,e)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit(`error`,e))}_handleEntry(e,t){if(this._isDestroyed||this._isFatalError)return;let n=e.path;t!==void 0&&(e.path=i.joinPathSegments(t,e.name,this._settings.pathSegmentSeparator)),i.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&i.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,t===void 0?void 0:e.path)}_emitEntry(e){this._emitter.emit(`entry`,e)}}})),Tb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=wb();e.default=class{constructor(e,n){this._root=e,this._settings=n,this._reader=new t.default(this._root,this._settings),this._storage=[]}read(e){this._reader.onError(t=>{n(e,t)}),this._reader.onEntry(e=>{this._storage.push(e)}),this._reader.onEnd(()=>{r(e,this._storage)}),this._reader.read()}};function n(e,t){e(t)}function r(e,t){e(null,t)}})),Eb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=require("stream"),n=wb();e.default=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new n.default(this._root,this._settings),this._stream=new t.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(e=>{this._stream.emit(`error`,e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}}})),Db=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=yb(),n=Sb(),r=Cb();e.default=class extends r.default{constructor(){super(...arguments),this._scandir=t.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(e,t){this._queue.add({directory:e,base:t})}_handleQueue(){for(let e of this._queue.values())this._handleDirectory(e.directory,e.base)}_handleDirectory(e,t){try{let n=this._scandir(e,this._settings.fsScandirSettings);for(let e of n)this._handleEntry(e,t)}catch(e){this._handleError(e)}}_handleError(e){if(n.isFatalError(this._settings,e))throw e}_handleEntry(e,t){let r=e.path;t!==void 0&&(e.path=n.joinPathSegments(t,e.name,this._settings.pathSegmentSeparator)),n.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&n.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(r,t===void 0?void 0:e.path)}_pushToStorage(e){this._storage.push(e)}}})),Ob=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Db();e.default=class{constructor(e,n){this._root=e,this._settings=n,this._reader=new t.default(this._root,this._settings)}read(){return this._reader.read()}}})),kb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=require("path"),n=yb();e.default=class{constructor(e={}){this._options=e,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,1/0),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,t.sep),this.fsScandirSettings=new n.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return e??t}}})),Ab=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Settings=e.walkStream=e.walkSync=e.walk=void 0;var t=Tb(),n=Eb(),r=Ob(),i=kb();e.Settings=i.default;function a(e,n,r){if(typeof n==`function`){new t.default(e,c()).read(n);return}new t.default(e,c(n)).read(r)}e.walk=a;function o(e,t){let n=c(t);return new r.default(e,n).read()}e.walkSync=o;function s(e,t){let r=c(t);return new n.default(e,r).read()}e.walkStream=s;function c(e={}){return e instanceof i.default?e:new i.default(e)}})),jb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=require("path"),n=cb(),r=nb();e.default=class{constructor(e){this._settings=e,this._fsStatSettings=new n.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return t.resolve(this._settings.cwd,e)}_makeEntry(e,t){let n={name:t,path:t,dirent:r.fs.createDirentFromStats(t,e)};return this._settings.stats&&(n.stats=e),n}_isFatalError(e){return!r.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}}})),Mb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=require("stream"),n=cb(),r=Ab(),i=jb();e.default=class extends i.default{constructor(){super(...arguments),this._walkStream=r.walkStream,this._stat=n.stat}dynamic(e,t){return this._walkStream(e,t)}static(e,n){let r=e.map(this._getFullEntryPath,this),i=new t.PassThrough({objectMode:!0});i._write=(t,a,o)=>this._getEntry(r[t],e[t],n).then(e=>{e!==null&&n.entryFilter(e)&&i.push(e),t===r.length-1&&i.end(),o()}).catch(o);for(let e=0;e<r.length;e++)i.write(e);return i}_getEntry(e,t,n){return this._getStat(e).then(e=>this._makeEntry(e,t)).catch(e=>{if(n.errorFilter(e))return null;throw e})}_getStat(e){return new Promise((t,n)=>{this._stat(e,this._fsStatSettings,(e,r)=>e===null?t(r):n(e))})}}})),Nb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Ab(),n=jb(),r=Mb();e.default=class extends n.default{constructor(){super(...arguments),this._walkAsync=t.walk,this._readerStream=new r.default(this._settings)}dynamic(e,t){return new Promise((n,r)=>{this._walkAsync(e,t,(e,t)=>{e===null?n(t):r(e)})})}async static(e,t){let n=[],r=this._readerStream.static(e,t);return new Promise((e,t)=>{r.once(`error`,t),r.on(`data`,e=>n.push(e)),r.once(`end`,()=>e(n))})}}})),Pb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=nb();e.default=class{constructor(e,t,n){this._patterns=e,this._settings=t,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){for(let e of this._patterns){let t=this._getPatternSegments(e),n=this._splitSegmentsIntoSections(t);this._storage.push({complete:n.length<=1,pattern:e,segments:t,sections:n})}}_getPatternSegments(e){return t.pattern.getPatternParts(e,this._micromatchOptions).map(e=>t.pattern.isDynamicPattern(e,this._settings)?{dynamic:!0,pattern:e,patternRe:t.pattern.makeRe(e,this._micromatchOptions)}:{dynamic:!1,pattern:e})}_splitSegmentsIntoSections(e){return t.array.splitWhen(e,e=>e.dynamic&&t.pattern.hasGlobStar(e.pattern))}}})),Fb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Pb();e.default=class extends t.default{match(e){let t=e.split(`/`),n=t.length,r=this._storage.filter(e=>!e.complete||e.segments.length>n);for(let e of r){let r=e.sections[0];if(!e.complete&&n>r.length||t.every((t,n)=>{let r=e.segments[n];return!!(r.dynamic&&r.patternRe.test(t)||!r.dynamic&&r.pattern===t)}))return!0}return!1}}})),Ib=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=nb(),n=Fb();e.default=class{constructor(e,t){this._settings=e,this._micromatchOptions=t}getFilter(e,t,n){let r=this._getMatcher(t),i=this._getNegativePatternsRe(n);return t=>this._filter(e,t,r,i)}_getMatcher(e){return new n.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){let n=e.filter(t.pattern.isAffectDepthOfReadingPattern);return t.pattern.convertPatternsToRe(n,this._micromatchOptions)}_filter(e,n,r,i){if(this._isSkippedByDeep(e,n.path)||this._isSkippedSymbolicLink(n))return!1;let a=t.path.removeLeadingDotSegment(n.path);return this._isSkippedByPositivePatterns(a,r)?!1:this._isSkippedByNegativePatterns(a,i)}_isSkippedByDeep(e,t){return this._settings.deep===1/0?!1:this._getEntryLevel(e,t)>=this._settings.deep}_getEntryLevel(e,t){let n=t.split(`/`).length;return e===``?n:n-e.split(`/`).length}_isSkippedSymbolicLink(e){return!this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(e,t){return!this._settings.baseNameMatch&&!t.match(e)}_isSkippedByNegativePatterns(e,n){return!t.pattern.matchAny(e,n)}}})),Lb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=nb();e.default=class{constructor(e,t){this._settings=e,this._micromatchOptions=t,this.index=new Map}getFilter(e,n){let[r,i]=t.pattern.partitionAbsoluteAndRelative(n),a={positive:{all:t.pattern.convertPatternsToRe(e,this._micromatchOptions)},negative:{absolute:t.pattern.convertPatternsToRe(r,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:t.pattern.convertPatternsToRe(i,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return e=>this._filter(e,a)}_filter(e,n){let r=t.path.removeLeadingDotSegment(e.path);if(this._settings.unique&&this._isDuplicateEntry(r)||this._onlyFileFilter(e)||this._onlyDirectoryFilter(e))return!1;let i=this._isMatchToPatternsSet(r,n,e.dirent.isDirectory());return this._settings.unique&&i&&this._createIndexRecord(r),i}_isDuplicateEntry(e){return this.index.has(e)}_createIndexRecord(e){this.index.set(e,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isMatchToPatternsSet(e,t,n){return!(!this._isMatchToPatterns(e,t.positive.all,n)||this._isMatchToPatterns(e,t.negative.relative,n)||this._isMatchToAbsoluteNegative(e,t.negative.absolute,n))}_isMatchToAbsoluteNegative(e,n,r){if(n.length===0)return!1;let i=t.path.makeAbsolute(this._settings.cwd,e);return this._isMatchToPatterns(i,n,r)}_isMatchToPatterns(e,n,r){if(n.length===0)return!1;let i=t.pattern.matchAny(e,n);return!i&&r?t.pattern.matchAny(e+`/`,n):i}}})),Rb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=nb();e.default=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return t.errno.isEnoentCodeError(e)||this._settings.suppressErrors}}})),zb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=nb();e.default=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let n=e.path;return this._settings.absolute&&(n=t.path.makeAbsolute(this._settings.cwd,n),n=t.path.unixify(n)),this._settings.markDirectories&&e.dirent.isDirectory()&&(n+=`/`),this._settings.objectMode?Object.assign(Object.assign({},e),{path:n}):n}}})),Bb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=require("path"),n=Ib(),r=Lb(),i=Rb(),a=zb();e.default=class{constructor(e){this._settings=e,this.errorFilter=new i.default(this._settings),this.entryFilter=new r.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new n.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new a.default(this._settings)}_getRootDirectory(e){return t.resolve(this._settings.cwd,e.base)}_getReaderOptions(e){let t=e.base===`.`?``:e.base;return{basePath:t,pathSegmentSeparator:`/`,concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(t,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}}})),Vb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Nb(),n=Bb();e.default=class extends n.default{constructor(){super(...arguments),this._reader=new t.default(this._settings)}async read(e){let t=this._getRootDirectory(e),n=this._getReaderOptions(e);return(await this.api(t,e,n)).map(e=>n.transform(e))}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}})),Hb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=require("stream"),n=Mb(),r=Bb();e.default=class extends r.default{constructor(){super(...arguments),this._reader=new n.default(this._settings)}read(e){let n=this._getRootDirectory(e),r=this._getReaderOptions(e),i=this.api(n,e,r),a=new t.Readable({objectMode:!0,read:()=>{}});return i.once(`error`,e=>a.emit(`error`,e)).on(`data`,e=>a.emit(`data`,r.transform(e))).once(`end`,()=>a.emit(`end`)),a.once(`close`,()=>i.destroy()),a}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}})),Ub=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=cb(),n=Ab(),r=jb();e.default=class extends r.default{constructor(){super(...arguments),this._walkSync=n.walkSync,this._statSync=t.statSync}dynamic(e,t){return this._walkSync(e,t)}static(e,t){let n=[];for(let r of e){let e=this._getFullEntryPath(r),i=this._getEntry(e,r,t);i===null||!t.entryFilter(i)||n.push(i)}return n}_getEntry(e,t,n){try{let n=this._getStat(e);return this._makeEntry(n,t)}catch(e){if(n.errorFilter(e))return null;throw e}}_getStat(e){return this._statSync(e,this._fsStatSettings)}}})),Wb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Ub(),n=Bb();e.default=class extends n.default{constructor(){super(...arguments),this._reader=new t.default(this._settings)}read(e){let t=this._getRootDirectory(e),n=this._getReaderOptions(e);return this.api(t,e,n).map(n.transform)}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}})),Gb=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var t=require("fs"),n=require("os"),r=Math.max(n.cpus().length,1);e.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:t.lstat,lstatSync:t.lstatSync,stat:t.stat,statSync:t.statSync,readdir:t.readdir,readdirSync:t.readdirSync},e.default=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,r),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(e,t){return e===void 0?t:e}_getFileSystemMethods(t={}){return Object.assign(Object.assign({},e.DEFAULT_FILE_SYSTEM_ADAPTER),t)}}})),Kb=u(s(((e,t)=>{var n=rb(),r=Vb(),i=Hb(),a=Wb(),o=Gb(),s=nb();async function c(e,t){u(e);let n=l(e,r.default,t),i=await Promise.all(n);return s.array.flatten(i)}(function(e){e.glob=e,e.globSync=t,e.globStream=r,e.async=e;function t(e,t){u(e);let n=l(e,a.default,t);return s.array.flatten(n)}e.sync=t;function r(e,t){u(e);let n=l(e,i.default,t);return s.stream.merge(n)}e.stream=r;function c(e,t){u(e);let r=[].concat(e),i=new o.default(t);return n.generate(r,i)}e.generateTasks=c;function d(e,t){u(e);let n=new o.default(t);return s.pattern.isDynamicPattern(e,n)}e.isDynamicPattern=d;function f(e){return u(e),s.path.escape(e)}e.escapePath=f;function p(e){return u(e),s.path.convertPathToPattern(e)}e.convertPathToPattern=p,(function(e){function t(e){return u(e),s.path.escapePosixPath(e)}e.escapePath=t;function n(e){return u(e),s.path.convertPosixPathToPattern(e)}e.convertPathToPattern=n})(e.posix||={}),(function(e){function t(e){return u(e),s.path.escapeWindowsPath(e)}e.escapePath=t;function n(e){return u(e),s.path.convertWindowsPathToPattern(e)}e.convertPathToPattern=n})(e.win32||={})})(c||={});function l(e,t,r){let i=[].concat(e),a=new o.default(r),s=n.generate(i,a),c=new t(a);return s.map(c.read,c)}function u(e){if(![].concat(e).every(e=>s.string.isString(e)&&!s.string.isEmpty(e)))throw TypeError(`Patterns must be a string (non empty) or an array of strings`)}t.exports=c}))(),1),qb={ignore:[`**/node_modules/**`,`**/.pnpm-store/**`]},Jb=async e=>{let t=f.default.join(f.default.dirname(e),`pnpm-workspace.yaml`),n;try{n=await g.default.readFile(t,`utf-8`)}catch{return null}return(0,_f.parse)(n)},Yb=async e=>{let t=f.default.join(f.default.dirname(e),`.yarnrc.yml`),n;try{n=await g.default.readFile(t,`utf-8`)}catch{return null}return(0,_f.parse)(n)},Xb=async(e,t)=>{let n={};if(e.packageManager===`pnpm`){let e=await Jb(t);e&&!Array.isArray(e)&&(e.catalog&&Object.assign(n,e.catalog),e.catalogs&&Object.assign(n,...Object.values(e.catalogs)),e.workspaces&&!Array.isArray(e.workspaces)&&(e.workspaces.catalog&&Object.assign(n,e.workspaces.catalog),e.workspaces.catalogs&&Object.assign(n,...Object.values(e.workspaces.catalogs))))}if(e.packageManager===`yarn`){let e=await Yb(t);e&&(e.catalog&&Object.assign(n,e.catalog),e.catalogs&&Object.assign(n,...Object.values(e.catalogs)))}let r=JSON.parse(await g.default.readFile(t,`utf-8`));return Object.assign(n,r.catalog,...Object.values(r.catalogs??{})),r.workspaces&&!Array.isArray(r.workspaces)&&Object.assign(n,r.workspaces.catalog,...Object.values(r.workspaces.catalogs??{})),Object.keys(n).length>0?n:null};async function Zb(e,t,n,r){let{pkgData:i,pkgPath:a}=await Dy({...e,packageFile:n,loglevel:`silent`}),o=(typeof i==`string`?JSON.parse(i):i).workspaces||await Jb(a||``),s=Array.isArray(o)?o:o?.packages;s||up(e,`workspaces property missing from package.json. --workspace${e.workspaces?`s`:``} only works when you specify a "workspaces" property in your package.json.`);let c=e.packageFile?f.default.dirname(f.default.resolve(e.packageFile)):r,l=(s||[]).map(e=>f.default.join(c,e,`package.json`).replace(/\\/g,`/`)),u=Kb.default.sync(l,qb),d=await Promise.all(u.map(async t=>{let n=await dp(e,t);return n.name=n.pkg.name||t.split(`/`).slice(-2)[0],n})),p=d.map(e=>e.name||``);return e.workspaces===!0?[d,p]:[d.filter(n=>e.workspace?.some(e=>s?.some(r=>n.name===e||n.filepath===f.default.join(c,f.default.dirname(r),e,t).replace(/\\/g,`/`)))),p]}async function Qb(e,t){if(!t)return null;let n=await Xb(e,t);if(!n)return null;let r={name:`catalog-dependencies`,version:`1.0.0`,dependencies:n};return{filepath:e.packageManager===`pnpm`?f.default.join(f.default.dirname(t),`pnpm-workspace.yaml`):e.packageManager===`yarn`?f.default.join(f.default.dirname(t),`.yarnrc.yml`):`${t}#catalog`,pkg:r,pkgFile:JSON.stringify(r,null,2),name:`catalogs`}}async function $b(e){let t=e.packageFile||`package.json`,n=e.cwd?Pl(e.cwd):`./`,r=e.packageFile||(e.cwd?f.default.join(n,`package.json`):`package.json`),i=e.workspaces===!0||e.workspace!==void 0&&e.workspace.length!==0,a=[];if(!i||e.root===!0){let t=r.replace(/\\/g,`/`),n=Kb.default.sync(t,qb),i=await Promise.all(n.map(async t=>await dp(e,t)));a=[...a,...i]}if(!i)return[a,[]];let o=null;if(i){let{pkgPath:t}=await Dy({...e,packageFile:r,loglevel:`silent`});t&&(o=await Qb(e,t))}let[s,c]=await Zb(e,t,r,n);return a=[...a,...s],o&&(a=[...a,o]),[a,c]}var ex=s(((e,t)=>{var n=require("path"),r=require("fs"),i=require("os"),a=require("url"),o=r.promises.readFile;function s(e,t){return[`package.json`,`.${e}rc.json`,`.${e}rc.js`,`.${e}rc.cjs`,...t?[]:[`.${e}rc.mjs`],`.config/${e}rc`,`.config/${e}rc.json`,`.config/${e}rc.js`,`.config/${e}rc.cjs`,...t?[]:[`.config/${e}rc.mjs`],`${e}.config.js`,`${e}.config.cjs`,...t?[]:[`${e}.config.mjs`]]}function c(e){return n.dirname(e)||n.sep}var l=(e,t)=>JSON.parse(t),u=typeof __webpack_require__==`function`?__non_webpack_require__:require,d=Object.freeze({".js":u,".json":u,".cjs":u,noExt:l});t.exports.defaultLoadersSync=d;var f=async e=>{try{return(await import(a.pathToFileURL(e).href)).default}catch(t){try{return u(e)}catch(e){throw e.code===`ERR_REQUIRE_ESM`||e instanceof SyntaxError&&e.toString().includes(`Cannot use import statement outside a module`)?t:e}}},p=Object.freeze({".js":f,".mjs":f,".cjs":f,".json":l,noExt:l});t.exports.defaultLoaders=p;function m(e,t,r){let a={stopDir:i.homedir(),searchPlaces:s(e,r),ignoreEmptySearchPlaces:!0,cache:!0,transform:e=>e,packageProp:[e],...t,loaders:{...r?d:p,...t.loaders}};return a.searchPlaces.forEach(e=>{let t=n.extname(e)||`noExt`,r=a.loaders[t];if(!r)throw Error(`Missing loader for extension "${e}"`);if(typeof r!=`function`)throw Error(`Loader for extension "${e}" is not a function: Received ${typeof r}.`)}),a}function h(e,t){return typeof e==`string`&&e in t?t[e]:(Array.isArray(e)?e:e.split(`.`)).reduce((e,t)=>e===void 0?e:e[t],t)||null}function g(e){if(!e)throw Error(`load must pass a non-empty string`)}function _(e,t){if(!e)throw Error(`No loader specified for extension "${t}"`);if(typeof e!=`function`)throw Error(`loader is not a function`)}var v=e=>(t,n,r)=>(e&&t.set(n,r),r);t.exports.lilconfig=function(e,t){let{ignoreEmptySearchPlaces:i,loaders:a,packageProp:s,searchPlaces:l,stopDir:u,transform:d,cache:f}=m(e,t??{},!1),p=new Map,y=new Map,b=v(f);return{async search(e=process.cwd()){let t={config:null,filepath:``},m=new Set,g=e;dirLoop:for(;;){if(f){let e=p.get(g);if(e!==void 0){for(let t of m)p.set(t,e);return e}m.add(g)}for(let e of l){let c=n.join(g,e);try{await r.promises.access(c)}catch{continue}let l=String(await o(c)),u=n.extname(e)||`noExt`,d=a[u];if(e===`package.json`){let e=h(s,await d(c,l));if(e!=null){t.config=e,t.filepath=c;break dirLoop}continue}let f=l.trim()===``;if(!(f&&i)){f?(t.isEmpty=!0,t.config=void 0):(_(d,u),t.config=await d(c,l)),t.filepath=c;break dirLoop}}if(g===u||g===c(g))break dirLoop;g=c(g)}let v=t.filepath===``&&t.config===null?d(null):d(t);if(f)for(let e of m)p.set(e,v);return v},async load(e){g(e);let t=n.resolve(process.cwd(),e);if(f&&y.has(t))return y.get(t);let{base:r,ext:c}=n.parse(t),l=c||`noExt`,u=a[l];_(u,l);let p=String(await o(t));if(r===`package.json`)return b(y,t,d({config:h(s,await u(t,p)),filepath:t}));let m={config:null,filepath:t},v=p.trim()===``;return v&&i?b(y,t,d({config:void 0,filepath:t,isEmpty:!0})):(m.config=v?void 0:await u(t,p),b(y,t,d(v?{...m,isEmpty:v,config:void 0}:m)))},clearLoadCache(){f&&y.clear()},clearSearchCache(){f&&p.clear()},clearCaches(){f&&(y.clear(),p.clear())}}},t.exports.lilconfigSync=function(e,t){let{ignoreEmptySearchPlaces:i,loaders:a,packageProp:o,searchPlaces:s,stopDir:l,transform:u,cache:d}=m(e,t??{},!0),f=new Map,p=new Map,y=v(d);return{search(e=process.cwd()){let t={config:null,filepath:``},p=new Set,m=e;dirLoop:for(;;){if(d){let e=f.get(m);if(e!==void 0){for(let t of p)f.set(t,e);return e}p.add(m)}for(let e of s){let s=n.join(m,e);try{r.accessSync(s)}catch{continue}let c=n.extname(e)||`noExt`,l=a[c],u=String(r.readFileSync(s));if(e===`package.json`){let e=h(o,l(s,u));if(e!=null){t.config=e,t.filepath=s;break dirLoop}continue}let d=u.trim()===``;if(!(d&&i)){d?(t.isEmpty=!0,t.config=void 0):(_(l,c),t.config=l(s,u)),t.filepath=s;break dirLoop}}if(m===l||m===c(m))break dirLoop;m=c(m)}let g=t.filepath===``&&t.config===null?u(null):u(t);if(d)for(let e of p)f.set(e,g);return g},load(e){g(e);let t=n.resolve(process.cwd(),e);if(d&&p.has(t))return p.get(t);let{base:s,ext:c}=n.parse(t),l=c||`noExt`,f=a[l];_(f,l);let m=String(r.readFileSync(t));if(s===`package.json`)return u({config:h(o,f(t,m)),filepath:t});let v={config:null,filepath:t},b=m.trim()===``;return b&&i?y(p,t,u({filepath:t,config:void 0,isEmpty:!0})):(v.config=b?void 0:f(t,m),y(p,t,u(b?{...v,isEmpty:b,config:void 0}:v)))},clearLoadCache(){d&&p.clear()},clearSearchCache(){d&&f.clear()},clearCaches(){d&&(p.clear(),f.clear())}}}}))(),tx=(e,t)=>{try{return(0,_f.parse)(t)}catch(t){throw Error(`YAML Error in ${e}:\n${t.message}`,{cause:t})}};function nx(e,t){let n=f.default.basename(t),r=e.includes(`__filename is not defined`)||e.includes(`__dirname is not defined`)||e.includes(`require is not defined`)||e.includes(`module is not defined`)||e.includes(`exports is not defined`),i=e.includes(`Cannot use import statement outside a module`)||e.includes(`Unexpected token 'export'`)||e.includes(`Unexpected token 'import'`)||e.includes(`SyntaxError: export `)||e.includes(`SyntaxError`)&&e.includes(`import`),a=t.endsWith(`.js`)&&!t.endsWith(`.cjs`)&&!t.endsWith(`.mjs`);return r&&a?`${n} uses CommonJS syntax (require/module.exports) but your package.json has "type": "module".\n\nRecommended: Convert to ESM syntax:\n import { ... } from '...'\n export default { ... }\n\nAlternative: Rename to ${n.replace(`.js`,`.cjs`)} to keep CommonJS syntax.`:i&&a?`${n} uses ESM syntax (import/export) but your package.json has "type": "commonjs".\n\nRecommended: Add "type": "module" to your package.json to use ESM throughout your project.\n\nAlternative: Rename to ${n.replace(`.js`,`.mjs`)} to keep CommonJS in package.json.`:null}async function rx({configFileName:e,configFilePath:t,packageFile:n,global:r,options:i}){let a=jn(i?.color),o=(0,ex.lilconfig)(`ncu`,{searchPlaces:[`.ncurc`,`.ncurc.json`,`.ncurc.yaml`,`.ncurc.yml`,`.ncurc.mjs`,`.ncurc.cjs`,`.ncurc.js`],loaders:{noExt:tx,".yaml":tx,".yml":tx}}),s=t||(r?m.default.homedir():n?f.default.dirname(n):process.cwd()),c=null,l;try{e?(l=f.default.isAbsolute(e)?e:f.default.join(s,e),c=await o.load(l)):c=await o.search(s)}catch(t){let n=t.message||``,r=l||e||`.ncurc.js`;e&&(t.code===`ENOENT`||n.includes(`no such file or directory`))&&up(i,`Config file ${e} not found in ${s}`);let a=nx(n,r);a&&up(i,a),up(i,`Config file error: ${n}`)}let u=c?.filepath,{$schema:d,...p}=c?.config||{},h=p||{};typeof h.format==`string`&&(h.format=Ci.format.parse(h.format));let g=Object.keys(h).filter(e=>!Ci[e]);return g.length>0&&(console.error(a.red(`Unknown option${g.length===1?``:`s`} found in config file:`),a.gray(g.join(`, `))),console.info(`Using config file `+u),console.info(`You can change the config file path with ${a.blue(`--configFilePath`)}`)),{filePath:u,args:Object.entries(h).flatMap(([e,t])=>typeof t==`boolean`||Ci[e]?.type===`boolean`?t?[`--${e}`]:[]:[`--${e}`,t]),config:h}}var ix=s(((e,t)=>{var n=`\\\\/`,r=`[^${n}]`,i=0,a=`\\.`,o=`\\+`,s=`\\?`,c=`\\/`,l=`(?=.)`,u=`[^/]`,d=`(?:${c}|$)`,f=`(?:^|${c})`,p=`${a}{1,2}${d}`,m={DOT_LITERAL:a,PLUS_LITERAL:o,QMARK_LITERAL:s,SLASH_LITERAL:c,ONE_CHAR:l,QMARK:u,END_ANCHOR:d,DOTS_SLASH:p,NO_DOT:`(?!${a})`,NO_DOTS:`(?!${f}${p})`,NO_DOT_SLASH:`(?!${a}{0,1}${d})`,NO_DOTS_SLASH:`(?!${p})`,QMARK_NO_DOT:`[^.${c}]`,STAR:`${u}*?`,START_ANCHOR:f,SEP:`/`},h={...m,SLASH_LITERAL:`[${n}]`,QMARK:r,STAR:`${r}*?`,DOTS_SLASH:`${a}{1,2}(?:[${n}]|$)`,NO_DOT:`(?!${a})`,NO_DOTS:`(?!(?:^|[${n}])${a}{1,2}(?:[${n}]|$))`,NO_DOT_SLASH:`(?!${a}{0,1}(?:[${n}]|$))`,NO_DOTS_SLASH:`(?!${a}{1,2}(?:[${n}]|$))`,QMARK_NO_DOT:`[^.${n}]`,START_ANCHOR:`(?:^|[${n}])`,END_ANCHOR:`(?:[${n}]|$)`,SEP:`\\`};t.exports={DEFAULT_MAX_EXTGLOB_RECURSION:i,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:{__proto__:null,alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?h:m}}})),ax=s((e=>{var{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=ix();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(i,`\\$1`),e.toPosixSlashes=e=>e.replace(t,`/`),e.isWindows=()=>{if(typeof navigator<`u`&&navigator.platform){let e=navigator.platform.toLowerCase();return e===`win32`||e===`windows`}return typeof process<`u`&&process.platform?process.platform===`win32`:!1},e.removeBackslashes=e=>e.replace(n,e=>e===`\\`?``:e),e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{let n=e.split(t?/[\\/]/:`/`),r=n[n.length-1];return r===``?n[n.length-2]:r}})),ox=s(((e,t)=>{var n=ax(),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:_}=ix(),v=e=>e===l||e===a,y=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let b=t||{},x=e.length-1,S=b.parts===!0||b.scanToEnd===!0,C=[],w=[],T=[],E=e,D=-1,O=0,k=0,A=!1,j=!1,M=!1,ee=!1,N=!1,P=!1,F=!1,I=!1,L=!1,R=!1,te=0,z,B,V={value:``,depth:0,isGlob:!1},ne=()=>D>=x,H=()=>E.charCodeAt(D+1),U=()=>(z=B,E.charCodeAt(++D));for(;D<x;){B=U();let e;if(B===a){F=V.backslashes=!0,B=U(),B===u&&(P=!0);continue}if(P===!0||B===u){for(te++;ne()!==!0&&(B=U());){if(B===a){F=V.backslashes=!0,U();continue}if(B===u){te++;continue}if(P!==!0&&B===s&&(B=U())===s){if(A=V.isBrace=!0,M=V.isGlob=!0,R=!0,S===!0)continue;break}if(P!==!0&&B===o){if(A=V.isBrace=!0,M=V.isGlob=!0,R=!0,S===!0)continue;break}if(B===h&&(te--,te===0)){P=!1,A=V.isBrace=!0,R=!0;break}}if(S===!0)continue;break}if(B===l){if(C.push(D),w.push(V),V={value:``,depth:0,isGlob:!1},R===!0)continue;if(z===s&&D===O+1){O+=2;continue}k=D+1;continue}if(b.noext!==!0&&(B===p||B===i||B===r||B===m||B===c)&&H()===d){if(M=V.isGlob=!0,ee=V.isExtglob=!0,R=!0,B===c&&D===O&&(L=!0),S===!0){for(;ne()!==!0&&(B=U());){if(B===a){F=V.backslashes=!0,B=U();continue}if(B===g){M=V.isGlob=!0,R=!0;break}}continue}break}if(B===r){if(z===r&&(N=V.isGlobstar=!0),M=V.isGlob=!0,R=!0,S===!0)continue;break}if(B===m){if(M=V.isGlob=!0,R=!0,S===!0)continue;break}if(B===f){for(;ne()!==!0&&(e=U());){if(e===a){F=V.backslashes=!0,U();continue}if(e===_){j=V.isBracket=!0,M=V.isGlob=!0,R=!0;break}}if(S===!0)continue;break}if(b.nonegate!==!0&&B===c&&D===O){I=V.negated=!0,O++;continue}if(b.noparen!==!0&&B===d){if(M=V.isGlob=!0,S===!0){for(;ne()!==!0&&(B=U());){if(B===d){F=V.backslashes=!0,B=U();continue}if(B===g){R=!0;break}}continue}break}if(M===!0){if(R=!0,S===!0)continue;break}}b.noext===!0&&(ee=!1,M=!1);let W=E,re=``,ie=``;O>0&&(re=E.slice(0,O),E=E.slice(O),k-=O),W&&M===!0&&k>0?(W=E.slice(0,k),ie=E.slice(k)):M===!0?(W=``,ie=E):W=E,W&&W!==``&&W!==`/`&&W!==E&&v(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),b.unescape===!0&&(ie&&=n.removeBackslashes(ie),W&&F===!0&&(W=n.removeBackslashes(W)));let ae={prefix:re,input:e,start:O,base:W,glob:ie,isBrace:A,isBracket:j,isGlob:M,isExtglob:ee,isGlobstar:N,negated:I,negatedExtglob:L};if(b.tokens===!0&&(ae.maxDepth=0,v(B)||w.push(V),ae.tokens=w),b.parts===!0||b.tokens===!0){let t;for(let n=0;n<C.length;n++){let r=t?t+1:O,i=C[n],a=e.slice(r,i);b.tokens&&(n===0&&O!==0?(w[n].isPrefix=!0,w[n].value=re):w[n].value=a,y(w[n]),ae.maxDepth+=w[n].depth),(n!==0||a!==``)&&T.push(a),t=i}if(t&&t+1<e.length){let n=e.slice(t+1);T.push(n),b.tokens&&(w[w.length-1].value=n,y(w[w.length-1]),ae.maxDepth+=w[w.length-1].depth)}ae.slashes=C,ae.parts=T}return ae}})),sx=s(((e,t)=>{var n=ix(),r=ax(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:c}=n,l=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>r.escapeRegex(e)).join(`..`)}return n},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=e=>{let t=[],n=0,r=0,i=0,a=``,o=!1;for(let s of e){if(o===!0){a+=s,o=!1;continue}if(s===`\\`){a+=s,o=!0;continue}if(s===`"`){i=i===1?0:1,a+=s;continue}if(i===0){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(n===0){if(s===`(`)r++;else if(s===`)`&&r>0)r--;else if(s===`|`&&r===0){t.push(a),a=``;continue}}}a+=s}return t.push(a),t},f=e=>{let t=!1;for(let n of e){if(t===!0){t=!1;continue}if(n===`\\`){t=!0;continue}if(/[?*+@!()[\]{}]/.test(n))return!1}return!0},p=e=>{let t=e.trim(),n=!0;for(;n===!0;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),n=!0);if(f(t))return t.replace(/\\(.)/g,`$1`)},m=e=>{let t=e.map(p).filter(Boolean);for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){let r=t[e],i=t[n],a=r[0];if(!(!a||r!==a.repeat(r.length)||i!==a.repeat(i.length))&&(r===i||r.startsWith(i)||i.startsWith(r)))return!0}return!1},h=(e,t=!0)=>{if(e[0]!==`+`&&e[0]!==`*`||e[1]!==`(`)return;let n=0,r=0,i=0,a=!1;for(let o=1;o<e.length;o++){let s=e[o];if(a===!0){a=!1;continue}if(s===`\\`){a=!0;continue}if(s===`"`){i=i===1?0:1;continue}if(i!==1){if(s===`[`){n++;continue}if(s===`]`&&n>0){n--;continue}if(!(n>0)){if(s===`(`){r++;continue}if(s===`)`&&(r--,r===0))return t===!0&&o!==e.length-1?void 0:{type:e[0],body:e.slice(2,o),end:o}}}}},g=e=>{let t=0,n=[];for(;t<e.length;){let r=h(e.slice(t),!1);if(!r||r.type!==`*`)return;let i=d(r.body).map(e=>e.trim());if(i.length!==1)return;let a=p(i[0]);if(!a||a.length!==1)return;n.push(a),t+=r.end+1}if(!(n.length<1))return`${n.length===1?r.escapeRegex(n[0]):`[${n.map(e=>r.escapeRegex(e)).join(``)}]`}*`},_=e=>{let t=0,n=e.trim(),r=h(n);for(;r;)t++,n=r.body.trim(),r=h(n);return t},v=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion==`number`?t.maxExtglobRecursion:n.DEFAULT_MAX_EXTGLOB_RECURSION,i=d(e).map(e=>e.trim());if(i.length>1&&(i.some(e=>e===``)||i.some(e=>/^[*?]+$/.test(e))||m(i)))return{risky:!0};for(let e of i){let t=g(e);if(t)return{risky:!0,safeOutput:t};if(_(e)>r)return{risky:!0}}return{risky:!1}},y=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=c[e]||e;let d={...t},f=typeof d.maxLength==`number`?Math.min(i,d.maxLength):i,p=e.length;if(p>f)throw SyntaxError(`Input length: ${p}, exceeds maximum allowed length: ${f}`);let m={type:`bos`,value:``,output:d.prepend||``},h=[m],g=d.capture?``:`?:`,_=n.globChars(d.windows),b=n.extglobChars(_),{DOT_LITERAL:x,PLUS_LITERAL:S,SLASH_LITERAL:C,ONE_CHAR:w,DOTS_SLASH:T,NO_DOT:E,NO_DOT_SLASH:D,NO_DOTS_SLASH:O,QMARK:k,QMARK_NO_DOT:A,STAR:j,START_ANCHOR:M}=_,ee=e=>`(${g}(?:(?!${M}${e.dot?T:x}).)*?)`,N=d.dot?``:E,P=d.dot?k:A,F=d.bash===!0?ee(d):j;d.capture&&(F=`(${F})`),typeof d.noext==`boolean`&&(d.noextglob=d.noext);let I={input:e,index:-1,start:0,dot:d.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:h};e=r.removePrefix(e,I),p=e.length;let L=[],R=[],te=[],z=m,B,V=()=>I.index===p-1,ne=I.peek=(t=1)=>e[I.index+t],H=I.advance=()=>e[++I.index]||``,U=()=>e.slice(I.index+1),W=(e=``,t=0)=>{I.consumed+=e,I.index+=t},re=e=>{I.output+=e.output==null?e.value:e.output,W(e.value)},ie=()=>{let e=1;for(;ne()===`!`&&(ne(2)!==`(`||ne(3)===`?`);)H(),I.start++,e++;return e%2==0?!1:(I.negated=!0,I.start++,!0)},ae=e=>{I[e]++,te.push(e)},oe=e=>{I[e]--,te.pop()},G=e=>{if(z.type===`globstar`){let t=I.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||L.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(I.output=I.output.slice(0,-z.output.length),z.type=`star`,z.value=`*`,z.output=F,I.output+=z.output)}if(L.length&&e.type!==`paren`&&(L[L.length-1].inner+=e.value),(e.value||e.output)&&re(e),z&&z.type===`text`&&e.type===`text`){z.output=(z.output||z.value)+e.value,z.value+=e.value;return}e.prev=z,h.push(e),z=e},K=(e,t)=>{let n={...b[t],conditions:1,inner:``};n.prev=z,n.parens=I.parens,n.output=I.output,n.startIndex=I.index,n.tokensIndex=h.length;let r=(d.capture?`(`:``)+n.open;ae(`parens`),G({type:e,value:t,output:I.output?``:w}),G({type:`paren`,extglob:!0,value:H(),output:r}),L.push(n)},se=n=>{let i=e.slice(n.startIndex,I.index+1),a=v(e.slice(n.startIndex+2,I.index),d);if((n.type===`plus`||n.type===`star`)&&a.risky){let e=a.safeOutput?(n.output?``:w)+(d.capture?`(${a.safeOutput})`:a.safeOutput):void 0,t=h[n.tokensIndex];t.type=`text`,t.value=i,t.output=e||r.escapeRegex(i);for(let e=n.tokensIndex+1;e<h.length;e++)h[e].value=``,h[e].output=``,delete h[e].suffix;I.output=n.output+t.output,I.backtrack=!0,G({type:`paren`,extglob:!0,value:B,output:``}),oe(`parens`);return}let o=n.close+(d.capture?`)`:``),s;if(n.type===`negate`){let e=F;n.inner&&n.inner.length>1&&n.inner.includes(`/`)&&(e=ee(d)),(e!==F||V()||/^\)+$/.test(U()))&&(o=n.close=`)$))${e}`),n.inner.includes(`*`)&&(s=U())&&/^\.[^\\/.]+$/.test(s)&&(o=n.close=`)${y(s,{...t,fastpaths:!1}).output})${e})`),n.prev.type===`bos`&&(I.negatedExtglob=!0)}G({type:`paren`,extglob:!0,value:B,output:o}),oe(`parens`)};if(d.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?k.repeat(a.length):``):o===0?P+(a?k.repeat(a.length):``):k.repeat(r.length):i===`.`?x.repeat(r.length):i===`*`?t?t+i+(a?F:``):F:t?e:`\\${e}`);return n===!0&&(i=d.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&d.contains===!0?(I.output=e,I):(I.output=r.wrapOutput(i,I,t),I)}for(;!V();){if(B=H(),B===`\0`)continue;if(B===`\\`){let e=ne();if(e===`/`&&d.bash!==!0||e===`.`||e===`;`)continue;if(!e){B+=`\\`,G({type:`text`,value:B});continue}let t=/^\\+/.exec(U()),n=0;if(t&&t[0].length>2&&(n=t[0].length,I.index+=n,n%2!=0&&(B+=`\\`)),d.unescape===!0?B=H():B+=H(),I.brackets===0){G({type:`text`,value:B});continue}}if(I.brackets>0&&(B!==`]`||z.value===`[`||z.value===`[^`)){if(d.posix!==!1&&B===`:`){let e=z.value.slice(1);if(e.includes(`[`)&&(z.posix=!0,e.includes(`:`))){let e=z.value.lastIndexOf(`[`),t=z.value.slice(0,e),n=a[z.value.slice(e+2)];if(n){z.value=t+n,I.backtrack=!0,H(),!m.output&&h.indexOf(z)===1&&(m.output=w);continue}}}(B===`[`&&ne()!==`:`||B===`-`&&ne()===`]`)&&(B=`\\${B}`),B===`]`&&(z.value===`[`||z.value===`[^`)&&(B=`\\${B}`),d.posix===!0&&B===`!`&&z.value===`[`&&(B=`^`),z.value+=B,re({value:B});continue}if(I.quotes===1&&B!==`"`){B=r.escapeRegex(B),z.value+=B,re({value:B});continue}if(B===`"`){I.quotes=I.quotes===1?0:1,d.keepQuotes===!0&&G({type:`text`,value:B});continue}if(B===`(`){ae(`parens`),G({type:`paren`,value:B});continue}if(B===`)`){if(I.parens===0&&d.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=L[L.length-1];if(e&&I.parens===e.parens+1){se(L.pop());continue}G({type:`paren`,value:B,output:I.parens?`)`:`\\)`}),oe(`parens`);continue}if(B===`[`){if(d.nobracket===!0||!U().includes(`]`)){if(d.nobracket!==!0&&d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));B=`\\${B}`}else ae(`brackets`);G({type:`bracket`,value:B});continue}if(B===`]`){if(d.nobracket===!0||z&&z.type===`bracket`&&z.value.length===1){G({type:`text`,value:B,output:`\\${B}`});continue}if(I.brackets===0){if(d.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));G({type:`text`,value:B,output:`\\${B}`});continue}oe(`brackets`);let e=z.value.slice(1);if(z.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(B=`/${B}`),z.value+=B,re({value:B}),d.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(z.value);if(I.output=I.output.slice(0,-z.value.length),d.literalBrackets===!0){I.output+=t,z.value=t;continue}z.value=`(${g}${t}|${z.value})`,I.output+=z.value;continue}if(B===`{`&&d.nobrace!==!0){ae(`braces`);let e={type:`brace`,value:B,output:`(`,outputIndex:I.output.length,tokensIndex:I.tokens.length};R.push(e),G(e);continue}if(B===`}`){let e=R[R.length-1];if(d.nobrace===!0||!e){G({type:`text`,value:B,output:B});continue}let t=`)`;if(e.dots===!0){let e=h.slice(),n=[];for(let t=e.length-1;t>=0&&(h.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&n.unshift(e[t].value);t=l(n,d),I.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=I.output.slice(0,e.outputIndex),r=I.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,B=t=`\\}`,I.output=n;for(let e of r)I.output+=e.output||e.value}G({type:`brace`,value:B,output:t}),oe(`braces`),R.pop();continue}if(B===`|`){L.length>0&&L[L.length-1].conditions++,G({type:`text`,value:B});continue}if(B===`,`){let e=B,t=R[R.length-1];t&&te[te.length-1]===`braces`&&(t.comma=!0,e=`|`),G({type:`comma`,value:B,output:e});continue}if(B===`/`){if(z.type===`dot`&&I.index===I.start+1){I.start=I.index+1,I.consumed=``,I.output=``,h.pop(),z=m;continue}G({type:`slash`,value:B,output:C});continue}if(B===`.`){if(I.braces>0&&z.type===`dot`){z.value===`.`&&(z.output=x);let e=R[R.length-1];z.type=`dots`,z.output+=B,z.value+=B,e.dots=!0;continue}if(I.braces+I.parens===0&&z.type!==`bos`&&z.type!==`slash`){G({type:`text`,value:B,output:x});continue}G({type:`dot`,value:B,output:x});continue}if(B===`?`){if(!(z&&z.value===`(`)&&d.noextglob!==!0&&ne()===`(`&&ne(2)!==`?`){K(`qmark`,B);continue}if(z&&z.type===`paren`){let e=ne(),t=B;(z.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(U()))&&(t=`\\${B}`),G({type:`text`,value:B,output:t});continue}if(d.dot!==!0&&(z.type===`slash`||z.type===`bos`)){G({type:`qmark`,value:B,output:A});continue}G({type:`qmark`,value:B,output:k});continue}if(B===`!`){if(d.noextglob!==!0&&ne()===`(`&&(ne(2)!==`?`||!/[!=<:]/.test(ne(3)))){K(`negate`,B);continue}if(d.nonegate!==!0&&I.index===0){ie();continue}}if(B===`+`){if(d.noextglob!==!0&&ne()===`(`&&ne(2)!==`?`){K(`plus`,B);continue}if(z&&z.value===`(`||d.regex===!1){G({type:`plus`,value:B,output:S});continue}if(z&&(z.type===`bracket`||z.type===`paren`||z.type===`brace`)||I.parens>0){G({type:`plus`,value:B});continue}G({type:`plus`,value:S});continue}if(B===`@`){if(d.noextglob!==!0&&ne()===`(`&&ne(2)!==`?`){G({type:`at`,extglob:!0,value:B,output:``});continue}G({type:`text`,value:B});continue}if(B!==`*`){(B===`$`||B===`^`)&&(B=`\\${B}`);let e=o.exec(U());e&&(B+=e[0],I.index+=e[0].length),G({type:`text`,value:B});continue}if(z&&(z.type===`globstar`||z.star===!0)){z.type=`star`,z.star=!0,z.value+=B,z.output=F,I.backtrack=!0,I.globstar=!0,W(B);continue}let t=U();if(d.noextglob!==!0&&/^\([^?]/.test(t)){K(`star`,B);continue}if(z.type===`star`){if(d.noglobstar===!0){W(B);continue}let n=z.prev,r=n.prev,i=n.type===`slash`||n.type===`bos`,a=r&&(r.type===`star`||r.type===`globstar`);if(d.bash===!0&&(!i||t[0]&&t[0]!==`/`)){G({type:`star`,value:B,output:``});continue}let o=I.braces>0&&(n.type===`comma`||n.type===`brace`),s=L.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){G({type:`star`,value:B,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[I.index+4];if(n&&n!==`/`)break;t=t.slice(3),W(`/**`,3)}if(n.type===`bos`&&V()){z.type=`globstar`,z.value+=B,z.output=ee(d),I.output=z.output,I.globstar=!0,W(B);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&V()){I.output=I.output.slice(0,-(n.output+z.output).length),n.output=`(?:${n.output}`,z.type=`globstar`,z.output=ee(d)+(d.strictSlashes?`)`:`|$)`),z.value+=B,I.globstar=!0,I.output+=n.output+z.output,W(B);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;I.output=I.output.slice(0,-(n.output+z.output).length),n.output=`(?:${n.output}`,z.type=`globstar`,z.output=`${ee(d)}${C}|${C}${e})`,z.value+=B,I.output+=n.output+z.output,I.globstar=!0,W(B+H()),G({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){z.type=`globstar`,z.value+=B,z.output=`(?:^|${C}|${ee(d)}${C})`,I.output=z.output,I.globstar=!0,W(B+H()),G({type:`slash`,value:`/`,output:``});continue}I.output=I.output.slice(0,-z.output.length),z.type=`globstar`,z.output=ee(d),z.value+=B,I.output+=z.output,I.globstar=!0,W(B);continue}let n={type:`star`,value:B,output:F};if(d.bash===!0){n.output=`.*?`,(z.type===`bos`||z.type===`slash`)&&(n.output=N+n.output),G(n);continue}if(z&&(z.type===`bracket`||z.type===`paren`)&&d.regex===!0){n.output=B,G(n);continue}(I.index===I.start||z.type===`slash`||z.type===`dot`)&&(z.type===`dot`?(I.output+=D,z.output+=D):d.dot===!0?(I.output+=O,z.output+=O):(I.output+=N,z.output+=N),ne()!==`*`&&(I.output+=w,z.output+=w)),G(n)}for(;I.brackets>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));I.output=r.escapeLast(I.output,`[`),oe(`brackets`)}for(;I.parens>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));I.output=r.escapeLast(I.output,`(`),oe(`parens`)}for(;I.braces>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));I.output=r.escapeLast(I.output,`{`),oe(`braces`)}if(d.strictSlashes!==!0&&(z.type===`star`||z.type===`bracket`)&&G({type:`maybe_slash`,value:``,output:`${C}?`}),I.backtrack===!0){I.output=``;for(let e of I.tokens)I.output+=e.output==null?e.value:e.output,e.suffix&&(I.output+=e.suffix)}return I};y.fastpaths=(e,t)=>{let a={...t},o=typeof a.maxLength==`number`?Math.min(i,a.maxLength):i,s=e.length;if(s>o)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${o}`);e=c[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:u,ONE_CHAR:d,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:m,NO_DOTS_SLASH:h,STAR:g,START_ANCHOR:_}=n.globChars(a.windows),v=a.dot?m:p,y=a.dot?h:p,b=a.capture?``:`?:`,x={negated:!1,prefix:``},S=a.bash===!0?`.*?`:g;a.capture&&(S=`(${S})`);let C=e=>e.noglobstar===!0?S:`(${b}(?:(?!${_}${e.dot?f:l}).)*?)`,w=e=>{switch(e){case`*`:return`${v}${d}${S}`;case`.*`:return`${l}${d}${S}`;case`*.*`:return`${v}${S}${l}${d}${S}`;case`*/*`:return`${v}${S}${u}${d}${y}${S}`;case`**`:return v+C(a);case`**/*`:return`(?:${v}${C(a)}${u})?${y}${d}${S}`;case`**/*.*`:return`(?:${v}${C(a)}${u})?${y}${S}${l}${d}${S}`;case`**/.*`:return`(?:${v}${C(a)}${u})?${l}${d}${S}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=w(t[1]);return n?n+l+t[2]:void 0}}},T=w(r.removePrefix(e,x));return T&&a.strictSlashes!==!0&&(T+=`${u}?`),T},t.exports=y})),cx=s(((e,t)=>{var n=ox(),r=sx(),i=ax(),a=ix(),o=e=>e&&typeof e==`object`&&!Array.isArray(e),s=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>s(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=o(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},a=i.windows,c=r?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=c.state;delete c.state;let u=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=s(i.ignore,e,n)}let d=(n,r=!1)=>{let{isMatch:o,match:d,output:f}=s.test(n,c,t,{glob:e,posix:a}),p={glob:e,state:l,regex:c,posix:a,input:n,output:f,match:d,isMatch:o};return typeof i.onResult==`function`&&i.onResult(p),o===!1?(p.isMatch=!1,r?p:!1):u(n)?(typeof i.onIgnore==`function`&&i.onIgnore(p),p.isMatch=!1,r?p:!1):(typeof i.onMatch==`function`&&i.onMatch(p),r?p:!0)};return n&&(d.state=l),d};s.test=(e,t,n,{glob:r,posix:a}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let o=n||{},c=o.format||(a?i.toPosixSlashes:null),l=e===r,u=l&&c?c(e):e;return l===!1&&(u=c?c(e):e,l=u===r),(l===!1||o.capture===!0)&&(l=o.matchBase===!0||o.basename===!0?s.matchBase(e,t,n,a):t.exec(u)),{isMatch:!!l,match:l,output:u}},s.matchBase=(e,t,n)=>(t instanceof RegExp?t:s.makeRe(t,n)).test(i.basename(e)),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map(e=>s.parse(e,t)):r(e,{...t,fastpaths:!1}),s.scan=(e,t)=>n(e,t),s.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,c=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(c=`^(?!${c}).*$`);let l=s.toRegex(c,t);return r===!0&&(l.state=e),l},s.makeRe=(e,t={},n=!1,i=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let a={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(a.output=r.fastpaths(e,t)),a.output||(a=r(e,t)),s.compileRe(a,t,n,i)},s.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},s.constants=a,t.exports=s})),lx=u(s(((e,t)=>{var n=cx(),r=ax();function i(e,t,i=!1){return t&&(t.windows===null||t.windows===void 0)&&(t={...t,windows:r.isWindows()}),n(e,t,i)}Object.assign(i,n),t.exports=i}))(),1),ux=c({greatest:()=>hx,greatestLevel:()=>gx,latest:()=>mx,minor:()=>_x,newest:()=>bx,patch:()=>vx,semver:()=>yx}),dx=(0,w.promisify)(E.default.execFile);async function fx(e){let t=(await dx(`git`,[`ls-remote`,`--tags`,e])).stdout,n={};for(let e of t.trim().split(`
638
+ `)){let t=e.split(` `);n[t[1].replace(/^refs\/tags\/|\^{}$/g,``)]=t[0]}return n}async function px(e,t,n){t=t.replace(/^github:/,``);let{auth:r,protocol:i,host:a,path:o}=(0,Qn.default)(t),s;try{if(i!==null)s=await fx(`${i?i.replace(`git+`,``):`https:`}//${r?r+`@`:``}${a}/${o?.replace(/^:/,``)}`);else try{s=await fx(`ssh://git@${a}/${o?.replace(/^:/,``)}`)}catch{s=await fx(`https://${r?r+`@`:``}${a}/${o}`)}}catch{Y(n??{},`Invalid, private repo, or no tags for ${e}: ${t}`,`verbose`);return}return Object.keys(s).map(jr).filter(e=>(0,q.valid)(e)).sort(xr)}var mx=async(e,t,n)=>{let r=await px(e,t,n);if(!r)return{version:null};let i=n?.pre?r:r.filter(e=>!Tr(e)),a=i[i.length-1];return{version:a?Vr(t,a):null}},hx=async(e,t,n)=>{let r=await px(e,t,n);if(!r)return{version:null};let i=r[r.length-1];return{version:i?Vr(t,i):null}},gx=e=>async(t,n,r={})=>{let i=decodeURIComponent((0,Qn.default)(n).branch).replace(/^semver:/,``),a=await px(t,n,r);if(!a)return{version:null};let o=Sr(a.map(e=>e.replace(/^v/,``)),i,e);return{version:o?Vr(n,o):null}},_x=gx(`minor`),vx=gx(`patch`),yx=async(e,t,n)=>({version:null}),bx=hx,xx=c({latest:()=>wx}),Sx=e=>e&&e.startsWith(`http://`)||e.startsWith(`https://`),Cx=(0,kl.default)(async e=>{let t=e.registry,n;if(Sx(t))n=await(await fetch(t)).text();else try{n=await g.default.readFile(t,`utf8`)}catch{up(e,`\nThe specified static registry file does not exist: ${e.registry}`)}return JSON.parse(n)}),wx=async(e,t,n)=>({version:(await Cx(n||{}))[e]||null}),Tx={npm:bu,pnpm:gf,yarn:zf,bun:qu,gitTags:ux,staticRegistry:xx};function Ex(e){if(typeof e==`string`)return e.trim();if(Array.isArray(e)&&(e.length===0||typeof e[0]==`string`)){let t=e.map(e=>typeof e==`string`?e.trim():e).filter(e=>e);return t.length>0?t:void 0}else return e}function Dx(e){try{return new URL(e),!0}catch{return!1}}var Ox=(e,t=Math.round(e*10)/10)=>`${t} day${t===1?``:`s`}`;async function kx(e,{cli:t}={}){let n=jn(e.color),r;if(!t){r={...e};let t=wi.reduce((e,t)=>({...e,...t.default==null?null:{[t.long]:t.default}}),{}),n={jsonUpgraded:!0,silent:e.silent||e.loglevel===void 0&&!e.verbose,args:[]};e={...t,...n,...e}}let i={...e,...e.packageData&&typeof e.packageData!=`string`?{packageData:JSON.stringify(e.packageData,null,2)}:null,cli:t,...t?null:{raw:r}},a=i.silent||i.format?.includes(`lines`)?`silent`:i.verbose?`verbose`:i.loglevel,o=Object.keys(i).filter(e=>e.startsWith(`json`)).some(e=>i[e]);!o&&a!==`silent`&&i.rcConfigPath&&!i.doctor&&Y(i,`Using config file ${i.rcConfigPath}`);let s=wi.filter(({long:e,deprecated:t})=>t&&i[e]||e===`packageManager`&&i.packageManager===`staticRegistry`);if(s.length>0){for(let{long:e,description:t}of s){let r=e===`packageManager`?`--packageManager staticRegistry is deprecated. Use --registryType json.`:`--${e}: ${t}`;Y(i,n.yellow(r),`warn`)}Y(i,``,`warn`)}for(let{long:e,choices:t}of wi){if(!t||t.length===0)continue;let n=i[e],r=Array.isArray(n)?n:[n];r.length!==0&&r.every(e=>!t.includes(e))&&up(i,`Invalid option value: --${e} ${n}. Valid values are: ${t.join(`, `)}.`)}i.cwd&&!await Fn(i.cwd)&&up(i,`No such directory: ${i.cwd}`);let c=Ex(i.args),l=Ex(i.filter),u=Ex(i.filterVersion),d=Ex(i.reject),f=Ex(i.rejectVersion),p=i.registryType||(i.registry?.endsWith(`.json`)?`json`:`npm`);i.filter&&c&&c.join(` `)!==(Array.isArray(l)?l.join(` `):l)?up(i,`Cannot specify a filter using both --filter and args. Did you forget to quote an argument?
639
+ See: https://github.com/raineorshine/npm-check-updates/issues/759#issuecomment-723587297`):i.packageFile&&i.deep?up(i,`Cannot specify both --packageFile and --deep. --deep is an alias for --packageFile '**/package.json'`):i.format?.includes(`lines`)&&i.jsonUpgraded?up(i,`Cannot specify both --format lines and --jsonUpgraded.`):i.format?.includes(`lines`)&&i.jsonAll?up(i,`Cannot specify both --format lines and --jsonAll.`):i.format?.includes(`lines`)&&i.format.length>1?up(i,`Cannot use --format lines with other formatting options.`):i.workspace?.length&&i.workspaces?up(i,`Cannot specify both --workspace and --workspaces.`):i.deep&&(i.workspace?.length||i.workspaces)?up(i,`Cannot specify both --deep and --workspace${i.workspaces?`s`:``}.`):i.doctor&&(i.workspace?.length||i.workspaces)?up(i,`Doctor mode is not currently supported with --workspace${i.workspaces?`s`:``}.`):i.packageManager===`staticRegistry`&&!i.registry?up(i,`When --package-manager staticRegistry is specified, you must provide the path for the registry file with --registry.`):i.registryType===`json`&&!i.registry?up(i,`When --registryType json is specified, you must provide the path for the registry file with --registry. Run "ncu --help registryType" for details.`):p!==`json`&&i.registry&&!Dx(i.registry)&&up(i,`--registry must be a valid URL. Invalid value: "${i.registry}"`);let m=await Ai(i);if(i.cooldown!=null){if(typeof i.cooldown==`string`){let e=ui(i.cooldown);e===null?up(i,`Invalid cooldown value: "${i.cooldown}". Use a number (days) or a string like "7d", "12h", or "30m".`):i.cooldown=e}let e=typeof i.cooldown==`number`&&!isNaN(i.cooldown)&&i.cooldown>=0,t=typeof i.cooldown==`function`;!e&&!t&&up(i,`Cooldown must be a non-negative number (days), a string like "7d", "12h", or "30m", or a predicate function.`)}else{let e=Ou.findNpmConfig(),t=e?.minReleaseAge;if(t!=null){let n=typeof t==`string`?ui(t)??parseInt(t,10):typeof t==`number`?t:null;if(n!=null&&!isNaN(n)){let t=e?.minReleaseAgeExclude,r=[...new Set((Array.isArray(t)?t:typeof t==`string`?[t]:[]).flatMap(e=>e.split(`,`)).map(e=>e.trim()).filter(e=>e))];if(r.length>0){let e=r.map(e=>({pattern:e,match:(0,lx.default)(e,{nonegate:!0,noext:!0})}));i.cooldown=t=>e.some(({pattern:e,match:n})=>t===e||n(t))?null:n,Y({...i,json:o},`Using min-release-age from .npmrc: ${Ox(n)} (${r.length} excluded pattern${r.length===1?``:`s`})`)}else i.cooldown=n,Y({...i,json:o},`Using min-release-age from .npmrc: ${Ox(n)}`)}}else if(m===`pnpm`){let e=await Ff.getPnpmWorkspaceMinimumReleaseAge();if(e!=null){let{minimumReleaseAge:t,minimumReleaseAgeExclude:n}=e,r=t/1440;if(n.length>0){let e=n.map(e=>(0,lx.default)(e));i.cooldown=t=>e.some(e=>e(t))?null:r,Y({...i,json:o},`Using minimumReleaseAge from pnpm-workspace.yaml: ${Ox(r)} (${n.length} excluded pattern${n.length===1?``:`s`})`)}else i.cooldown=r,Y({...i,json:o},`Using minimumReleaseAge from pnpm-workspace.yaml: ${Ox(r)}`)}}else if(m===`yarn`){let e=await lp.getYarnMinimalAgeGate(i);if(e!=null){let{npmMinimalAgeGate:t,npmPreapprovedPackages:n}=e,r=t/1440;if(n.length>0){let e=n.map(e=>(0,lx.default)(e));i.cooldown=t=>e.some(e=>e(t))?null:r,Y({...i,json:o},`Using npmMinimalAgeGate from .yarnrc.yml: ${r} day${r===1?``:`s`} (${n.length} pre-approved package${n.length===1?``:`s`})`)}else i.cooldown=r,Y({...i,json:o},`Using npmMinimalAgeGate from .yarnrc.yml: ${Ox(r)}`)}}}let h=i.target||`latest`,g=h===`newest`||h===`greatest`,_={...i,...i.deep?{packageFile:`**/package.json`}:null,...m===`deno`?{dep:[`imports`]}:null,...i.format&&i.format.length>0?{format:i.format}:null,filter:c||l,filterVersion:u,json:o,loglevel:a,minimal:i.minimal===void 0?!1:i.minimal,...i.pre!=null||g?{pre:i.pre==null?g:!!i.pre}:null,reject:d,rejectVersion:f,target:h,...i.interactive&&i.upgrade===void 0?{upgrade:!o}:null,packageManager:m,...i.prefix?{prefix:await(Tx[m||``]?.defaultPrefix||Tx.npm.defaultPrefix)(i)}:null,registryType:p};_.cacher=await li(_);let v=Dn(_,(e,t)=>t===void 0?null:{[e]:t});return!i.packageManager&&m!==`npm`&&Y(v,`Using ${m}`),v}function Ax(e,t){return Array.from(new Set([...e||[],...t||[]]))}function jx(e,t){let n=e||{},r=t||{},i={...n,...r};for(let e of Object.keys(i))Array.isArray(n[e])&&Array.isArray(r[e])&&(i[e]=Ax(n[e],r[e]));return i}var Mx=s(((e,t)=>{var n=e=>typeof e==`function`?e:()=>e,r=(...e)=>(...t)=>e.length===0||!!n(e[0])(...t)&&r(...e.slice(1))(...t),i=(...e)=>(...t)=>e.length>0&&(!!n(e[0])(...t)||i(...e.slice(1))(...t));t.exports={and:r,or:i}}))();function Nx(e){let t;if(!e)t=()=>!0;else if(typeof e==`string`)if(e[0]===`/`&&e.at(-1)===`/`){let n=new RegExp(e.slice(1,-1));t=e=>n.test(e)}else{let n=e.split(/[\s,]+/);t=e=>n.some((0,Mx.or)(t=>(0,lx.default)(t)(e),t=>!t.includes(`/`)&&e.includes(`/`)&&(0,lx.default)(t)(e.replace(/\//g,`_`))))}else if(Array.isArray(e))t=(t,n)=>e.some(e=>Nx(e)(t,n));else if(e instanceof RegExp)t=t=>e.test(t);else if(typeof e==`function`)t=(t,n)=>e(t,(0,$n.parseRange)(n??t));else throw TypeError(`Invalid filter. Must be a RegExp, array, or comma-or-space-delimited list.`);return t}function Px(e,t,n,r){return(0,Mx.and)((n,r)=>(0,Mx.and)(e?Nx(e):!0,t?(...e)=>!Nx(t)(...e):!0)(n,r),(e,t)=>(0,Mx.and)(n?Nx(n):!0,r?(...e)=>!Nx(r)(...e):!0)(t))}function Fx(e,t){return!t||t===`deno`?Tx.npm:e.registryType===`json`?Tx.staticRegistry:(Tx[t]||up(e,`Invalid package manager: ${t}`),Tx[t])}async function Ix(e={}){let t=await Fx(e,e.packageManager).list?.({cwd:e.cwd,prefix:e.prefix,global:e.global});t||up(e,`Unable to retrieve package list`);let n=Px(e.filter,e.reject,e.filterVersion,e.rejectVersion),r={};try{r=Pn(t,(e,t)=>!!t&&!hr(t)&&n(e,t))}catch(t){up(e,`Invalid filter: `+t.message||t)}return r}var Lx=e=>/^@[^/]*\./.test(e)?`"${e}"`:e,Rx=c({default:()=>zx,pMapSkip:()=>Bx});async function zx(e,t,{concurrency:n=1/0,stopOnError:r=!0,signal:i}={}){return new Promise((a,o)=>{if(e[Symbol.iterator]===void 0&&e[Symbol.asyncIterator]===void 0)throw TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof e})`);if(typeof t!=`function`)throw TypeError(`Mapper function is required`);if(!(Number.isSafeInteger(n)&&n>=1||n===1/0))throw TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${n}\` (${typeof n})`);let s=[],c=[],l=new Map,u=!1,d=!1,f=!1,p=0,m=0,h=e[Symbol.iterator]===void 0?e[Symbol.asyncIterator]():e[Symbol.iterator](),g=()=>{y(i.reason)},_=()=>{i?.removeEventListener(`abort`,g)},v=e=>{a(e),_()},y=e=>{u=!0,d=!0,o(e),_()};i&&(i.aborted&&y(i.reason),i.addEventListener(`abort`,g,{once:!0}));let b=async()=>{if(d)return;let e=await h.next(),n=m;if(m++,e.done){if(f=!0,p===0&&!d){if(!r&&c.length>0){y(AggregateError(c));return}if(d=!0,l.size===0){v(s);return}let e=[];for(let[t,n]of s.entries())l.get(t)!==Bx&&e.push(n);v(e)}return}p++,(async()=>{try{let r=await e.value;if(d)return;let i=await t(r,n);i===Bx&&l.set(n,i),s[n]=i,p--,await b()}catch(e){if(r)y(e);else{c.push(e),p--;try{await b()}catch(e){y(e)}}}})()};(async()=>{for(let e=0;e<n;e++){try{await b()}catch(e){y(e);break}if(f||u)break}})()})}var Bx,Vx=o((()=>{Bx=Symbol(`skip`)})),Hx=s(((e,t)=>{e=t.exports=n;function n(e,t){if(this.stream=t.stream||process.stderr,typeof t==`number`){var n=t;t={},t.total=n}else{if(t||={},typeof e!=`string`)throw Error(`format required`);if(typeof t.total!=`number`)throw Error(`total required`)}this.fmt=e,this.curr=t.curr||0,this.total=t.total,this.width=t.width||this.total,this.clear=t.clear,this.chars={complete:t.complete||`=`,incomplete:t.incomplete||`-`,head:t.head||t.complete||`=`},this.renderThrottle=t.renderThrottle===0?0:t.renderThrottle||16,this.lastRender=-1/0,this.callback=t.callback||function(){},this.tokens={},this.lastDraw=``}n.prototype.tick=function(e,t){if(e!==0&&(e||=1),typeof e==`object`&&(t=e,e=1),t&&(this.tokens=t),this.curr==0&&(this.start=new Date),this.curr+=e,this.render(),this.curr>=this.total){this.render(void 0,!0),this.complete=!0,this.terminate(),this.callback(this);return}},n.prototype.render=function(e,t){if(t=t===void 0?!1:t,e&&(this.tokens=e),this.stream.isTTY){var n=Date.now(),r=n-this.lastRender;if(!(!t&&r<this.renderThrottle)){this.lastRender=n;var i=this.curr/this.total;i=Math.min(Math.max(i,0),1);var a=Math.floor(i*100),o,s,c,l=new Date-this.start,u=a==100?0:l*(this.total/this.curr-1),d=this.curr/(l/1e3),f=this.fmt.replace(`:current`,this.curr).replace(`:total`,this.total).replace(`:elapsed`,isNaN(l)?`0.0`:(l/1e3).toFixed(1)).replace(`:eta`,isNaN(u)||!isFinite(u)?`0.0`:(u/1e3).toFixed(1)).replace(`:percent`,a.toFixed(0)+`%`).replace(`:rate`,Math.round(d)),p=Math.max(0,this.stream.columns-f.replace(`:bar`,``).length);p&&process.platform===`win32`&&--p;var m=Math.min(this.width,p);if(c=Math.round(m*i),s=Array(Math.max(0,c+1)).join(this.chars.complete),o=Array(Math.max(0,m-c+1)).join(this.chars.incomplete),c>0&&(s=s.slice(0,-1)+this.chars.head),f=f.replace(`:bar`,s+o),this.tokens)for(var h in this.tokens)f=f.replace(`:`+h,this.tokens[h]);this.lastDraw!==f&&(this.stream.cursorTo(0),this.stream.write(f),this.stream.clearLine(1),this.lastDraw=f)}}},n.prototype.update=function(e,t){var n=Math.floor(e*this.total)-this.curr;this.tick(n,t)},n.prototype.interrupt=function(e){this.stream.clearLine(),this.stream.cursorTo(0),this.stream.write(e),this.stream.write(`
640
640
  `),this.stream.write(this.lastDraw)},n.prototype.terminate=function(){this.clear?this.stream.clearLine&&(this.stream.clearLine(),this.stream.cursorTo(0)):this.stream.write(`
641
- `)}})),Gx=s(((e,t)=>{t.exports=Wx()}));Ux();var Kx=u(Gx(),1);function qx(e,t){let n=[[t]];for(;n.length>0;){let t=[];for(let r of n){let n=Object.keys(e[r[0]]??{});for(let e of n){if(e===r.at(-1))return{isCircular:!0,offendingPackage:r[0]};t.push([e,...r])}}n=t}return{isCircular:!1}}async function Jx(e,t){let n=Lx(t,t.packageManager);if(!n.getPeerDependencies)return{};let r=Object.keys(e).length,i;!t.json&&t.loglevel!==`silent`&&t.loglevel!==`verbose`&&r>0&&(i=new Kx.default(`[:bar] :current/:total :percent`,{total:r,width:20}),i.render());let a=await Vx(Object.entries(e),async([e,r])=>{let a,o=t.cacher?.getPeers(e,r);return o?a=o:(a=await n.getPeerDependencies(e,r,{cwd:t.cwd}),t.cacher?.setPeers(e,r,a)),i&&i.tick(),{pkg:e,dependencies:a}},{concurrency:t.concurrency}),o={};for(let{pkg:e,dependencies:t}of a){o[e]=t;let n=qx(o,e);n.isCircular&&delete o[e][n.offendingPackage]}return await t.cacher?.save(),t.cacher?.log(!0),o}function Yx(e,t){let n={};for(let r of t)n[r]=e[r];return n}function Xx(e,t){let n={};for(let[r,i]of Object.entries(e??{})){let e=r;t(i,e)&&(n[e]=i)}return n}var Zx=[`latest`,`newest`,`greatest`,`minor`,`patch`,`semver`];Ux();async function Qx(e,t={}){let n=jn(t.color),r=Object.keys(e),i=Lx(t,t.packageManager),a;!t.json&&t.loglevel!==`silent`&&t.loglevel!==`verbose`&&r.length>0&&(a=new Kx.default(`[:bar] :current/:total :percent`,{total:r.length,width:20}),a.render());async function o(r){let o=Pr(e[r]),[s,c]=o||[r,e[r]];if(qn(c))return a?.tick(),{version:null};let l=t.target||`latest`,u=typeof l==`string`?l:l(s,(0,$n.parseRange)(c)),[d,f]=u.startsWith(`@`)?[`distTag`,u.slice(1)]:[u,`latest`];if(!t.cooldown){let e=t.cacher?.get(s,d);if(e?.version&&(e?.time||!t.format?.includes(`time`)))return a?.tick(),e}let p,m=Lr(e[r]),h=m?Dx.gitTags:i,g=m?`github urls`:t.packageManager||`npm`,_=h[d];if(!_){let e=Zx.filter(e=>e in h);up(t,n.red(`\nUnsupported target "${d}" using ${g}`)+`
641
+ `)}})),Ux=s(((e,t)=>{t.exports=Hx()}));Vx();var Wx=u(Ux(),1);function Gx(e,t){let n=new Set,r=[[t]];for(;r.length>0;){let t=[];for(let i of r){let r=i[0];if(n.has(r))continue;n.add(r);let a=Object.keys(e[r]??{});for(let e of a){if(e===i.at(-1))return{isCircular:!0,offendingPackage:r};t.push([e,...i])}}r=t}return{isCircular:!1}}async function Kx(e,t){let n=Fx(t,t.packageManager);if(!n.getPeerDependencies)return{};let r=Object.keys(e).length,i;!t.json&&t.loglevel!==`silent`&&t.loglevel!==`verbose`&&r>0&&(i=new Wx.default(`[:bar] :current/:total :percent`,{total:r,width:20}),i.render());let a=await zx(Object.entries(e),async([e,r])=>{let a,o=t.cacher?.getPeers(e,r);return o?a=o:(a=await n.getPeerDependencies(e,r,{cwd:t.cwd}),t.cacher?.setPeers(e,r,a)),i&&i.tick(),{pkg:e,dependencies:a}},{concurrency:t.concurrency}),o={};for(let{pkg:e,dependencies:t}of a){o[e]=t;let n=Gx(o,e);n.isCircular&&delete o[e][n.offendingPackage]}return await t.cacher?.save(),t.cacher?.log(!0),o}function qx(e,t){let n={};for(let r of t)n[r]=e[r];return n}function Jx(e,t){let n={};for(let[r,i]of Object.entries(e??{})){let e=r;t(i,e)&&(n[e]=i)}return n}var Yx=[`latest`,`newest`,`greatest`,`minor`,`patch`,`semver`];Vx();async function Xx(e,t={}){let n=jn(t.color),r=Object.keys(e),i=Fx(t,t.packageManager),a;!t.json&&t.loglevel!==`silent`&&t.loglevel!==`verbose`&&r.length>0&&(a=new Wx.default(`[:bar] :current/:total :percent`,{total:r.length,width:20}),a.render());async function o(r){let o=Pr(e[r]),[s,c]=o||[r,e[r]];if(qn(c))return a?.tick(),{version:null};let l=t.target||`latest`,u=typeof l==`string`?l:l(s,(0,$n.parseRange)(c)),[d,f]=u.startsWith(`@`)?[`distTag`,u.slice(1)]:[u,`latest`];if(!t.cooldown){let e=t.cacher?.get(s,d);if(e?.version&&(e?.time||!t.format?.includes(`time`)))return a?.tick(),e}let p,m=Lr(e[r]),h=m?Tx.gitTags:i,g=m?`github urls`:t.packageManager||`npm`,_=h[d];if(!_){let e=Yx.filter(e=>e in h);up(t,n.red(`\nUnsupported target "${d}" using ${g}`)+`
642
642
  Supported version targets are: `+e.join(`, `)+(m?``:`, and tags (e.g. @next)`),{color:!1})}try{try{p=await _(s,c,{...t,distTag:f,pre:t.pre==null?u.startsWith(`@`)||Tr(c):t.pre,retry:t.retry??2})}catch(e){p={error:e?.body?.error||e.toString()}}p.version=!m&&o&&p?.version?Nr(s,p.version):p?.version??null}catch(e){let r=e?(e.message||e).toString():``;if(r.match(/E504|Gateway Timeout/i))return{error:`${r}. All ${t.retry} retry attempts failed.`};if(r.match(/E400|E404|ENOTFOUND|404 Not Found|400 Bad Request/i))return{error:`${r.replace(/ - Not found$/i,``)}. All ${t.retry} retry attempts failed. Either your internet connection is down, the registry is inaccessible, the authentication credentials are invalid, or the package does not exist.`};if(e.code===`ERR_INVALID_URL`)return{error:r||`Invalid URL`};throw!process.env.NCU_TESTS&&/(Response|network) timeout/i.test(r)&&console.error(`
643
643
 
644
644
  `+n.red(`FetchError: Request Timeout. npm-registry-fetch defaults to 30000 (30 seconds). Try setting the --timeout option (in milliseconds) to override this.`)+`
645
- `),e}return a?.tick(),p.version&&t.cacher?.set(s,d,p.version,p.time),p}let s=await Vx(r,o,{concurrency:t.concurrency});return await t.cacher?.save(),t.cacher?.log(),Dn(s,(e,t)=>e.version||e.error||e.cooldownInfo?{[r[t]]:e}:null)}function $x(e){if(Object.keys(e).length===0)return null;let t=Object.values(e).reduce((e,t)=>{let n=or.find(e=>t&&t.includes(e));return n!==void 0&&(e[n]||=[],e[n].push(t)),e},{}),n=tr(Object.entries(t).map(([e,t])=>({wildcard:e,instances:t})),e=>-e.instances.length);return n.length>0?n[0].wildcard:null}function eS(e,t,{downgrade:n}={}){if(!q.validRange(e)||mr(e))return!1;let[r]=$n.default.parseRange(e);if(!r)throw Error(`"${e}" could not be parsed by semver-utils. This is probably a bug. Please file an issue at https://github.com/raineorshine/npm-check-updates.`);let i=jr(t),a=ur(r),o=!!q.validRange(a),s=!!q.valid(i);return o&&s&&(!br(i,a)||!q.satisfies(i,r.operator===`<`?e:a)&&(n||!q.ltr(i,a)))}function tS(e,t,n={}){let r=n.target||`latest`;e=Pn(e,(e,t)=>!!t);let i=$x(e)||`^`,a=(e,t)=>zr(e,t,{wildcard:i,removeRange:n.removeRange});return[e=>Xx(e,(e,n)=>n in t),e=>Object.entries(e).reduce((e,[n,r])=>{let i=t[n],a=null,o=null;if(Fr(r)&&(a=Pr(r)[1]),Fr(i)&&(o=Pr(i)[1]),Lr(r)){let[e]=(0,$n.parseRange)(Rr(r));a=ur(e)}if(Lr(i)){let[e]=(0,$n.parseRange)(Rr(i));o=ur(e)}return e[n]={current:r,currentParsed:a,latest:i,latestParsed:o},e},{}),e=>Xx(e,({current:e,currentParsed:t,latest:n,latestParsed:i},a)=>{let o=Tr(e)&&(typeof r==`string`?r:r(a,(0,$n.parseRange)(e))).startsWith(`@`);return eS(t||e,i||n,{downgrade:o})}),e=>Object.entries(e).reduce((e,[t,{current:n,currentParsed:r,latest:i,latestParsed:o}])=>{let s=a(r||n,o||i);return e[t]=Fr(n)?Ir(n,s):Lr(n)?Vr(n,s):s,e},{})].reduce((e,t)=>t(e),e)}var nS=(e,t,n)=>{let r={...e,...t},i=Xx(t,(e,t)=>{let i=n[t];return i?Object.entries(i).every(([e,t])=>r[e]===void 0||!(0,q.validRange)(t)||!(0,q.validRange)(r[e])||(0,q.intersects)(r[e],t)):!0}),a=Object.keys(t).length>Object.keys(i).length,o=n;return a&&(o=Xx(n,(e,n)=>i[n]||!t[n])),{violated:a,filteredUpgradedDependencies:i,upgradedPeerDependencies:o}};async function rS(e,t){let n=await Qx(e,t),r=Dn(n,(n,r)=>r?.version&&(!t.filterResults||t.filterResults(n,{currentVersion:e[n],currentVersionSemver:(0,$n.parseRange)(e[n]),upgradedVersion:r.version,upgradedVersionSemver:(0,$n.parse)(r.version)}))?{[n]:r.version}:null),i=Xx(tS(e,r,t),(n,i)=>!t.jsonUpgraded||!t.minimal||!(0,q.satisfies)(r[i],e[i])),a=Xx(r,(e,t)=>i[t]),o=[i,n,t.peerDependencies];if(!t.peer||Object.keys(a).length===0)return o;if(t.peer&&Object.keys(a).length>0){let r=await Jx(a,t),s;if((0,w.isDeepStrictEqual)(t.peerDependencies,{...t.peerDependencies,...r})){if(s=nS(e,i,t.peerDependencies),!s.violated)return o}else s={violated:!1,filteredUpgradedDependencies:i,upgradedPeerDependencies:r};let c=0;do{if(c++>6)throw Error(`Stuck in a while loop. Please report an issue`);let r={...t.peerDependencies,...s.upgradedPeerDependencies};if((0,w.isDeepStrictEqual)(t.peerDependencies,r))return[{},n,t.peerDependencies];let[i,a,l]=await rS({...e,...s.filteredUpgradedDependencies},{...t,peerDependencies:r,loglevel:`silent`});o=[{...s.filteredUpgradedDependencies,...i},{...n,...a},l],s=nS(e,o[0],o[2])}while(s.violated)}return o}async function iS(e){Y(e,`
645
+ `),e}return a?.tick(),p.version&&t.cacher?.set(s,d,p.version,p.time),p}let s=await zx(r,o,{concurrency:t.concurrency});return await t.cacher?.save(),t.cacher?.log(),Dn(s,(e,t)=>e.version||e.error||e.cooldownInfo?{[r[t]]:e}:null)}function Zx(e){if(Object.keys(e).length===0)return null;let t=Object.values(e).reduce((e,t)=>{let n=or.find(e=>t&&t.includes(e));return n!==void 0&&(e[n]||=[],e[n].push(t)),e},{}),n=tr(Object.entries(t).map(([e,t])=>({wildcard:e,instances:t})),e=>-e.instances.length);return n.length>0?n[0].wildcard:null}function Qx(e,t,{downgrade:n}={}){if(!q.validRange(e)||mr(e))return!1;let[r]=$n.default.parseRange(e);if(!r)throw Error(`"${e}" could not be parsed by semver-utils. This is probably a bug. Please file an issue at https://github.com/raineorshine/npm-check-updates.`);let i=jr(t),a=ur(r),o=!!q.validRange(a),s=!!q.valid(i);return o&&s&&(!br(i,a)||!q.satisfies(i,r.operator===`<`?e:a)&&(n||!q.ltr(i,a)))}function $x(e,t,n={}){let r=n.target||`latest`;e=Pn(e,(e,t)=>!!t);let i=Zx(e)||`^`,a=(e,t)=>zr(e,t,{wildcard:i,removeRange:n.removeRange});return[e=>Jx(e,(e,n)=>n in t),e=>Object.entries(e).reduce((e,[n,r])=>{let i=t[n],a=null,o=null;if(Fr(r)&&(a=Pr(r)[1]),Fr(i)&&(o=Pr(i)[1]),Lr(r)){let[e]=(0,$n.parseRange)(Rr(r));a=ur(e)}if(Lr(i)){let[e]=(0,$n.parseRange)(Rr(i));o=ur(e)}return e[n]={current:r,currentParsed:a,latest:i,latestParsed:o},e},{}),e=>Jx(e,({current:e,currentParsed:t,latest:n,latestParsed:i},a)=>{let o=Tr(e)&&(typeof r==`string`?r:r(a,(0,$n.parseRange)(e))).startsWith(`@`);return Qx(t||e,i||n,{downgrade:o})}),e=>Object.entries(e).reduce((e,[t,{current:n,currentParsed:r,latest:i,latestParsed:o}])=>{let s=a(r||n,o||i);return e[t]=Fr(n)?Ir(n,s):Lr(n)?Vr(n,s):s,e},{})].reduce((e,t)=>t(e),e)}var eS=(e,t,n)=>{let r={...e,...t},i=Jx(t,(e,t)=>{let i=n[t];return i?Object.entries(i).every(([e,t])=>r[e]===void 0||!(0,q.validRange)(t)||!(0,q.validRange)(r[e])||(0,q.intersects)(r[e],t)):!0}),a=Object.keys(t).length>Object.keys(i).length,o=n;return a&&(o=Jx(n,(e,n)=>i[n]||!t[n])),{violated:a,filteredUpgradedDependencies:i,upgradedPeerDependencies:o}};async function tS(e,t){let n=await Xx(e,t),r=Dn(n,(n,r)=>r?.version&&(!t.filterResults||t.filterResults(n,{currentVersion:e[n],currentVersionSemver:(0,$n.parseRange)(e[n]),upgradedVersion:r.version,upgradedVersionSemver:(0,$n.parse)(r.version)}))?{[n]:r.version}:null),i=Jx($x(e,r,t),(n,i)=>!t.jsonUpgraded||!t.minimal||!(0,q.satisfies)(r[i],e[i])),a=Jx(r,(e,t)=>i[t]),o=[i,n,t.peerDependencies];if(!t.peer||Object.keys(a).length===0)return o;if(t.peer&&Object.keys(a).length>0){let r=await Kx(a,t),s;if((0,w.isDeepStrictEqual)(t.peerDependencies,{...t.peerDependencies,...r})){if(s=eS(e,i,t.peerDependencies),!s.violated)return o}else s={violated:!1,filteredUpgradedDependencies:i,upgradedPeerDependencies:r};let c=0;do{if(c++>6)throw Error(`Stuck in a while loop. Please report an issue`);let r={...t.peerDependencies,...s.upgradedPeerDependencies};if((0,w.isDeepStrictEqual)(t.peerDependencies,r))return[{},n,t.peerDependencies];let[i,a,l]=await tS({...e,...s.filteredUpgradedDependencies},{...t,peerDependencies:r,loglevel:`silent`});o=[{...s.filteredUpgradedDependencies,...i},{...n,...a},l],s=eS(e,o[0],o[2])}while(s.violated)}return o}async function nS(e){Y(e,`
646
646
  Options:`,`verbose`),Kr(e,e,`verbose`),Y(e,`
647
- Getting installed packages`,`verbose`);let t={};try{let{cli:n,cwd:r,filter:i,filterVersion:a,global:o,packageManager:s,prefix:c,reject:l,rejectVersion:u}=e;t=await Rx({cli:n,cwd:r,filter:i,filterVersion:a,global:o,packageManager:s,prefix:c,reject:l,rejectVersion:u})}catch(t){up(e,t.message)}Y(e,`globalPackages:`,`verbose`),Y(e,t,`verbose`),Y(e,``,`verbose`),Y(e,`Fetching ${e.target} versions`,`verbose`);let[n,r]=await rS(t,e);Y(e,r,`verbose`);let i=Dn(r,(e,t)=>{let n=t.time??t.cooldownInfo?.currentVersionTime;return n?{[e]:n}:null}),a=Dn(r,(e,t)=>t.cooldownInfo?{[e]:t.cooldownInfo}:null),o=Object.values(a).length,s=Object.keys(n);await ei(e,{current:t,upgraded:n,skippedByCooldown:a,latest:r,numCooldown:o,total:s.length,time:i});let c=n?s.map(e=>zx(e+`@`+n[e])).join(` `):`[package]`;if(e.json)Wr(e,n);else if(c.length){let t=e.packageManager===`yarn`?`yarn global upgrade`:e.packageManager===`pnpm`?`pnpm -g add`:e.packageManager===`bun`?`bun add -g`:`npm -g install`;Y(e,`
647
+ Getting installed packages`,`verbose`);let t={};try{let{cli:n,cwd:r,filter:i,filterVersion:a,global:o,packageManager:s,prefix:c,reject:l,rejectVersion:u}=e;t=await Ix({cli:n,cwd:r,filter:i,filterVersion:a,global:o,packageManager:s,prefix:c,reject:l,rejectVersion:u})}catch(t){up(e,t.message)}Y(e,`globalPackages:`,`verbose`),Y(e,t,`verbose`),Y(e,``,`verbose`),Y(e,`Fetching ${e.target} versions`,`verbose`);let[n,r]=await tS(t,e);Y(e,r,`verbose`);let i=Dn(r,(e,t)=>{let n=t.time??t.cooldownInfo?.currentVersionTime;return n?{[e]:n}:null}),a=Dn(r,(e,t)=>t.cooldownInfo?{[e]:t.cooldownInfo}:null),o=Object.values(a).length,s=Object.keys(n);await ei(e,{current:t,upgraded:n,skippedByCooldown:a,latest:r,numCooldown:o,total:s.length,time:i});let c=n?s.map(e=>Lx(e+`@`+n[e])).join(` `):`[package]`;if(e.json)Wr(e,n);else if(c.length){let t=e.packageManager===`yarn`?`yarn global upgrade`:e.packageManager===`pnpm`?`pnpm -g add`:e.packageManager===`bun`?`bun add -g`:`npm -g install`;Y(e,`
648
648
  `+J.cyan(`ncu`)+` itself cannot upgrade global packages. Run the following to upgrade all global packages:
649
649
 
650
650
  `+J.cyan(`${t} `+c)+`
651
- `)}return e.cli&&e.errorLevel===2&&s.length>0&&process.exit(1),n}var aS=(e,t)=>q.validRange(e)&&q.validRange(t)&&q.gt(q.minVersion(e),q.minVersion(t)),oS=e=>{if(!e.packageManager)return{};let[t,n]=e.packageManager.split(`@`);return{[t]:n}};function sS(e={},t={}){let n=vy(t.dep).reduce((t,n)=>({...t,...n===`packageManager`?oS(e):Pn(e[n]||{},(e,n)=>!aS(n,t[e]))}),{}),r=Dn(t.workspacePackages||[]),i={};try{i=Pn(Pn(n,e=>!r[e]),Ix(t.filter||null,t.reject||null,t.filterVersion||null,t.rejectVersion||null))}catch(e){up(t,`Invalid filter: `+e.message||e)}return i}async function cS(e,t){let n=Lx(t,t.packageManager);if(!n.getEngines)return{};let r=Object.keys(e).length,i;return!t.json&&t.loglevel!==`silent`&&t.loglevel!==`verbose`&&r>0&&(i=new Kx.default(`[:bar] :current/:total :percent`,{total:r,width:20}),i.render()),Object.entries(e).reduce(async(e,[r,a])=>{let o=(await n.getEngines(r,a,t)).node;return i&&i.tick(),{...await e,[r]:o}},Promise.resolve({}))}var lS=(e,t)=>!e||(0,q.satisfies)(t,e);async function uS(e,t,n={}){if(!n.nodeEngineVersion)return{};let r=(0,q.minVersion)(n.nodeEngineVersion)?.version;if(!r)return{};let[i,a]=await rS(e,{...n,enginesNode:!1,nodeEngineVersion:void 0,loglevel:`silent`}),o=await cS(Dn(a,(e,t)=>i[e]&&t?.version?{[e]:t.version}:null),n);return Object.entries(i).filter(([e,n])=>t[e]!==n&&!lS(o[e],r)).reduce((t,[n,r])=>({...t,[n]:{from:e[n],to:r,enginesNode:o[n]}}),{})}async function dS(e,t,n,r={}){let i={...e,...t},[a,o]=await rS(e,{...r,peer:!1,peerDependencies:void 0,loglevel:`silent`}),s=await Jx(Object.fromEntries(Object.entries(a).map(([e,t])=>[e,(0,q.validRange)(t)?(0,q.minVersion)(t)?.version??t:t])),r);return Object.entries(a).filter(([e,n])=>t[e]!==n).reduce((t,[r,a])=>{let c=Object.entries(n).filter(([,e])=>e[r]!==void 0&&o[r]?.version&&!(0,q.satisfies)(o[r].version,e[r])).reduce((e,[t,n])=>({...e,[t]:(0,q.validRange)(n[r])?n[r]:`a range that semver does not understand: ${n[r]}. This range does not work with semver.satisfies or semver.intersects, which npm-check-updates relies on to determine peer dependency compatibility. Either this is a mistake in ${t}, or it relies on a new syntax that is not compatible with the semver package.`}),{});if(Object.keys(c).length===0){let e=s?.[r]||{};c=Object.entries(e).filter(([e,t])=>i[e]&&!!(0,q.validRange)(i[e])&&!(!(0,q.validRange)(t)||(0,q.intersects)(i[e],t))).reduce((e,[t,n])=>({...e,[r]:`${t} ${n}`}),{})}return{...t,[r]:{from:e[r],to:a,reason:c}}},{})}function fS(e,t=!1){let n=e.length,r=0,i=``,a=0,o=16,s=0,c=0,l=0,u=0,d=0;function f(t,n){let i=0,a=0;for(;i<t||!n;){let t=e.charCodeAt(r);if(t>=48&&t<=57)a=a*16+t-48;else if(t>=65&&t<=70)a=a*16+t-65+10;else if(t>=97&&t<=102)a=a*16+t-97+10;else break;r++,i++}return i<t&&(a=-1),a}function p(e){r=e,i=``,a=0,o=16,d=0}function m(){let t=r;if(e.charCodeAt(r)===48)r++;else for(r++;r<e.length&&hS(e.charCodeAt(r));)r++;if(r<e.length&&e.charCodeAt(r)===46)if(r++,r<e.length&&hS(e.charCodeAt(r)))for(r++;r<e.length&&hS(e.charCodeAt(r));)r++;else return d=3,e.substring(t,r);let n=r;if(r<e.length&&(e.charCodeAt(r)===69||e.charCodeAt(r)===101))if(r++,(r<e.length&&e.charCodeAt(r)===43||e.charCodeAt(r)===45)&&r++,r<e.length&&hS(e.charCodeAt(r))){for(r++;r<e.length&&hS(e.charCodeAt(r));)r++;n=r}else d=3;return e.substring(t,n)}function h(){let t=``,i=r;for(;;){if(r>=n){t+=e.substring(i,r),d=2;break}let a=e.charCodeAt(r);if(a===34){t+=e.substring(i,r),r++;break}if(a===92){if(t+=e.substring(i,r),r++,r>=n){d=2;break}switch(e.charCodeAt(r++)){case 34:t+=`"`;break;case 92:t+=`\\`;break;case 47:t+=`/`;break;case 98:t+=`\b`;break;case 102:t+=`\f`;break;case 110:t+=`
652
- `;break;case 114:t+=`\r`;break;case 116:t+=` `;break;case 117:let e=f(4,!0);e>=0?t+=String.fromCharCode(e):d=4;break;default:d=5}i=r;continue}if(a>=0&&a<=31)if(mS(a)){t+=e.substring(i,r),d=2;break}else d=6;r++}return t}function g(){if(i=``,d=0,a=r,c=s,u=l,r>=n)return a=n,o=17;let t=e.charCodeAt(r);if(pS(t)){do r++,i+=String.fromCharCode(t),t=e.charCodeAt(r);while(pS(t));return o=15}if(mS(t))return r++,i+=String.fromCharCode(t),t===13&&e.charCodeAt(r)===10&&(r++,i+=`
653
- `),s++,l=r,o=14;switch(t){case 123:return r++,o=1;case 125:return r++,o=2;case 91:return r++,o=3;case 93:return r++,o=4;case 58:return r++,o=6;case 44:return r++,o=5;case 34:return r++,i=h(),o=10;case 47:let c=r-1;if(e.charCodeAt(r+1)===47){for(r+=2;r<n&&!mS(e.charCodeAt(r));)r++;return i=e.substring(c,r),o=12}if(e.charCodeAt(r+1)===42){r+=2;let t=n-1,a=!1;for(;r<t;){let t=e.charCodeAt(r);if(t===42&&e.charCodeAt(r+1)===47){r+=2,a=!0;break}r++,mS(t)&&(t===13&&e.charCodeAt(r)===10&&r++,s++,l=r)}return a||(r++,d=1),i=e.substring(c,r),o=13}return i+=String.fromCharCode(t),r++,o=16;case 45:if(i+=String.fromCharCode(t),r++,r===n||!hS(e.charCodeAt(r)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=m(),o=11;default:for(;r<n&&_(t);)r++,t=e.charCodeAt(r);if(a!==r){switch(i=e.substring(a,r),i){case`true`:return o=8;case`false`:return o=9;case`null`:return o=7}return o=16}return i+=String.fromCharCode(t),r++,o=16}}function _(e){if(pS(e)||mS(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function v(){let e;do e=g();while(e>=12&&e<=15);return e}return{setPosition:p,getPosition:()=>r,scan:t?v:g,getToken:()=>o,getTokenValue:()=>i,getTokenOffset:()=>a,getTokenLength:()=>r-a,getTokenStartLine:()=>c,getTokenStartCharacter:()=>a-u,getTokenError:()=>d}}function pS(e){return e===32||e===9}function mS(e){return e===10||e===13}function hS(e){return e>=48&&e<=57}var gS;(function(e){e[e.lineFeed=10]=`lineFeed`,e[e.carriageReturn=13]=`carriageReturn`,e[e.space=32]=`space`,e[e._0=48]=`_0`,e[e._1=49]=`_1`,e[e._2=50]=`_2`,e[e._3=51]=`_3`,e[e._4=52]=`_4`,e[e._5=53]=`_5`,e[e._6=54]=`_6`,e[e._7=55]=`_7`,e[e._8=56]=`_8`,e[e._9=57]=`_9`,e[e.a=97]=`a`,e[e.b=98]=`b`,e[e.c=99]=`c`,e[e.d=100]=`d`,e[e.e=101]=`e`,e[e.f=102]=`f`,e[e.g=103]=`g`,e[e.h=104]=`h`,e[e.i=105]=`i`,e[e.j=106]=`j`,e[e.k=107]=`k`,e[e.l=108]=`l`,e[e.m=109]=`m`,e[e.n=110]=`n`,e[e.o=111]=`o`,e[e.p=112]=`p`,e[e.q=113]=`q`,e[e.r=114]=`r`,e[e.s=115]=`s`,e[e.t=116]=`t`,e[e.u=117]=`u`,e[e.v=118]=`v`,e[e.w=119]=`w`,e[e.x=120]=`x`,e[e.y=121]=`y`,e[e.z=122]=`z`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.asterisk=42]=`asterisk`,e[e.backslash=92]=`backslash`,e[e.closeBrace=125]=`closeBrace`,e[e.closeBracket=93]=`closeBracket`,e[e.colon=58]=`colon`,e[e.comma=44]=`comma`,e[e.dot=46]=`dot`,e[e.doubleQuote=34]=`doubleQuote`,e[e.minus=45]=`minus`,e[e.openBrace=123]=`openBrace`,e[e.openBracket=91]=`openBracket`,e[e.plus=43]=`plus`,e[e.slash=47]=`slash`,e[e.formFeed=12]=`formFeed`,e[e.tab=9]=`tab`})(gS||={}),Array(20).fill(0).map((e,t)=>` `.repeat(t));var _S=200;Array(_S).fill(0).map((e,t)=>`
654
- `+` `.repeat(t)),Array(_S).fill(0).map((e,t)=>`\r`+` `.repeat(t)),Array(_S).fill(0).map((e,t)=>`\r
655
- `+` `.repeat(t)),Array(_S).fill(0).map((e,t)=>`
656
- `+` `.repeat(t)),Array(_S).fill(0).map((e,t)=>`\r`+` `.repeat(t)),Array(_S).fill(0).map((e,t)=>`\r
657
- `+` `.repeat(t));var vS;(function(e){e.DEFAULT={allowTrailingComma:!1}})(vS||={});function yS(e,t=[],n=vS.DEFAULT){let r=null,i=[],a=[];function o(e){Array.isArray(i)?i.push(e):r!==null&&(i[r]=e)}return bS(e,{onObjectBegin:()=>{let e={};o(e),a.push(i),i=e,r=null},onObjectProperty:e=>{r=e},onObjectEnd:()=>{i=a.pop()},onArrayBegin:()=>{let e=[];o(e),a.push(i),i=e,r=null},onArrayEnd:()=>{i=a.pop()},onLiteralValue:o,onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}},n),i[0]}function bS(e,t,n=vS.DEFAULT){let r=fS(e,!1),i=[],a=0;function o(e){return e?()=>a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function s(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function c(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice()):()=>!0}function l(e){return e?()=>{a>0?a++:e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice())===!1&&(a=1)}:()=>!0}function u(e){return e?()=>{a>0&&a--,a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter())}:()=>!0}let d=l(t.onObjectBegin),f=c(t.onObjectProperty),p=u(t.onObjectEnd),m=l(t.onArrayBegin),h=u(t.onArrayEnd),g=c(t.onLiteralValue),_=s(t.onSeparator),v=o(t.onComment),y=s(t.onError),b=n&&n.disallowComments,x=n&&n.allowTrailingComma;function S(){for(;;){let e=r.scan();switch(r.getTokenError()){case 4:C(14);break;case 5:C(15);break;case 3:C(13);break;case 1:b||C(11);break;case 2:C(12);break;case 6:C(16);break}switch(e){case 12:case 13:b?C(10):v();break;case 16:C(1);break;case 15:case 14:break;default:return e}}}function C(e,t=[],n=[]){if(y(e),t.length+n.length>0){let e=r.getToken();for(;e!==17;){if(t.indexOf(e)!==-1){S();break}else if(n.indexOf(e)!==-1)break;e=S()}}}function w(e){let t=r.getTokenValue();return e?g(t):(f(t),i.push(t)),S(),!0}function T(){switch(r.getToken()){case 11:let e=r.getTokenValue(),t=Number(e);isNaN(t)&&(C(2),t=0),g(t);break;case 7:g(null);break;case 8:g(!0);break;case 9:g(!1);break;default:return!1}return S(),!0}function E(){return r.getToken()===10?(w(!1),r.getToken()===6?(_(`:`),S(),k()||C(4,[],[2,5])):C(5,[],[2,5]),i.pop(),!0):(C(3,[],[2,5]),!1)}function D(){d(),S();let e=!1;for(;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if(e||C(4,[],[]),_(`,`),S(),r.getToken()===2&&x)break}else e&&C(6,[],[]);E()||C(4,[],[2,5]),e=!0}return p(),r.getToken()===2?S():C(7,[2],[]),!0}function O(){m(),S();let e=!0,t=!1;for(;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if(t||C(4,[],[]),_(`,`),S(),r.getToken()===4&&x)break}else t&&C(6,[],[]);e?(i.push(0),e=!1):i[i.length-1]++,k()||C(4,[],[4,5]),t=!0}return h(),e||i.pop(),r.getToken()===4?S():C(8,[4],[]),!0}function k(){switch(r.getToken()){case 3:return O();case 1:return D();case 10:return w(!0);default:return T()}}return S(),r.getToken()===17?n.allowEmptyContent?!0:(C(4,[],[]),!1):k()?(r.getToken()!==17&&C(9,[],[]),!0):(C(4,[],[]),!1)}function xS(e,t){let n=fS(e),r=[],i,a=0,o;do switch(o=n.getPosition(),i=n.scan(),i){case 12:case 13:case 17:a!==o&&r.push(e.substring(a,o)),t!==void 0&&r.push(n.getTokenValue().replace(/[^\r\n]/g,t)),a=n.getPosition();break}while(i!==17);return r.join(``)}var SS;(function(e){e[e.None=0]=`None`,e[e.UnexpectedEndOfComment=1]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=2]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=3]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=4]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=5]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=6]=`InvalidCharacter`})(SS||={});var CS;(function(e){e[e.OpenBraceToken=1]=`OpenBraceToken`,e[e.CloseBraceToken=2]=`CloseBraceToken`,e[e.OpenBracketToken=3]=`OpenBracketToken`,e[e.CloseBracketToken=4]=`CloseBracketToken`,e[e.CommaToken=5]=`CommaToken`,e[e.ColonToken=6]=`ColonToken`,e[e.NullKeyword=7]=`NullKeyword`,e[e.TrueKeyword=8]=`TrueKeyword`,e[e.FalseKeyword=9]=`FalseKeyword`,e[e.StringLiteral=10]=`StringLiteral`,e[e.NumericLiteral=11]=`NumericLiteral`,e[e.LineCommentTrivia=12]=`LineCommentTrivia`,e[e.BlockCommentTrivia=13]=`BlockCommentTrivia`,e[e.LineBreakTrivia=14]=`LineBreakTrivia`,e[e.Trivia=15]=`Trivia`,e[e.Unknown=16]=`Unknown`,e[e.EOF=17]=`EOF`})(CS||={});var wS=yS,TS=xS,ES;(function(e){e[e.InvalidSymbol=1]=`InvalidSymbol`,e[e.InvalidNumberFormat=2]=`InvalidNumberFormat`,e[e.PropertyNameExpected=3]=`PropertyNameExpected`,e[e.ValueExpected=4]=`ValueExpected`,e[e.ColonExpected=5]=`ColonExpected`,e[e.CommaExpected=6]=`CommaExpected`,e[e.CloseBraceExpected=7]=`CloseBraceExpected`,e[e.CloseBracketExpected=8]=`CloseBracketExpected`,e[e.EndOfFileExpected=9]=`EndOfFileExpected`,e[e.InvalidCommentToken=10]=`InvalidCommentToken`,e[e.UnexpectedEndOfComment=11]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=12]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=13]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=14]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=15]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=16]=`InvalidCharacter`})(ES||={});var DS=process.stdout.columns||80;function OS(e){return`${e.length?e.slice(0,Math.min(e.length,DS)):`<empty>`}\n`}function kS(e){return e>DS?``:`${` `.repeat(e-1)}^\n`}function AS(e,t,n){let r=e.length;if(r===0)return`<empty>`;if(r===1)return`${OS(e[0])}${kS(n)}`;let i=Math.min(t+2,r),a=``;for(let r=Math.max(t-2,1);r<=i;r++)a+=OS(e[r-1]),r===t&&(a+=kS(n));return`${a}\n`}function jS(e){e=TS(e);try{return JSON.parse(e)}catch{let t=[],n=wS(e,t);if(t.length===0)return n;let r=``,i=e.split(`
658
- `);for(let e of t){let t=e.offset,n=1,a=1,o=0;for(let e of i){if(o+e.length>=t){a=t-o+1;break}o+=e.length+1,n++}r+=`Error at line ${n}, column ${a}: ${ES[e.error]}\n${AS(i,n,a)}\n`}throw SyntaxError(r)}}var MS=`
651
+ `)}return e.cli&&e.errorLevel===2&&s.length>0&&process.exit(1),n}var rS=(e,t)=>q.validRange(e)&&q.validRange(t)&&q.gt(q.minVersion(e),q.minVersion(t)),iS=e=>{if(!e.packageManager)return{};let[t,n]=e.packageManager.split(`@`);return{[t]:n}};function aS(e={},t={}){let n=vy(t.dep).reduce((t,n)=>({...t,...n===`packageManager`?iS(e):Pn(e[n]||{},(e,n)=>!rS(n,t[e]))}),{}),r=Dn(t.workspacePackages||[]),i={};try{i=Pn(Pn(n,e=>!r[e]),Px(t.filter||null,t.reject||null,t.filterVersion||null,t.rejectVersion||null))}catch(e){up(t,`Invalid filter: `+e.message||e)}return i}async function oS(e,t){let n=Fx(t,t.packageManager);if(!n.getEngines)return{};let r=Object.keys(e).length,i;!t.json&&t.loglevel!==`silent`&&t.loglevel!==`verbose`&&r>0&&(i=new Wx.default(`[:bar] :current/:total :percent`,{total:r,width:20}),i.render());let a={};for(let[r,o]of Object.entries(e)){let e=(await n.getEngines(r,o,t)).node;i&&i.tick(),a[r]=e}return a}var sS=(e,t)=>!e||(0,q.satisfies)(t,e);async function cS(e,t,n={}){if(!n.nodeEngineVersion)return{};let r=(0,q.minVersion)(n.nodeEngineVersion)?.version;if(!r)return{};let[i,a]=await tS(e,{...n,enginesNode:!1,nodeEngineVersion:void 0,loglevel:`silent`}),o=await oS(Dn(a,(e,t)=>i[e]&&t?.version?{[e]:t.version}:null),n),s={};for(let[n,a]of Object.entries(i))t[n]===a||sS(o[n],r)||(s[n]={from:e[n],to:a,enginesNode:o[n]});return s}async function lS(e,t,n,r={}){let i={...e,...t},[a,o]=await tS(e,{...r,peer:!1,peerDependencies:void 0,loglevel:`silent`}),s=await Kx(Object.fromEntries(Object.entries(a).map(([e,t])=>[e,(0,q.validRange)(t)?(0,q.minVersion)(t)?.version??t:t])),r),c={};for(let[r,l]of Object.entries(a)){if(t[r]===l)continue;let a={};for(let[e,t]of Object.entries(n))t[r]!==void 0&&o[r]?.version&&!(0,q.satisfies)(o[r].version,t[r])&&(a[e]=(0,q.validRange)(t[r])?t[r]:`a range that semver does not understand: ${t[r]}. This range does not work with semver.satisfies or semver.intersects, which npm-check-updates relies on to determine peer dependency compatibility. Either this is a mistake in ${e}, or it relies on a new syntax that is not compatible with the semver package.`);if(Object.keys(a).length===0){let e=s?.[r]||{};for(let[t,n]of Object.entries(e))i[t]&&(0,q.validRange)(i[t])&&!(!(0,q.validRange)(n)||(0,q.intersects)(i[t],n))&&(a[r]=`${t} ${n}`)}c[r]={from:e[r],to:l,reason:a}}return c}function uS(e,t=!1){let n=e.length,r=0,i=``,a=0,o=16,s=0,c=0,l=0,u=0,d=0;function f(t,n){let i=0,a=0;for(;i<t||!n;){let t=e.charCodeAt(r);if(t>=48&&t<=57)a=a*16+t-48;else if(t>=65&&t<=70)a=a*16+t-65+10;else if(t>=97&&t<=102)a=a*16+t-97+10;else break;r++,i++}return i<t&&(a=-1),a}function p(e){r=e,i=``,a=0,o=16,d=0}function m(){let t=r;if(e.charCodeAt(r)===48)r++;else for(r++;r<e.length&&pS(e.charCodeAt(r));)r++;if(r<e.length&&e.charCodeAt(r)===46)if(r++,r<e.length&&pS(e.charCodeAt(r)))for(r++;r<e.length&&pS(e.charCodeAt(r));)r++;else return d=3,e.substring(t,r);let n=r;if(r<e.length&&(e.charCodeAt(r)===69||e.charCodeAt(r)===101))if(r++,(r<e.length&&e.charCodeAt(r)===43||e.charCodeAt(r)===45)&&r++,r<e.length&&pS(e.charCodeAt(r))){for(r++;r<e.length&&pS(e.charCodeAt(r));)r++;n=r}else d=3;return e.substring(t,n)}function h(){let t=``,i=r;for(;;){if(r>=n){t+=e.substring(i,r),d=2;break}let a=e.charCodeAt(r);if(a===34){t+=e.substring(i,r),r++;break}if(a===92){if(t+=e.substring(i,r),r++,r>=n){d=2;break}switch(e.charCodeAt(r++)){case 34:t+=`"`;break;case 92:t+=`\\`;break;case 47:t+=`/`;break;case 98:t+=`\b`;break;case 102:t+=`\f`;break;case 110:t+=`
652
+ `;break;case 114:t+=`\r`;break;case 116:t+=` `;break;case 117:let e=f(4,!0);e>=0?t+=String.fromCharCode(e):d=4;break;default:d=5}i=r;continue}if(a>=0&&a<=31)if(fS(a)){t+=e.substring(i,r),d=2;break}else d=6;r++}return t}function g(){if(i=``,d=0,a=r,c=s,u=l,r>=n)return a=n,o=17;let t=e.charCodeAt(r);if(dS(t)){do r++,i+=String.fromCharCode(t),t=e.charCodeAt(r);while(dS(t));return o=15}if(fS(t))return r++,i+=String.fromCharCode(t),t===13&&e.charCodeAt(r)===10&&(r++,i+=`
653
+ `),s++,l=r,o=14;switch(t){case 123:return r++,o=1;case 125:return r++,o=2;case 91:return r++,o=3;case 93:return r++,o=4;case 58:return r++,o=6;case 44:return r++,o=5;case 34:return r++,i=h(),o=10;case 47:let c=r-1;if(e.charCodeAt(r+1)===47){for(r+=2;r<n&&!fS(e.charCodeAt(r));)r++;return i=e.substring(c,r),o=12}if(e.charCodeAt(r+1)===42){r+=2;let t=n-1,a=!1;for(;r<t;){let t=e.charCodeAt(r);if(t===42&&e.charCodeAt(r+1)===47){r+=2,a=!0;break}r++,fS(t)&&(t===13&&e.charCodeAt(r)===10&&r++,s++,l=r)}return a||(r++,d=1),i=e.substring(c,r),o=13}return i+=String.fromCharCode(t),r++,o=16;case 45:if(i+=String.fromCharCode(t),r++,r===n||!pS(e.charCodeAt(r)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=m(),o=11;default:for(;r<n&&_(t);)r++,t=e.charCodeAt(r);if(a!==r){switch(i=e.substring(a,r),i){case`true`:return o=8;case`false`:return o=9;case`null`:return o=7}return o=16}return i+=String.fromCharCode(t),r++,o=16}}function _(e){if(dS(e)||fS(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function v(){let e;do e=g();while(e>=12&&e<=15);return e}return{setPosition:p,getPosition:()=>r,scan:t?v:g,getToken:()=>o,getTokenValue:()=>i,getTokenOffset:()=>a,getTokenLength:()=>r-a,getTokenStartLine:()=>c,getTokenStartCharacter:()=>a-u,getTokenError:()=>d}}function dS(e){return e===32||e===9}function fS(e){return e===10||e===13}function pS(e){return e>=48&&e<=57}var mS;(function(e){e[e.lineFeed=10]=`lineFeed`,e[e.carriageReturn=13]=`carriageReturn`,e[e.space=32]=`space`,e[e._0=48]=`_0`,e[e._1=49]=`_1`,e[e._2=50]=`_2`,e[e._3=51]=`_3`,e[e._4=52]=`_4`,e[e._5=53]=`_5`,e[e._6=54]=`_6`,e[e._7=55]=`_7`,e[e._8=56]=`_8`,e[e._9=57]=`_9`,e[e.a=97]=`a`,e[e.b=98]=`b`,e[e.c=99]=`c`,e[e.d=100]=`d`,e[e.e=101]=`e`,e[e.f=102]=`f`,e[e.g=103]=`g`,e[e.h=104]=`h`,e[e.i=105]=`i`,e[e.j=106]=`j`,e[e.k=107]=`k`,e[e.l=108]=`l`,e[e.m=109]=`m`,e[e.n=110]=`n`,e[e.o=111]=`o`,e[e.p=112]=`p`,e[e.q=113]=`q`,e[e.r=114]=`r`,e[e.s=115]=`s`,e[e.t=116]=`t`,e[e.u=117]=`u`,e[e.v=118]=`v`,e[e.w=119]=`w`,e[e.x=120]=`x`,e[e.y=121]=`y`,e[e.z=122]=`z`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.asterisk=42]=`asterisk`,e[e.backslash=92]=`backslash`,e[e.closeBrace=125]=`closeBrace`,e[e.closeBracket=93]=`closeBracket`,e[e.colon=58]=`colon`,e[e.comma=44]=`comma`,e[e.dot=46]=`dot`,e[e.doubleQuote=34]=`doubleQuote`,e[e.minus=45]=`minus`,e[e.openBrace=123]=`openBrace`,e[e.openBracket=91]=`openBracket`,e[e.plus=43]=`plus`,e[e.slash=47]=`slash`,e[e.formFeed=12]=`formFeed`,e[e.tab=9]=`tab`})(mS||={}),Array(20).fill(0).map((e,t)=>` `.repeat(t));var hS=200;Array(hS).fill(0).map((e,t)=>`
654
+ `+` `.repeat(t)),Array(hS).fill(0).map((e,t)=>`\r`+` `.repeat(t)),Array(hS).fill(0).map((e,t)=>`\r
655
+ `+` `.repeat(t)),Array(hS).fill(0).map((e,t)=>`
656
+ `+` `.repeat(t)),Array(hS).fill(0).map((e,t)=>`\r`+` `.repeat(t)),Array(hS).fill(0).map((e,t)=>`\r
657
+ `+` `.repeat(t));var gS;(function(e){e.DEFAULT={allowTrailingComma:!1}})(gS||={});function _S(e,t=[],n=gS.DEFAULT){let r=null,i=[],a=[];function o(e){Array.isArray(i)?i.push(e):r!==null&&(i[r]=e)}return vS(e,{onObjectBegin:()=>{let e={};o(e),a.push(i),i=e,r=null},onObjectProperty:e=>{r=e},onObjectEnd:()=>{i=a.pop()},onArrayBegin:()=>{let e=[];o(e),a.push(i),i=e,r=null},onArrayEnd:()=>{i=a.pop()},onLiteralValue:o,onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}},n),i[0]}function vS(e,t,n=gS.DEFAULT){let r=uS(e,!1),i=[],a=0;function o(e){return e?()=>a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function s(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function c(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice()):()=>!0}function l(e){return e?()=>{a>0?a++:e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice())===!1&&(a=1)}:()=>!0}function u(e){return e?()=>{a>0&&a--,a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter())}:()=>!0}let d=l(t.onObjectBegin),f=c(t.onObjectProperty),p=u(t.onObjectEnd),m=l(t.onArrayBegin),h=u(t.onArrayEnd),g=c(t.onLiteralValue),_=s(t.onSeparator),v=o(t.onComment),y=s(t.onError),b=n&&n.disallowComments,x=n&&n.allowTrailingComma;function S(){for(;;){let e=r.scan();switch(r.getTokenError()){case 4:C(14);break;case 5:C(15);break;case 3:C(13);break;case 1:b||C(11);break;case 2:C(12);break;case 6:C(16);break}switch(e){case 12:case 13:b?C(10):v();break;case 16:C(1);break;case 15:case 14:break;default:return e}}}function C(e,t=[],n=[]){if(y(e),t.length+n.length>0){let e=r.getToken();for(;e!==17;){if(t.indexOf(e)!==-1){S();break}else if(n.indexOf(e)!==-1)break;e=S()}}}function w(e){let t=r.getTokenValue();return e?g(t):(f(t),i.push(t)),S(),!0}function T(){switch(r.getToken()){case 11:let e=r.getTokenValue(),t=Number(e);isNaN(t)&&(C(2),t=0),g(t);break;case 7:g(null);break;case 8:g(!0);break;case 9:g(!1);break;default:return!1}return S(),!0}function E(){return r.getToken()===10?(w(!1),r.getToken()===6?(_(`:`),S(),k()||C(4,[],[2,5])):C(5,[],[2,5]),i.pop(),!0):(C(3,[],[2,5]),!1)}function D(){d(),S();let e=!1;for(;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if(e||C(4,[],[]),_(`,`),S(),r.getToken()===2&&x)break}else e&&C(6,[],[]);E()||C(4,[],[2,5]),e=!0}return p(),r.getToken()===2?S():C(7,[2],[]),!0}function O(){m(),S();let e=!0,t=!1;for(;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if(t||C(4,[],[]),_(`,`),S(),r.getToken()===4&&x)break}else t&&C(6,[],[]);e?(i.push(0),e=!1):i[i.length-1]++,k()||C(4,[],[4,5]),t=!0}return h(),e||i.pop(),r.getToken()===4?S():C(8,[4],[]),!0}function k(){switch(r.getToken()){case 3:return O();case 1:return D();case 10:return w(!0);default:return T()}}return S(),r.getToken()===17?n.allowEmptyContent?!0:(C(4,[],[]),!1):k()?(r.getToken()!==17&&C(9,[],[]),!0):(C(4,[],[]),!1)}function yS(e,t){let n=uS(e),r=[],i,a=0,o;do switch(o=n.getPosition(),i=n.scan(),i){case 12:case 13:case 17:a!==o&&r.push(e.substring(a,o)),t!==void 0&&r.push(n.getTokenValue().replace(/[^\r\n]/g,t)),a=n.getPosition();break}while(i!==17);return r.join(``)}var bS;(function(e){e[e.None=0]=`None`,e[e.UnexpectedEndOfComment=1]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=2]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=3]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=4]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=5]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=6]=`InvalidCharacter`})(bS||={});var xS;(function(e){e[e.OpenBraceToken=1]=`OpenBraceToken`,e[e.CloseBraceToken=2]=`CloseBraceToken`,e[e.OpenBracketToken=3]=`OpenBracketToken`,e[e.CloseBracketToken=4]=`CloseBracketToken`,e[e.CommaToken=5]=`CommaToken`,e[e.ColonToken=6]=`ColonToken`,e[e.NullKeyword=7]=`NullKeyword`,e[e.TrueKeyword=8]=`TrueKeyword`,e[e.FalseKeyword=9]=`FalseKeyword`,e[e.StringLiteral=10]=`StringLiteral`,e[e.NumericLiteral=11]=`NumericLiteral`,e[e.LineCommentTrivia=12]=`LineCommentTrivia`,e[e.BlockCommentTrivia=13]=`BlockCommentTrivia`,e[e.LineBreakTrivia=14]=`LineBreakTrivia`,e[e.Trivia=15]=`Trivia`,e[e.Unknown=16]=`Unknown`,e[e.EOF=17]=`EOF`})(xS||={});var SS=_S,CS=yS,wS;(function(e){e[e.InvalidSymbol=1]=`InvalidSymbol`,e[e.InvalidNumberFormat=2]=`InvalidNumberFormat`,e[e.PropertyNameExpected=3]=`PropertyNameExpected`,e[e.ValueExpected=4]=`ValueExpected`,e[e.ColonExpected=5]=`ColonExpected`,e[e.CommaExpected=6]=`CommaExpected`,e[e.CloseBraceExpected=7]=`CloseBraceExpected`,e[e.CloseBracketExpected=8]=`CloseBracketExpected`,e[e.EndOfFileExpected=9]=`EndOfFileExpected`,e[e.InvalidCommentToken=10]=`InvalidCommentToken`,e[e.UnexpectedEndOfComment=11]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=12]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=13]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=14]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=15]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=16]=`InvalidCharacter`})(wS||={});var TS=process.stdout.columns||80;function ES(e){return`${e.length?e.slice(0,Math.min(e.length,TS)):`<empty>`}\n`}function DS(e){return e>TS?``:`${` `.repeat(e-1)}^\n`}function OS(e,t,n){let r=e.length;if(r===0)return`<empty>`;if(r===1)return`${ES(e[0])}${DS(n)}`;let i=Math.min(t+2,r),a=``;for(let r=Math.max(t-2,1);r<=i;r++)a+=ES(e[r-1]),r===t&&(a+=DS(n));return`${a}\n`}function kS(e){e=CS(e);try{return JSON.parse(e)}catch{let t=[],n=SS(e,t);if(t.length===0)return n;let r=``,i=e.split(`
658
+ `);for(let e of t){let t=e.offset,n=1,a=1,o=0;for(let e of i){if(o+e.length>=t){a=t-o+1;break}o+=e.length+1,n++}r+=`Error at line ${n}, column ${a}: ${wS[e.error]}\n${OS(i,n,a)}\n`}throw SyntaxError(r)}}var AS=`
659
659
  ↑/↓: Select a package
660
660
  Space: Toggle selection
661
661
  a: Toggle all
662
- Enter: Upgrade`;function NS(e,t){let n=e?MS.split(`
663
- `).length:0;return process.stdout.rows?Math.max(3,process.stdout.rows-n-1-(t?.length??0)*2):50}async function PS(e,t,n){let r=Lx(n,n.packageManager);return await Object.keys(t).reduce(async(i,a)=>{let o=e[a]||null,s=t[a]||null,c=await r.packageAuthorChanged(a,o,s,n);return{...await i,[a]:c}},{})}var FS=async(e,t,n,r,i,a)=>{let o=[],s=process.stdout.rows>18,c=Dn((await Xr({from:e,to:t,skippedByCooldown:n,format:a.format,pkgFile:i||void 0,time:r})).toString().split(`
662
+ Enter: Upgrade`;function jS(e,t){let n=e?AS.split(`
663
+ `).length:0;return process.stdout.rows?Math.max(3,process.stdout.rows-n-1-(t?.length??0)*2):50}async function MS(e,t,n){let r=Fx(n,n.packageManager),i={};for(let a of Object.keys(t)){let o=e[a]||null,s=t[a]||null;i[a]=await r.packageAuthorChanged(a,o,s,n)}return i}var NS=async(e,t,n,r,i,a)=>{let o=[],s=process.stdout.rows>18,c=Dn((await Xr({from:e,to:t,skippedByCooldown:n,format:a.format,pkgFile:i||void 0,time:r})).toString().split(`
664
664
  `),e=>({[e.trim().split(` `)[0]]:e.trim()}));if(Object.keys(t).length>0)if(Y(a,``),a.format?.includes(`group`)){let n=_r(t,e,a);o=(await(0,he.default)({choices:[...n.flatMap(({heading:e,groupName:t,packages:n})=>[{title:`
665
- `+e,heading:!0},...Object.keys(n).sort().map(e=>({title:c[e],value:e,selected:[`patch`,`minor`].includes(t)}))]),{title:` `,heading:!0}],hint:s&&MS,instructions:!1,message:`Choose which packages to update`,name:`value`,optionsPerPage:NS(s,n),type:`multiselect`,onState:e=>{e.aborted&&process.nextTick(()=>process.exit(1))}})).value}else o=(await(0,he.default)({choices:[...Object.keys(t).sort().map(e=>({title:c[e],value:e,selected:!0})),{title:` `,heading:!0}],hint:s&&MS+`
666
- `,instructions:!1,message:`Choose which packages to update`,name:`value`,optionsPerPage:NS(s),type:`multiselect`,onState:e=>{e.aborted&&process.nextTick(()=>process.exit(1))}})).value;return Dn(o,e=>({[e]:t[e]}))};async function IS(e,t,n){Y(e,`
667
- Options:`,`verbose`),Kr(e,e,`verbose`);let r;try{t?r=jS(t):up(e,`Missing package data`)}catch(t){up(e,`Invalid package file${n?`: ${n}`:` from stdin`}. Error details:\n${t.message}`)}let i=sS(r,e);Y(e,`
668
- Current versions:`,`verbose`),Y(e,i,`verbose`),e.enginesNode&&(e.nodeEngineVersion=r?.engines?.node),e.peer&&(e.peerDependencies=await Jx(Object.fromEntries(Object.entries(i).map(([e,t])=>[e,q.default.validRange(t)?q.default.minVersion(t)?.version??t:t])),e));let[a,o,s]=await rS(i,e),c=Dn(o,(e,t)=>t.version?{[e]:t.version}:null),l=Dn(o,(e,t)=>t.error?{[e]:t.error}:null),u=Dn(o,(e,t)=>{let n=t.time??t.cooldownInfo?.currentVersionTime;return n?{[e]:n}:null}),d=Dn(o,(e,t)=>t.cooldownInfo?{[e]:t.cooldownInfo}:null),f=Object.values(d).length;e.peer&&(Y(e,`
665
+ `+e,heading:!0},...Object.keys(n).sort().map(e=>({title:c[e],value:e,selected:[`patch`,`minor`].includes(t)}))]),{title:` `,heading:!0}],hint:s&&AS,instructions:!1,message:`Choose which packages to update`,name:`value`,optionsPerPage:jS(s,n),type:`multiselect`,onState:e=>{e.aborted&&process.nextTick(()=>process.exit(1))}})).value}else o=(await(0,he.default)({choices:[...Object.keys(t).sort().map(e=>({title:c[e],value:e,selected:!0})),{title:` `,heading:!0}],hint:s&&AS+`
666
+ `,instructions:!1,message:`Choose which packages to update`,name:`value`,optionsPerPage:jS(s),type:`multiselect`,onState:e=>{e.aborted&&process.nextTick(()=>process.exit(1))}})).value;return Dn(o,e=>({[e]:t[e]}))};async function PS(e,t,n){Y(e,`
667
+ Options:`,`verbose`),Kr(e,e,`verbose`);let r;try{t?r=kS(t):up(e,`Missing package data`)}catch(t){up(e,`Invalid package file${n?`: ${n}`:` from stdin`}. Error details:\n${t.message}`)}let i=aS(r,e);Y(e,`
668
+ Current versions:`,`verbose`),Y(e,i,`verbose`),e.enginesNode&&(e.nodeEngineVersion=r?.engines?.node),e.peer&&(e.peerDependencies=await Kx(Object.fromEntries(Object.entries(i).map(([e,t])=>[e,q.default.validRange(t)?q.default.minVersion(t)?.version??t:t])),e));let[a,o,s]=await tS(i,e),c=Dn(o,(e,t)=>t.version?{[e]:t.version}:null),l=Dn(o,(e,t)=>t.error?{[e]:t.error}:null),u=Dn(o,(e,t)=>{let n=t.time??t.cooldownInfo?.currentVersionTime;return n?{[e]:n}:null}),d=Dn(o,(e,t)=>t.cooldownInfo?{[e]:t.cooldownInfo}:null),f=Object.values(d).length;e.peer&&(Y(e,`
669
669
  upgradedPeerDependencies:`,`verbose`),Y(e,s,`verbose`)),Y(e,`\n${typeof e.target==`string`?`${e.target[0].toUpperCase()}${e.target.slice(1)}`:`Fetched`} versions:`,`verbose`),Y(e,c,`verbose`),Y(e,`
670
- Upgraded versions:`,`verbose`),Y(e,a,`verbose`);let p=e.minimal?Dn(a,(e,t)=>q.default.satisfies(c[e],i[e])?null:{[e]:t}):a,m=(e.format||[]).includes(`ownerChanged`)?await PS(i,p,e):void 0,h=e.interactive?await FS(i,p,d,u,n,e):p;if(!e.json||e.deep){if(await ei(e.interactive?{...e,format:(e.format||[]).filter(e=>e!==`group`)}:e,{current:i,upgraded:h,skippedByCooldown:d,total:Object.keys(a).length,latest:o,numCooldown:f,ownersChangedDeps:m,pkgFile:n||void 0,errors:l,time:u}),e.peer){let t=await dS(i,a,s,e);Object.keys(t).length>0&&ti(e,t)}if(e.enginesNode){let t=await uS(i,a,e);Object.keys(t).length>0&&ni(e,t)}}let _=await Ty(t,i,h,e,n||void 0),v=e.jsonAll?n?.endsWith(`.yaml`)||n?.endsWith(`.yml`)?(0,_f.parseDocument)(_).toJSON():jS(_):e.jsonDeps&&n?.endsWith(`.json`)?Yx(jS(_),vy(e.dep)):h,y;if(e.json&&!e.deep&&Wr(e,v),Object.keys(p).length>0&&n)if(e.upgrade)y=g.default.writeFile(n.replace(`#catalog`,``),_);else{let t=process.env.npm_lifecycle_event===`npx`?`npx npm-check-updates`:`ncu`,n=process.argv.slice(2).map(e=>e.includes(` `)?`"${e}"`:e).join(` `),r=n&&` `+n;Y(e,`\nRun ${J.cyan(`${t}${r} -u`)} to upgrade ${e.packageFile||`package.json`}`)}return await y,v}function LS(e){return e}process.env.INJECT_PROMPTS&&he.default.inject(JSON.parse(process.env.INJECT_PROMPTS));var RS=!1,zS=null;process.on(`unhandledRejection`,e=>{console.error(e),RS=!0}),process.on(`exit`,()=>{RS&&zS&&up(zS,`Unhandled Rejection! This is a bug and should be reported: ${ge.bugs.url}`)});var BS=e=>{e.global&&(process.env.VOLTA_HOME||process.env.PATH?.includes(`\\Volta`))&&(Y(e,`It appears you are using Volta. \`npm-check-updates --global\` cannot be used with Volta because Volta has its own system for managing global packages which circumvents npm.
670
+ Upgraded versions:`,`verbose`),Y(e,a,`verbose`);let p=e.minimal?Dn(a,(e,t)=>q.default.satisfies(c[e],i[e])?null:{[e]:t}):a,m=(e.format||[]).includes(`ownerChanged`)?await MS(i,p,e):void 0,h=e.interactive?await NS(i,p,d,u,n,e):p;if(!e.json||e.deep){if(await ei(e.interactive?{...e,format:(e.format||[]).filter(e=>e!==`group`)}:e,{current:i,upgraded:h,skippedByCooldown:d,total:Object.keys(a).length,latest:o,numCooldown:f,ownersChangedDeps:m,pkgFile:n||void 0,errors:l,time:u}),e.peer){let t=await lS(i,a,s,e);Object.keys(t).length>0&&ti(e,t)}if(e.enginesNode){let t=await cS(i,a,e);Object.keys(t).length>0&&ni(e,t)}}let _=await Cy(t,i,h,e,n||void 0),v=e.jsonAll?n?.endsWith(`.yaml`)||n?.endsWith(`.yml`)?(0,_f.parseDocument)(_).toJSON():kS(_):e.jsonDeps&&n?.endsWith(`.json`)?qx(kS(_),vy(e.dep)):h,y;if(e.json&&!e.deep&&Wr(e,v),Object.keys(p).length>0&&n)if(e.upgrade)y=g.default.writeFile(n.replace(`#catalog`,``),_);else{let t=process.env.npm_lifecycle_event===`npx`?`npx npm-check-updates`:`ncu`,n=process.argv.slice(2).map(e=>e.includes(` `)?`"${e}"`:e).join(` `),r=n&&` `+n;Y(e,`\nRun ${J.cyan(`${t}${r} -u`)} to upgrade ${e.packageFile||`package.json`}`)}return await y,v}function FS(e){return e}process.env.INJECT_PROMPTS&&he.default.inject(JSON.parse(process.env.INJECT_PROMPTS));var IS=!1,LS=null;process.on(`unhandledRejection`,e=>{console.error(e),IS=!0}),process.on(`exit`,()=>{IS&&LS&&up(LS,`Unhandled Rejection! This is a bug and should be reported: ${ge.bugs.url}`)});var RS=e=>{e.global&&(process.env.VOLTA_HOME||process.env.PATH?.includes(`\\Volta`))&&(Y(e,`It appears you are using Volta. \`npm-check-updates --global\` cannot be used with Volta because Volta has its own system for managing global packages which circumvents npm.
671
671
 
672
- If you are still receiving this message after uninstalling Volta, ensure your PATH does not contain an entry for Volta and your shell profile does not define VOLTA_HOME. You may need to reboot for changes to your shell profile to take effect.`,`error`),process.exit(1))},VS=async(e,t)=>{let n={...e,cwd:e.cwd||f.default.resolve(t,`..`),packageFile:t};return e.packageManager===`staticRegistry`?await Ai({...n,packageManager:void 0}):e.packageManager&&e.packageManager!==`npm`?e.packageManager:await Ai(n)},HS=(e,t,n)=>{let r=!n.deep&&!n.workspaces&&!n.workspace?{[e[0]]:t}:t;return Object.values(r).some(e=>Object.keys(e).length>0)},US=async(e,t,n)=>{if(n.install===`never`){Y(n,``);return}if(!HS(e,t,n))return;let r=await VS(n,e[0]),i=`Run ${J.cyan(r+` install`)}${e.length>1&&!n.workspace&&!n.workspaces?` in each project directory`:``} to install new versions`,a=n.interactive&&(process.env.NCU_TESTS||!process.env.NCU_DOCTOR),o;if(a&&n.install===`prompt`&&(Y(n,``),o=await(0,he.default)({type:`confirm`,name:`value`,message:`${i}?`,initial:!0,onState:e=>{e.aborted&&process.nextTick(()=>process.exit(1))}})),n.install===`always`||a&&o.value){n.install===`always`&&Y(n,``),Y(n,`Installing dependencies...`);let t=n.workspaces||n.workspace?.length?[`package.json`]:e;for await(let e of t){let t=await VS(n,e),r=n.cwd||f.default.resolve(e,`..`),i=``;try{await pu(t,[`install`],{stdout:e=>{i+=e},stderr:e=>{console.error(J.red(e.toString()))}},{cwd:r,env:{...process.env,...n.color===!1?null:{FORCE_COLOR:!0},...t===`pnpm`?{npm_config_strict_peer_dependencies:!1}:null}}),Y(n,i),Y(n,`Done`)}catch(e){console.error(e?.message||e||i),up(n,`Install failed. This is not a bug in npm-check-updates. The most common causes are invalid peer dependencies, networking issues, or failing postinstall scripts. Consider using --peer to filter updates to compatible versions (takes longer) or --doctor to identify breaking upgrades.`)}}}else a||Y(n,`\n${i}.`)};async function WS(e,t){let[n,r]=await tx(e),i=n.map(e=>e.filepath),a=e.workspaces||!!e.workspace?.length;e.deep=e.deep||a||n.length>1;let o;if(e.global){let n=await iS(e);return clearTimeout(t),n}else if(e.deep){let t={};for(let[i,a]of n.entries()){let n=i>0,o=(await ax({packageFile:a.filepath,options:e})).config;e.mergeConfig&&Object.keys(o).length&&(o=Nx(e,o));let s={...e,...o,packageFile:a.filepath,workspacePackages:r},c,l,u;if(a.filepath.includes(`#`)||a.name===`catalogs`){c=a.pkgFile,l=a.filepath,u=a.filepath.includes(`#catalog`)?a.filepath.replace(`#catalog`,``):a.filepath;let e=f.default.resolve(u);n&&Y(s,``),Y(s,`${s.upgrade?`Upgrading`:`Checking`} ${e} catalog dependencies`)}else{n&&Y(s,``);let e=await ky(s);c=e.pkgData,l=e.pkgFile||a.filepath,u=l}let d=s.cwd?f.default.relative(f.default.resolve(s.cwd),u).replace(/\\/g,`/`):u;t[d]=await IS(s,c,l)}o=t,e.json&&Wr(e,o)}else{n.length===1&&n[0].filepath!==(e.packageFile||`package.json`)&&(e.packageFile=n[0].filepath);let{pkgData:t,pkgFile:r}=await ky(e);i.length===0&&r&&(i=[r]),o=await IS(e,t,r)}return clearTimeout(t),e.errorLevel===2&&HS(i,o,e)&&up(e,`
673
- Dependencies not up-to-date`),e.upgrade&&(e.packageManager===`deno`?Y(e,``):await US(i,o,e)),o}async function GS(e={},{cli:t}={}){RS=!1;let n=await jx(e,{cli:t});zS=n,await Mn(n.color),BS(n),Y(n,`Initializing`,`verbose`),n.cacheClear&&await ci(n);let r,i=new Promise(()=>null);if(n.timeout){let e=typeof n.timeout==`string`?Number.parseInt(n.timeout,10):n.timeout;i=new Promise((t,i)=>{r=setTimeout(()=>{let t=`Exceeded global timeout of ${e}ms`;i(t);try{up(n,t)}catch{}},e)})}if(n.doctor){if(n.upgrade)return Promise.race([i,Oy(GS,n)]);Y(n,`Usage: ncu --doctor\n\n${typeof Ci.doctor.help==`function`?Ci.doctor.help({}):Ci.doctor.help}`,`warn`)}else return Promise.race([i,WS(n,r)])}exports._=d,exports.a=xi,exports.c=En,Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return Ye}}),exports.default=GS,exports.run=GS,exports.defineConfig=LS,Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return be}}),exports.g=c,exports.h=o,exports.i=wi,Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return At}}),exports.m=s,exports.n=ax,exports.o=Mn,exports.p=ge,exports.r=Ci,exports.s=jn,exports.t=Xx,Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return ot}}),exports.v=u;
672
+ If you are still receiving this message after uninstalling Volta, ensure your PATH does not contain an entry for Volta and your shell profile does not define VOLTA_HOME. You may need to reboot for changes to your shell profile to take effect.`,`error`),process.exit(1))},zS=async(e,t)=>{let n={...e,cwd:e.cwd||f.default.resolve(t,`..`),packageFile:t};return e.packageManager===`staticRegistry`?await Ai({...n,packageManager:void 0}):e.packageManager&&e.packageManager!==`npm`?e.packageManager:await Ai(n)},BS=(e,t,n)=>{let r=!n.deep&&!n.workspaces&&!n.workspace?{[e[0]]:t}:t;return Object.values(r).some(e=>Object.keys(e).length>0)},VS=async(e,t,n)=>{if(n.install===`never`){Y(n,``);return}if(!BS(e,t,n))return;let r=await zS(n,e[0]),i=`Run ${J.cyan(r+` install`)}${e.length>1&&!n.workspace&&!n.workspaces?` in each project directory`:``} to install new versions`,a=n.interactive&&(process.env.NCU_TESTS||!process.env.NCU_DOCTOR),o;if(a&&n.install===`prompt`&&(Y(n,``),o=await(0,he.default)({type:`confirm`,name:`value`,message:`${i}?`,initial:!0,onState:e=>{e.aborted&&process.nextTick(()=>process.exit(1))}})),n.install===`always`||a&&o.value){n.install===`always`&&Y(n,``),Y(n,`Installing dependencies...`);let t=n.workspaces||n.workspace?.length?[`package.json`]:e;for(let e of t){let t=await zS(n,e),r=n.cwd||f.default.resolve(e,`..`),i=``;try{await pu(t,[`install`],{stdout:e=>{i+=e},stderr:e=>{console.error(J.red(e.toString()))}},{cwd:r,env:{...process.env,...n.color===!1?null:{FORCE_COLOR:!0},...t===`pnpm`?{npm_config_strict_peer_dependencies:!1}:null}}),Y(n,i),Y(n,`Done`)}catch(e){console.error(e?.message||e||i),up(n,`Install failed. This is not a bug in npm-check-updates. The most common causes are invalid peer dependencies, networking issues, or failing postinstall scripts. Consider using --peer to filter updates to compatible versions (takes longer) or --doctor to identify breaking upgrades.`)}}}else a||Y(n,`\n${i}.`)};async function HS(e,t){let[n,r]=await $b(e),i=n.map(e=>e.filepath),a=e.workspaces||!!e.workspace?.length;e.deep=e.deep||a||n.length>1;let o;if(e.global){let n=await nS(e);return clearTimeout(t),n}else if(e.deep){let t={};for(let[i,a]of n.entries()){let n=i>0,o=(await rx({packageFile:a.filepath,options:e})).config;e.mergeConfig&&Object.keys(o).length&&(o=jx(e,o));let s={...e,...o,packageFile:a.filepath,workspacePackages:r},c,l,u;if(a.filepath.includes(`#`)||a.name===`catalogs`){c=a.pkgFile,l=a.filepath,u=a.filepath.includes(`#catalog`)?a.filepath.replace(`#catalog`,``):a.filepath;let e=f.default.resolve(u);n&&Y(s,``),Y(s,`${s.upgrade?`Upgrading`:`Checking`} ${e} catalog dependencies`)}else{n&&Y(s,``);let e=await Dy(s);c=e.pkgData,l=e.pkgFile||a.filepath,u=l}let d=s.cwd?f.default.relative(f.default.resolve(s.cwd),u).replace(/\\/g,`/`):u;t[d]=await PS(s,c,l)}o=t,e.json&&Wr(e,o)}else{n.length===1&&n[0].filepath!==(e.packageFile||`package.json`)&&(e.packageFile=n[0].filepath);let{pkgData:t,pkgFile:r}=await Dy(e);i.length===0&&r&&(i=[r]),o=await PS(e,t,r)}return clearTimeout(t),e.errorLevel===2&&BS(i,o,e)&&up(e,`
673
+ Dependencies not up-to-date`),e.upgrade&&(e.packageManager===`deno`?Y(e,``):await VS(i,o,e)),o}async function US(e={},{cli:t}={}){IS=!1;let n=await kx(e,{cli:t});LS=n,Mn(n.color),RS(n),Y(n,`Initializing`,`verbose`),n.cacheClear&&await ci(n);let r,i=new Promise(()=>null);if(n.timeout){let e=typeof n.timeout==`string`?Number.parseInt(n.timeout,10):n.timeout;i=new Promise((t,i)=>{r=setTimeout(()=>{let t=`Exceeded global timeout of ${e}ms`;i(t);try{up(n,t)}catch{}},e)})}if(n.doctor){if(n.upgrade)return Promise.race([i,Ey(US,n)]);Y(n,`Usage: ncu --doctor\n\n${typeof Ci.doctor.help==`function`?Ci.doctor.help({}):Ci.doctor.help}`,`warn`)}else return Promise.race([i,HS(n,r)])}exports._=d,exports.a=xi,exports.c=En,Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return Ye}}),exports.default=US,exports.run=US,exports.defineConfig=FS,Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return be}}),exports.g=c,exports.h=o,exports.i=wi,Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return At}}),exports.m=s,exports.n=rx,exports.o=Mn,exports.p=ge,exports.r=Ci,exports.s=jn,exports.t=Jx,Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return ot}}),exports.v=u;
674
674
  //# sourceMappingURL=index.cjs.map