Rearranged the code and added CLI that installs tools locally.
Test Action / test (push) Successful in 3s

This commit is contained in:
slawek committed 2026-01-11 10:54:25 +01:00
1 parent ef971a6da4
commit 620da93338
12 files changed
+559 -188

No files matched your search

+1 -1
View File
@@ -3,4 +3,4 @@ lib/
*.log *.log
*.map *.map
.DS_Store .DS_Store
Notes.md .github/*.md
+118 -12
View File
@@ -1,6 +1,47 @@
# Setup GitHub Release Action # Setup GitHub Release Action
This GitHub/Gitea Action downloads a tool from a GitHub release, extracts it, automatically finds the executable, and adds it to the system PATH. It supports platform-aware selection, recursive binary search, and tool caching. This project implements a GitHub Action (`setup-github-release`) and a CLI tool (`install-github-release`) that downloads a release asset from a specified GitHub repository, extracts it, searches for a binary within the extracted files, and prepares the runtime environment.
## Installation / Setup
### GitHub/Gitea Action
Add the action to your workflow. Authenticate with `github.token` (default) or a custom token for Gitea/private repos.
```yaml
- name: Install Tool
uses: koszewscy/setup-github-release@v1
with:
repository: 'owner/repo'
```
### CLI Tool
Install the CLI tool on any destination system with Node.js 24 or newer.
**Using npx (Quick Run):**
```bash
npx install-github-release rclone/rclone
```
**Global Installation:**
```bash
npm install -g install-github-release
install-github-release rclone/rclone
```
**From Source:**
```bash
git clone https://github.com/koszewscy/setup-github-release
cd setup-github-release
npm install
npm run build
# The CLI is available at dist/cli.js
node dist/cli.js <repository>
```
## Features ## Features
@@ -30,7 +71,7 @@ For projects with multiple binary versions, you can use a regex pattern (prefixe
```yaml ```yaml
- name: Install Extended Hugo - name: Install Extended Hugo
uses: koszewscy/setup-github-release@v1 uses: skoszewski/setup-github-release@v1
with: with:
repository: 'gohugoio/hugo' repository: 'gohugoio/hugo'
file-name: '~hugo_extended_[^a-z]' # Regex to match extended version file-name: '~hugo_extended_[^a-z]' # Regex to match extended version
@@ -42,7 +83,7 @@ If the binary name is different from the repository name, like in the example of
```yaml ```yaml
- name: Install GitHub CLI - name: Install GitHub CLI
uses: koszewscy/setup-github-release@v1 uses: skoszewski/setup-github-release@v1
with: with:
repository: 'cli/cli' repository: 'cli/cli'
binary-name: 'gh' # Searches for 'gh' (or 'gh.exe') inside the extracted release binary-name: 'gh' # Searches for 'gh' (or 'gh.exe') inside the extracted release
@@ -53,19 +94,84 @@ If the binary name is different from the repository name, like in the example of
If you are unsure how the binary is named, use the `debug` flag to list all files in the unpacked asset, or download the asset manually to inspect its structure. If you are unsure how the binary is named, use the `debug` flag to list all files in the unpacked asset, or download the asset manually to inspect its structure.
```yaml ```yaml
- uses: koszewscy/setup-github-release@v1 - uses: skoszewski/setup-github-release@v1
with: with:
repository: 'owner/repo' repository: 'owner/repo'
debug: true debug: true
``` ```
## Inputs ## Inputs / Options
- `repository` (required): GitHub repository in `owner/repo` format. The following inputs are available for the GitHub Action, and as options for the CLI tool:
- `file-name` (optional): Literal name or regex pattern (if starts with `~`) to match the asset.
- `binary-name` (optional): The name or regex pattern (if starts with `~`) of the binary to find. Defaults to the repository name. - `repository` (required): The GitHub repository in the format `owner/repo` from which to download the release.
- `file-type` (optional, default: `archive`): Predefined keywords `archive`, `package`, or a custom regex pattern. - `file-name` (optional): The name or the regex pattern (prefixed with `~`) of the asset file to download from the release.
- `debug` (optional, default: `false`): Set to `true` to log the contents of the unpacked asset. - `binary-name` (optional): The name or regex pattern (prefixed with `~`) of the binary to search for within the downloaded asset. Defaults to the repository name.
- `token` (optional): GitHub token for authentication (defaults to `${{ github.token }}` that is an equivalent of `${{ secrets.GITHUB_TOKEN }}`). Use `${{ secrets.GITEA_TOKEN }}` for Gitea, or create a personal access token. - `file-type` (optional, default: 'archive'): The regex pattern to identify the type of the file to be downloaded. There are two predefined keywords:
- 'archive': matches common archive file extensions like .zip, .tar.gz, .tar, .tgz, .7z.
- 'package': matches common package file extensions like .deb, .rpm, .pkg.
- or a custom regex pattern can be provided to match specific file types.
- `update-cache` (optional, default: 'false'): When set to 'false', the action will use the cached version of the tool if it is already available. If set to 'true', the action will check the latest release and update the cache if a newer version is found. If set to 'always', it will always download and install, updating the cache regardless.
- `debug` (optional, default: 'false'): When set to `true`, the action will log the contents of the unpacked directory to the console.
- `token` (optional): A GitHub token for authentication, useful for accessing private repositories or increasing rate limits.
> **Important:** Default authentication will only work if the action is used within GitHub workflow. For Gitea or the CLI, you must provide a token explicitly (e.g. `GITHUB_TOKEN` environment variable).
## CLI Usage
The `install-github-release` tool follows the same logic as the Action.
```bash
Usage: install-github-release [options] <repository>
Arguments:
repository The GitHub repository (owner/repo)
Options:
-f, --file-name <name> Asset file name or regex pattern (prefixed with ~)
-b, --binary-name <name> Binary to search for (prefixed with ~ for regex)
-t, --file-type <type> 'archive', 'package', or custom regex (default: archive)
-k, --token <token> GitHub token
-d, --debug Enable debug logging
-h, --help Show this help message
```
## Asset Selection Procedure
The list of assets from the latest release is filtered based on the following rules:
1. If neither `file-name` nor `file-type` is provided, the tool defaults to selecting assets that match the following regular expression: `{{SYSTEM}}[_-]{{ARCH}}.*{{EXT_PATTERN}}$`, where:
- `{{SYSTEM}}` is replaced with the detected operating system regex.
- `{{ARCH}}` is replaced with the detected architecture regex.
- `{{EXT_PATTERN}}` is a regex pattern defined by the `file-type` input (defaulting to 'archive' if not specified).
2. If `file-name` is provided literally, the tool uses it directly to match the asset name by using exact string comparison.
3. If `file-name` is provided as a regex pattern (prefixed with `~`), then:
- If the pattern does not end with `$` and does not include any placeholders, the tool appends `.*{{SYSTEM}}[_-]{{ARCH}}.*{{EXT_PATTERN}}$` to the provided pattern.
- If it already ends with `$` or includes all three placeholders, the tool uses it as-is to match the asset name using regex.
- If only `{{SYSTEM}}` and `{{ARCH}}` placeholders are included, the tool appends `.*{{EXT_PATTERN}}$`.
4. If `file-type` is not equal to 'archive' or 'package', it is treated as a custom regex pattern to match the file extension.
5. The tool applies the constructed regex pattern to filter the assets from the latest release.
6. If multiple assets match the criteria, the tool fails.
7. After download and extraction, the tool recursively searches for the binary specified by `binary-name` (or the repository name). If found, the directory containing the binary is used as the tool directory and added to the PATH (or used for installation). If the binary is not found, the tool fails.
8. `{{SYSTEM}}` is replaced with the detected operating system regex:
- For Linux: `linux`.
- For MacOS: `(darwin|macos|mac|osx)`.
- For Windows: `(windows|win)`.
9. `{{ARCH}}` is replaced with the detected architecture regex:
- For x64: `(x86_64|x64|amd64)`.
- For arm64: `(aarch64|arm64)`.
10. All regular expression matches are case-insensitive.
## License
MIT
> **Important:** Default authentication will will only work if the action is used within GitHub workflow. For Gitea, you must provide a token explicitly.
Vendored Executable
+15
View File
@@ -0,0 +1,15 @@
#!/usr/bin/env node
"use strict";var F=Object.create;var N=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var U=Object.getPrototypeOf,X=Object.prototype.hasOwnProperty;var G=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of O(e))!X.call(t,s)&&s!==n&&N(t,s,{get:()=>e[s],enumerable:!(r=H(e,s))||r.enumerable});return t};var f=(t,e,n)=>(n=t!=null?F(U(t)):{},G(e||!t||!t.__esModule?N(n,"default",{value:t,enumerable:!0}):n,t));var B=require("util"),h=f(require("path")),c=f(require("fs")),P=f(require("os"));var S=f(require("os")),Y={linux:"linux",darwin:"(darwin|macos|mac|osx)",win32:"(windows|win)"},q={x64:"(x86_64|x64|amd64)",arm64:"(aarch64|arm64)"};function _(){let t=S.platform(),e=S.arch();return{system:t,arch:e,systemPattern:Y[t]||t,archPattern:q[e]||e}}function M(t,e,n){let{fileName:r,fileType:s="archive"}=n,o;if(s==="archive"?o="\\.(zip|tar\\.gz|tar|tgz|7z)":s==="package"?o="\\.(deb|rpm|pkg)":o=s,r)if(r.startsWith("~")){let i=r.substring(1),l=i.includes("{{SYSTEM}}"),a=i.includes("{{ARCH}}"),p=i.includes("{{EXT_PATTERN}}"),$=i.endsWith("$");!l&&!a&&!p&&!$?i+=".*{{SYSTEM}}[_-]{{ARCH}}.*{{EXT_PATTERN}}$":l&&a&&!p&&!$&&(i+=".*{{EXT_PATTERN}}$");let m=i.replace(/{{SYSTEM}}/g,e.systemPattern).replace(/{{ARCH}}/g,e.archPattern).replace(/{{EXT_PATTERN}}/g,o),x=new RegExp(m,"i"),g=t.filter(d=>x.test(d.name));if(g.length===0)throw new Error(`No assets matched the regex: ${m}`);if(g.length>1)throw new Error(`Multiple assets matched the criteria: ${g.map(d=>d.name).join(", ")}`);return g[0]}else{let i=t.find(l=>l.name===r);if(!i)throw new Error(`No asset found matching the exact name: ${r}`);return i}else{let i=`${e.systemPattern}[_-]${e.archPattern}.*${o}$`,l=new RegExp(i,"i"),a=t.filter(p=>l.test(p.name));if(a.length===0)throw new Error(`No assets matched the default criteria: ${i}`);if(a.length>1)throw new Error(`Multiple assets matched the default criteria: ${a.map(p=>p.name).join(", ")}`);return a[0]}}var b=f(require("fs")),j=f(require("path"));function k(t,e,n,r){let s=b.readdirSync(t);n&&(r(`Searching for binary in ${t}...`),s.forEach(o=>r(` - ${o}`)));for(let o of s){let i=j.join(t,o);if(b.statSync(i).isDirectory()){let a=k(i,e,n,r);if(a)return a}else{let a=!1;if(e instanceof RegExp?a=e.test(o):(a=o===e,!a&&process.platform==="win32"&&!e.toLowerCase().endsWith(".exe")&&(a=o.toLowerCase()===`${e.toLowerCase()}.exe`)),a)return i}}}async function C(t,e){let n=`https://api.github.com/repos/${t}/releases/latest`,r={Accept:"application/vnd.github.v3+json","User-Agent":"setup-github-release-action"};e&&(r.Authorization=`token ${e}`);let s=await fetch(n,{headers:r});if(!s.ok){let o=await s.text();throw new Error(`Failed to fetch latest release for ${t}: ${s.statusText}. ${o}`)}return await s.json()}async function W(t,e,n){let r={"User-Agent":"setup-github-release-action"};n&&(r.Authorization=`token ${n}`);let s=await fetch(t,{headers:r});if(!s.ok)throw new Error(`Failed to download asset: ${s.statusText}`);let o=await import("fs"),{Readable:i}=await import("stream"),{finished:l}=await import("stream/promises"),a=o.createWriteStream(e);await l(i.fromWeb(s.body).pipe(a))}var E=require("child_process"),u=f(require("path")),y=f(require("fs"));async function L(t,e){let n=u.extname(t).toLowerCase(),r=u.basename(t).toLowerCase();if(y.existsSync(e)||y.mkdirSync(e,{recursive:!0}),r.endsWith(".tar.gz")||r.endsWith(".tgz")||r.endsWith(".tar")){let o=(0,E.spawnSync)("tar",["-xf",t,"-C",e]);if(o.status!==0)throw new Error(`tar failed with status ${o.status}: ${o.stderr.toString()}`)}else if(r.endsWith(".zip"))if(process.platform==="win32"){let s=`Expand-Archive -Path "${t}" -DestinationPath "${e}" -Force`,o=(0,E.spawnSync)("powershell",["-Command",s]);if(o.status!==0)throw new Error(`powershell Expand-Archive failed with status ${o.status}: ${o.stderr.toString()}`)}else{let s=(0,E.spawnSync)("unzip",["-q",t,"-d",e]);if(s.status!==0)throw new Error(`unzip failed with status ${s.status}: ${s.stderr.toString()}`)}else if(r.endsWith(".7z")){let s=(0,E.spawnSync)("7z",["x",t,`-o${e}`,"-y"]);if(s.status!==0)throw new Error(`7z failed with status ${s.status}. Make sure 7z is installed.`)}else{let s=u.join(e,u.basename(t));y.copyFileSync(t,s)}}async function K(){let{values:t,positionals:e}=(0,B.parseArgs)({options:{"file-name":{type:"string",short:"f"},"binary-name":{type:"string",short:"b"},"file-type":{type:"string",short:"t",default:"archive"},token:{type:"string",short:"k"},debug:{type:"boolean",short:"d",default:!1},help:{type:"boolean",short:"h"}},allowPositionals:!0});(t.help||e.length===0)&&(console.log(`
Usage: install-github-release [options] <repository>
Arguments:
repository The GitHub repository (owner/repo)
Options:
-f, --file-name <name> Asset file name or regex pattern (prefixed with ~)
-b, --binary-name <name> Binary to search for (prefixed with ~ for regex)
-t, --file-type <type> 'archive', 'package', or custom regex (default: archive)
-k, --token <token> GitHub token
-d, --debug Enable debug logging
-h, --help Show this help message
`),process.exit(0));let n=e[0];n||(console.error("Error: Repository is required."),process.exit(1));let r=t["file-name"],s=t["binary-name"],o=t["file-type"],i=!!t.debug,l=t.token||process.env.GITHUB_TOKEN;try{let a=_(),p=n.split("/").pop()||n;console.log(`Fetching latest release for ${n}...`);let $=await C(n,l),m=M($.assets,a,{fileName:r,fileType:o});console.log(`Selected asset: ${m.name}`);let x=c.mkdtempSync(h.join(P.tmpdir(),"setup-gh-release-")),g=h.join(x,m.name);console.log(`Downloading ${m.name}...`),await W(m.browser_download_url,g,l);let d=h.join(x,"extract");console.log(`Extracting ${m.name}...`),await L(g,d);let A=s||p,R;A.startsWith("~")?R=new RegExp(A.substring(1),"i"):R=A;let T=k(d,R,i,console.log);if(!T)throw new Error(`Could not find binary "${A}" in the extracted asset.`);let w;if(process.getuid&&process.getuid()===0)w="/usr/local/bin";else{let z=h.join(P.homedir(),"bin");c.existsSync(z)?w=z:w="/usr/local/bin"}c.existsSync(w)||c.mkdirSync(w,{recursive:!0});let I=h.basename(T),v=h.join(w,I);console.log(`Installing ${I} to ${v}...`),c.copyFileSync(T,v),process.platform!=="win32"&&c.chmodSync(v,"755"),c.rmSync(x,{recursive:!0,force:!0}),console.log("Installation successful!")}catch(a){console.error(`Error: ${a.message}`),process.exit(1)}}K();
+37 -37
View File
@@ -1,65 +1,65 @@
"use strict";var Af=Object.create;var tQ=Object.defineProperty;var ef=Object.getOwnPropertyDescriptor;var tf=Object.getOwnPropertyNames;var rf=Object.getPrototypeOf,sf=Object.prototype.hasOwnProperty;var h=(A,e)=>()=>(e||A((e={exports:{}}).exports,e),e.exports);var nf=(A,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of tf(e))!sf.call(A,s)&&s!==t&&tQ(A,s,{get:()=>e[s],enumerable:!(r=ef(e,s))||r.enumerable});return A};var cs=(A,e,t)=>(t=A!=null?Af(rf(A)):{},nf(e||!A||!A.__esModule?tQ(t,"default",{value:A,enumerable:!0}):t,A));var ii=h(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.toCommandProperties=Cr.toCommandValue=void 0;function of(A){return A==null?"":typeof A=="string"||A instanceof String?A:JSON.stringify(A)}Cr.toCommandValue=of;function Ef(A){return Object.keys(A).length?{title:A.title,file:A.file,line:A.startLine,endLine:A.endLine,col:A.startColumn,endColumn:A.endColumn}:{}}Cr.toCommandProperties=Ef});var nQ=h(pe=>{"use strict";var af=pe&&pe.__createBinding||(Object.create?(function(A,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,r,s)}):(function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]})),gf=pe&&pe.__setModuleDefault||(Object.create?(function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}):function(A,e){A.default=e}),Qf=pe&&pe.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.prototype.hasOwnProperty.call(A,t)&&af(e,A,t);return gf(e,A),e};Object.defineProperty(pe,"__esModule",{value:!0});pe.issue=pe.issueCommand=void 0;var cf=Qf(require("os")),sQ=ii();function iQ(A,e,t){let r=new Bo(A,e,t);process.stdout.write(r.toString()+cf.EOL)}pe.issueCommand=iQ;function Cf(A,e=""){iQ(A,{},e)}pe.issue=Cf;var rQ="::",Bo=class{constructor(e,t,r){e||(e="missing.command"),this.command=e,this.properties=t,this.message=r}toString(){let e=rQ+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let t=!0;for(let r in this.properties)if(this.properties.hasOwnProperty(r)){let s=this.properties[r];s&&(t?t=!1:e+=",",e+=`${r}=${If(s)}`)}}return e+=`${rQ}${Bf(this.message)}`,e}};function Bf(A){return(0,sQ.toCommandValue)(A).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function If(A){return(0,sQ.toCommandValue)(A).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}});var aQ=h(we=>{"use strict";var hf=we&&we.__createBinding||(Object.create?(function(A,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,r,s)}):(function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]})),lf=we&&we.__setModuleDefault||(Object.create?(function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}):function(A,e){A.default=e}),ho=we&&we.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.prototype.hasOwnProperty.call(A,t)&&hf(e,A,t);return lf(e,A),e};Object.defineProperty(we,"__esModule",{value:!0});we.prepareKeyValueMessage=we.issueFileCommand=void 0;var uf=ho(require("crypto")),oQ=ho(require("fs")),Io=ho(require("os")),EQ=ii();function ff(A,e){let t=process.env[`GITHUB_${A}`];if(!t)throw new Error(`Unable to find environment variable for file command ${A}`);if(!oQ.existsSync(t))throw new Error(`Missing file at path: ${t}`);oQ.appendFileSync(t,`${(0,EQ.toCommandValue)(e)}${Io.EOL}`,{encoding:"utf8"})}we.issueFileCommand=ff;function df(A,e){let t=`ghadelimiter_${uf.randomUUID()}`,r=(0,EQ.toCommandValue)(e);if(A.includes(t))throw new Error(`Unexpected input: name should not contain the delimiter "${t}"`);if(r.includes(t))throw new Error(`Unexpected input: value should not contain the delimiter "${t}"`);return`${A}<<${t}${Io.EOL}${r}${Io.EOL}${t}`}we.prepareKeyValueMessage=df});var QQ=h(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});Br.checkBypass=Br.getProxyUrl=void 0;function yf(A){let e=A.protocol==="https:";if(gQ(A))return;let t=e?process.env.https_proxy||process.env.HTTPS_PROXY:process.env.http_proxy||process.env.HTTP_PROXY;if(t)try{return new ni(t)}catch{if(!t.startsWith("http://")&&!t.startsWith("https://"))return new ni(`http://${t}`)}else return}Br.getProxyUrl=yf;function gQ(A){if(!A.hostname)return!1;let e=A.hostname;if(pf(e))return!0;let t=process.env.no_proxy||process.env.NO_PROXY||"";if(!t)return!1;let r;A.port?r=Number(A.port):A.protocol==="http:"?r=80:A.protocol==="https:"&&(r=443);let s=[A.hostname.toUpperCase()];typeof r=="number"&&s.push(`${s[0]}:${r}`);for(let i of t.split(",").map(n=>n.trim().toUpperCase()).filter(n=>n))if(i==="*"||s.some(n=>n===i||n.endsWith(`.${i}`)||i.startsWith(".")&&n.endsWith(`${i}`)))return!0;return!1}Br.checkBypass=gQ;functLine truncated "use strict";var nf=Object.create;var sQ=Object.defineProperty;var of=Object.getOwnPropertyDescriptor;var Ef=Object.getOwnPropertyNames;var af=Object.getPrototypeOf,gf=Object.prototype.hasOwnProperty;var h=(A,e)=>()=>(e||A((e={exports:{}}).exports,e),e.exports);var Qf=(A,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Ef(e))!gf.call(A,s)&&s!==t&&sQ(A,s,{get:()=>e[s],enumerable:!(r=of(e,s))||r.enumerable});return A};var Gt=(A,e,t)=>(t=A!=null?nf(af(A)):{},Qf(e||!A||!A.__esModule?sQ(t,"default",{value:A,enumerable:!0}):t,A));var nn=h(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.toCommandProperties=Er.toCommandValue=void 0;function cf(A){return A==null?"":typeof A=="string"||A instanceof String?A:JSON.stringify(A)}Er.toCommandValue=cf;function Cf(A){return Object.keys(A).length?{title:A.title,file:A.file,line:A.startLine,endLine:A.endLine,col:A.startColumn,endColumn:A.endColumn}:{}}Er.toCommandProperties=Cf});var EQ=h(de=>{"use strict";var Bf=de&&de.__createBinding||(Object.create?(function(A,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,r,s)}):(function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]})),If=de&&de.__setModuleDefault||(Object.create?(function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}):function(A,e){A.default=e}),hf=de&&de.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.prototype.hasOwnProperty.call(A,t)&&Bf(e,A,t);return If(e,A),e};Object.defineProperty(de,"__esModule",{value:!0});de.issue=de.issueCommand=void 0;var lf=hf(require("os")),iQ=nn();function oQ(A,e,t){let r=new Io(A,e,t);process.stdout.write(r.toString()+lf.EOL)}de.issueCommand=oQ;function uf(A,e=""){oQ(A,{},e)}de.issue=uf;var nQ="::",Io=class{constructor(e,t,r){e||(e="missing.command"),this.command=e,this.properties=t,this.message=r}toString(){let e=nQ+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let t=!0;for(let r in this.properties)if(this.properties.hasOwnProperty(r)){let s=this.properties[r];s&&(t?t=!1:e+=",",e+=`${r}=${df(s)}`)}}return e+=`${nQ}${ff(this.message)}`,e}};function ff(A){return(0,iQ.toCommandValue)(A).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function df(A){return(0,iQ.toCommandValue)(A).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}});var QQ=h(ye=>{"use strict";var yf=ye&&ye.__createBinding||(Object.create?(function(A,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,r,s)}):(function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]})),pf=ye&&ye.__setModuleDefault||(Object.create?(function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}):function(A,e){A.default=e}),lo=ye&&ye.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.prototype.hasOwnProperty.call(A,t)&&yf(e,A,t);return pf(e,A),e};Object.defineProperty(ye,"__esModule",{value:!0});ye.prepareKeyValueMessage=ye.issueFileCommand=void 0;var wf=lo(require("crypto")),aQ=lo(require("fs")),ho=lo(require("os")),gQ=nn();function Df(A,e){let t=process.env[`GITHUB_${A}`];if(!t)throw new Error(`Unable to find environment variable for file command ${A}`);if(!aQ.existsSync(t))throw new Error(`Missing file at path: ${t}`);aQ.appendFileSync(t,`${(0,gQ.toCommandValue)(e)}${ho.EOL}`,{encoding:"utf8"})}ye.issueFileCommand=Df;function Rf(A,e){let t=`ghadelimiter_${wf.randomUUID()}`,r=(0,gQ.toCommandValue)(e);if(A.includes(t))throw new Error(`Unexpected input: name should not contain the delimiter "${t}"`);if(r.includes(t))throw new Error(`Unexpected input: value should not contain the delimiter "${t}"`);return`${A}<<${t}${ho.EOL}${r}${ho.EOL}${t}`}ye.prepareKeyValueMessage=Rf});var CQ=h(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.checkBypass=ar.getProxyUrl=void 0;function Nf(A){let e=A.protocol==="https:";if(cQ(A))return;let t=e?process.env.https_proxy||process.env.HTTPS_PROXY:process.env.http_proxy||process.env.HTTP_PROXY;if(t)try{return new on(t)}catch{if(!t.startsWith("http://")&&!t.startsWith("https://"))return new on(`http://${t}`)}else return}ar.getProxyUrl=Nf;function cQ(A){if(!A.hostname)return!1;let e=A.hostname;if(mf(e))return!0;let t=process.env.no_proxy||process.env.NO_PROXY||"";if(!t)return!1;let r;A.port?r=Number(A.port):A.protocol==="http:"?r=80:A.protocol==="https:"&&(r=443);let s=[A.hostname.toUpperCase()];typeof r=="number"&&s.push(`${s[0]}:${r}`);for(let n of t.split(",").map(i=>i.trim().toUpperCase()).filter(i=>i))if(n==="*"||s.some(i=>i===n||i.endsWith(`.${n}`)||n.startsWith(".")&&i.endsWith(`${n}`)))return!0;return!1}ar.checkBypass=cQ;functLine truncated
`,Q.message,Q.stack);var c=new Error("tunneling socket could not be established, cause="+Q.message);c.code="ECONNRESET",e.request.emit("error",c),r.removeSocket(s)}};ot.prototype.removeSocket=function(e){var t=this.sockets.indexOf(e);if(t!==-1){this.sockets.splice(t,1);var r=this.requests.shift();r&&this.createSocket(r,function(s){r.request.onSocket(s)})}};function CQ(A,e){var t=this;ot.prototype.createSocket.call(t,A,function(r){var s=A.request.getHeader("host"),i=uo({},t.options,{socket:r,servername:s?s.replace(/:.*$/,""):A.host}),n=wf.connect(0,i);t.sockets[t.sockets.indexOf(r)]=n,e(n)})}function BQ(A,e,t){return typeof A=="string"?{host:A,port:e,localAddress:t}:A}function uo(A){for(var e=1,t=arguments.length;e<t;++e){var r=arguments[e];if(typeof r=="object")for(var s=Object.keys(r),i=0,n=s.length;i<n;++i){var o=s[i];r[o]!==void 0&&(A[o]=r[o])}}return A}var Dt;process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?Dt=function(){var A=Array.prototype.slice.call(arguments);typeof A[0]=="string"?A[0]="TUNNEL: "+A[0]:A.unshift("TUNNEL:"),console.error.apply(console,A)}:Dt=function(){};Ir.debug=Dt});var lQ=h((fU,hQ)=>{hQ.exports=IQ()});var EA=h((dU,uQ)=>{uQ.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kHeadersList:Symbol("headers list"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kInterceptors:Symbol("dispatch interceptors"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2SessionState:Symbol("http2Session state"),kHTTP2BuildRequest:Symbol("http2 build request"),kHTTP1BuildRequest:Symbol("http1 build request"),kHTTP2CopyHeaders:Symbol("http2 copy headers"),kHTTPConnVersion:Symbol("http connection version"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable")}});var tA=h((yU,fQ)=>{"use strict";var yA=class extends Error{constructor(e){super(e),this.name="UndiciError",this.code="UND_ERR"}},fo=class A extends yA{constructor(e){super(e),Error.captureStackTrace(this,A),this.name="ConnectTimeoutError",this.message=e||"Connect Timeout Error",this.code="UND_ERR_CONNECT_TIMEOUT"}},yo=class A extends yA{constructor(e){super(e),Error.captureStackTrace(this,A),this.name="HeadersTimeoutError",this.message=e||"Headers Timeout Error",this.code="UND_ERR_HEADERS_TIMEOUT"}},po=class A extends yA{constructor(e){super(e),Error.captureStackTrace(this,A),this.name="HeadersOverflowError",this.message=e||"Headers Overflow Error",this.code="UND_ERR_HEADERS_OVERFLOW"}},wo=class A extends yA{constructor(e){super(e),Error.captureStackTrace(this,A),this.name="BodyTimeoutError",this.message=e||"Body Timeout Error",this.code="UND_ERR_BODY_TIMEOUT"}},Do=class A extends yA{constructor(e,t,r,s){super(e),Error.captureStackTrace(this,A),this.name="ResponseStatusCodeError",this.message=e||"Response Status Code Error",this.code="UND_ERR_RESPONSE_STATUS_CODE",this.body=s,this.status=t,this.statusCode=t,this.headers=r}},Ro=class A extends yA{constructor(e){super(e),Error.captureStackTrace(this,A),this.name="InvalidArgumentError",this.message=e||"Invalid Argument Error",this.code="UND_ERR_INVALID_ARG"}},No=class A extends yA{constructor(e){super(e),Error.captureStackTrace(this,A),this.name="InvalidReturnValueError",this.message=e||"Invalid Return Value Error",this.code="UND_ERR_INVALID_RETURN_VALUE"}},mo=class A extends yA{constructor(e){super(e),Error.captureStackTrace(this,A),this.name="AbortError",this.message=e Line truncated `,Q.message,Q.stack);var c=new Error("tunneling socket could not be established, cause="+Q.message);c.code="ECONNRESET",e.request.emit("error",c),r.removeSocket(s)}};st.prototype.removeSocket=function(e){var t=this.sockets.indexOf(e);if(t!==-1){this.sockets.splice(t,1);var r=this.requests.shift();r&&this.createSocket(r,function(s){r.request.onSocket(s)})}};function IQ(A,e){var t=this;st.prototype.createSocket.call(t,A,function(r){var s=A.request.getHeader("host"),n=fo({},t.options,{socket:r,servername:s?s.replace(/:.*$/,""):A.host}),i=Ff.connect(0,n);t.sockets[t.sockets.indexOf(r)]=i,e(i)})}function hQ(A,e,t){return typeof A=="string"?{host:A,port:e,localAddress:t}:A}function fo(A){for(var e=1,t=arguments.length;e<t;++e){var r=arguments[e];if(typeof r=="object")for(var s=Object.keys(r),n=0,i=s.length;n<i;++n){var o=s[n];r[o]!==void 0&&(A[o]=r[o])}}return A}var pt;process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?pt=function(){var A=Array.prototype.slice.call(arguments);typeof A[0]=="string"?A[0]="TUNNEL: "+A[0]:A.unshift("TUNNEL:"),console.error.apply(console,A)}:pt=function(){};gr.debug=pt});var fQ=h((NU,uQ)=>{uQ.exports=lQ()});var nA=h((mU,dQ)=>{dQ.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kHeadersList:Symbol("headers list"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kInterceptors:Symbol("dispatch interceptors"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2SessionState:Symbol("http2Session state"),kHTTP2BuildRequest:Symbol("http2 build request"),kHTTP1BuildRequest:Symbol("http1 build request"),kHTTP2CopyHeaders:Symbol("http2 copy headers"),kHTTPConnVersion:Symbol("http connection version"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable")}});var AA=h((FU,yQ)=>{"use strict";var hA=class extends Error{constructor(e){super(e),this.name="UndiciError",this.code="UND_ERR"}},yo=class A extends hA{constructor(e){super(e),Error.captureStackTrace(this,A),this.name="ConnectTimeoutError",this.message=e||"Connect Timeout Error",this.code="UND_ERR_CONNECT_TIMEOUT"}},po=class A extends hA{constructor(e){super(e),Error.captureStackTrace(this,A),this.name="HeadersTimeoutError",this.message=e||"Headers Timeout Error",this.code="UND_ERR_HEADERS_TIMEOUT"}},wo=class A extends hA{constructor(e){super(e),Error.captureStackTrace(this,A),this.name="HeadersOverflowError",this.message=e||"Headers Overflow Error",this.code="UND_ERR_HEADERS_OVERFLOW"}},Do=class A extends hA{constructor(e){super(e),Error.captureStackTrace(this,A),this.name="BodyTimeoutError",this.message=e||"Body Timeout Error",this.code="UND_ERR_BODY_TIMEOUT"}},Ro=class A extends hA{constructor(e,t,r,s){super(e),Error.captureStackTrace(this,A),this.name="ResponseStatusCodeError",this.message=e||"Response Status Code Error",this.code="UND_ERR_RESPONSE_STATUS_CODE",this.body=s,this.status=t,this.statusCode=t,this.headers=r}},No=class A extends hA{constructor(e){super(e),Error.captureStackTrace(this,A),this.name="InvalidArgumentError",this.message=e||"Invalid Argument Error",this.code="UND_ERR_INVALID_ARG"}},mo=class A extends hA{constructor(e){super(e),Error.captureStackTrace(this,A),this.name="InvalidReturnValueError",this.message=e||"Invalid Return Value Error",this.code="UND_ERR_INVALID_RETURN_VALUE"}},Fo=class A extends hA{constructor(e){super(e),Error.captureStackTrace(this,A),this.name="AbortError",this.message=e Line truncated
\r \r
`),Id=/\r\n/g,hd=/^([^:]+):[ \t]?([\x00-\xFF]+)?$/;function lr(A){VQ.call(this),A=A||{};let e=this;this.nread=0,this.maxed=!1,this.npairs=0,this.maxHeaderPairs=HQ(A,"maxHeaderPairs",2e3),this.maxHeaderSize=HQ(A,"maxHeaderSize",80*1024),this.buffer="",this.header={},this.finished=!1,this.ss=new Cd(Bd),this.ss.on("info",function(t,r,s,i){r&&!e.maxed&&(e.nread+i-s>=e.maxHeaderSize?(i=e.maxHeaderSize-e.nread+s,e.nread=e.maxHeaderSize,e.maxed=!0):e.nread+=i-s,e.buffer+=r.toString("binary",s,i)),t&&e._finish()})}cd(lr,VQ);lr.prototype.push=function(A){let e=this.ss.push(A);if(this.finished)return e};lr.prototype.reset=function(){this.finished=!1,this.buffer="",this.header={},this.ss.reset()};lr.prototype._finish=function(){this.buffer&&this._parseHeader(),this.ss.matches=this.ss.maxMatches;let A=this.header;this.header={},this.buffer="",this.finished=!0,this.nread=this.npairs=0,this.maxed=!1,this.emit("header",A)};lr.prototype._parseHeader=function(){if(this.npairs===this.maxHeaderPairs)return;let A=this.buffer.split(Id),e=A.length,t,r;for(var s=0;s<e;++s){if(A[s].length===0)continue;if((A[s][0]===" "||A[s][0]===" ")&&r){this.header[r][this.header[r].length-1]+=A[s];continue}let i=A[s].indexOf(":");if(i===-1||i===0)return;if(t=hd.exec(A[s]),r=t[1].toLowerCase(),this.header[r]=this.header[r]||[],this.header[r].push(t[2]||""),++this.npairs===this.maxHeaderPairs)break}};qQ.exports=lr});var Po=h((kU,PQ)=>{"use strict";var Wo=require("node:stream").Writable,ld=require("node:util").inherits,ud=qo(),WQ=JQ(),fd=OQ(),dd=45,yd=Buffer.from("-"),pd=Buffer.from(`\r `),dd=/\r\n/g,yd=/^([^:]+):[ \t]?([\x00-\xFF]+)?$/;function cr(A){OQ.call(this),A=A||{};let e=this;this.nread=0,this.maxed=!1,this.npairs=0,this.maxHeaderPairs=qQ(A,"maxHeaderPairs",2e3),this.maxHeaderSize=qQ(A,"maxHeaderSize",80*1024),this.buffer="",this.header={},this.finished=!1,this.ss=new ud(fd),this.ss.on("info",function(t,r,s,n){r&&!e.maxed&&(e.nread+n-s>=e.maxHeaderSize?(n=e.maxHeaderSize-e.nread+s,e.nread=e.maxHeaderSize,e.maxed=!0):e.nread+=n-s,e.buffer+=r.toString("binary",s,n)),t&&e._finish()})}ld(cr,OQ);cr.prototype.push=function(A){let e=this.ss.push(A);if(this.finished)return e};cr.prototype.reset=function(){this.finished=!1,this.buffer="",this.header={},this.ss.reset()};cr.prototype._finish=function(){this.buffer&&this._parseHeader(),this.ss.matches=this.ss.maxMatches;let A=this.header;this.header={},this.buffer="",this.finished=!0,this.nread=this.npairs=0,this.maxed=!1,this.emit("header",A)};cr.prototype._parseHeader=function(){if(this.npairs===this.maxHeaderPairs)return;let A=this.buffer.split(dd),e=A.length,t,r;for(var s=0;s<e;++s){if(A[s].length===0)continue;if((A[s][0]===" "||A[s][0]===" ")&&r){this.header[r][this.header[r].length-1]+=A[s];continue}let n=A[s].indexOf(":");if(n===-1||n===0)return;if(t=yd.exec(A[s]),r=t[1].toLowerCase(),this.header[r]=this.header[r]||[],this.header[r].push(t[2]||""),++this.npairs===this.maxHeaderPairs)break}};WQ.exports=cr});var _o=h((YU,XQ)=>{"use strict";var Po=require("node:stream").Writable,pd=require("node:util").inherits,wd=Oo(),_Q=HQ(),Dd=PQ(),Rd=45,Nd=Buffer.from("-"),md=Buffer.from(`\r
`),wd=function(){};function xe(A){if(!(this instanceof xe))return new xe(A);if(Wo.call(this,A),!A||!A.headerFirst&&typeof A.boundary!="string")throw new TypeError("Boundary required");typeof A.boundary=="string"?this.setBoundary(A.boundary):this._bparser=void 0,this._headerFirst=A.headerFirst,this._dashes=0,this._parts=0,this._finished=!1,this._realFinish=!1,this._isPreamble=!0,this._justMatched=!1,this._firstWrite=!0,this._inHeader=!0,this._part=void 0,this._cb=void 0,this._ignoreData=!1,this._partOpts={highWaterMark:A.partHwm},this._pause=!1;let e=this;this._hparser=new fd(A),this._hparser.on("header",function(t){e._inHeader=!1,e._part.emit("header",t)})}ld(xe,Wo);xe.prototype.emit=function(A){if(A==="finish"&&!this._realFinish){if(!this._finished){let e=this;process.nextTick(function(){if(e.emit("error",new Error("Unexpected end of multipart data")),e._part&&!e._ignoreData){let t=e._isPreamble?"Preamble":"Part";e._part.emit("error",new Error(t+" terminated early due to unexpected end of multipart data")),e._part.push(null),process.nextTick(function(){e._realFinish=!0,e.emit("finish"),e._realFinish=!1});return}e._realFinish=!0,e.emit("finish"),e._realFinish=!1})}}else Wo.prototype.emit.apply(this,arguments)};xe.prototype._write=function(A,e,t){if(!this._hparser&&!this._bparser)return t();if(this._headerFirst&&this._isPreamble){this._part||(this._part=new WQ(this._partOpts),this.listenerCount("preamble")!==0?this.emit("preamble",this._part):this._ignore());let r=this._hparser.push(A);if(!this._inHeader&&r!==void 0&&r<A.length)A=A.slice(r);else return t()}this._firstWrite&&(this._bparser.push(pd),this._firstWrite=!1),this._bparser.push(A),this._pause?this._cb=t:t()};xe.prototype.reset=function(){this._part=void 0,this._bparser=void 0,this._hparser=void 0};xe.prototype.setBoundary=function(A){let e=this;this._bparser=new ud(`\r `),Fd=function(){};function Le(A){if(!(this instanceof Le))return new Le(A);if(Po.call(this,A),!A||!A.headerFirst&&typeof A.boundary!="string")throw new TypeError("Boundary required");typeof A.boundary=="string"?this.setBoundary(A.boundary):this._bparser=void 0,this._headerFirst=A.headerFirst,this._dashes=0,this._parts=0,this._finished=!1,this._realFinish=!1,this._isPreamble=!0,this._justMatched=!1,this._firstWrite=!0,this._inHeader=!0,this._part=void 0,this._cb=void 0,this._ignoreData=!1,this._partOpts={highWaterMark:A.partHwm},this._pause=!1;let e=this;this._hparser=new Dd(A),this._hparser.on("header",function(t){e._inHeader=!1,e._part.emit("header",t)})}pd(Le,Po);Le.prototype.emit=function(A){if(A==="finish"&&!this._realFinish){if(!this._finished){let e=this;process.nextTick(function(){if(e.emit("error",new Error("Unexpected end of multipart data")),e._part&&!e._ignoreData){let t=e._isPreamble?"Preamble":"Part";e._part.emit("error",new Error(t+" terminated early due to unexpected end of multipart data")),e._part.push(null),process.nextTick(function(){e._realFinish=!0,e.emit("finish"),e._realFinish=!1});return}e._realFinish=!0,e.emit("finish"),e._realFinish=!1})}}else Po.prototype.emit.apply(this,arguments)};Le.prototype._write=function(A,e,t){if(!this._hparser&&!this._bparser)return t();if(this._headerFirst&&this._isPreamble){this._part||(this._part=new _Q(this._partOpts),this.listenerCount("preamble")!==0?this.emit("preamble",this._part):this._ignore());let r=this._hparser.push(A);if(!this._inHeader&&r!==void 0&&r<A.length)A=A.slice(r);else return t()}this._firstWrite&&(this._bparser.push(md),this._firstWrite=!1),this._bparser.push(A),this._pause?this._cb=t:t()};Le.prototype.reset=function(){this._part=void 0,this._bparser=void 0,this._hparser=void 0};Le.prototype.setBoundary=function(A){let e=this;this._bparser=new wd(`\r
--`+A),this._bparser.on("info",function(t,r,s,i){e._oninfo(t,r,s,i)})};xe.prototype._ignore=function(){this._part&&!this._ignoreData&&(this._ignoreData=!0,this._part.on("error",wd),this._part.resume())};xe.prototype._oninfo=function(A,e,t,r){let s,i=this,n=0,o,E=!0;if(!this._part&&this._justMatched&&e){for(;this._dashes<2&&t+n<r;)if(e[t+n]===dd)++n,++this._dashes;else{this._dashes&&(s=yd),this._dashes=0;break}if(this._dashes===2&&(t+n<r&&this.listenerCount("trailer")!==0&&this.emit("trailer",e.slice(t+n,r)),this.reset(),this._finished=!0,i._parts===0&&(i._realFinish=!0,i.emit("finish"),i._realFinish=!1)),this._dashes)return}this._justMatched&&(this._justMatched=!1),this._part||(this._part=new WQ(this._partOpts),this._part._read=function(g){i._unpause()},this._isPreamble&&this.listenerCount("preamble")!==0?this.emit("preamble",this._part):this._isPreamble!==!0&&this.listenerCount("part")!==0?this.emit("part",this._part):this._ignore(),this._isPreamble||(this._inHeader=!0)),e&&t<r&&!this._ignoreData&&(this._isPreamble||!this._inHeader?(s&&(E=this._part.push(s)),E=this._part.push(e.slice(t,r)),E||(this._pause=!0)):!this._isPreamble&&this._inHeader&&(s&&this._hparser.push(s),o=this._hparser.push(e.slice(t,r)),!this._inHeader&&o!==void 0&&o<r&&this._oninfo(!1,e,t+o,r))),A&&(this._hparser.reset(),this._isPreamble?this._isPreamble=!1:t!==r&&(++this._parts,this._part.on("end",function(){--i._parts===0&&(i._finished?(i._realFinish=!0,i.emit("finish"),i._realFinish=!1):i._unpause())})),this._part.push(null),this._part=void 0,this._ignoreData=!1,this._justMatched=!0,this._dashes=0)};xe.prototype._unpause=function(){if(this._pause&&(this._pause=!1,this._cb)){let A=this._cb;this._cb=void 0,A()}};PQ.exports=xe});var ci=h((_o,ZQ)=>{"use strict";var _Q=new TextDecoder("utf-8"),XQ=new Map([["utf-8",_Q],["utf8",_Q]]);function Dd(A){let e;for(;;)switch(A){case"utf-8":case"utf8":return Bs.utf8;case"latin1":case"ascii":case"us-ascii":case"iso-8859-1":case"iso8859-1":case"iso88591":case"iso_8859-1":case"windows-1252":case"iso_8859-1:1987":case"cp1252":case"x-cp1252":return Bs.latin1;case"utf16le":case"utf-16le":case"ucs2":case"ucs-2":return Bs.utf16le;case"base64":return Bs.base64;default:if(e===void 0){e=!0,A=A.toLowerCase();continue}return Bs.other.bind(A)}}var Bs={utf8:(A,e)=>A.length===0?"":(typeof A=="string"&&(A=Buffer.from(A,e)),A.utf8Slice(0,A.length)),latin1:(A,e)=>A.length===0?"":typeof A=="string"?A:A.latin1Slice(0,A.length),utf16le:(A,e)=>A.length===0?"":(typeof A=="string"&&(A=Buffer.from(A,e)),A.ucs2Slice(0,A.length)),base64:(A,e)=>A.length===0?"":(typeof A=="string"&&(A=Buffer.from(A,e)),A.base64Slice(0,A.length)),other:(A,e)=>{if(A.length===0)return"";if(typeof A=="string"&&(A=Buffer.from(A,e)),XQ.has(_o.toString()))try{return XQ.get(_o).decode(A)}catch{}return typeof A=="string"?A:A.toString()}};function Rd(A,e,t){return A&&Dd(t)(A,e)}ZQ.exports=Rd});var Zo=h((bU,Ac)=>{"use strict";var Ci=ci(),jQ=/%[a-fA-F0-9][a-fA-F0-9]/g,Nd={"%00":"\0","%01":"","%02":"","%03":"","%04":"","%05":"","%06":"","%07":"\x07","%08":"\b","%09":" ","%0a":` --`+A),this._bparser.on("info",function(t,r,s,n){e._oninfo(t,r,s,n)})};Le.prototype._ignore=function(){this._part&&!this._ignoreData&&(this._ignoreData=!0,this._part.on("error",Fd),this._part.resume())};Le.prototype._oninfo=function(A,e,t,r){let s,n=this,i=0,o,E=!0;if(!this._part&&this._justMatched&&e){for(;this._dashes<2&&t+i<r;)if(e[t+i]===Rd)++i,++this._dashes;else{this._dashes&&(s=Nd),this._dashes=0;break}if(this._dashes===2&&(t+i<r&&this.listenerCount("trailer")!==0&&this.emit("trailer",e.slice(t+i,r)),this.reset(),this._finished=!0,n._parts===0&&(n._realFinish=!0,n.emit("finish"),n._realFinish=!1)),this._dashes)return}this._justMatched&&(this._justMatched=!1),this._part||(this._part=new _Q(this._partOpts),this._part._read=function(g){n._unpause()},this._isPreamble&&this.listenerCount("preamble")!==0?this.emit("preamble",this._part):this._isPreamble!==!0&&this.listenerCount("part")!==0?this.emit("part",this._part):this._ignore(),this._isPreamble||(this._inHeader=!0)),e&&t<r&&!this._ignoreData&&(this._isPreamble||!this._inHeader?(s&&(E=this._part.push(s)),E=this._part.push(e.slice(t,r)),E||(this._pause=!0)):!this._isPreamble&&this._inHeader&&(s&&this._hparser.push(s),o=this._hparser.push(e.slice(t,r)),!this._inHeader&&o!==void 0&&o<r&&this._oninfo(!1,e,t+o,r))),A&&(this._hparser.reset(),this._isPreamble?this._isPreamble=!1:t!==r&&(++this._parts,this._part.on("end",function(){--n._parts===0&&(n._finished?(n._realFinish=!0,n.emit("finish"),n._realFinish=!1):n._unpause())})),this._part.push(null),this._part=void 0,this._ignoreData=!1,this._justMatched=!0,this._dashes=0)};Le.prototype._unpause=function(){if(this._pause&&(this._pause=!1,this._cb)){let A=this._cb;this._cb=void 0,A()}};XQ.exports=Le});var Cn=h((Xo,KQ)=>{"use strict";var ZQ=new TextDecoder("utf-8"),jQ=new Map([["utf-8",ZQ],["utf8",ZQ]]);function kd(A){let e;for(;;)switch(A){case"utf-8":case"utf8":return Qs.utf8;case"latin1":case"ascii":case"us-ascii":case"iso-8859-1":case"iso8859-1":case"iso88591":case"iso_8859-1":case"windows-1252":case"iso_8859-1:1987":case"cp1252":case"x-cp1252":return Qs.latin1;case"utf16le":case"utf-16le":case"ucs2":case"ucs-2":return Qs.utf16le;case"base64":return Qs.base64;default:if(e===void 0){e=!0,A=A.toLowerCase();continue}return Qs.other.bind(A)}}var Qs={utf8:(A,e)=>A.length===0?"":(typeof A=="string"&&(A=Buffer.from(A,e)),A.utf8Slice(0,A.length)),latin1:(A,e)=>A.length===0?"":typeof A=="string"?A:A.latin1Slice(0,A.length),utf16le:(A,e)=>A.length===0?"":(typeof A=="string"&&(A=Buffer.from(A,e)),A.ucs2Slice(0,A.length)),base64:(A,e)=>A.length===0?"":(typeof A=="string"&&(A=Buffer.from(A,e)),A.base64Slice(0,A.length)),other:(A,e)=>{if(A.length===0)return"";if(typeof A=="string"&&(A=Buffer.from(A,e)),jQ.has(Xo.toString()))try{return jQ.get(Xo).decode(A)}catch{}return typeof A=="string"?A:A.toString()}};function bd(A,e,t){return A&&kd(t)(A,e)}KQ.exports=bd});var jo=h((TU,tc)=>{"use strict";var Bn=Cn(),zQ=/%[a-fA-F0-9][a-fA-F0-9]/g,Sd={"%00":"\0","%01":"","%02":"","%03":"","%04":"","%05":"","%06":"","%07":"\x07","%08":"\b","%09":" ","%0a":`
`,"%0A":` `,"%0A":`
`,"%0b":"\v","%0B":"\v","%0c":"\f","%0C":"\f","%0d":"\r","%0D":"\r","%0e":"","%0E":"","%0f":"","%0F":"","%10":"","%11":"","%12":"","%13":"","%14":"","%15":"","%16":"","%17":"","%18":"","%19":"","%1a":"","%1A":"","%1b":"\x1B","%1B":"\x1B","%1c":"","%1C":"","%1d":"","%1D":"","%1e":"","%1E":"","%1f":"","%1F":"","%20":" ","%21":"!","%22":'"',"%23":"#","%24":"$","%25":"%","%26":"&","%27":"'","%28":"(","%29":")","%2a":"*","%2A":"*","%2b":"+","%2B":"+","%2c":",","%2C":",","%2d":"-","%2D":"-","%2e":".","%2E":".","%2f":"/","%2F":"/","%30":"0","%31":"1","%32":"2","%33":"3","%34":"4","%35":"5","%36":"6","%37":"7","%38":"8","%39":"9","%3a":":","%3A":":","%3b":";","%3B":";","%3c":"<","%3C":"<","%3d":"=","%3D":"=","%3e":">","%3E":">","%3f":"?","%3F":"?","%40":"@","%41":"A","%42":"B","%43":"C","%44":"D","%45":"E","%46":"F","%47":"G","%48":"H","%49":"I","%4a":"J","%4A":"J","%4b":"K","%4B":"K","%4c":"L","%4C":"L","%4d":"M","%4D":"M","%4e":"N","%4E":"N","%4f":"O","%4F":"O","%50":"P","%51":"Q","%52":"R","%53":"S","%54":"T","%55":"U","%56":"V","%57":"W","%58":"X","%59":"Y","%5a":"Z","%5A":"Z","%5b":"[","%5B":"[","%5c":"\\","%5C":"\\","%5d":"]","%5D":"]","%5e":"^","%5E":"^","%5f":"_","%5F":"_","%60":"`","%61":"a","%62":"b","%63":"c","%64":"d","%65":"e","%66":"f","%67":"g","%68":"h","%69":"i","%6a":"j","%6A":"j","%6b":"k","%6B":"k","%6c":"l","%6C":"l","%6d":"m","%6D":"m","%6e":"n","%6E":"n","%6f":"o","%6F":"o","%70":"p","%71":"q","%72":"r","%73":"s","%74":"t","%75":"u","%76":"v","%77":"w","%78":"x","%79":"y","%7a":"z","%7A":"z","%7b":"{","%7B":"{","%7c":"|","%7C":"|","%7d":"}","%7D":"}","%7e":"~","%7E":"~","%7f":"\x7F","%7F":"\x7F","%80":"\x80","%81":"\x81","%82":"\x82","%83":"\x83","%84":"\x84","%85":"\x85","%86":"\x86","%87":"\x87","%88":"\x88","%89":"\x89","%8a":"\x8A","%8A":"\x8A","%8b":"\x8B","%8B":"\x8B","%8c":"\x8C","%8C":"\x8C","%8d":"\x8D","%8D":"\x8D","%8e":"\x8E","%8E":"\x8E","%8f":"\x8F","%8F":"\x8F","%90":"\x90","%91":"\x91","%92":"\x92","%93":"\x93","%94":"\x94","%95":"\x95","%96":"\x96","%97":"\x97","%98":"\x98","%99":"\x99","%9a":"\x9A","%9A":"\x9A","%9b":"\x9B","%9B":"\x9B","%9c":"\x9C","%9C":"\x9C","%9d":"\x9D","%9D":"\x9D","%9e":"\x9E","%9E":"\x9E","%9f":"\x9F","%9F":"\x9F","%a0":"\xA0","%A0":"\xA0","%a1":"\xA1","%A1":"\xA1","%a2":"\xA2","%A2":"\xA2","%a3":"\xA3","%A3":"\xA3","%a4":"\xA4","%A4":"\xA4","%a5":"\xA5","%A5":"\xA5","%a6":"\xA6","%A6":"\xA6","%a7":"\xA7","%A7":"\xA7","%a8":"\xA8","%A8":"\xA8","%a9":"\xA9","%A9":"\xA9","%aa":"\xAA","%Aa":"\xAA","%aA":"\xAA","%AA":"\xAA","%ab":"\xAB","%Ab":"\xAB","%aB":"\xAB","%AB":"\xAB","%ac":"\xAC","%Ac":"\xAC","%aC":"\xAC","%AC":"\xAC","%ad":"\xAD","%Ad":"\xAD","%aD":"\xAD","%AD":"\xAD","%ae":"\xAE","%Ae":"\xAE","%aE":"\xAE","%AE":"\xAE","%af":"\xAF","%Af":"\xAF","%aF":"\xAF","%AF":"\xAF","%b0":"\xB0","%B0":"\xB0","%b1":"\xB1","%B1":"\xB1","%b2":"\xB2","%B2":"\xB2","%b3":"\xB3","%B3":"\xB3","%b4":"\xB4","%B4":"\xB4","%b5":"\xB5","%B5":"\xB5","%b6":"\xB6","%B6":"\xB6","%b7":"\xB7","%B7":"\xB7","%b8":"\xB8","%B8":"\xB8","%b9":"\xB9","%B9":"\xB9","%ba":"\xBA","%Ba":"\xBA","%bA":"\xBA","%BA":"\xBA","%bb":"\xBB","%Bb":"\xBB","%bB":"\xBB","%BB":"\xBB","%bc":"\xBC","%Bc":"\xBC","%bC":"\xBC","%BC":"\xBC","%bd":"\xBD","%Bd":"\xBD","%bD":"\xBD","%BD":"\xBD","%be":"\xBE","%Be":"\xBE","%bE":"\xBE","%BE":"\xBE","%bf":"\xBF","%Bf":"\xBF","%bF":"\xBF","%BF":"\xBF","%c0":"\xC0","%C0":"\xC0","%c1":"\xC1","%C1":"\xC1","%c2":"\xC2","%C2":"\xC2","%c3":"\xC3","%C3":"\xC3","%c4":"\xC4","%C4":"\xC4","%c5":"\xC5","%C5":"\xC5","%c6":"\xC6","%C6":"\xC6","%c7":"\xC7","%C7":"\xC7","%c8":"\xC8","%C8":"\xC8","%c9":"\xC9","%C9":"\xC9","%ca":"\xCA","%Ca":"\xCA","%cA":"\xCA","%CA":"\xCA","%cb":"\xCB","%Cb":"\xCB","%cB":"\xCB","%CB":"\xCB","%cc":"\xCC","%Cc":"\xCC","%cC":"\xCC","%CC":"\xCC","%cd":"\xCD","%Cd":"\xCD","%cD":"\xCD","%CD":"\xCD","%ce":"\xCE","%Ce":"\xCE","%cE":"\xCE","%CE":"\xCE","%cf":"\xCF","%Cf":"\xCF","%cF":"\xCF","%CF":"\xCF","%d0":"\xD0","%D0":"\xD0","%d1":"\xD1","%D1":"\xD1","%d2":"\xD2","%D2":"\xD2","%d3":"\xD3","%D3":"\xD3","%d4":"\xD4","%D4":"\xD4","%d5":"\xD5","%D5":"\xD5","%d6":"\xD6","%D6":"\xD6","%d7":"\xD7","%D7":"\xD7","%d8":"\xD8","%D8":"\xD8","%d9":"\xD9","%D9":"\xD9","%da":"\xDA","%Da":"\xDA","%dA":"\xDA","%DA":"\xDA","%db":"\xDB","%Db":"\xDB","%dB":"\xDB","%DB":"\xDB","%dc":"\xDC","%Dc":"\xDC","%dC":"\xDC","%DC":"\xDC","%dd":"\xDD","%Dd":"\xDD","%dD":"\xDD","%DD":"\xDD","%de":"\xDE","%De":"\xDE","%dE":"\xDE","%DE":"\xDE","%df":"\xDF","%Df":"\xDF","%dF":"\xDF","%DF":"\xDF","%e0":"\xE0","%E0":"\xE0","%e1":"\xE1","%E1":"\xE1","%e2":"\xE2","%E2":"\xE2","%e3":"\xE3","%E3":"\xE3","%e4":"\xE4","%E4":"\xE4","%e5":"\xE5","%E5":"\xE5","%e6":"\xE6","%E6":"\xE6","%e7":"\xE7","%E7":"\xE7","%e8":"\xE8","%E8":"\xE8","%e9":"\xE9","%E9":"\xE9","%ea":"\xEA","%Ea":"\xEA","%eA":"\xEA","%EA":"\xEA","%eb":"\xEB","%Eb":"\xEB","%eB":"\xEB","%EB":"\xEB","%ec":"\xEC","%Ec":"\xEC","%eC":"\xEC","%EC":"\xEC","%ed":"\xED","%Ed":"\xED","%eD":"\xED","%ED":"\xED","%ee":"\xLine truncated `,"%0b":"\v","%0B":"\v","%0c":"\f","%0C":"\f","%0d":"\r","%0D":"\r","%0e":"","%0E":"","%0f":"","%0F":"","%10":"","%11":"","%12":"","%13":"","%14":"","%15":"","%16":"","%17":"","%18":"","%19":"","%1a":"","%1A":"","%1b":"\x1B","%1B":"\x1B","%1c":"","%1C":"","%1d":"","%1D":"","%1e":"","%1E":"","%1f":"","%1F":"","%20":" ","%21":"!","%22":'"',"%23":"#","%24":"$","%25":"%","%26":"&","%27":"'","%28":"(","%29":")","%2a":"*","%2A":"*","%2b":"+","%2B":"+","%2c":",","%2C":",","%2d":"-","%2D":"-","%2e":".","%2E":".","%2f":"/","%2F":"/","%30":"0","%31":"1","%32":"2","%33":"3","%34":"4","%35":"5","%36":"6","%37":"7","%38":"8","%39":"9","%3a":":","%3A":":","%3b":";","%3B":";","%3c":"<","%3C":"<","%3d":"=","%3D":"=","%3e":">","%3E":">","%3f":"?","%3F":"?","%40":"@","%41":"A","%42":"B","%43":"C","%44":"D","%45":"E","%46":"F","%47":"G","%48":"H","%49":"I","%4a":"J","%4A":"J","%4b":"K","%4B":"K","%4c":"L","%4C":"L","%4d":"M","%4D":"M","%4e":"N","%4E":"N","%4f":"O","%4F":"O","%50":"P","%51":"Q","%52":"R","%53":"S","%54":"T","%55":"U","%56":"V","%57":"W","%58":"X","%59":"Y","%5a":"Z","%5A":"Z","%5b":"[","%5B":"[","%5c":"\\","%5C":"\\","%5d":"]","%5D":"]","%5e":"^","%5E":"^","%5f":"_","%5F":"_","%60":"`","%61":"a","%62":"b","%63":"c","%64":"d","%65":"e","%66":"f","%67":"g","%68":"h","%69":"i","%6a":"j","%6A":"j","%6b":"k","%6B":"k","%6c":"l","%6C":"l","%6d":"m","%6D":"m","%6e":"n","%6E":"n","%6f":"o","%6F":"o","%70":"p","%71":"q","%72":"r","%73":"s","%74":"t","%75":"u","%76":"v","%77":"w","%78":"x","%79":"y","%7a":"z","%7A":"z","%7b":"{","%7B":"{","%7c":"|","%7C":"|","%7d":"}","%7D":"}","%7e":"~","%7E":"~","%7f":"\x7F","%7F":"\x7F","%80":"\x80","%81":"\x81","%82":"\x82","%83":"\x83","%84":"\x84","%85":"\x85","%86":"\x86","%87":"\x87","%88":"\x88","%89":"\x89","%8a":"\x8A","%8A":"\x8A","%8b":"\x8B","%8B":"\x8B","%8c":"\x8C","%8C":"\x8C","%8d":"\x8D","%8D":"\x8D","%8e":"\x8E","%8E":"\x8E","%8f":"\x8F","%8F":"\x8F","%90":"\x90","%91":"\x91","%92":"\x92","%93":"\x93","%94":"\x94","%95":"\x95","%96":"\x96","%97":"\x97","%98":"\x98","%99":"\x99","%9a":"\x9A","%9A":"\x9A","%9b":"\x9B","%9B":"\x9B","%9c":"\x9C","%9C":"\x9C","%9d":"\x9D","%9D":"\x9D","%9e":"\x9E","%9E":"\x9E","%9f":"\x9F","%9F":"\x9F","%a0":"\xA0","%A0":"\xA0","%a1":"\xA1","%A1":"\xA1","%a2":"\xA2","%A2":"\xA2","%a3":"\xA3","%A3":"\xA3","%a4":"\xA4","%A4":"\xA4","%a5":"\xA5","%A5":"\xA5","%a6":"\xA6","%A6":"\xA6","%a7":"\xA7","%A7":"\xA7","%a8":"\xA8","%A8":"\xA8","%a9":"\xA9","%A9":"\xA9","%aa":"\xAA","%Aa":"\xAA","%aA":"\xAA","%AA":"\xAA","%ab":"\xAB","%Ab":"\xAB","%aB":"\xAB","%AB":"\xAB","%ac":"\xAC","%Ac":"\xAC","%aC":"\xAC","%AC":"\xAC","%ad":"\xAD","%Ad":"\xAD","%aD":"\xAD","%AD":"\xAD","%ae":"\xAE","%Ae":"\xAE","%aE":"\xAE","%AE":"\xAE","%af":"\xAF","%Af":"\xAF","%aF":"\xAF","%AF":"\xAF","%b0":"\xB0","%B0":"\xB0","%b1":"\xB1","%B1":"\xB1","%b2":"\xB2","%B2":"\xB2","%b3":"\xB3","%B3":"\xB3","%b4":"\xB4","%B4":"\xB4","%b5":"\xB5","%B5":"\xB5","%b6":"\xB6","%B6":"\xB6","%b7":"\xB7","%B7":"\xB7","%b8":"\xB8","%B8":"\xB8","%b9":"\xB9","%B9":"\xB9","%ba":"\xBA","%Ba":"\xBA","%bA":"\xBA","%BA":"\xBA","%bb":"\xBB","%Bb":"\xBB","%bB":"\xBB","%BB":"\xBB","%bc":"\xBC","%Bc":"\xBC","%bC":"\xBC","%BC":"\xBC","%bd":"\xBD","%Bd":"\xBD","%bD":"\xBD","%BD":"\xBD","%be":"\xBE","%Be":"\xBE","%bE":"\xBE","%BE":"\xBE","%bf":"\xBF","%Bf":"\xBF","%bF":"\xBF","%BF":"\xBF","%c0":"\xC0","%C0":"\xC0","%c1":"\xC1","%C1":"\xC1","%c2":"\xC2","%C2":"\xC2","%c3":"\xC3","%C3":"\xC3","%c4":"\xC4","%C4":"\xC4","%c5":"\xC5","%C5":"\xC5","%c6":"\xC6","%C6":"\xC6","%c7":"\xC7","%C7":"\xC7","%c8":"\xC8","%C8":"\xC8","%c9":"\xC9","%C9":"\xC9","%ca":"\xCA","%Ca":"\xCA","%cA":"\xCA","%CA":"\xCA","%cb":"\xCB","%Cb":"\xCB","%cB":"\xCB","%CB":"\xCB","%cc":"\xCC","%Cc":"\xCC","%cC":"\xCC","%CC":"\xCC","%cd":"\xCD","%Cd":"\xCD","%cD":"\xCD","%CD":"\xCD","%ce":"\xCE","%Ce":"\xCE","%cE":"\xCE","%CE":"\xCE","%cf":"\xCF","%Cf":"\xCF","%cF":"\xCF","%CF":"\xCF","%d0":"\xD0","%D0":"\xD0","%d1":"\xD1","%D1":"\xD1","%d2":"\xD2","%D2":"\xD2","%d3":"\xD3","%D3":"\xD3","%d4":"\xD4","%D4":"\xD4","%d5":"\xD5","%D5":"\xD5","%d6":"\xD6","%D6":"\xD6","%d7":"\xD7","%D7":"\xD7","%d8":"\xD8","%D8":"\xD8","%d9":"\xD9","%D9":"\xD9","%da":"\xDA","%Da":"\xDA","%dA":"\xDA","%DA":"\xDA","%db":"\xDB","%Db":"\xDB","%dB":"\xDB","%DB":"\xDB","%dc":"\xDC","%Dc":"\xDC","%dC":"\xDC","%DC":"\xDC","%dd":"\xDD","%Dd":"\xDD","%dD":"\xDD","%DD":"\xDD","%de":"\xDE","%De":"\xDE","%dE":"\xDE","%DE":"\xDE","%df":"\xDF","%Df":"\xDF","%dF":"\xDF","%DF":"\xDF","%e0":"\xE0","%E0":"\xE0","%e1":"\xE1","%E1":"\xE1","%e2":"\xE2","%E2":"\xE2","%e3":"\xE3","%E3":"\xE3","%e4":"\xE4","%E4":"\xE4","%e5":"\xE5","%E5":"\xE5","%e6":"\xE6","%E6":"\xE6","%e7":"\xE7","%E7":"\xE7","%e8":"\xE8","%E8":"\xE8","%e9":"\xE9","%E9":"\xE9","%ea":"\xEA","%Ea":"\xEA","%eA":"\xEA","%EA":"\xEA","%eb":"\xEB","%Eb":"\xEB","%eB":"\xEB","%EB":"\xEB","%ec":"\xEC","%Ec":"\xEC","%eC":"\xEC","%EC":"\xEC","%ed":"\xED","%Ed":"\xED","%eD":"\xED","%ED":"\xED","%ee":"\xLine truncated
`))}function Ry(A,e){let{headersList:t}=e,r=(t.get("referrer-policy")??"").split(","),s="";if(r.length>0)for(let i=r.length;i!==0;i--){let n=r[i-1].trim();if(Qy.has(n)){s=n;break}}s!==""&&(A.referrerPolicy=s)}function Ny(){return"allowed"}function my(){return"success"}function Fy(){return"success"}function ky(A){let e=null;e=A.mode,A.headersList.set("sec-fetch-mode",e)}function by(A){let e=A.origin;if(A.responseTainting==="cors"||A.mode==="websocket")e&&A.headersList.append("origin",e);else if(A.method!=="GET"&&A.method!=="HEAD"){switch(A.referrerPolicy){case"no-referrer":e=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":A.origin&&rE(A.origin)&&!rE(ls(A))&&(e=null);break;case"same-origin":ui(A,ls(A))||(e=null);break;default:}e&&A.headersList.append("origin",e)}}function Sy(A){return By.now()}function Uy(A){return{startTime:A.startTime??0,redirectStartTime:0,redirectEndTime:0,postRedirectStartTime:A.startTime??0,finalServiceWorkerStartTime:0,finalNetworkResponseStartTime:0,finalNetworkRequestStartTime:0,endTime:0,encodedBodySize:0,decodedBodySize:0,finalConnectionTimingInfo:null}}function Ly(){return{referrerPolicy:"strict-origin-when-cross-origin"}}function My(A){return{referrerPolicy:A.referrerPolicy}}function xy(A){let e=A.referrerPolicy;pr(e);let t=null;if(A.referrer==="client"){let o=Cy();if(!o||o.origin==="null")return"no-referrer";t=new URL(o)}else A.referrer instanceof URL&&(t=A.referrer);let r=eE(t),s=eE(t,!0);r.toString().length>4096&&(r=s);let i=ui(A,r),n=hs(r)&&!hs(A.url);switch(e){case"origin":return s??eE(t,!0);case"unsafe-url":return r;case"same-origin":return i?s:"no-referrer";case"origin-when-cross-origin":return i?r:s;case"strict-origin-when-cross-origin":{let o=ls(A);return ui(r,o)?r:hs(r)&&!hs(o)?"no-referrer":s}default:return n?"no-referrer":s}}function eE(A,e){return pr(A instanceof URL),A.protocol==="file:"||A.protocol==="about:"||A.protocol==="blank:"?"no-referrer":(A.username="",A.password="",A.hash="",e&&(A.pathname="",A.search=""),A)}function hs(A){if(!(A instanceof URL))return!1;if(A.href==="about:blank"||A.href==="about:srcdoc"||A.protocol==="data:"||A.protocol==="file:")return!0;return e(A.origin);function e(t){if(t==null||t==="null")return!1;let r=new URL(t);return!!(r.protocol==="https:"||r.protocol==="wss:"||/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(r.hostname)||r.hostname==="localhost"||r.hostname.includes("localhost.")||r.hostname.endsWith(".localhost"))}}function Yy(A,e){if(li===void 0)return!0;let t=mc(e);if(t==="no metadata"||t.length===0)return!0;let r=Gy(t),s=Jy(t,r);for(let i of s){let n=i.algo,o=i.hash,E=li.createHash(n).update(A).digest("base64");if(E[E.length-1]==="="&&(E[E.length-2]==="="?E=E.slice(0,-2):E=E.slice(0,-1)),vy(E,o))return!0}return!1}var Ty=/(?<algo>sha256|sha384|sha512)-((?<hash>[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;function mc(A){let e=[],t=!0;for(let r of A.split(" ")){t=!1;let s=Ty.exec(r);if(s===null||s.groups===void 0||s.groups.algo===void 0)continue;let i=s.groups.algo.toLowerCase();wc.includes(i)&&e.push(s.groups)}return t===!0?"no metadata":e}function Gy(A){let e=A[0].algo;if(e[3]==="5")return e;for(let t=1;t<A.length;++t){let r=A[t];if(r.algo[3]==="5"){e="sha512";break}else{if(e[3]==="3")continue;r.algo[3]==="3"&&(e="sha384")}}return e}function Jy(A,e){if(A.length===1)return A;let t=0;for(let r=0;r<A.length;++r)A[r].algo===e&&(A[t++]=A[r]);return A.length=t,A}function vy(A,e){if(A.length!==e.length)return!1;for(let t=0;t<A.length;++t)if(A[t]!==e[t]){if(A[t]==="+"&&e[t]==="-"||A[t]==="/"&&e[t]==="_")continue;return!1}return!0}function Hy(A){}function ui(A,e){return A.origin===e.origin&&A.origin==="null"||A.protocol===e.protocol&&A.hostname===e.hostname&&A.port===e.port}function Vy(){let A,e;return{promise:new Promise((r,s)=>{A=r,e=s}),resolve:A,reject:e}}function qy(A){return A.controller.state==="aborted"}function Oy(A){return A.controller.state==="aborted"||A.controller.state==="terminated"}var sE={delete:"DELETE",DELETE:"DELETE",get:"GET",GET:"GET",head:"HEAD",HEAD:"HEAD",options:"OPTIONS",OPTIONS:"OPTIONS",post:"POST",POST:"POST",put:"PUT",PUT:"PUT"};Object.setPrototypeOf(sE,null);function Wy(A){return sE[A.toLowerCase()]??A}function Py(A){let e=JSON.stringify(A);if(e===void 0)throw new TypeError("Value is not JSON serializable");return pr(typeof e=="string"),e}var _y=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function Xy(A,e,t){let r={index:0,kind:t,target:A},s={next(){if(Object.getPrototypeOf(this)!==s)throw new TypeError(`'next' called on an object that does not implement interface ${e} Iterator.`);let{index:i,kind:n,target:o}=r,E=o(),g=E.length;if(i>=g)return{value:void 0,done:!0};let a=E[i];return r.index=i+1,Zy(a,n)},[Symbol.toStringTag]:`${e} Iterator`};return Object.setPrototypeOf(s,_y),Object.setPrototypeOf({},s)}function Zy(A,e){let t;switch(e){case"key":{t=A[0];break}case"value":{t=A[1];break}case"key+value":{t Line truncated `))}function by(A,e){let{headersList:t}=e,r=(t.get("referrer-policy")??"").split(","),s="";if(r.length>0)for(let n=r.length;n!==0;n--){let i=r[n-1].trim();if(hy.has(i)){s=i;break}}s!==""&&(A.referrerPolicy=s)}function Sy(){return"allowed"}function Uy(){return"success"}function Ly(){return"success"}function My(A){let e=null;e=A.mode,A.headersList.set("sec-fetch-mode",e)}function xy(A){let e=A.origin;if(A.responseTainting==="cors"||A.mode==="websocket")e&&A.headersList.append("origin",e);else if(A.method!=="GET"&&A.method!=="HEAD"){switch(A.referrerPolicy){case"no-referrer":e=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":A.origin&&sE(A.origin)&&!sE(Bs(A))&&(e=null);break;case"same-origin":fn(A,Bs(A))||(e=null);break;default:}e&&A.headersList.append("origin",e)}}function Yy(A){return fy.now()}function Ty(A){return{startTime:A.startTime??0,redirectStartTime:0,redirectEndTime:0,postRedirectStartTime:A.startTime??0,finalServiceWorkerStartTime:0,finalNetworkResponseStartTime:0,finalNetworkRequestStartTime:0,endTime:0,encodedBodySize:0,decodedBodySize:0,finalConnectionTimingInfo:null}}function Gy(){return{referrerPolicy:"strict-origin-when-cross-origin"}}function Jy(A){return{referrerPolicy:A.referrerPolicy}}function vy(A){let e=A.referrerPolicy;lr(e);let t=null;if(A.referrer==="client"){let o=uy();if(!o||o.origin==="null")return"no-referrer";t=new URL(o)}else A.referrer instanceof URL&&(t=A.referrer);let r=tE(t),s=tE(t,!0);r.toString().length>4096&&(r=s);let n=fn(A,r),i=Cs(r)&&!Cs(A.url);switch(e){case"origin":return s??tE(t,!0);case"unsafe-url":return r;case"same-origin":return n?s:"no-referrer";case"origin-when-cross-origin":return n?r:s;case"strict-origin-when-cross-origin":{let o=Bs(A);return fn(r,o)?r:Cs(r)&&!Cs(o)?"no-referrer":s}default:return i?"no-referrer":s}}function tE(A,e){return lr(A instanceof URL),A.protocol==="file:"||A.protocol==="about:"||A.protocol==="blank:"?"no-referrer":(A.username="",A.password="",A.hash="",e&&(A.pathname="",A.search=""),A)}function Cs(A){if(!(A instanceof URL))return!1;if(A.href==="about:blank"||A.href==="about:srcdoc"||A.protocol==="data:"||A.protocol==="file:")return!0;return e(A.origin);function e(t){if(t==null||t==="null")return!1;let r=new URL(t);return!!(r.protocol==="https:"||r.protocol==="wss:"||/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(r.hostname)||r.hostname==="localhost"||r.hostname.includes("localhost.")||r.hostname.endsWith(".localhost"))}}function Hy(A,e){if(un===void 0)return!0;let t=kc(e);if(t==="no metadata"||t.length===0)return!0;let r=qy(t),s=Oy(t,r);for(let n of s){let i=n.algo,o=n.hash,E=un.createHash(i).update(A).digest("base64");if(E[E.length-1]==="="&&(E[E.length-2]==="="?E=E.slice(0,-2):E=E.slice(0,-1)),Wy(E,o))return!0}return!1}var Vy=/(?<algo>sha256|sha384|sha512)-((?<hash>[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;function kc(A){let e=[],t=!0;for(let r of A.split(" ")){t=!1;let s=Vy.exec(r);if(s===null||s.groups===void 0||s.groups.algo===void 0)continue;let n=s.groups.algo.toLowerCase();Rc.includes(n)&&e.push(s.groups)}return t===!0?"no metadata":e}function qy(A){let e=A[0].algo;if(e[3]==="5")return e;for(let t=1;t<A.length;++t){let r=A[t];if(r.algo[3]==="5"){e="sha512";break}else{if(e[3]==="3")continue;r.algo[3]==="3"&&(e="sha384")}}return e}function Oy(A,e){if(A.length===1)return A;let t=0;for(let r=0;r<A.length;++r)A[r].algo===e&&(A[t++]=A[r]);return A.length=t,A}function Wy(A,e){if(A.length!==e.length)return!1;for(let t=0;t<A.length;++t)if(A[t]!==e[t]){if(A[t]==="+"&&e[t]==="-"||A[t]==="/"&&e[t]==="_")continue;return!1}return!0}function Py(A){}function fn(A,e){return A.origin===e.origin&&A.origin==="null"||A.protocol===e.protocol&&A.hostname===e.hostname&&A.port===e.port}function _y(){let A,e;return{promise:new Promise((r,s)=>{A=r,e=s}),resolve:A,reject:e}}function Xy(A){return A.controller.state==="aborted"}function Zy(A){return A.controller.state==="aborted"||A.controller.state==="terminated"}var nE={delete:"DELETE",DELETE:"DELETE",get:"GET",GET:"GET",head:"HEAD",HEAD:"HEAD",options:"OPTIONS",OPTIONS:"OPTIONS",post:"POST",POST:"POST",put:"PUT",PUT:"PUT"};Object.setPrototypeOf(nE,null);function jy(A){return nE[A.toLowerCase()]??A}function Ky(A){let e=JSON.stringify(A);if(e===void 0)throw new TypeError("Value is not JSON serializable");return lr(typeof e=="string"),e}var zy=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function $y(A,e,t){let r={index:0,kind:t,target:A},s={next(){if(Object.getPrototypeOf(this)!==s)throw new TypeError(`'next' called on an object that does not implement interface ${e} Iterator.`);let{index:n,kind:i,target:o}=r,E=o(),g=E.length;if(n>=g)return{value:void 0,done:!0};let a=E[n];return r.index=n+1,Ap(a,i)},[Symbol.toStringTag]:`${e} Iterator`};return Object.setPrototypeOf(s,zy),Object.setPrototypeOf({},s)}function Ap(A,e){let t;switch(e){case"key":{t=A[0];break}case"value":{t=A[1];break}case"key+value":{t Line truncated
`||A===" "||A===" "}function iE(A,e=!0,t=!0){let r=0,s=A.length-1;if(e)for(;r<A.length&&Mc(A[r]);r++);if(t)for(;s>0&&Mc(A[s]);s--);return A.slice(r,s+1)}function xc(A){return A==="\r"||A===` `||A===" "||A===" "}function iE(A,e=!0,t=!0){let r=0,s=A.length-1;if(e)for(;r<A.length&&Yc(A[r]);r++);if(t)for(;s>0&&Yc(A[s]);s--);return A.slice(r,s+1)}function Tc(A){return A==="\r"||A===`
`||A===" "||A==="\f"||A===" "}function Bp(A,e=!0,t=!0){let r=0,s=A.length-1;if(e)for(;r<A.length&&xc(A[r]);r++);if(t)for(;s>0&&xc(A[s]);s--);return A.slice(r,s+1)}Jc.exports={dataURLProcessor:gp,URLSerializer:Yc,collectASequenceOfCodePoints:yi,collectASequenceOfCodePointsFast:wr,stringPercentDecode:Tc,parseMIMEType:nE,collectAnHTTPQuotedString:Gc,serializeAMimeType:Cp}});var pi=h((VU,Oc)=>{"use strict";var{Blob:Vc,File:vc}=require("buffer"),{types:oE}=require("util"),{kState:ge}=at(),{isBlobLike:qc}=De(),{webidl:Z}=OA(),{parseMIMEType:Ip,serializeAMimeType:hp}=Ye(),{kEnumerableProperty:Hc}=W(),lp=new TextEncoder,us=class A extends Vc{constructor(e,t,r={}){Z.argumentLengthCheck(arguments,2,{header:"File constructor"}),e=Z.converters["sequence<BlobPart>"](e),t=Z.converters.USVString(t),r=Z.converters.FilePropertyBag(r);let s=t,i=r.type,n;A:{if(i){if(i=Ip(i),i==="failure"){i="";break A}i=hp(i).toLowerCase()}n=r.lastModified}super(up(e,r),{type:i}),this[ge]={name:s,lastModified:n,type:i}}get name(){return Z.brandCheck(this,A),this[ge].name}get lastModified(){return Z.brandCheck(this,A),this[ge].lastModified}get type(){return Z.brandCheck(this,A),this[ge].type}},EE=class A{constructor(e,t,r={}){let s=t,i=r.type,n=r.lastModified??Date.now();this[ge]={blobLike:e,name:s,type:i,lastModified:n}}stream(...e){return Z.brandCheck(this,A),this[ge].blobLike.stream(...e)}arrayBuffer(...e){return Z.brandCheck(this,A),this[ge].blobLike.arrayBuffer(...e)}slice(...e){return Z.brandCheck(this,A),this[ge].blobLike.slice(...e)}text(...e){return Z.brandCheck(this,A),this[ge].blobLike.text(...e)}get size(){return Z.brandCheck(this,A),this[ge].blobLike.size}get type(){return Z.brandCheck(this,A),this[ge].blobLike.type}get name(){return Z.brandCheck(this,A),this[ge].name}get lastModified(){return Z.brandCheck(this,A),this[ge].lastModified}get[Symbol.toStringTag](){return"File"}};Object.defineProperties(us.prototype,{[Symbol.toStringTag]:{value:"File",configurable:!0},name:Hc,lastModified:Hc});Z.converters.Blob=Z.interfaceConverter(Vc);Z.converters.BlobPart=function(A,e){if(Z.util.Type(A)==="Object"){if(qc(A))return Z.converters.Blob(A,{strict:!1});if(ArrayBuffer.isView(A)||oE.isAnyArrayBuffer(A))return Z.converters.BufferSource(A,e)}return Z.converters.USVString(A,e)};Z.converters["sequence<BlobPart>"]=Z.sequenceConverter(Z.converters.BlobPart);Z.converters.FilePropertyBag=Z.dictionaryConverter([{key:"lastModified",converter:Z.converters["long long"],get defaultValue(){return Date.now()}},{key:"type",converter:Z.converters.DOMString,defaultValue:""},{key:"endings",converter:A=>(A=Z.converters.DOMString(A),A=A.toLowerCase(),A!=="native"&&(A="transparent"),A),defaultValue:"transparent"}]);function up(A,e){let t=[];for(let r of A)if(typeof r=="string"){let s=r;e.endings==="native"&&(s=fp(s)),t.push(lp.encode(s))}else oE.isAnyArrayBuffer(r)||oE.isTypedArray(r)?r.buffer?t.push(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)):t.push(new Uint8Array(r)):qc(r)&&t.push(r);return t}function fp(A){let e=` `||A===" "||A==="\f"||A===" "}function fp(A,e=!0,t=!0){let r=0,s=A.length-1;if(e)for(;r<A.length&&Tc(A[r]);r++);if(t)for(;s>0&&Tc(A[s]);s--);return A.slice(r,s+1)}Hc.exports={dataURLProcessor:Ip,URLSerializer:Gc,collectASequenceOfCodePoints:pn,collectASequenceOfCodePointsFast:ur,stringPercentDecode:Jc,parseMIMEType:oE,collectAnHTTPQuotedString:vc,serializeAMimeType:up}});var wn=h((ZU,Pc)=>{"use strict";var{Blob:Oc,File:Vc}=require("buffer"),{types:EE}=require("util"),{kState:Ee}=it(),{isBlobLike:Wc}=pe(),{webidl:X}=GA(),{parseMIMEType:dp,serializeAMimeType:yp}=Me(),{kEnumerableProperty:qc}=q(),pp=new TextEncoder,Is=class A extends Oc{constructor(e,t,r={}){X.argumentLengthCheck(arguments,2,{header:"File constructor"}),e=X.converters["sequence<BlobPart>"](e),t=X.converters.USVString(t),r=X.converters.FilePropertyBag(r);let s=t,n=r.type,i;A:{if(n){if(n=dp(n),n==="failure"){n="";break A}n=yp(n).toLowerCase()}i=r.lastModified}super(wp(e,r),{type:n}),this[Ee]={name:s,lastModified:i,type:n}}get name(){return X.brandCheck(this,A),this[Ee].name}get lastModified(){return X.brandCheck(this,A),this[Ee].lastModified}get type(){return X.brandCheck(this,A),this[Ee].type}},aE=class A{constructor(e,t,r={}){let s=t,n=r.type,i=r.lastModified??Date.now();this[Ee]={blobLike:e,name:s,type:n,lastModified:i}}stream(...e){return X.brandCheck(this,A),this[Ee].blobLike.stream(...e)}arrayBuffer(...e){return X.brandCheck(this,A),this[Ee].blobLike.arrayBuffer(...e)}slice(...e){return X.brandCheck(this,A),this[Ee].blobLike.slice(...e)}text(...e){return X.brandCheck(this,A),this[Ee].blobLike.text(...e)}get size(){return X.brandCheck(this,A),this[Ee].blobLike.size}get type(){return X.brandCheck(this,A),this[Ee].blobLike.type}get name(){return X.brandCheck(this,A),this[Ee].name}get lastModified(){return X.brandCheck(this,A),this[Ee].lastModified}get[Symbol.toStringTag](){return"File"}};Object.defineProperties(Is.prototype,{[Symbol.toStringTag]:{value:"File",configurable:!0},name:qc,lastModified:qc});X.converters.Blob=X.interfaceConverter(Oc);X.converters.BlobPart=function(A,e){if(X.util.Type(A)==="Object"){if(Wc(A))return X.converters.Blob(A,{strict:!1});if(ArrayBuffer.isView(A)||EE.isAnyArrayBuffer(A))return X.converters.BufferSource(A,e)}return X.converters.USVString(A,e)};X.converters["sequence<BlobPart>"]=X.sequenceConverter(X.converters.BlobPart);X.converters.FilePropertyBag=X.dictionaryConverter([{key:"lastModified",converter:X.converters["long long"],get defaultValue(){return Date.now()}},{key:"type",converter:X.converters.DOMString,defaultValue:""},{key:"endings",converter:A=>(A=X.converters.DOMString(A),A=A.toLowerCase(),A!=="native"&&(A="transparent"),A),defaultValue:"transparent"}]);function wp(A,e){let t=[];for(let r of A)if(typeof r=="string"){let s=r;e.endings==="native"&&(s=Dp(s)),t.push(pp.encode(s))}else EE.isAnyArrayBuffer(r)||EE.isTypedArray(r)?r.buffer?t.push(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)):t.push(new Uint8Array(r)):Wc(r)&&t.push(r);return t}function Dp(A){let e=`
`;return process.platform==="win32"&&(e=`\r `;return process.platform==="win32"&&(e=`\r
`),A.replace(/\r?\n/g,e)}function dp(A){return vc&&A instanceof vc||A instanceof us||A&&(typeof A.stream=="function"||typeof A.arrayBuffer=="function")&&A[Symbol.toStringTag]==="File"}Oc.exports={File:us,FileLike:EE,isFileLike:dp}});var Di=h((qU,Zc)=>{"use strict";var{isBlobLike:wi,toUSVString:yp,makeIterator:aE}=De(),{kState:JA}=at(),{File:Xc,FileLike:Wc,isFileLike:pp}=pi(),{webidl:AA}=OA(),{Blob:wp,File:gE}=require("buffer"),Pc=gE??Xc,Dr=class A{constructor(e){if(e!==void 0)throw AA.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]});this[JA]=[]}append(e,t,r=void 0){if(AA.brandCheck(this,A),AA.argumentLengthCheck(arguments,2,{header:"FormData.append"}),arguments.length===3&&!wi(t))throw new TypeError("Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'");e=AA.converters.USVString(e),t=wi(t)?AA.converters.Blob(t,{strict:!1}):AA.converters.USVString(t),r=arguments.length===3?AA.converters.USVString(r):void 0;let s=_c(e,t,r);this[JA].push(s)}delete(e){AA.brandCheck(this,A),AA.argumentLengthCheck(arguments,1,{header:"FormData.delete"}),e=AA.converters.USVString(e),this[JA]=this[JA].filter(t=>t.name!==e)}get(e){AA.brandCheck(this,A),AA.argumentLengthCheck(arguments,1,{header:"FormData.get"}),e=AA.converters.USVString(e);let t=this[JA].findIndex(r=>r.name===e);return t===-1?null:this[JA][t].value}getAll(e){return AA.brandCheck(this,A),AA.argumentLengthCheck(arguments,1,{header:"FormData.getAll"}),e=AA.converters.USVString(e),this[JA].filter(t=>t.name===e).map(t=>t.value)}has(e){return AA.brandCheck(this,A),AA.argumentLengthCheck(arguments,1,{header:"FormData.has"}),e=AA.converters.USVString(e),this[JA].findIndex(t=>t.name===e)!==-1}set(e,t,r=void 0){if(AA.brandCheck(this,A),AA.argumentLengthCheck(arguments,2,{header:"FormData.set"}),arguments.length===3&&!wi(t))throw new TypeError("Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'");e=AA.converters.USVString(e),t=wi(t)?AA.converters.Blob(t,{strict:!1}):AA.converters.USVString(t),r=arguments.length===3?yp(r):void 0;let s=_c(e,t,r),i=this[JA].findIndex(n=>n.name===e);i!==-1?this[JA]=[...this[JA].slice(0,i),s,...this[JA].slice(i+1).filter(n=>n.name!==e)]:this[JA].push(s)}entries(){return AA.brandCheck(this,A),aE(()=>this[JA].map(e=>[e.name,e.value]),"FormData","key+value")}keys(){return AA.brandCheck(this,A),aE(()=>this[JA].map(e=>[e.name,e.value]),"FormData","key")}values(){return AA.brandCheck(this,A),aE(()=>this[JA].map(e=>[e.name,e.value]),"FormData","value")}forEach(e,t=globalThis){if(AA.brandCheck(this,A),AA.argumentLengthCheck(arguments,1,{header:"FormData.forEach"}),typeof e!="function")throw new TypeError("Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'.");for(let[r,s]of this)e.apply(t,[s,r,this])}};Dr.prototype[Symbol.iterator]=Dr.prototype.entries;Object.defineProperties(Dr.prototype,{[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function _c(A,e,t){if(A=Buffer.from(A).toString("utf8"),typeof e=="string")e=Buffer.from(e).toString("utf8");else if(pp(e)||(e=e instanceof wp?new Pc([e],"blob",{type:e.type}):new Wc(e,"blob",{type:e.type})),t!==void 0){let r={type:e.type,lastModified:e.lastModified};e=gE&&e instanceof gE||e instanceof Xc?new Pc([e],t,r):new Wc(e,t,r)}return{name:A,value:e}}Zc.exports={FormData:Dr}});var fs=h((OU,sC)=>{"use strict";var Dp=Cc(),Rr=W(),{ReadableStreamFrom:Rp,isBlobLike:jc,isReadableStreamLike:Np,readableStreamClose:mp,createDeferredPromise:Fp,fullyReadBody:kp}=De(),{FormData:Kc}=Di(),{kState:Qt}=at(),{webidl:QE}=OA(),{DOMException:AC,structuredClone:bp}=mt(),{Blob:Sp,File:Up}=require("buffer"),{kBodyUsed:Lp}=EA(),cE=require("assert"),{isErrored:Mp}=W(),{isUint8Array:eC,isArrayBuffer:xp}=require("util/types"),{File:Yp}=pi(),{parseMIMEType:Tp,serializeAMimeType:Gp}=Ye(),CE;try{let A=require("node:crypto");CE=e=>A.randomInt(0,e)}catch{CE=A=>Math.floor(Math.random(A))}var gt=globalThis.ReadableStream,zc=Up??Yp,Ri=new TextEncoder,Jp=new TextDecoder;function tC(A,e=!1){gt||(gt=require("stream/web").ReadableStream);let t=null;A instanceof gt?t=A:jc(A)?t=A.stream():t=new gt({async pull(E){E.enqueue(typeof s=="string"?Ri.encode(s):s),queueMicrotask(()=>mp(E))},start(){},type:void 0}),cE(Np(t));let r=null,s=null,i=null,n=null;if(typeof A=="string")s=A,n="text/plain;charset=UTF-8";else if(A instanceof URLSearchParams)s=A.toString(),n="application/x-www-form-urlencoded;charset=UTF-8";else if(xp(A))s=new Uint8Array(A.slice());else if(ArrayBuffer.isView(A))s=new Uint8Array(A.buffer.slice(A.byteOffset,A.byteOffset+A.byteLength));else if(Rr.isFormDataLike(A)){let E=`----formdata-undici-0${`${CE(1e11)}`.padStart(11,"0")}`,g=`--${E}\r `),A.replace(/\r?\n/g,e)}function Rp(A){return Vc&&A instanceof Vc||A instanceof Is||A&&(typeof A.stream=="function"||typeof A.arrayBuffer=="function")&&A[Symbol.toStringTag]==="File"}Pc.exports={File:Is,FileLike:aE,isFileLike:Rp}});var Rn=h((jU,Kc)=>{"use strict";var{isBlobLike:Dn,toUSVString:Np,makeIterator:gE}=pe(),{kState:LA}=it(),{File:jc,FileLike:_c,isFileLike:mp}=wn(),{webidl:z}=GA(),{Blob:Fp,File:QE}=require("buffer"),Xc=QE??jc,fr=class A{constructor(e){if(e!==void 0)throw z.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]});this[LA]=[]}append(e,t,r=void 0){if(z.brandCheck(this,A),z.argumentLengthCheck(arguments,2,{header:"FormData.append"}),arguments.length===3&&!Dn(t))throw new TypeError("Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'");e=z.converters.USVString(e),t=Dn(t)?z.converters.Blob(t,{strict:!1}):z.converters.USVString(t),r=arguments.length===3?z.converters.USVString(r):void 0;let s=Zc(e,t,r);this[LA].push(s)}delete(e){z.brandCheck(this,A),z.argumentLengthCheck(arguments,1,{header:"FormData.delete"}),e=z.converters.USVString(e),this[LA]=this[LA].filter(t=>t.name!==e)}get(e){z.brandCheck(this,A),z.argumentLengthCheck(arguments,1,{header:"FormData.get"}),e=z.converters.USVString(e);let t=this[LA].findIndex(r=>r.name===e);return t===-1?null:this[LA][t].value}getAll(e){return z.brandCheck(this,A),z.argumentLengthCheck(arguments,1,{header:"FormData.getAll"}),e=z.converters.USVString(e),this[LA].filter(t=>t.name===e).map(t=>t.value)}has(e){return z.brandCheck(this,A),z.argumentLengthCheck(arguments,1,{header:"FormData.has"}),e=z.converters.USVString(e),this[LA].findIndex(t=>t.name===e)!==-1}set(e,t,r=void 0){if(z.brandCheck(this,A),z.argumentLengthCheck(arguments,2,{header:"FormData.set"}),arguments.length===3&&!Dn(t))throw new TypeError("Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'");e=z.converters.USVString(e),t=Dn(t)?z.converters.Blob(t,{strict:!1}):z.converters.USVString(t),r=arguments.length===3?Np(r):void 0;let s=Zc(e,t,r),n=this[LA].findIndex(i=>i.name===e);n!==-1?this[LA]=[...this[LA].slice(0,n),s,...this[LA].slice(n+1).filter(i=>i.name!==e)]:this[LA].push(s)}entries(){return z.brandCheck(this,A),gE(()=>this[LA].map(e=>[e.name,e.value]),"FormData","key+value")}keys(){return z.brandCheck(this,A),gE(()=>this[LA].map(e=>[e.name,e.value]),"FormData","key")}values(){return z.brandCheck(this,A),gE(()=>this[LA].map(e=>[e.name,e.value]),"FormData","value")}forEach(e,t=globalThis){if(z.brandCheck(this,A),z.argumentLengthCheck(arguments,1,{header:"FormData.forEach"}),typeof e!="function")throw new TypeError("Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'.");for(let[r,s]of this)e.apply(t,[s,r,this])}};fr.prototype[Symbol.iterator]=fr.prototype.entries;Object.defineProperties(fr.prototype,{[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function Zc(A,e,t){if(A=Buffer.from(A).toString("utf8"),typeof e=="string")e=Buffer.from(e).toString("utf8");else if(mp(e)||(e=e instanceof Fp?new Xc([e],"blob",{type:e.type}):new _c(e,"blob",{type:e.type})),t!==void 0){let r={type:e.type,lastModified:e.lastModified};e=QE&&e instanceof QE||e instanceof jc?new Xc([e],t,r):new _c(e,t,r)}return{name:A,value:e}}Kc.exports={FormData:fr}});var hs=h((KU,iC)=>{"use strict";var kp=Ic(),dr=q(),{ReadableStreamFrom:bp,isBlobLike:zc,isReadableStreamLike:Sp,readableStreamClose:Up,createDeferredPromise:Lp,fullyReadBody:Mp}=pe(),{FormData:$c}=Rn(),{kState:Et}=it(),{webidl:cE}=GA(),{DOMException:tC,structuredClone:xp}=Rt(),{Blob:Yp,File:Tp}=require("buffer"),{kBodyUsed:Gp}=nA(),CE=require("assert"),{isErrored:Jp}=q(),{isUint8Array:rC,isArrayBuffer:vp}=require("util/types"),{File:Hp}=wn(),{parseMIMEType:Vp,serializeAMimeType:qp}=Me(),BE;try{let A=require("node:crypto");BE=e=>A.randomInt(0,e)}catch{BE=A=>Math.floor(Math.random(A))}var ot=globalThis.ReadableStream,AC=Tp??Hp,Nn=new TextEncoder,Op=new TextDecoder;function sC(A,e=!1){ot||(ot=require("stream/web").ReadableStream);let t=null;A instanceof ot?t=A:zc(A)?t=A.stream():t=new ot({async pull(E){E.enqueue(typeof s=="string"?Nn.encode(s):s),queueMicrotask(()=>Up(E))},start(){},type:void 0}),CE(Sp(t));let r=null,s=null,n=null,i=null;if(typeof A=="string")s=A,i="text/plain;charset=UTF-8";else if(A instanceof URLSearchParams)s=A.toString(),i="application/x-www-form-urlencoded;charset=UTF-8";else if(vp(A))s=new Uint8Array(A.slice());else if(ArrayBuffer.isView(A))s=new Uint8Array(A.buffer.slice(A.byteOffset,A.byteOffset+A.byteLength));else if(dr.isFormDataLike(A)){let E=`----formdata-undici-0${`${BE(1e11)}`.padStart(11,"0")}`,g=`--${E}\r
Content-Disposition: form-data`;let a=u=>u.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),Q=u=>u.replace(/\r?\n|\r/g,`\r Content-Disposition: form-data`;let a=l=>l.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),Q=l=>l.replace(/\r?\n|\r/g,`\r
`),c=[],B=new Uint8Array([13,10]);i=0;let C=!1;for(let[u,y]of A)if(typeof y=="string"){let R=Ri.encode(g+`; name="${a(Q(u))}"\r `),c=[],B=new Uint8Array([13,10]);n=0;let C=!1;for(let[l,y]of A)if(typeof y=="string"){let R=Nn.encode(g+`; name="${a(Q(l))}"\r
\r \r
${Q(y)}\r ${Q(y)}\r
`);c.push(R),i+=R.byteLength}else{let R=Ri.encode(`${g}; name="${a(Q(u))}"`+(y.name?`; filename="${a(y.name)}"`:"")+`\r `);c.push(R),n+=R.byteLength}else{let R=Nn.encode(`${g}; name="${a(Q(l))}"`+(y.name?`; filename="${a(y.name)}"`:"")+`\r
Content-Type: ${y.type||"application/octet-stream"}\r Content-Type: ${y.type||"application/octet-stream"}\r
\r \r
`);c.push(R,y,B),typeof y.size=="number"?i+=R.byteLength+y.size+B.byteLength:C=!0}let d=Ri.encode(`--${E}--`);c.push(d),i+=d.byteLength,C&&(i=null),s=A,r=async function*(){for(let u of c)u.stream?yield*u.stream():yield u},n="multipart/form-data; boundary="+E}else if(jc(A))s=A,i=A.size,A.type&&(n=A.type);else if(typeof A[Symbol.asyncIterator]=="function"){if(e)throw new TypeError("keepalive");if(Rr.isDisturbed(A)||A.locked)throw new TypeError("Response body object should not be disturbed or locked");t=A instanceof gt?A:Rp(A)}if((typeof s=="string"||Rr.isBuffer(s))&&(i=Buffer.byteLength(s)),r!=null){let E;t=new gt({async start(){E=r(A)[Symbol.asyncIterator]()},async pull(g){let{value:a,done:Q}=await E.next();return Q?queueMicrotask(()=>{g.close()}):Mp(t)||g.enqueue(new Uint8Array(a)),g.desiredSize>0},async cancel(g){await E.return()},type:void 0})}return[{stream:t,source:s,length:i},n]}function vp(A,e=!1){return gt||(gt=require("stream/web").ReadableStream),A instanceof gt&&(cE(!Rr.isDisturbed(A),"The body has already been consumed."),cE(!A.locked,"The stream is locked.")),tC(A,e)}function Hp(A){let[e,t]=A.stream.tee(),r=bp(t,{transfer:[t]}),[,s]=r.tee();return A.stream=e,{stream:s,length:A.length,source:A.source}}async function*$c(A){if(A)if(eC(A))yield A;else{let e=A.stream;if(Rr.isDisturbed(e))throw new TypeError("The body has already been consumed.");if(e.locked)throw new TypeError("The stream is locked.");e[Lp]=!0,yield*e}}function BE(A){if(A.aborted)throw new AC("The operation was aborted.","AbortError")}function Vp(A){return{blob(){return Ni(this,t=>{let r=Pp(this);return r==="failure"?r="":r&&(r=Gp(r)),new Sp([t],{type:r})},A)},arrayBuffer(){return Ni(this,t=>new Uint8Array(t).buffer,A)},text(){return Ni(this,rC,A)},json(){return Ni(this,Wp,A)},async formData(){QE.brandCheck(this,A),BE(this[Qt]);let t=this.headers.get("Content-Type");if(/multipart\/form-data/.test(t)){let r={};for(let[o,E]of this.headers)r[o.toLowerCase()]=E;let s=new Kc,i;try{i=new Dp({headers:r,preservePath:!0})}catch(o){throw new AC(`${o}`,"AbortError")}i.on("field",(o,E)=>{s.append(o,E)}),i.on("file",(o,E,g,a,Q)=>{let c=[];if(a==="base64"||a.toLowerCase()==="base64"){let B="";E.on("data",C=>{B+=C.toString().replace(/[\r\n]/gm,"");let d=B.length-B.length%4;c.push(Buffer.from(B.slice(0,d),"base64")),B=B.slice(d)}),E.on("end",()=>{c.push(Buffer.from(B,"base64")),s.append(o,new zc(c,g,{type:Q}))})}else E.on("data",B=>{c.push(B)}),E.on("end",()=>{s.append(o,new zc(c,g,{type:Q}))})});let n=new Promise((o,E)=>{i.on("finish",o),i.on("error",g=>E(new TypeError(g)))});if(this.body!==null)for await(let o of $c(this[Qt].body))i.write(o);return i.end(),await n,s}else if(/application\/x-www-form-urlencoded/.test(t)){let r;try{let i="",n=new TextDecoder("utf-8",{ignoreBOM:!0});for await(let o of $c(this[Qt].body)){if(!eC(o))throw new TypeError("Expected Uint8Array chunk");i+=n.decode(o,{stream:!0})}i+=n.decode(),r=new URLSearchParams(i)}catch(i){throw Object.assign(new TypeError,{cause:i})}let s=new Kc;for(let[i,n]of r)s.append(i,n);return s}else throw await Promise.resolve(),BE(this[Qt]),QE.errors.exception({header:`${A.name}.formData`,message:"Could not parse content as FormData."})}}}function qp(A){Object.assign(A.prototype,Vp(A))}async function Ni(A,e,t){if(QE.brandCheck(A,t),BE(A[Qt]),Op(A[Qt].body))throw new TypeError("Body is unusable");let r=Fp(),s=n=>r.reject(n),i=n=>{try{r.resolve(e(n))}catch(o){s(o)}};return A[Qt].body==null?(i(new Uint8Array),r.promise):(await kp(A[Qt].body,i,s),r.promise)}function Op(A){return A!=null&&(A.stream.locked||Rr.isDisturbed(A.stream))}function rC(A){return A.length===0?"":(A[0]===239&&A[1]===187&&A[2]===191&&(A=A.subarray(3)),Jp.decode(A))}function Wp(A){return JSON.parse(rC(A))}function Pp(A){let{headersList:e}=A[Qt],t=e.get("content-type");return t===null?"failure":Tp(t)}sC.exports={extractBody:tC,safelyExtractBody:vp,cloneBody:Hp,mixinBody:qp}});var EC=h((WU,oC)=>{"use strict";var{InvalidArgumentError:iA,NotSupportedError:_p}=tA(),ct=require("assert"),{kHTTP2BuildRequest:Xp,kHTTP2CopyHeaders:Zp,kHTTP1BuildRequest:jp}=EA(),$A=W(),iC=/^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/,nC=/[^\t\x20-\x7e\x80-\xff]/,Kp=/[^\u0021-\u00ff]/,Te=Symbol("handler"),NA={},IE;try{let A=require("diagnostics_channel");NA.create=A.channel("undici:request:create"),NA.bodySent=A.channel("undici:request:bodySent"),NA.headers=A.channel("undici:request:headers"),NA.trailers=A.channel("undici:request:trailers"),NA.error=A.channel("undici:request:error")}catch{NA.create={hasSubscribers:!1},NA.bodySent={hasSubscribers:!1},NA.headers={hasSubscribers:!1},NA.trailers={hasSubscribers:!1},NA.error={hasSubscribers:!1}}var hE=class A{constructor(e,{path:t,method:r,body:s,headers:i,query:n,idempotent:o,blocking:E,upgrade:g,headersTimeout:a,bodyTimeout:Q,reset:c,throwOnError:B,expectContinue:C},d){if(typeof t!="string")throw new iA("path must be a string");if(t[0]!=="/"&&!(t.startsWith("http://")||t.startsWith("https://"))&&r!=="CONNECT")throw new iA("Line truncated `);c.push(R,y,B),typeof y.size=="number"?n+=R.byteLength+y.size+B.byteLength:C=!0}let f=Nn.encode(`--${E}--`);c.push(f),n+=f.byteLength,C&&(n=null),s=A,r=async function*(){for(let l of c)l.stream?yield*l.stream():yield l},i="multipart/form-data; boundary="+E}else if(zc(A))s=A,n=A.size,A.type&&(i=A.type);else if(typeof A[Symbol.asyncIterator]=="function"){if(e)throw new TypeError("keepalive");if(dr.isDisturbed(A)||A.locked)throw new TypeError("Response body object should not be disturbed or locked");t=A instanceof ot?A:bp(A)}if((typeof s=="string"||dr.isBuffer(s))&&(n=Buffer.byteLength(s)),r!=null){let E;t=new ot({async start(){E=r(A)[Symbol.asyncIterator]()},async pull(g){let{value:a,done:Q}=await E.next();return Q?queueMicrotask(()=>{g.close()}):Jp(t)||g.enqueue(new Uint8Array(a)),g.desiredSize>0},async cancel(g){await E.return()},type:void 0})}return[{stream:t,source:s,length:n},i]}function Wp(A,e=!1){return ot||(ot=require("stream/web").ReadableStream),A instanceof ot&&(CE(!dr.isDisturbed(A),"The body has already been consumed."),CE(!A.locked,"The stream is locked.")),sC(A,e)}function Pp(A){let[e,t]=A.stream.tee(),r=xp(t,{transfer:[t]}),[,s]=r.tee();return A.stream=e,{stream:s,length:A.length,source:A.source}}async function*eC(A){if(A)if(rC(A))yield A;else{let e=A.stream;if(dr.isDisturbed(e))throw new TypeError("The body has already been consumed.");if(e.locked)throw new TypeError("The stream is locked.");e[Gp]=!0,yield*e}}function IE(A){if(A.aborted)throw new tC("The operation was aborted.","AbortError")}function _p(A){return{blob(){return mn(this,t=>{let r=Kp(this);return r==="failure"?r="":r&&(r=qp(r)),new Yp([t],{type:r})},A)},arrayBuffer(){return mn(this,t=>new Uint8Array(t).buffer,A)},text(){return mn(this,nC,A)},json(){return mn(this,jp,A)},async formData(){cE.brandCheck(this,A),IE(this[Et]);let t=this.headers.get("Content-Type");if(/multipart\/form-data/.test(t)){let r={};for(let[o,E]of this.headers)r[o.toLowerCase()]=E;let s=new $c,n;try{n=new kp({headers:r,preservePath:!0})}catch(o){throw new tC(`${o}`,"AbortError")}n.on("field",(o,E)=>{s.append(o,E)}),n.on("file",(o,E,g,a,Q)=>{let c=[];if(a==="base64"||a.toLowerCase()==="base64"){let B="";E.on("data",C=>{B+=C.toString().replace(/[\r\n]/gm,"");let f=B.length-B.length%4;c.push(Buffer.from(B.slice(0,f),"base64")),B=B.slice(f)}),E.on("end",()=>{c.push(Buffer.from(B,"base64")),s.append(o,new AC(c,g,{type:Q}))})}else E.on("data",B=>{c.push(B)}),E.on("end",()=>{s.append(o,new AC(c,g,{type:Q}))})});let i=new Promise((o,E)=>{n.on("finish",o),n.on("error",g=>E(new TypeError(g)))});if(this.body!==null)for await(let o of eC(this[Et].body))n.write(o);return n.end(),await i,s}else if(/application\/x-www-form-urlencoded/.test(t)){let r;try{let n="",i=new TextDecoder("utf-8",{ignoreBOM:!0});for await(let o of eC(this[Et].body)){if(!rC(o))throw new TypeError("Expected Uint8Array chunk");n+=i.decode(o,{stream:!0})}n+=i.decode(),r=new URLSearchParams(n)}catch(n){throw Object.assign(new TypeError,{cause:n})}let s=new $c;for(let[n,i]of r)s.append(n,i);return s}else throw await Promise.resolve(),IE(this[Et]),cE.errors.exception({header:`${A.name}.formData`,message:"Could not parse content as FormData."})}}}function Xp(A){Object.assign(A.prototype,_p(A))}async function mn(A,e,t){if(cE.brandCheck(A,t),IE(A[Et]),Zp(A[Et].body))throw new TypeError("Body is unusable");let r=Lp(),s=i=>r.reject(i),n=i=>{try{r.resolve(e(i))}catch(o){s(o)}};return A[Et].body==null?(n(new Uint8Array),r.promise):(await Mp(A[Et].body,n,s),r.promise)}function Zp(A){return A!=null&&(A.stream.locked||dr.isDisturbed(A.stream))}function nC(A){return A.length===0?"":(A[0]===239&&A[1]===187&&A[2]===191&&(A=A.subarray(3)),Op.decode(A))}function jp(A){return JSON.parse(nC(A))}function Kp(A){let{headersList:e}=A[Et],t=e.get("content-type");return t===null?"failure":Vp(t)}iC.exports={extractBody:sC,safelyExtractBody:Wp,cloneBody:Pp,mixinBody:Xp}});var gC=h((zU,aC)=>{"use strict";var{InvalidArgumentError:rA,NotSupportedError:zp}=AA(),at=require("assert"),{kHTTP2BuildRequest:$p,kHTTP2CopyHeaders:Aw,kHTTP1BuildRequest:ew}=nA(),XA=q(),oC=/^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/,EC=/[^\t\x20-\x7e\x80-\xff]/,tw=/[^\u0021-\u00ff]/,xe=Symbol("handler"),yA={},hE;try{let A=require("diagnostics_channel");yA.create=A.channel("undici:request:create"),yA.bodySent=A.channel("undici:request:bodySent"),yA.headers=A.channel("undici:request:headers"),yA.trailers=A.channel("undici:request:trailers"),yA.error=A.channel("undici:request:error")}catch{yA.create={hasSubscribers:!1},yA.bodySent={hasSubscribers:!1},yA.headers={hasSubscribers:!1},yA.trailers={hasSubscribers:!1},yA.error={hasSubscribers:!1}}var lE=class A{constructor(e,{path:t,method:r,body:s,headers:n,query:i,idempotent:o,blocking:E,upgrade:g,headersTimeout:a,bodyTimeout:Q,reset:c,throwOnError:B,expectContinue:C},f){if(typeof t!="string")throw new rA("path must be a string");if(t[0]!=="/"&&!(t.startsWith("http://")||t.startsWith("https://"))&&r!=="CONNECT")throw new rA("Line truncated
`),this.body=u.stream,this.contentLength=u.length}else $A.isBlobLike(s)&&this.contentType==null&&s.type&&(this.contentType=s.type,this.headers+=`content-type: ${s.type}\r `),this.body=l.stream,this.contentLength=l.length}else XA.isBlobLike(s)&&this.contentType==null&&s.type&&(this.contentType=s.type,this.headers+=`content-type: ${s.type}\r
`);$A.validateHandler(d,r,g),this.servername=$A.getServerName(this.host),this[Te]=d,NA.create.hasSubscribers&&NA.create.publish({request:this})}onBodySent(e){if(this[Te].onBodySent)try{return this[Te].onBodySent(e)}catch(t){this.abort(t)}}onRequestSent(){if(NA.bodySent.hasSubscribers&&NA.bodySent.publish({request:this}),this[Te].onRequestSent)try{return this[Te].onRequestSent()}catch(e){this.abort(e)}}onConnect(e){if(ct(!this.aborted),ct(!this.completed),this.error)e(this.error);else return this.abort=e,this[Te].onConnect(e)}onHeaders(e,t,r,s){ct(!this.aborted),ct(!this.completed),NA.headers.hasSubscribers&&NA.headers.publish({request:this,response:{statusCode:e,headers:t,statusText:s}});try{return this[Te].onHeaders(e,t,r,s)}catch(i){this.abort(i)}}onData(e){ct(!this.aborted),ct(!this.completed);try{return this[Te].onData(e)}catch(t){return this.abort(t),!1}}onUpgrade(e,t,r){return ct(!this.aborted),ct(!this.completed),this[Te].onUpgrade(e,t,r)}onComplete(e){this.onFinally(),ct(!this.aborted),this.completed=!0,NA.trailers.hasSubscribers&&NA.trailers.publish({request:this,trailers:e});try{return this[Te].onComplete(e)}catch(t){this.onError(t)}}onError(e){if(this.onFinally(),NA.error.hasSubscribers&&NA.error.publish({request:this,error:e}),!this.aborted)return this.aborted=!0,this[Te].onError(e)}onFinally(){this.errorHandler&&(this.body.off("error",this.errorHandler),this.errorHandler=null),this.endHandler&&(this.body.off("end",this.endHandler),this.endHandler=null)}addHeader(e,t){return ds(this,e,t),this}static[jp](e,t,r){return new A(e,t,r)}static[Xp](e,t,r){let s=t.headers;t={...t,headers:null};let i=new A(e,t,r);if(i.headers={},Array.isArray(s)){if(s.length%2!==0)throw new iA("headers array must be even");for(let n=0;n<s.length;n+=2)ds(i,s[n],s[n+1],!0)}else if(s&&typeof s=="object"){let n=Object.keys(s);for(let o=0;o<n.length;o++){let E=n[o];ds(i,E,s[E],!0)}}else if(s!=null)throw new iA("headers must be an object or an array");return i}static[Zp](e){let t=e.split(`\r `);XA.validateHandler(f,r,g),this.servername=XA.getServerName(this.host),this[xe]=f,yA.create.hasSubscribers&&yA.create.publish({request:this})}onBodySent(e){if(this[xe].onBodySent)try{return this[xe].onBodySent(e)}catch(t){this.abort(t)}}onRequestSent(){if(yA.bodySent.hasSubscribers&&yA.bodySent.publish({request:this}),this[xe].onRequestSent)try{return this[xe].onRequestSent()}catch(e){this.abort(e)}}onConnect(e){if(at(!this.aborted),at(!this.completed),this.error)e(this.error);else return this.abort=e,this[xe].onConnect(e)}onHeaders(e,t,r,s){at(!this.aborted),at(!this.completed),yA.headers.hasSubscribers&&yA.headers.publish({request:this,response:{statusCode:e,headers:t,statusText:s}});try{return this[xe].onHeaders(e,t,r,s)}catch(n){this.abort(n)}}onData(e){at(!this.aborted),at(!this.completed);try{return this[xe].onData(e)}catch(t){return this.abort(t),!1}}onUpgrade(e,t,r){return at(!this.aborted),at(!this.completed),this[xe].onUpgrade(e,t,r)}onComplete(e){this.onFinally(),at(!this.aborted),this.completed=!0,yA.trailers.hasSubscribers&&yA.trailers.publish({request:this,trailers:e});try{return this[xe].onComplete(e)}catch(t){this.onError(t)}}onError(e){if(this.onFinally(),yA.error.hasSubscribers&&yA.error.publish({request:this,error:e}),!this.aborted)return this.aborted=!0,this[xe].onError(e)}onFinally(){this.errorHandler&&(this.body.off("error",this.errorHandler),this.errorHandler=null),this.endHandler&&(this.body.off("end",this.endHandler),this.endHandler=null)}addHeader(e,t){return ls(this,e,t),this}static[ew](e,t,r){return new A(e,t,r)}static[$p](e,t,r){let s=t.headers;t={...t,headers:null};let n=new A(e,t,r);if(n.headers={},Array.isArray(s)){if(s.length%2!==0)throw new rA("headers array must be even");for(let i=0;i<s.length;i+=2)ls(n,s[i],s[i+1],!0)}else if(s&&typeof s=="object"){let i=Object.keys(s);for(let o=0;o<i.length;o++){let E=i[o];ls(n,E,s[E],!0)}}else if(s!=null)throw new rA("headers must be an object or an array");return n}static[Aw](e){let t=e.split(`\r
`),r={};for(let s of t){let[i,n]=s.split(": ");n==null||n.length===0||(r[i]?r[i]+=`,${n}`:r[i]=n)}return r}};function Wt(A,e,t){if(e&&typeof e=="object")throw new iA(`invalid ${A} header`);if(e=e!=null?`${e}`:"",nC.exec(e)!==null)throw new iA(`invalid ${A} header`);return t?e:`${A}: ${e}\r `),r={};for(let s of t){let[n,i]=s.split(": ");i==null||i.length===0||(r[n]?r[n]+=`,${i}`:r[n]=i)}return r}};function Ht(A,e,t){if(e&&typeof e=="object")throw new rA(`invalid ${A} header`);if(e=e!=null?`${e}`:"",EC.exec(e)!==null)throw new rA(`invalid ${A} header`);return t?e:`${A}: ${e}\r
`}function ds(A,e,t,r=!1){if(t&&typeof t=="object"&&!Array.isArray(t))throw new iA(`invalid ${e} header`);if(t===void 0)return;if(A.host===null&&e.length===4&&e.toLowerCase()==="host"){if(nC.exec(t)!==null)throw new iA(`invalid ${e} header`);A.host=t}else if(A.contentLength===null&&e.length===14&&e.toLowerCase()==="content-length"){if(A.contentLength=parseInt(t,10),!Number.isFinite(A.contentLength))throw new iA("invalid content-length header")}else if(A.contentType===null&&e.length===12&&e.toLowerCase()==="content-type")A.contentType=t,r?A.headers[e]=Wt(e,t,r):A.headers+=Wt(e,t);else{if(e.length===17&&e.toLowerCase()==="transfer-encoding")throw new iA("invalid transfer-encoding header");if(e.length===10&&e.toLowerCase()==="connection"){let s=typeof t=="string"?t.toLowerCase():null;if(s!=="close"&&s!=="keep-alive")throw new iA("invalid connection header");s==="close"&&(A.reset=!0)}else{if(e.length===10&&e.toLowerCase()==="keep-alive")throw new iA("invalid keep-alive header");if(e.length===7&&e.toLowerCase()==="upgrade")throw new iA("invalid upgrade header");if(e.length===6&&e.toLowerCase()==="expect")throw new _p("expect header not supported");if(iC.exec(e)===null)throw new iA("invalid header key");if(Array.isArray(t))for(let s=0;s<t.length;s++)r?A.headers[e]?A.headers[e]+=`,${Wt(e,t[s],r)}`:A.headers[e]=Wt(e,t[s],r):A.headers+=Wt(e,t[s]);else r?A.headers[e]=Wt(e,t,r):A.headers+=Wt(e,t)}}}oC.exports=hE});var mi=h((PU,aC)=>{"use strict";var zp=require("events"),lE=class extends zp{dispatch(){throw new Error("not implemented")}close(){throw new Error("not implemented")}destroy(){throw new Error("not implemented")}};aC.exports=lE});var ps=h((_U,gC)=>{"use strict";var $p=mi(),{ClientDestroyedError:uE,ClientClosedError:Aw,InvalidArgumentError:Nr}=tA(),{kDestroy:ew,kClose:tw,kDispatch:fE,kInterceptors:Pt}=EA(),mr=Symbol("destroyed"),ys=Symbol("closed"),Ct=Symbol("onDestroyed"),Fr=Symbol("onClosed"),Fi=Symbol("Intercepted Dispatch"),dE=class extends $p{constructor(){super(),this[mr]=!1,this[Ct]=null,this[ys]=!1,this[Fr]=[]}get destroyed(){return this[mr]}get closed(){return this[ys]}get interceptors(){return this[Pt]}set interceptors(e){if(e){for(let t=e.length-1;t>=0;t--)if(typeof this[Pt][t]!="function")throw new Nr("interceptor must be an function")}this[Pt]=e}close(e){if(e===void 0)return new Promise((r,s)=>{this.close((i,n)=>i?s(i):r(n))});if(typeof e!="function")throw new Nr("invalid callback");if(this[mr]){queueMicrotask(()=>e(new uE,null));return}if(this[ys]){this[Fr]?this[Fr].push(e):queueMicrotask(()=>e(null,null));return}this[ys]=!0,this[Fr].push(e);let t=()=>{let r=this[Fr];this[Fr]=null;for(let s=0;s<r.length;s++)r[s](null,null)};this[tw]().then(()=>this.destroy()).then(()=>{queueMicrotask(t)})}destroy(e,t){if(typeof e=="function"&&(t=e,e=null),t===void 0)return new Promise((s,i)=>{this.destroy(e,(n,o)=>n?i(n):s(o))});if(typeof t!="function")throw new Nr("invalid callback");if(this[mr]){this[Ct]?this[Ct].push(t):queueMicrotask(()=>t(null,null));return}e||(e=new uE),this[mr]=!0,this[Ct]=this[Ct]||[],this[Ct].push(t);let r=()=>{let s=this[Ct];this[Ct]=null;for(let i=0;i<s.length;i++)s[i](null,null)};this[ew](e).then(()=>{queueMicrotask(r)})}[Fi](e,t){if(!this[Pt]||this[Pt].length===0)return this[Fi]=this[fE],this[fE](e,t);let r=this[fE].bind(this);for(let s=this[Pt].length-1;s>=0;s--)r=this[Pt][s](r);return this[Fi]=r,r(e,t)}dispatch(e,t){if(!t||typeof t!="object")throw new Nr("handler must be an object");try{if(!e||typeof e!="object")throw new Nr("opts must be an object.");if(this[mr]||this[Ct])throw new uE;if(this[ys])throw new Aw;return this[Fi](e,t)}catch(r){if(typeof t.onError!="function")throw new Nr("invalid onError method");return t.onError(r),!1}}};gC.exports=dE});var ws=h((jU,CC)=>{"use strict";var rw=require("net"),QC=require("assert"),cC=W(),{InvalidArgumentError:sw,ConnectTimeoutError:iw}=tA(),yE,pE;global.FinalizationRegistry&&!process.env.NODE_V8_COVERAGE?pE=class{constructor(e){this._maxCachedSessions=e,this._sessionCache=new Map,this._sessionRegistry=new global.FinalizationRegistry(t=>{if(this._sessionCache.size<this._maxCachedSessions)return;let r=this._sessionCache.get(t);r!==void 0&&r.deref()===void 0&&this._sessionCache.delete(t)})}get(e){let t=this._sessionCache.get(e);return t?t.deref():null}set(e,t){this._maxCachedSessions!==0&&(this._sessionCache.set(e,new WeakRef(t)),this._sessionRegistry.register(t,e))}}:pE=class{constructor(e){this._maxCachedSessions=e,this._sessionCache=new Map}get(e){return this._sessionCache.get(e)}set(e,t){if(this._maxCachedSessions!==0){if(this._sessionCache.size>=this._maxCachedSessions){let{value:r}=this._sessionCache.keys().next();this._sessionCache.delete(r)}this._sessionCache.set(e,t)}}};function nw({allowH2:A,maxCachedSessions:e,socketPath:t,timeout:r,...s}){if(e!=null&&(!Number.isInteger(e)||e<0))throw new sw("maxCachedSessions must be a positive integer or zero");let i={path:t,...s},n=new pE(e??100);return r=r??1e4,A=A??!1,function({hostname:E,ho Line truncated `}function ls(A,e,t,r=!1){if(t&&typeof t=="object"&&!Array.isArray(t))throw new rA(`invalid ${e} header`);if(t===void 0)return;if(A.host===null&&e.length===4&&e.toLowerCase()==="host"){if(EC.exec(t)!==null)throw new rA(`invalid ${e} header`);A.host=t}else if(A.contentLength===null&&e.length===14&&e.toLowerCase()==="content-length"){if(A.contentLength=parseInt(t,10),!Number.isFinite(A.contentLength))throw new rA("invalid content-length header")}else if(A.contentType===null&&e.length===12&&e.toLowerCase()==="content-type")A.contentType=t,r?A.headers[e]=Ht(e,t,r):A.headers+=Ht(e,t);else{if(e.length===17&&e.toLowerCase()==="transfer-encoding")throw new rA("invalid transfer-encoding header");if(e.length===10&&e.toLowerCase()==="connection"){let s=typeof t=="string"?t.toLowerCase():null;if(s!=="close"&&s!=="keep-alive")throw new rA("invalid connection header");s==="close"&&(A.reset=!0)}else{if(e.length===10&&e.toLowerCase()==="keep-alive")throw new rA("invalid keep-alive header");if(e.length===7&&e.toLowerCase()==="upgrade")throw new rA("invalid upgrade header");if(e.length===6&&e.toLowerCase()==="expect")throw new zp("expect header not supported");if(oC.exec(e)===null)throw new rA("invalid header key");if(Array.isArray(t))for(let s=0;s<t.length;s++)r?A.headers[e]?A.headers[e]+=`,${Ht(e,t[s],r)}`:A.headers[e]=Ht(e,t[s],r):A.headers+=Ht(e,t[s]);else r?A.headers[e]=Ht(e,t,r):A.headers+=Ht(e,t)}}}aC.exports=lE});var Fn=h(($U,QC)=>{"use strict";var rw=require("events"),uE=class extends rw{dispatch(){throw new Error("not implemented")}close(){throw new Error("not implemented")}destroy(){throw new Error("not implemented")}};QC.exports=uE});var fs=h((AL,cC)=>{"use strict";var sw=Fn(),{ClientDestroyedError:fE,ClientClosedError:nw,InvalidArgumentError:yr}=AA(),{kDestroy:iw,kClose:ow,kDispatch:dE,kInterceptors:Vt}=nA(),pr=Symbol("destroyed"),us=Symbol("closed"),gt=Symbol("onDestroyed"),wr=Symbol("onClosed"),kn=Symbol("Intercepted Dispatch"),yE=class extends sw{constructor(){super(),this[pr]=!1,this[gt]=null,this[us]=!1,this[wr]=[]}get destroyed(){return this[pr]}get closed(){return this[us]}get interceptors(){return this[Vt]}set interceptors(e){if(e){for(let t=e.length-1;t>=0;t--)if(typeof this[Vt][t]!="function")throw new yr("interceptor must be an function")}this[Vt]=e}close(e){if(e===void 0)return new Promise((r,s)=>{this.close((n,i)=>n?s(n):r(i))});if(typeof e!="function")throw new yr("invalid callback");if(this[pr]){queueMicrotask(()=>e(new fE,null));return}if(this[us]){this[wr]?this[wr].push(e):queueMicrotask(()=>e(null,null));return}this[us]=!0,this[wr].push(e);let t=()=>{let r=this[wr];this[wr]=null;for(let s=0;s<r.length;s++)r[s](null,null)};this[ow]().then(()=>this.destroy()).then(()=>{queueMicrotask(t)})}destroy(e,t){if(typeof e=="function"&&(t=e,e=null),t===void 0)return new Promise((s,n)=>{this.destroy(e,(i,o)=>i?n(i):s(o))});if(typeof t!="function")throw new yr("invalid callback");if(this[pr]){this[gt]?this[gt].push(t):queueMicrotask(()=>t(null,null));return}e||(e=new fE),this[pr]=!0,this[gt]=this[gt]||[],this[gt].push(t);let r=()=>{let s=this[gt];this[gt]=null;for(let n=0;n<s.length;n++)s[n](null,null)};this[iw](e).then(()=>{queueMicrotask(r)})}[kn](e,t){if(!this[Vt]||this[Vt].length===0)return this[kn]=this[dE],this[dE](e,t);let r=this[dE].bind(this);for(let s=this[Vt].length-1;s>=0;s--)r=this[Vt][s](r);return this[kn]=r,r(e,t)}dispatch(e,t){if(!t||typeof t!="object")throw new yr("handler must be an object");try{if(!e||typeof e!="object")throw new yr("opts must be an object.");if(this[pr]||this[gt])throw new fE;if(this[us])throw new nw;return this[kn](e,t)}catch(r){if(typeof t.onError!="function")throw new yr("invalid onError method");return t.onError(r),!1}}};cC.exports=yE});var ds=h((rL,IC)=>{"use strict";var Ew=require("net"),CC=require("assert"),BC=q(),{InvalidArgumentError:aw,ConnectTimeoutError:gw}=AA(),pE,wE;global.FinalizationRegistry&&!process.env.NODE_V8_COVERAGE?wE=class{constructor(e){this._maxCachedSessions=e,this._sessionCache=new Map,this._sessionRegistry=new global.FinalizationRegistry(t=>{if(this._sessionCache.size<this._maxCachedSessions)return;let r=this._sessionCache.get(t);r!==void 0&&r.deref()===void 0&&this._sessionCache.delete(t)})}get(e){let t=this._sessionCache.get(e);return t?t.deref():null}set(e,t){this._maxCachedSessions!==0&&(this._sessionCache.set(e,new WeakRef(t)),this._sessionRegistry.register(t,e))}}:wE=class{constructor(e){this._maxCachedSessions=e,this._sessionCache=new Map}get(e){return this._sessionCache.get(e)}set(e,t){if(this._maxCachedSessions!==0){if(this._sessionCache.size>=this._maxCachedSessions){let{value:r}=this._sessionCache.keys().next();this._sessionCache.delete(r)}this._sessionCache.set(e,t)}}};function Qw({allowH2:A,maxCachedSessions:e,socketPath:t,timeout:r,...s}){if(e!=null&&(!Number.isInteger(e)||e<0))throw new aw("maxCachedSessions must be a positive integer or zero");let n={path:t,...s},i=new wE(e??100);return r=r??1e4,A=A??!1,function({hostname:E,ho Line truncated
`,this[bC]=E??3e5,this[kC]=s??3e5,this[ks]=R??!0,this[Yw]=Y,this[bs]=DA,this[kt]=null,this[UC]=dA>-1?dA:-1,this[Ke]="h1",this[ce]=null,this[Yi]=bA?{openStreams:0,maxConcurrentStreams:q??100}:null,this[LC]=`${this[xA].hostname}${this[xA].port?`:${this[xA].port}`:""}`,this[aA]=[],this[gA]=0,this[Qe]=0}get pipelining(){return this[St]}set pipelining(e){this[St]=e,Ce(this,!0)}get[Zt](){return this[aA].length-this[Qe]}get[IA](){return this[Qe]-this[gA]}get[Xt](){return this[aA].length-this[gA]}get[xw](){return!!this[uA]&&!this[br]&&!this[uA].destroyed}get[bE](){let e=this[uA];return e&&(e[WA]||e[ht]||e[Ur])||this[Xt]>=(this[St]||1)||this[Zt]>0}[Mw](e){TC(this),this.once("connect",e)}[Jw](e,t){let r=e.origin||this[xA].origin,s=this[Ke]==="h2"?kE[Hw](r,e,t):kE[qw](r,e,t);return this[aA].push(s),this[_t]||(F.bodyLength(s.body)==null&&F.isIterable(s.body)?(this[_t]=1,process.nextTick(Ce,this)):Ce(this,!0)),this[_t]&&this[bt]!==2&&this[bE]&&(this[bt]=2),this[bt]<2}async[Tw](){return new Promise(e=>{this[Xt]?this[kt]=e:e(null)})}async[Gw](e){return new Promise(t=>{let r=this[aA].splice(this[Qe]);for(let i=0;i<r.length;i++){let n=r[i];PA(this,n,e)}let s=()=>{this[kt]&&(this[kt](),this[kt]=null),t()};this[ce]!=null&&(F.destroy(this[ce],e),this[ce]=null,this[Yi]=null),this[uA]?F.destroy(this[uA].on("close",s),e):queueMicrotask(s),Ce(this)})}};function Kw(A){w(A.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[uA][YA]=A,vi(this[je],A)}function zw(A,e,t){let r=new Ze(`HTTP/2: "frameError" received - type ${A}, code ${e}`);t===0&&(this[uA][YA]=r,vi(this[je],r))}function $w(){F.destroy(this,new Sr("other side closed")),F.destroy(this[uA],new Sr("other side closed"))}function AD(A){let e=this[je],t=new Ze(`HTTP/2: "GOAWAY" frame received with code ${A}`);if(e[uA]=null,e[ce]=null,e.destroyed){w(this[Zt]===0);let r=e[aA].splice(e[gA]);for(let s=0;s<r.length;s++){let i=r[s];PA(this,i,t)}}else if(e[IA]>0){let r=e[aA][e[gA]];e[aA][e[gA]++]=null,PA(e,r,t)}e[Qe]=e[gA],w(e[IA]===0),e.emit("disconnect",e[xA],[e],t),Ce(e)}var Pe=IC(),eD=Si(),tD=Buffer.alloc(0);async function rD(){let A=process.env.JEST_WORKER_ID?NE():void 0,e;try{e=await WebAssembly.compile(Buffer.from(pC(),"base64"))}catch{e=await WebAssembly.compile(Buffer.from(A||NE(),"base64"))}return await WebAssembly.instantiate(e,{env:{wasm_on_url:(t,r,s)=>0,wasm_on_status:(t,r,s)=>{w.strictEqual(kA.ptr,t);let i=r-Xe+_e.byteOffset;return kA.onStatus(new Ui(_e.buffer,i,s))||0},wasm_on_message_begin:t=>(w.strictEqual(kA.ptr,t),kA.onMessageBegin()||0),wasm_on_header_field:(t,r,s)=>{w.strictEqual(kA.ptr,t);let i=r-Xe+_e.byteOffset;return kA.onHeaderField(new Ui(_e.buffer,i,s))||0},wasm_on_header_value:(t,r,s)=>{w.strictEqual(kA.ptr,t);let i=r-Xe+_e.byteOffset;return kA.onHeaderValue(new Ui(_e.buffer,i,s))||0},wasm_on_headers_complete:(t,r,s,i)=>(w.strictEqual(kA.ptr,t),kA.onHeadersComplete(r,!!s,!!i)||0),wasm_on_body:(t,r,s)=>{w.strictEqual(kA.ptr,t);let i=r-Xe+_e.byteOffset;return kA.onBody(new Ui(_e.buffer,i,s))||0},wasm_on_message_complete:t=>(w.strictEqual(kA.ptr,t),kA.onMessageComplete()||0)}})}var FE=null,LE=rD();LE.catch();var kA=null,_e=null,Li=0,Xe=null,Lr=1,xi=2,ME=3,xE=class{constructor(e,t,{exports:r}){w(Number.isFinite(e[Mi])&&e[Mi]>0),this.llhttp=r,this.ptr=this.llhttp.llhttp_alloc(Pe.TYPE.RESPONSE),this.client=e,this.socket=t,this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.statusCode=null,this.statusText="",this.upgrade=!1,this.headers=[],this.headersSize=0,this.headersMaxSize=e[Mi],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[UC]}setTimeout(e,t){this.timeoutType=t,e!==this.timeoutValue?(mE.clearTimeout(this.timeout),e?(this.timeout=mE.setTimeout(sD,e,this),this.timeout.unref&&this.timeout.unref()):this.timeout=null,this.timeoutValue=e):this.timeout&&this.timeout.refresh&&this.timeout.refresh()}resume(){this.socket.destroyed||!this.paused||(w(this.ptr!=null),w(kA==null),this.llhttp.llhttp_resume(this.ptr),w(this.timeoutType===xi),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||tD),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){w(this.ptr!=null),w(kA==null),w(!this.paused);let{socket:t,llhttp:r}=this;e.length>Li&&(Xe&&r.free(Xe),Li=Math.ceil(e.length/4096)*4096,Xe=r.malloc(Li)),new Uint8Array(r.memory.buffer,Xe,Li).set(e);try{let s;try{_e=e,kA=this,s=r.llhttp_execute(this.ptr,Xe,e.length)}catch(n){throw n}finally{kA=null,_e=null}let i=r.llhttp_get_error_pos(this.ptr)-Xe;if(s===Pe.ERROR.PAUSED_UPGRADE)this.onUpgrade(e.slice(i));else if(s===Pe.ERROR.PAUSED)this.paused=!0,t.unshift(e.slice(i));else if(s!==Pe.ERROR.OK){let n=r.llhttp_get_error_reason(this.ptr),o="";if(n){let E=new Uint8Array(r.memory.buffer,n).indexOf(0);o="Response does not match the HTTP/1.1 protocol ("+Buffer.from(r.memory. Line truncated `,this[UC]=E??3e5,this[SC]=s??3e5,this[Ns]=R??!0,this[Hw]=U,this[ms]=dA,this[mt]=null,this[MC]=UA>-1?UA:-1,this[Xe]="h1",this[ge]=null,this[Tn]=ie?{openStreams:0,maxConcurrentStreams:W??100}:null,this[xC]=`${this[FA].hostname}${this[FA].port?`:${this[FA].port}`:""}`,this[iA]=[],this[oA]=0,this[ae]=0}get pipelining(){return this[kt]}set pipelining(e){this[kt]=e,Qe(this,!0)}get[Wt](){return this[iA].length-this[ae]}get[gA](){return this[ae]-this[oA]}get[Ot](){return this[iA].length-this[oA]}get[vw](){return!!this[BA]&&!this[Rr]&&!this[BA].destroyed}get[SE](){let e=this[BA];return e&&(e[JA]||e[Ct]||e[mr])||this[Ot]>=(this[kt]||1)||this[Wt]>0}[Jw](e){JC(this),this.once("connect",e)}[Ow](e,t){let r=e.origin||this[FA].origin,s=this[Xe]==="h2"?bE[Pw](r,e,t):bE[Xw](r,e,t);return this[iA].push(s),this[qt]||(m.bodyLength(s.body)==null&&m.isIterable(s.body)?(this[qt]=1,process.nextTick(Qe,this)):Qe(this,!0)),this[qt]&&this[Ft]!==2&&this[SE]&&(this[Ft]=2),this[Ft]<2}async[Vw](){return new Promise(e=>{this[Ot]?this[mt]=e:e(null)})}async[qw](e){return new Promise(t=>{let r=this[iA].splice(this[ae]);for(let n=0;n<r.length;n++){let i=r[n];vA(this,i,e)}let s=()=>{this[mt]&&(this[mt](),this[mt]=null),t()};this[ge]!=null&&(m.destroy(this[ge],e),this[ge]=null,this[Tn]=null),this[BA]?m.destroy(this[BA].on("close",s),e):queueMicrotask(s),Qe(this)})}};function tD(A){w(A.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[BA][kA]=A,Hn(this[_e],A)}function rD(A,e,t){let r=new Pe(`HTTP/2: "frameError" received - type ${A}, code ${e}`);t===0&&(this[BA][kA]=r,Hn(this[_e],r))}function sD(){m.destroy(this,new Nr("other side closed")),m.destroy(this[BA],new Nr("other side closed"))}function nD(A){let e=this[_e],t=new Pe(`HTTP/2: "GOAWAY" frame received with code ${A}`);if(e[BA]=null,e[ge]=null,e.destroyed){w(this[Wt]===0);let r=e[iA].splice(e[oA]);for(let s=0;s<r.length;s++){let n=r[s];vA(this,n,t)}}else if(e[gA]>0){let r=e[iA][e[oA]];e[iA][e[oA]++]=null,vA(e,r,t)}e[ae]=e[oA],w(e[gA]===0),e.emit("disconnect",e[FA],[e],t),Qe(e)}var qe=lC(),iD=Un(),oD=Buffer.alloc(0);async function ED(){let A=process.env.JEST_WORKER_ID?mE():void 0,e;try{e=await WebAssembly.compile(Buffer.from(DC(),"base64"))}catch{e=await WebAssembly.compile(Buffer.from(A||mE(),"base64"))}return await WebAssembly.instantiate(e,{env:{wasm_on_url:(t,r,s)=>0,wasm_on_status:(t,r,s)=>{w.strictEqual(DA.ptr,t);let n=r-We+Oe.byteOffset;return DA.onStatus(new Ln(Oe.buffer,n,s))||0},wasm_on_message_begin:t=>(w.strictEqual(DA.ptr,t),DA.onMessageBegin()||0),wasm_on_header_field:(t,r,s)=>{w.strictEqual(DA.ptr,t);let n=r-We+Oe.byteOffset;return DA.onHeaderField(new Ln(Oe.buffer,n,s))||0},wasm_on_header_value:(t,r,s)=>{w.strictEqual(DA.ptr,t);let n=r-We+Oe.byteOffset;return DA.onHeaderValue(new Ln(Oe.buffer,n,s))||0},wasm_on_headers_complete:(t,r,s,n)=>(w.strictEqual(DA.ptr,t),DA.onHeadersComplete(r,!!s,!!n)||0),wasm_on_body:(t,r,s)=>{w.strictEqual(DA.ptr,t);let n=r-We+Oe.byteOffset;return DA.onBody(new Ln(Oe.buffer,n,s))||0},wasm_on_message_complete:t=>(w.strictEqual(DA.ptr,t),DA.onMessageComplete()||0)}})}var kE=null,ME=ED();ME.catch();var DA=null,Oe=null,Mn=0,We=null,Fr=1,Yn=2,xE=3,YE=class{constructor(e,t,{exports:r}){w(Number.isFinite(e[xn])&&e[xn]>0),this.llhttp=r,this.ptr=this.llhttp.llhttp_alloc(qe.TYPE.RESPONSE),this.client=e,this.socket=t,this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.statusCode=null,this.statusText="",this.upgrade=!1,this.headers=[],this.headersSize=0,this.headersMaxSize=e[xn],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[MC]}setTimeout(e,t){this.timeoutType=t,e!==this.timeoutValue?(FE.clearTimeout(this.timeout),e?(this.timeout=FE.setTimeout(aD,e,this),this.timeout.unref&&this.timeout.unref()):this.timeout=null,this.timeoutValue=e):this.timeout&&this.timeout.refresh&&this.timeout.refresh()}resume(){this.socket.destroyed||!this.paused||(w(this.ptr!=null),w(DA==null),this.llhttp.llhttp_resume(this.ptr),w(this.timeoutType===Yn),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||oD),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){w(this.ptr!=null),w(DA==null),w(!this.paused);let{socket:t,llhttp:r}=this;e.length>Mn&&(We&&r.free(We),Mn=Math.ceil(e.length/4096)*4096,We=r.malloc(Mn)),new Uint8Array(r.memory.buffer,We,Mn).set(e);try{let s;try{Oe=e,DA=this,s=r.llhttp_execute(this.ptr,We,e.length)}catch(i){throw i}finally{DA=null,Oe=null}let n=r.llhttp_get_error_pos(this.ptr)-We;if(s===qe.ERROR.PAUSED_UPGRADE)this.onUpgrade(e.slice(n));else if(s===qe.ERROR.PAUSED)this.paused=!0,t.unshift(e.slice(n));else if(s!==qe.ERROR.OK){let i=r.llhttp_get_error_reason(this.ptr),o="";if(i){let E=new Uint8Array(r.memory.buffer,i).indexOf(0);o="Response does not match the HTTP/1.1 protocol ("+Buffer.from(r.memory. Line truncated
`;return typeof i=="string"?C+=`host: ${i}\r `;return typeof n=="string"?C+=`host: ${n}\r
`:C+=A[NC],n?C+=`connection: upgrade\r `:C+=A[FC],i?C+=`connection: upgrade\r
upgrade: ${n}\r upgrade: ${i}\r
`:A[St]&&!B[WA]?C+=`connection: keep-alive\r `:A[kt]&&!B[JA]?C+=`connection: keep-alive\r
`:C+=`connection: close\r `:C+=`connection: close\r
`,o&&(C+=o),vA.sendHeaders.hasSubscribers&&vA.sendHeaders.publish({request:e,headers:C,socket:B}),!t||Q===0?(c===0?B.write(`${C}content-length: 0\r `,o&&(C+=o),MA.sendHeaders.hasSubscribers&&MA.sendHeaders.publish({request:e,headers:C,socket:B}),!t||Q===0?(c===0?B.write(`${C}content-length: 0\r
\r \r
`,"latin1"):(w(c===null,"no body must not have content length"),B.write(`${C}\r `,"latin1"):(w(c===null,"no body must not have content length"),B.write(`${C}\r
`,"latin1")),e.onRequestSent()):F.isBuffer(t)?(w(c===t.byteLength,"buffer body must have content length"),B.cork(),B.write(`${C}content-length: ${c}\r `,"latin1")),e.onRequestSent()):m.isBuffer(t)?(w(c===t.byteLength,"buffer body must have content length"),B.cork(),B.write(`${C}content-length: ${c}\r
\r \r
`,"latin1"),B.write(t),B.uncork(),e.onBodySent(t),e.onRequestSent(),a||(B[WA]=!0)):F.isBlobLike(t)?typeof t.stream=="function"?Gi({body:t.stream(),client:A,request:e,socket:B,contentLength:c,header:C,expectsPayload:a}):vC({body:t,client:A,request:e,socket:B,contentLength:c,header:C,expectsPayload:a}):F.isStream(t)?JC({body:t,client:A,request:e,socket:B,contentLength:c,header:C,expectsPayload:a}):F.isIterable(t)?Gi({body:t,client:A,request:e,socket:B,contentLength:c,header:C,expectsPayload:a}):w(!1),!0}function oD(A,e,t){let{body:r,method:s,path:i,host:n,upgrade:o,expectContinue:E,signal:g,headers:a}=t,Q;if(typeof a=="string"?Q=kE[Vw](a.trim()):Q=a,o)return PA(A,t,new Error("Upgrade not supported for H2")),!1;try{t.onConnect(R=>{t.aborted||t.completed||PA(A,t,R||new TE)})}catch(R){PA(A,t,R)}if(t.aborted)return!1;let c,B=A[Yi];if(Q[Ow]=n||A[LC],Q[Ww]=s,s==="CONNECT")return e.ref(),c=e.request(Q,{endStream:!1,signal:g}),c.id&&!c.pending?(t.onUpgrade(null,null,c),++B.openStreams):c.once("ready",()=>{t.onUpgrade(null,null,c),++B.openStreams}),c.once("close",()=>{B.openStreams-=1,B.openStreams===0&&e.unref()}),!0;Q[Pw]=i,Q[_w]="https";let C=s==="PUT"||s==="POST"||s==="PATCH";r&&typeof r.read=="function"&&r.read(0);let d=F.bodyLength(r);if(d==null&&(d=t.contentLength),(d===0||!C)&&(d=null),GC(s)&&d>0&&t.contentLength!=null&&t.contentLength!==d){if(A[ks])return PA(A,t,new It),!1;process.emitWarning(new It)}d!=null&&(w(r,"no body must not have content length"),Q[Xw]=`${d}`),e.ref();let u=s==="GET"||s==="HEAD";return E?(Q[Zw]="100-continue",c=e.request(Q,{endStream:u,signal:g}),c.once("continue",y)):(c=e.request(Q,{endStream:u,signal:g}),y()),++B.openStreams,c.once("response",R=>{let{[jw]:m,...Y}=R;t.onHeaders(Number(m),Y,c.resume.bind(c),"")===!1&&c.pause()}),c.once("end",()=>{t.onComplete([])}),c.on("data",R=>{t.onData(R)===!1&&c.pause()}),c.once("close",()=>{B.openStreams-=1,B.openStreams===0&&e.unref()}),c.once("error",function(R){A[ce]&&!A[ce].destroyed&&!this.closed&&!this.destroyed&&(B.streams-=1,F.destroy(c,R))}),c.once("frameError",(R,m)=>{let Y=new Ze(`HTTP/2: "frameError" received - type ${R}, code ${m}`);PA(A,t,Y),A[ce]&&!A[ce].destroyed&&!this.closed&&!this.destroyed&&(B.streams-=1,F.destroy(c,Y))}),!0;function y(){r?F.isBuffer(r)?(w(d===r.byteLength,"buffer body must have content length"),c.cork(),c.write(r),c.uncork(),c.end(),t.onBodySent(r),t.onRequestSent()):F.isBlobLike(r)?typeof r.stream=="function"?Gi({client:A,request:t,contentLength:d,h2stream:c,expectsPayload:C,body:r.stream(),socket:A[uA],header:""}):vC({body:r,client:A,request:t,contentLength:d,expectsPayload:C,h2stream:c,header:"",socket:A[uA]}):F.isStream(r)?JC({body:r,client:A,request:t,contentLength:d,expectsPayload:C,socket:A[uA],h2stream:c,header:""}):F.isIterable(r)?Gi({body:r,client:A,request:t,contentLength:d,expectsPayload:C,header:"",h2stream:c,socket:A[uA]}):w(!1):t.onRequestSent()}}function JC({h2stream:A,body:e,client:t,request:r,socket:s,contentLength:i,header:n,expectsPayload:o}){if(w(i!==0||t[IA]===0,"stream body cannot be pipelined"),t[Ke]==="h2"){let d=function(u){r.onBodySent(u)},C=Dw(e,A,u=>{u?(F.destroy(e,u),F.destroy(A,u)):r.onRequestSent()});C.on("data",d),C.once("end",()=>{C.removeListener("data",d),F.destroy(C)});return}let E=!1,g=new Ji({socket:s,request:r,contentLength:i,client:t,expectsPayload:o,header:n}),a=function(C){if(!E)try{!g.write(C)&&this.pause&&this.pause()}catch(d){F.destroy(this,d)}},Q=function(){E||e.resume&&e.resume()},c=function(){if(E)return;let C=new TE;queueMicrotask(()=>B(C))},B=function(C){if(!E){if(E=!0,w(s.destroyed||s[ht]&&t[IA]<=1),s.off("drain",Q).off("error",B),e.removeListener("data",a).removeListener("end",B).removeListener("error",B).removeListener("close",c),!C)try{g.end()}catch(d){C=d}g.destroy(C),C&&(C.code!=="UND_ERR_INFO"||C.message!=="reset")?F.destroy(e,C):F.destroy(e)}};e.on("data",a).on("end",B).on("error",B).on("close",c),e.resume&&e.resume(),s.on("drain",Q).on("error",B)}async function vC({h2stream:A,body:e,client:t,request:r,socket:s,contentLength:i,header:n,expectsPayload:o}){w(i===e.size,"blob body must have content length");let E=t[Ke]==="h2";try{if(i!=null&&i!==e.size)throw new It;let g=Buffer.from(await e.arrayBuffer());E?(A.cork(),A.write(g),A.uncork()):(s.cork(),s.write(`${n}content-length: ${i}\r `,"latin1"),B.write(t),B.uncork(),e.onBodySent(t),e.onRequestSent(),a||(B[JA]=!0)):m.isBlobLike(t)?typeof t.stream=="function"?Jn({body:t.stream(),client:A,request:e,socket:B,contentLength:c,header:C,expectsPayload:a}):VC({body:t,client:A,request:e,socket:B,contentLength:c,header:C,expectsPayload:a}):m.isStream(t)?HC({body:t,client:A,request:e,socket:B,contentLength:c,header:C,expectsPayload:a}):m.isIterable(t)?Jn({body:t,client:A,request:e,socket:B,contentLength:c,header:C,expectsPayload:a}):w(!1),!0}function cD(A,e,t){let{body:r,method:s,path:n,host:i,upgrade:o,expectContinue:E,signal:g,headers:a}=t,Q;if(typeof a=="string"?Q=bE[_w](a.trim()):Q=a,o)return vA(A,t,new Error("Upgrade not supported for H2")),!1;try{t.onConnect(R=>{t.aborted||t.completed||vA(A,t,R||new GE)})}catch(R){vA(A,t,R)}if(t.aborted)return!1;let c,B=A[Tn];if(Q[Zw]=i||A[xC],Q[jw]=s,s==="CONNECT")return e.ref(),c=e.request(Q,{endStream:!1,signal:g}),c.id&&!c.pending?(t.onUpgrade(null,null,c),++B.openStreams):c.once("ready",()=>{t.onUpgrade(null,null,c),++B.openStreams}),c.once("close",()=>{B.openStreams-=1,B.openStreams===0&&e.unref()}),!0;Q[Kw]=n,Q[zw]="https";let C=s==="PUT"||s==="POST"||s==="PATCH";r&&typeof r.read=="function"&&r.read(0);let f=m.bodyLength(r);if(f==null&&(f=t.contentLength),(f===0||!C)&&(f=null),vC(s)&&f>0&&t.contentLength!=null&&t.contentLength!==f){if(A[Ns])return vA(A,t,new ct),!1;process.emitWarning(new ct)}f!=null&&(w(r,"no body must not have content length"),Q[$w]=`${f}`),e.ref();let l=s==="GET"||s==="HEAD";return E?(Q[AD]="100-continue",c=e.request(Q,{endStream:l,signal:g}),c.once("continue",y)):(c=e.request(Q,{endStream:l,signal:g}),y()),++B.openStreams,c.once("response",R=>{let{[eD]:S,...U}=R;t.onHeaders(Number(S),U,c.resume.bind(c),"")===!1&&c.pause()}),c.once("end",()=>{t.onComplete([])}),c.on("data",R=>{t.onData(R)===!1&&c.pause()}),c.once("close",()=>{B.openStreams-=1,B.openStreams===0&&e.unref()}),c.once("error",function(R){A[ge]&&!A[ge].destroyed&&!this.closed&&!this.destroyed&&(B.streams-=1,m.destroy(c,R))}),c.once("frameError",(R,S)=>{let U=new Pe(`HTTP/2: "frameError" received - type ${R}, code ${S}`);vA(A,t,U),A[ge]&&!A[ge].destroyed&&!this.closed&&!this.destroyed&&(B.streams-=1,m.destroy(c,U))}),!0;function y(){r?m.isBuffer(r)?(w(f===r.byteLength,"buffer body must have content length"),c.cork(),c.write(r),c.uncork(),c.end(),t.onBodySent(r),t.onRequestSent()):m.isBlobLike(r)?typeof r.stream=="function"?Jn({client:A,request:t,contentLength:f,h2stream:c,expectsPayload:C,body:r.stream(),socket:A[BA],header:""}):VC({body:r,client:A,request:t,contentLength:f,expectsPayload:C,h2stream:c,header:"",socket:A[BA]}):m.isStream(r)?HC({body:r,client:A,request:t,contentLength:f,expectsPayload:C,socket:A[BA],h2stream:c,header:""}):m.isIterable(r)?Jn({body:r,client:A,request:t,contentLength:f,expectsPayload:C,header:"",h2stream:c,socket:A[BA]}):w(!1):t.onRequestSent()}}function HC({h2stream:A,body:e,client:t,request:r,socket:s,contentLength:n,header:i,expectsPayload:o}){if(w(n!==0||t[gA]===0,"stream body cannot be pipelined"),t[Xe]==="h2"){let f=function(l){r.onBodySent(l)},C=kw(e,A,l=>{l?(m.destroy(e,l),m.destroy(A,l)):r.onRequestSent()});C.on("data",f),C.once("end",()=>{C.removeListener("data",f),m.destroy(C)});return}let E=!1,g=new vn({socket:s,request:r,contentLength:n,client:t,expectsPayload:o,header:i}),a=function(C){if(!E)try{!g.write(C)&&this.pause&&this.pause()}catch(f){m.destroy(this,f)}},Q=function(){E||e.resume&&e.resume()},c=function(){if(E)return;let C=new GE;queueMicrotask(()=>B(C))},B=function(C){if(!E){if(E=!0,w(s.destroyed||s[Ct]&&t[gA]<=1),s.off("drain",Q).off("error",B),e.removeListener("data",a).removeListener("end",B).removeListener("error",B).removeListener("close",c),!C)try{g.end()}catch(f){C=f}g.destroy(C),C&&(C.code!=="UND_ERR_INFO"||C.message!=="reset")?m.destroy(e,C):m.destroy(e)}};e.on("data",a).on("end",B).on("error",B).on("close",c),e.resume&&e.resume(),s.on("drain",Q).on("error",B)}async function VC({h2stream:A,body:e,client:t,request:r,socket:s,contentLength:n,header:i,expectsPayload:o}){w(n===e.size,"blob body must have content length");let E=t[Xe]==="h2";try{if(n!=null&&n!==e.size)throw new ct;let g=Buffer.from(await e.arrayBuffer());E?(A.cork(),A.write(g),A.uncork()):(s.cork(),s.write(`${i}content-length: ${n}\r
\r \r
`,"latin1"),s.write(g),s.uncork()),r.onBodySent(g),r.onRequestSent(),o||(s[WA]=!0),Ce(t)}catch(g){F.destroy(E?A:s,g)}}async function Gi({h2stream:A,body:e,client:t,request:r,socket:s,contentLength:i,header:n,expectsPayload:o}){w(i!==0||t[IA]===0,"iterator body cannot be pipelined");let E=null;function g(){if(E){let c=E;E=null,c()}}let a=()=>new Promise((c,B)=>{w(E===null),s[YA]?B(s[YA]):E=c});if(t[Ke]==="h2"){A.on("close",g).on("drain",g);try{for await(let c of e){if(s[YA])throw s[YA];let B=A.write(c);r.onBodySent(c),B||await a()}}catch(c){A.destroy(c)}finally{r.onRequestSent(),A.end(),A.off("close",g).off("drain",g)}return}s.on("close",g).on("drain",g);let Q=new Ji({socket:s,request:r,contentLength:i,client:t,expectsPayload:o,header:n});try{for await(let c of e){if(s[YA])throw s[YA];Q.write(c)||await a()}Q.end()}catch(c){Q.destroy(c)}finally{s.off("close",g).off("drain",g)}}var Ji=class{constructor({socket:e,request:t,contentLength:r,client:s,expectsPayload:i,header:n}){this.socket=e,this.request=t,this.contentLength=r,this.client=s,this.bytesWritten=0,this.expectsPayload=i,this.header=n,e[ht]=!0}write(e){let{socket:t,request:r,contentLength:s,client:i,bytesWritten:n,expectsPayload:o,header:E}=this;if(t[YA])throw t[YA];if(t.destroyed)return!1;let g=Buffer.byteLength(e);if(!g)return!0;if(s!==null&&n+g>s){if(i[ks])throw new It;process.emitWarning(new It)}t.cork(),n===0&&(o||(t[WA]=!0),s===null?t.write(`${E}transfer-encoding: chunked\r `,"latin1"),s.write(g),s.uncork()),r.onBodySent(g),r.onRequestSent(),o||(s[JA]=!0),Qe(t)}catch(g){m.destroy(E?A:s,g)}}async function Jn({h2stream:A,body:e,client:t,request:r,socket:s,contentLength:n,header:i,expectsPayload:o}){w(n!==0||t[gA]===0,"iterator body cannot be pipelined");let E=null;function g(){if(E){let c=E;E=null,c()}}let a=()=>new Promise((c,B)=>{w(E===null),s[kA]?B(s[kA]):E=c});if(t[Xe]==="h2"){A.on("close",g).on("drain",g);try{for await(let c of e){if(s[kA])throw s[kA];let B=A.write(c);r.onBodySent(c),B||await a()}}catch(c){A.destroy(c)}finally{r.onRequestSent(),A.end(),A.off("close",g).off("drain",g)}return}s.on("close",g).on("drain",g);let Q=new vn({socket:s,request:r,contentLength:n,client:t,expectsPayload:o,header:i});try{for await(let c of e){if(s[kA])throw s[kA];Q.write(c)||await a()}Q.end()}catch(c){Q.destroy(c)}finally{s.off("close",g).off("drain",g)}}var vn=class{constructor({socket:e,request:t,contentLength:r,client:s,expectsPayload:n,header:i}){this.socket=e,this.request=t,this.contentLength=r,this.client=s,this.bytesWritten=0,this.expectsPayload=n,this.header=i,e[Ct]=!0}write(e){let{socket:t,request:r,contentLength:s,client:n,bytesWritten:i,expectsPayload:o,header:E}=this;if(t[kA])throw t[kA];if(t.destroyed)return!1;let g=Buffer.byteLength(e);if(!g)return!0;if(s!==null&&i+g>s){if(n[Ns])throw new ct;process.emitWarning(new ct)}t.cork(),i===0&&(o||(t[JA]=!0),s===null?t.write(`${E}transfer-encoding: chunked\r
`,"latin1"):t.write(`${E}content-length: ${s}\r `,"latin1"):t.write(`${E}content-length: ${s}\r
\r \r
`,"latin1")),s===null&&t.write(`\r `,"latin1")),s===null&&t.write(`\r
${g.toString(16)}\r ${g.toString(16)}\r
`,"latin1"),this.bytesWritten+=g;let a=t.write(e);return t.uncork(),r.onBodySent(e),a||t[lA].timeout&&t[lA].timeoutType===Lr&&t[lA].timeout.refresh&&t[lA].timeout.refresh(),a}end(){let{socket:e,contentLength:t,client:r,bytesWritten:s,expectsPayload:i,header:n,request:o}=this;if(o.onRequestSent(),e[ht]=!1,e[YA])throw e[YA];if(!e.destroyed){if(s===0?i?e.write(`${n}content-length: 0\r `,"latin1"),this.bytesWritten+=g;let a=t.write(e);return t.uncork(),r.onBodySent(e),a||t[CA].timeout&&t[CA].timeoutType===Fr&&t[CA].timeout.refresh&&t[CA].timeout.refresh(),a}end(){let{socket:e,contentLength:t,client:r,bytesWritten:s,expectsPayload:n,header:i,request:o}=this;if(o.onRequestSent(),e[Ct]=!1,e[kA])throw e[kA];if(!e.destroyed){if(s===0?n?e.write(`${i}content-length: 0\r
\r \r
`,"latin1"):e.write(`${n}\r `,"latin1"):e.write(`${i}\r
`,"latin1"):t===null&&e.write(`\r `,"latin1"):t===null&&e.write(`\r
0\r 0\r
\r \r
`,"latin1"),t!==null&&s!==t){if(r[ks])throw new It;process.emitWarning(new It)}e[lA].timeout&&e[lA].timeoutType===Lr&&e[lA].timeout.refresh&&e[lA].timeout.refresh(),Ce(r)}}destroy(e){let{socket:t,client:r}=this;t[ht]=!1,e&&(w(r[IA]<=1,"pipeline should only contain this request"),F.destroy(t,e))}};function PA(A,e,t){try{e.onError(t),w(e.aborted)}catch(r){A.emit("error",r)}}HC.exports=UE});var qC=h((iL,VC)=>{"use strict";var Hi=class{constructor(){this.bottom=0,this.top=0,this.list=new Array(2048),this.next=null}isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&2047)===this.bottom}push(e){this.list[this.top]=e,this.top=this.top+1&2047}shift(){let e=this.list[this.bottom];return e===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&2047,e)}};VC.exports=class{constructor(){this.head=this.tail=new Hi}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new Hi),this.head.push(e)}shift(){let e=this.tail,t=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next),t}}});var WC=h((nL,OC)=>{var{kFree:ED,kConnected:aD,kPending:gD,kQueued:QD,kRunning:cD,kSize:CD}=EA(),jt=Symbol("pool"),GE=class{constructor(e){this[jt]=e}get connected(){return this[jt][aD]}get free(){return this[jt][ED]}get pending(){return this[jt][gD]}get queued(){return this[jt][QD]}get running(){return this[jt][cD]}get size(){return this[jt][CD]}};OC.exports=GE});var OE=h((oL,eB)=>{"use strict";var BD=ps(),ID=qC(),{kConnected:JE,kSize:PC,kRunning:_C,kPending:XC,kQueued:Us,kBusy:hD,kFree:lD,kUrl:uD,kClose:fD,kDestroy:dD,kDispatch:yD}=EA(),pD=WC(),Ae=Symbol("clients"),_A=Symbol("needDrain"),Ls=Symbol("queue"),vE=Symbol("closed resolve"),HE=Symbol("onDrain"),ZC=Symbol("onConnect"),jC=Symbol("onDisconnect"),KC=Symbol("onConnectionError"),VE=Symbol("get dispatcher"),$C=Symbol("add client"),AB=Symbol("remove client"),zC=Symbol("stats"),qE=class extends BD{constructor(){super(),this[Ls]=new ID,this[Ae]=[],this[Us]=0;let e=this;this[HE]=function(r,s){let i=e[Ls],n=!1;for(;!n;){let o=i.shift();if(!o)break;e[Us]--,n=!this.dispatch(o.opts,o.handler)}this[_A]=n,!this[_A]&&e[_A]&&(e[_A]=!1,e.emit("drain",r,[e,...s])),e[vE]&&i.isEmpty()&&Promise.all(e[Ae].map(o=>o.close())).then(e[vE])},this[ZC]=(t,r)=>{e.emit("connect",t,[e,...r])},this[jC]=(t,r,s)=>{e.emit("disconnect",t,[e,...r],s)},this[KC]=(t,r,s)=>{e.emit("connectionError",t,[e,...r],s)},this[zC]=new pD(this)}get[hD](){return this[_A]}get[JE](){return this[Ae].filter(e=>e[JE]).length}get[lD](){return this[Ae].filter(e=>e[JE]&&!e[_A]).length}get[XC](){let e=this[Us];for(let{[XC]:t}of this[Ae])e+=t;return e}get[_C](){let e=0;for(let{[_C]:t}of this[Ae])e+=t;return e}get[PC](){let e=this[Us];for(let{[PC]:t}of this[Ae])e+=t;return e}get stats(){return this[zC]}async[fD](){return this[Ls].isEmpty()?Promise.all(this[Ae].map(e=>e.close())):new Promise(e=>{this[vE]=e})}async[dD](e){for(;;){let t=this[Ls].shift();if(!t)break;t.handler.onError(e)}return Promise.all(this[Ae].map(t=>t.destroy(e)))}[yD](e,t){let r=this[VE]();return r?r.dispatch(e,t)||(r[_A]=!0,this[_A]=!this[VE]()):(this[_A]=!0,this[Ls].push({opts:e,handler:t}),this[Us]++),!this[_A]}[$C](e){return e.on("drain",this[HE]).on("connect",this[ZC]).on("disconnect",this[jC]).on("connectionError",this[KC]),this[Ae].push(e),this[_A]&&process.nextTick(()=>{this[_A]&&this[HE](e[uD],[this,e])}),this}[AB](e){e.close(()=>{let t=this[Ae].indexOf(e);t!==-1&&this[Ae].splice(t,1)}),this[_A]=this[Ae].some(t=>!t[_A]&&t.closed!==!0&&t.destroyed!==!0)}};eB.exports={PoolBase:qE,kClients:Ae,kNeedDrain:_A,kAddClient:$C,kRemoveClient:AB,kGetDispatcher:VE}});var Mr=h((EL,sB)=>{"use strict";var{PoolBase:wD,kClients:Vi,kNeedDrain:DD,kAddClient:RD,kGetDispatcher:ND}=OE(),mD=Ss(),{InvalidArgumentError:WE}=tA(),PE=W(),{kUrl:tB,kInterceptors:FD}=EA(),kD=ws(),_E=Symbol("options"),XE=Symbol("connections"),rB=Symbol("factory");function bD(A,e){return new mD(A,e)}var ZE=class extends wD{constructor(e,{connections:t,factory:r=bD,connect:s,connectTimeout:i,tls:n,maxCachedSessions:o,socketPath:E,autoSelectFamily:g,autoSelectFamilyAttemptTimeout:a,allowH2:Q,...c}={}){if(super(),t!=null&&(!Number.isFinite(t)||t<0))throw new WE("invalid connections");if(typeof r!="function")throw new WE("factory must be a function.");if(s!=null&&typeof s!="function"&&typeof s!="object")throw new WE("connect must be a function or an object");typeof s!="function"&&(s=kD({...n,maxCachedSessions:o,allowH2:Q,socketPath:E,timeout:i,...PE.nodeHasAutoSelectFamily&&g?{autoSelectFamily:g,autoSelectFamilyAttemptTimeout:a}:void 0,...s})),this[FD]=c.interceptors&&c.interceptors.Pool&&Array.isArray(c.interceptors.Pool)?c.interceptors.Pool:[],this[XE]=t||null,this[tB]=PE.parseOrigin(e),this[_E]={...PE.deepClone(c),connect:s,allowH2:Q},this[_E].interceptors=c.interceptors?{...c.interceptors}:void 0,this[rB]=r,this.on("connectionError",(B,C,d)=>{for(let u of C){let y=this[Vi].indexOf(u);y!==-1&&this[Vi].splice(y,1)}})}[ND](){let e=this[Vi].find(t=>!t[ Line truncated `,"latin1"),t!==null&&s!==t){if(r[Ns])throw new ct;process.emitWarning(new ct)}e[CA].timeout&&e[CA].timeoutType===Fr&&e[CA].timeout.refresh&&e[CA].timeout.refresh(),Qe(r)}}destroy(e){let{socket:t,client:r}=this;t[Ct]=!1,e&&(w(r[gA]<=1,"pipeline should only contain this request"),m.destroy(t,e))}};function vA(A,e,t){try{e.onError(t),w(e.aborted)}catch(r){A.emit("error",r)}}qC.exports=LE});var WC=h((cL,OC)=>{"use strict";var Vn=class{constructor(){this.bottom=0,this.top=0,this.list=new Array(2048),this.next=null}isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&2047)===this.bottom}push(e){this.list[this.top]=e,this.top=this.top+1&2047}shift(){let e=this.list[this.bottom];return e===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&2047,e)}};OC.exports=class{constructor(){this.head=this.tail=new Vn}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new Vn),this.head.push(e)}shift(){let e=this.tail,t=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next),t}}});var _C=h((CL,PC)=>{var{kFree:CD,kConnected:BD,kPending:ID,kQueued:hD,kRunning:lD,kSize:uD}=nA(),Pt=Symbol("pool"),JE=class{constructor(e){this[Pt]=e}get connected(){return this[Pt][BD]}get free(){return this[Pt][CD]}get pending(){return this[Pt][ID]}get queued(){return this[Pt][hD]}get running(){return this[Pt][lD]}get size(){return this[Pt][uD]}};PC.exports=JE});var WE=h((BL,rB)=>{"use strict";var fD=fs(),dD=WC(),{kConnected:vE,kSize:XC,kRunning:ZC,kPending:jC,kQueued:ks,kBusy:yD,kFree:pD,kUrl:wD,kClose:DD,kDestroy:RD,kDispatch:ND}=nA(),mD=_C(),ZA=Symbol("clients"),HA=Symbol("needDrain"),bs=Symbol("queue"),HE=Symbol("closed resolve"),VE=Symbol("onDrain"),KC=Symbol("onConnect"),zC=Symbol("onDisconnect"),$C=Symbol("onConnectionError"),qE=Symbol("get dispatcher"),eB=Symbol("add client"),tB=Symbol("remove client"),AB=Symbol("stats"),OE=class extends fD{constructor(){super(),this[bs]=new dD,this[ZA]=[],this[ks]=0;let e=this;this[VE]=function(r,s){let n=e[bs],i=!1;for(;!i;){let o=n.shift();if(!o)break;e[ks]--,i=!this.dispatch(o.opts,o.handler)}this[HA]=i,!this[HA]&&e[HA]&&(e[HA]=!1,e.emit("drain",r,[e,...s])),e[HE]&&n.isEmpty()&&Promise.all(e[ZA].map(o=>o.close())).then(e[HE])},this[KC]=(t,r)=>{e.emit("connect",t,[e,...r])},this[zC]=(t,r,s)=>{e.emit("disconnect",t,[e,...r],s)},this[$C]=(t,r,s)=>{e.emit("connectionError",t,[e,...r],s)},this[AB]=new mD(this)}get[yD](){return this[HA]}get[vE](){return this[ZA].filter(e=>e[vE]).length}get[pD](){return this[ZA].filter(e=>e[vE]&&!e[HA]).length}get[jC](){let e=this[ks];for(let{[jC]:t}of this[ZA])e+=t;return e}get[ZC](){let e=0;for(let{[ZC]:t}of this[ZA])e+=t;return e}get[XC](){let e=this[ks];for(let{[XC]:t}of this[ZA])e+=t;return e}get stats(){return this[AB]}async[DD](){return this[bs].isEmpty()?Promise.all(this[ZA].map(e=>e.close())):new Promise(e=>{this[HE]=e})}async[RD](e){for(;;){let t=this[bs].shift();if(!t)break;t.handler.onError(e)}return Promise.all(this[ZA].map(t=>t.destroy(e)))}[ND](e,t){let r=this[qE]();return r?r.dispatch(e,t)||(r[HA]=!0,this[HA]=!this[qE]()):(this[HA]=!0,this[bs].push({opts:e,handler:t}),this[ks]++),!this[HA]}[eB](e){return e.on("drain",this[VE]).on("connect",this[KC]).on("disconnect",this[zC]).on("connectionError",this[$C]),this[ZA].push(e),this[HA]&&process.nextTick(()=>{this[HA]&&this[VE](e[wD],[this,e])}),this}[tB](e){e.close(()=>{let t=this[ZA].indexOf(e);t!==-1&&this[ZA].splice(t,1)}),this[HA]=this[ZA].some(t=>!t[HA]&&t.closed!==!0&&t.destroyed!==!0)}};rB.exports={PoolBase:OE,kClients:ZA,kNeedDrain:HA,kAddClient:eB,kRemoveClient:tB,kGetDispatcher:qE}});var kr=h((IL,iB)=>{"use strict";var{PoolBase:FD,kClients:qn,kNeedDrain:kD,kAddClient:bD,kGetDispatcher:SD}=WE(),UD=Fs(),{InvalidArgumentError:PE}=AA(),_E=q(),{kUrl:sB,kInterceptors:LD}=nA(),MD=ds(),XE=Symbol("options"),ZE=Symbol("connections"),nB=Symbol("factory");function xD(A,e){return new UD(A,e)}var jE=class extends FD{constructor(e,{connections:t,factory:r=xD,connect:s,connectTimeout:n,tls:i,maxCachedSessions:o,socketPath:E,autoSelectFamily:g,autoSelectFamilyAttemptTimeout:a,allowH2:Q,...c}={}){if(super(),t!=null&&(!Number.isFinite(t)||t<0))throw new PE("invalid connections");if(typeof r!="function")throw new PE("factory must be a function.");if(s!=null&&typeof s!="function"&&typeof s!="object")throw new PE("connect must be a function or an object");typeof s!="function"&&(s=MD({...i,maxCachedSessions:o,allowH2:Q,socketPath:E,timeout:n,..._E.nodeHasAutoSelectFamily&&g?{autoSelectFamily:g,autoSelectFamilyAttemptTimeout:a}:void 0,...s})),this[LD]=c.interceptors&&c.interceptors.Pool&&Array.isArray(c.interceptors.Pool)?c.interceptors.Pool:[],this[ZE]=t||null,this[sB]=_E.parseOrigin(e),this[XE]={..._E.deepClone(c),connect:s,allowH2:Q},this[XE].interceptors=c.interceptors?{...c.interceptors}:void 0,this[nB]=r,this.on("connectionError",(B,C,f)=>{for(let l of C){let y=this[qn].indexOf(l);y!==-1&&this[qn].splice(y,1)}})}[SD](){let e=this[qn].find(t=>!t[ Line truncated
${r.count} ${r.noun} ${r.is} pending: ${r.count} ${r.noun} ${r.is} pending:
${e.format(t)} ${e.format(t)}
`.trim())}};YI.exports=La});var qI=h((LL,VI)=>{"use strict";var{kProxy:S0,kClose:U0,kDestroy:L0,kInterceptors:M0}=EA(),{URL:GI}=require("url"),JI=xs(),x0=Mr(),Y0=ps(),{InvalidArgumentError:vs,RequestAbortedError:T0}=tA(),vI=ws(),Gs=Symbol("proxy agent"),gn=Symbol("proxy client"),Js=Symbol("proxy headers"),Ma=Symbol("request tls settings"),G0=Symbol("proxy tls settings"),HI=Symbol("connect endpoint function");function J0(A){return A==="https:"?443:80}function v0(A){if(typeof A=="string"&&(A={uri:A}),!A||!A.uri)throw new vs("Proxy opts.uri is mandatory");return{uri:A.uri,protocol:A.protocol||"https"}}function H0(A,e){return new x0(A,e)}var xa=class extends Y0{constructor(e){if(super(e),this[S0]=v0(e),this[Gs]=new JI(e),this[M0]=e.interceptors&&e.interceptors.ProxyAgent&&Array.isArray(e.interceptors.ProxyAgent)?e.interceptors.ProxyAgent:[],typeof e=="string"&&(e={uri:e}),!e||!e.uri)throw new vs("Proxy opts.uri is mandatory");let{clientFactory:t=H0}=e;if(typeof t!="function")throw new vs("Proxy opts.clientFactory must be a function.");this[Ma]=e.requestTls,this[G0]=e.proxyTls,this[Js]=e.headers||{};let r=new GI(e.uri),{origin:s,port:i,host:n,username:o,password:E}=r;if(e.auth&&e.token)throw new vs("opts.auth cannot be used in combination with opts.token");e.auth?this[Js]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[Js]["proxy-authorization"]=e.token:o&&E&&(this[Js]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(o)}:${decodeURIComponent(E)}`).toString("base64")}`);let g=vI({...e.proxyTls});this[HI]=vI({...e.requestTls}),this[gn]=t(r,{connect:g}),this[Gs]=new JI({...e,connect:async(a,Q)=>{let c=a.host;a.port||(c+=`:${J0(a.protocol)}`);try{let{socket:B,statusCode:C}=await this[gn].connect({origin:s,port:i,path:c,signal:a.signal,headers:{...this[Js],host:n}});if(C!==200&&(B.on("error",()=>{}).destroy(),Q(new T0(`Proxy response (${C}) !== 200 when HTTP Tunneling`))),a.protocol!=="https:"){Q(null,B);return}let d;this[Ma]?d=this[Ma].servername:d=a.servername,this[HI]({...a,servername:d,httpSocket:B},Q)}catch(B){Q(B)}}})}dispatch(e,t){let{host:r}=new GI(e.origin),s=V0(e.headers);return q0(s),this[Gs].dispatch({...e,headers:{...s,host:r}},t)}async[U0](){await this[Gs].close(),await this[gn].close()}async[L0](){await this[Gs].destroy(),await this[gn].destroy()}};function V0(A){if(Array.isArray(A)){let e={};for(let t=0;t<A.length;t+=2)e[A[t]]=A[t+1];return e}return A}function q0(A){if(A&&Object.keys(A).find(t=>t.toLowerCase()==="proxy-authorization"))throw new vs("Proxy-Authorization should be sent in ProxyAgent constructor")}VI.exports=xa});var XI=h((ML,_I)=>{var tr=require("assert"),{kRetryHandlerDefaultRetry:OI}=EA(),{RequestRetryError:Qn}=tA(),{isDisturbed:WI,parseHeaders:O0,parseRangeHeader:PI}=W();function W0(A){let e=Date.now();return new Date(A).getTime()-e}var Ya=class A{constructor(e,t){let{retryOptions:r,...s}=e,{retry:i,maxRetries:n,maxTimeout:o,minTimeout:E,timeoutFactor:g,methods:a,errorCodes:Q,retryAfter:c,statusCodes:B}=r??{};this.dispatch=t.dispatch,this.handler=t.handler,this.opts=s,this.abort=null,this.aborted=!1,this.retryOpts={retry:i??A[OI],retryAfter:c??!0,maxTimeout:o??30*1e3,timeout:E??500,timeoutFactor:g??2,maxRetries:n??5,methods:a??["GET","HEAD","OPTIONS","PUT","DELETE","TRACE"],statusCodes:B??[500,502,503,504,429],errorCodes:Q??["ECONNRESET","ECONNREFUSED","ENOTFOUND","ENETDOWN","ENETUNREACH","EHOSTDOWN","EHOSTUNREACH","EPIPE"]},this.retryCount=0,this.start=0,this.end=null,this.etag=null,this.resume=null,this.handler.onConnect(C=>{this.aborted=!0,this.abort?this.abort(C):this.reason=C})}onRequestSent(){this.handler.onRequestSent&&this.handler.onRequestSent()}onUpgrade(e,t,r){this.handler.onUpgrade&&this.handler.onUpgrade(e,t,r)}onConnect(e){this.aborted?e(this.reason):this.abort=e}onBodySent(e){if(this.handler.onBodySent)return this.handler.onBodySent(e)}static[OI](e,{state:t,opts:r},s){let{statusCode:i,code:n,headers:o}=e,{method:E,retryOptions:g}=r,{maxRetries:a,timeout:Q,maxTimeout:c,timeoutFactor:B,statusCodes:C,errorCodes:d,methods:u}=g,{counter:y,currentTimeout:R}=t;if(R=R!=null&&R>0?R:Q,n&&n!=="UND_ERR_REQ_RETRY"&&n!=="UND_ERR_SOCKET"&&!d.includes(n)){s(e);return}if(Array.isArray(u)&&!u.includes(E)){s(e);return}if(i!=null&&Array.isArray(C)&&!C.includes(i)){s(e);return}if(y>a){s(e);return}let m=o!=null&&o["retry-after"];m&&(m=Number(m),m=isNaN(m)?W0(m):m*1e3);let Y=m>0?Math.min(m,c):Math.min(R*B**y,c);t.currentTimeout=Y,setTimeout(()=>s(null),Y)}onHeaders(e,t,r,s){let i=O0(t);if(this.retryCount+=1,e>=300)return this.abort(new Qn("Request failed",e,{headers:i,count:this.retryCount})),!1;if(this.resume!=null){if(this.resume=null,e!==206)return!0;let o=PI(i["content-range"]);if(!o)return this.abort(new Qn("Content-Range mismatch",e,{headers:i,count:this.retryCount})),!1;if(this.etag!=null&&this.etag!==i.etag)return this.abort(new Qn("ETag mismatch",e,{headers:i,count:this.retryCount})),!1;let{start:E,size:g,end:a=g}=o;return tr(this.start===E,"content-range mism Line truncated `.trim())}};GI.exports=Ma});var WI=h((vL,OI)=>{"use strict";var{kProxy:Y0,kClose:T0,kDestroy:G0,kInterceptors:J0}=nA(),{URL:vI}=require("url"),HI=Us(),v0=kr(),H0=fs(),{InvalidArgumentError:Ts,RequestAbortedError:V0}=AA(),VI=ds(),xs=Symbol("proxy agent"),gi=Symbol("proxy client"),Ys=Symbol("proxy headers"),xa=Symbol("request tls settings"),q0=Symbol("proxy tls settings"),qI=Symbol("connect endpoint function");function O0(A){return A==="https:"?443:80}function W0(A){if(typeof A=="string"&&(A={uri:A}),!A||!A.uri)throw new Ts("Proxy opts.uri is mandatory");return{uri:A.uri,protocol:A.protocol||"https"}}function P0(A,e){return new v0(A,e)}var Ya=class extends H0{constructor(e){if(super(e),this[Y0]=W0(e),this[xs]=new HI(e),this[J0]=e.interceptors&&e.interceptors.ProxyAgent&&Array.isArray(e.interceptors.ProxyAgent)?e.interceptors.ProxyAgent:[],typeof e=="string"&&(e={uri:e}),!e||!e.uri)throw new Ts("Proxy opts.uri is mandatory");let{clientFactory:t=P0}=e;if(typeof t!="function")throw new Ts("Proxy opts.clientFactory must be a function.");this[xa]=e.requestTls,this[q0]=e.proxyTls,this[Ys]=e.headers||{};let r=new vI(e.uri),{origin:s,port:n,host:i,username:o,password:E}=r;if(e.auth&&e.token)throw new Ts("opts.auth cannot be used in combination with opts.token");e.auth?this[Ys]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[Ys]["proxy-authorization"]=e.token:o&&E&&(this[Ys]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(o)}:${decodeURIComponent(E)}`).toString("base64")}`);let g=VI({...e.proxyTls});this[qI]=VI({...e.requestTls}),this[gi]=t(r,{connect:g}),this[xs]=new HI({...e,connect:async(a,Q)=>{let c=a.host;a.port||(c+=`:${O0(a.protocol)}`);try{let{socket:B,statusCode:C}=await this[gi].connect({origin:s,port:n,path:c,signal:a.signal,headers:{...this[Ys],host:i}});if(C!==200&&(B.on("error",()=>{}).destroy(),Q(new V0(`Proxy response (${C}) !== 200 when HTTP Tunneling`))),a.protocol!=="https:"){Q(null,B);return}let f;this[xa]?f=this[xa].servername:f=a.servername,this[qI]({...a,servername:f,httpSocket:B},Q)}catch(B){Q(B)}}})}dispatch(e,t){let{host:r}=new vI(e.origin),s=_0(e.headers);return X0(s),this[xs].dispatch({...e,headers:{...s,host:r}},t)}async[T0](){await this[xs].close(),await this[gi].close()}async[G0](){await this[xs].destroy(),await this[gi].destroy()}};function _0(A){if(Array.isArray(A)){let e={};for(let t=0;t<A.length;t+=2)e[A[t]]=A[t+1];return e}return A}function X0(A){if(A&&Object.keys(A).find(t=>t.toLowerCase()==="proxy-authorization"))throw new Ts("Proxy-Authorization should be sent in ProxyAgent constructor")}OI.exports=Ya});var jI=h((HL,ZI)=>{var zt=require("assert"),{kRetryHandlerDefaultRetry:PI}=nA(),{RequestRetryError:Qi}=AA(),{isDisturbed:_I,parseHeaders:Z0,parseRangeHeader:XI}=q();function j0(A){let e=Date.now();return new Date(A).getTime()-e}var Ta=class A{constructor(e,t){let{retryOptions:r,...s}=e,{retry:n,maxRetries:i,maxTimeout:o,minTimeout:E,timeoutFactor:g,methods:a,errorCodes:Q,retryAfter:c,statusCodes:B}=r??{};this.dispatch=t.dispatch,this.handler=t.handler,this.opts=s,this.abort=null,this.aborted=!1,this.retryOpts={retry:n??A[PI],retryAfter:c??!0,maxTimeout:o??30*1e3,timeout:E??500,timeoutFactor:g??2,maxRetries:i??5,methods:a??["GET","HEAD","OPTIONS","PUT","DELETE","TRACE"],statusCodes:B??[500,502,503,504,429],errorCodes:Q??["ECONNRESET","ECONNREFUSED","ENOTFOUND","ENETDOWN","ENETUNREACH","EHOSTDOWN","EHOSTUNREACH","EPIPE"]},this.retryCount=0,this.start=0,this.end=null,this.etag=null,this.resume=null,this.handler.onConnect(C=>{this.aborted=!0,this.abort?this.abort(C):this.reason=C})}onRequestSent(){this.handler.onRequestSent&&this.handler.onRequestSent()}onUpgrade(e,t,r){this.handler.onUpgrade&&this.handler.onUpgrade(e,t,r)}onConnect(e){this.aborted?e(this.reason):this.abort=e}onBodySent(e){if(this.handler.onBodySent)return this.handler.onBodySent(e)}static[PI](e,{state:t,opts:r},s){let{statusCode:n,code:i,headers:o}=e,{method:E,retryOptions:g}=r,{maxRetries:a,timeout:Q,maxTimeout:c,timeoutFactor:B,statusCodes:C,errorCodes:f,methods:l}=g,{counter:y,currentTimeout:R}=t;if(R=R!=null&&R>0?R:Q,i&&i!=="UND_ERR_REQ_RETRY"&&i!=="UND_ERR_SOCKET"&&!f.includes(i)){s(e);return}if(Array.isArray(l)&&!l.includes(E)){s(e);return}if(n!=null&&Array.isArray(C)&&!C.includes(n)){s(e);return}if(y>a){s(e);return}let S=o!=null&&o["retry-after"];S&&(S=Number(S),S=isNaN(S)?j0(S):S*1e3);let U=S>0?Math.min(S,c):Math.min(R*B**y,c);t.currentTimeout=U,setTimeout(()=>s(null),U)}onHeaders(e,t,r,s){let n=Z0(t);if(this.retryCount+=1,e>=300)return this.abort(new Qi("Request failed",e,{headers:n,count:this.retryCount})),!1;if(this.resume!=null){if(this.resume=null,e!==206)return!0;let o=XI(n["content-range"]);if(!o)return this.abort(new Qi("Content-Range mismatch",e,{headers:n,count:this.retryCount})),!1;if(this.etag!=null&&this.etag!==n.etag)return this.abort(new Qi("ETag mismatch",e,{headers:n,count:this.retryCount})),!1;let{start:E,size:g,end:a=g}=o;return zt(this.start===E,"content-range mism Line truncated
Error Code : ${n.statusCode} Error Code : ${i.statusCode}
Error Message: ${n.message}`)})).result)===null||t===void 0?void 0:t.value;if(!i)throw new Error("Response json body do not have ID Token field");return i})}static getIDToken(e){return su(this,void 0,void 0,function*(){try{let t=A.getIDTokenUrl();if(e){let s=encodeURIComponent(e);t=`${t}&audience=${s}`}(0,iu.debug)(`ID token url is ${t}`);let r=yield A.getCall(t);return(0,iu.setSecret)(r),r}catch(t){throw new Error(`Error message: ${t.message}`)}})}};is.OidcClient=Ng});var bg=h(ie=>{"use strict";var mg=ie&&ie.__awaiter||function(A,e,t,r){function s(i){return i instanceof t?i:new t(function(n){n(i)})}return new(t||(t=Promise))(function(i,n){function o(a){try{g(r.next(a))}catch(Q){n(Q)}}function E(a){try{g(r.throw(a))}catch(Q){n(Q)}}function g(a){a.done?i(a.value):s(a.value).then(o,E)}g((r=r.apply(A,e||[])).next())})};Object.defineProperty(ie,"__esModule",{value:!0});ie.summary=ie.markdownSummary=ie.SUMMARY_DOCS_URL=ie.SUMMARY_ENV_VAR=void 0;var xk=require("os"),Fg=require("fs"),{access:Yk,appendFile:Tk,writeFile:Gk}=Fg.promises;ie.SUMMARY_ENV_VAR="GITHUB_STEP_SUMMARY";ie.SUMMARY_DOCS_URL="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";var kg=class{constructor(){this._buffer=""}filePath(){return mg(this,void 0,void 0,function*(){if(this._filePath)return this._filePath;let e=process.env[ie.SUMMARY_ENV_VAR];if(!e)throw new Error(`Unable to find environment variable for $${ie.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);try{yield Yk(e,Fg.constants.R_OK|Fg.constants.W_OK)}catch{throw new Error(`Unable to access summary file: '${e}'. Check if the file has correct read/write permissions.`)}return this._filePath=e,this._filePath})}wrap(e,t,r={}){let s=Object.entries(r).map(([i,n])=>` ${i}="${n}"`).join("");return t?`<${e}${s}>${t}</${e}>`:`<${e}${s}>`}write(e){return mg(this,void 0,void 0,function*(){let t=!!e?.overwrite,r=yield this.filePath();return yield(t?Gk:Tk)(r,this._buffer,{encoding:"utf8"}),this.emptyBuffer()})}clear(){return mg(this,void 0,void 0,function*(){return this.emptyBuffer().write({overwrite:!0})})}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){return this._buffer="",this}addRaw(e,t=!1){return this._buffer+=e,t?this.addEOL():this}addEOL(){return this.addRaw(xk.EOL)}addCodeBlock(e,t){let r=Object.assign({},t&&{lang:t}),s=this.wrap("pre",this.wrap("code",e),r);return this.addRaw(s).addEOL()}addList(e,t=!1){let r=t?"ol":"ul",s=e.map(n=>this.wrap("li",n)).join(""),i=this.wrap(r,s);return this.addRaw(i).addEOL()}addTable(e){let t=e.map(s=>{let i=s.map(n=>{if(typeof n=="string")return this.wrap("td",n);let{header:o,data:E,colspan:g,rowspan:a}=n,Q=o?"th":"td",c=Object.assign(Object.assign({},g&&{colspan:g}),a&&{rowspan:a});return this.wrap(Q,E,c)}).join("");return this.wrap("tr",i)}).join(""),r=this.wrap("table",t);return this.addRaw(r).addEOL()}addDetails(e,t){let r=this.wrap("details",this.wrap("summary",e)+t);return this.addRaw(r).addEOL()}addImage(e,t,r){let{width:s,height:i}=r||{},n=Object.assign(Object.assign({},s&&{width:s}),i&&{height:i}),o=this.wrap("img",null,Object.assign({src:e,alt:t},n));return this.addRaw(o).addEOL()}addHeading(e,t){let r=`h${t}`,s=["h1","h2","h3","h4","h5","h6"].includes(r)?r:"h1",i=this.wrap(s,e);return this.addRaw(i).addEOL()}addSeparator(){let e=this.wrap("hr",null);return this.addRaw(e).addEOL()}addBreak(){let e=this.wrap("br",null);return this.addRaw(e).addEOL()}addQuote(e,t){let r=Object.assign({},t&&{cite:t}),s=this.wrap("blockquote",e,r);return this.addRaw(s).addEOL()}addLink(e,t){let r=this.wrap("a",e,{href:t});return this.addRaw(r).addEOL()}},ou=new kg;ie.markdownSummary=ou;ie.summary=ou});var Eu=h(ne=>{"use strict";var Jk=ne&&ne.__createBinding||(Object.create?(function(A,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,r,s)}):(function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]})),vk=ne&&ne.__setModuleDefault||(Object.create?(function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}):function(A,e){A.default=e}),Hk=ne&&ne.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.prototype.hasOwnProperty.call(A,t)&&Jk(e,A,t);return vk(e,A),e};Object.defineProperty(ne,"__esModule",{value:!0});ne.toPlatformPath=ne.toWin32Path=ne.toPosixPath=void 0;var Vk=Hk(require("path"));function qk(A){return A.replace(/[\\]/g,"/")}ne.toPosixPath=qk;function Ok(A){return A.replace(/[/]/g,"\\")}ne.toWin32Path=Ok;function Wk(A){return A.replace(/[/\\]/g,Vk.sep)}ne.toPlatformPath=Wk});var Ug=h(N=>{"use strict";var Pk=N&&N.__createBinding||(Object.create?(function(A,e,t,r){r===void 0&&(r=t),Object.defineProperty(A,r,{enumerable:!0,get:function(){return e[t]}})}):(function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]})),_k=N&&N.__setModLine truncated Error Message: ${i.message}`)})).result)===null||t===void 0?void 0:t.value;if(!n)throw new Error("Response json body do not have ID Token field");return n})}static getIDToken(e){return iu(this,void 0,void 0,function*(){try{let t=A.getIDTokenUrl();if(e){let s=encodeURIComponent(e);t=`${t}&audience=${s}`}(0,ou.debug)(`ID token url is ${t}`);let r=yield A.getCall(t);return(0,ou.setSecret)(r),r}catch(t){throw new Error(`Error message: ${t.message}`)}})}};As.OidcClient=mg});var Sg=h(Ae=>{"use strict";var Fg=Ae&&Ae.__awaiter||function(A,e,t,r){function s(n){return n instanceof t?n:new t(function(i){i(n)})}return new(t||(t=Promise))(function(n,i){function o(a){try{g(r.next(a))}catch(Q){i(Q)}}function E(a){try{g(r.throw(a))}catch(Q){i(Q)}}function g(a){a.done?n(a.value):s(a.value).then(o,E)}g((r=r.apply(A,e||[])).next())})};Object.defineProperty(Ae,"__esModule",{value:!0});Ae.summary=Ae.markdownSummary=Ae.SUMMARY_DOCS_URL=Ae.SUMMARY_ENV_VAR=void 0;var vk=require("os"),kg=require("fs"),{access:Hk,appendFile:Vk,writeFile:qk}=kg.promises;Ae.SUMMARY_ENV_VAR="GITHUB_STEP_SUMMARY";Ae.SUMMARY_DOCS_URL="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";var bg=class{constructor(){this._buffer=""}filePath(){return Fg(this,void 0,void 0,function*(){if(this._filePath)return this._filePath;let e=process.env[Ae.SUMMARY_ENV_VAR];if(!e)throw new Error(`Unable to find environment variable for $${Ae.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);try{yield Hk(e,kg.constants.R_OK|kg.constants.W_OK)}catch{throw new Error(`Unable to access summary file: '${e}'. Check if the file has correct read/write permissions.`)}return this._filePath=e,this._filePath})}wrap(e,t,r={}){let s=Object.entries(r).map(([n,i])=>` ${n}="${i}"`).join("");return t?`<${e}${s}>${t}</${e}>`:`<${e}${s}>`}write(e){return Fg(this,void 0,void 0,function*(){let t=!!e?.overwrite,r=yield this.filePath();return yield(t?qk:Vk)(r,this._buffer,{encoding:"utf8"}),this.emptyBuffer()})}clear(){return Fg(this,void 0,void 0,function*(){return this.emptyBuffer().write({overwrite:!0})})}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){return this._buffer="",this}addRaw(e,t=!1){return this._buffer+=e,t?this.addEOL():this}addEOL(){return this.addRaw(vk.EOL)}addCodeBlock(e,t){let r=Object.assign({},t&&{lang:t}),s=this.wrap("pre",this.wrap("code",e),r);return this.addRaw(s).addEOL()}addList(e,t=!1){let r=t?"ol":"ul",s=e.map(i=>this.wrap("li",i)).join(""),n=this.wrap(r,s);return this.addRaw(n).addEOL()}addTable(e){let t=e.map(s=>{let n=s.map(i=>{if(typeof i=="string")return this.wrap("td",i);let{header:o,data:E,colspan:g,rowspan:a}=i,Q=o?"th":"td",c=Object.assign(Object.assign({},g&&{colspan:g}),a&&{rowspan:a});return this.wrap(Q,E,c)}).join("");return this.wrap("tr",n)}).join(""),r=this.wrap("table",t);return this.addRaw(r).addEOL()}addDetails(e,t){let r=this.wrap("details",this.wrap("summary",e)+t);return this.addRaw(r).addEOL()}addImage(e,t,r){let{width:s,height:n}=r||{},i=Object.assign(Object.assign({},s&&{width:s}),n&&{height:n}),o=this.wrap("img",null,Object.assign({src:e,alt:t},i));return this.addRaw(o).addEOL()}addHeading(e,t){let r=`h${t}`,s=["h1","h2","h3","h4","h5","h6"].includes(r)?r:"h1",n=this.wrap(s,e);return this.addRaw(n).addEOL()}addSeparator(){let e=this.wrap("hr",null);return this.addRaw(e).addEOL()}addBreak(){let e=this.wrap("br",null);return this.addRaw(e).addEOL()}addQuote(e,t){let r=Object.assign({},t&&{cite:t}),s=this.wrap("blockquote",e,r);return this.addRaw(s).addEOL()}addLink(e,t){let r=this.wrap("a",e,{href:t});return this.addRaw(r).addEOL()}},au=new bg;Ae.markdownSummary=au;Ae.summary=au});var gu=h(ee=>{"use strict";var Ok=ee&&ee.__createBinding||(Object.create?(function(A,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,r,s)}):(function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]})),Wk=ee&&ee.__setModuleDefault||(Object.create?(function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}):function(A,e){A.default=e}),Pk=ee&&ee.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.prototype.hasOwnProperty.call(A,t)&&Ok(e,A,t);return Wk(e,A),e};Object.defineProperty(ee,"__esModule",{value:!0});ee.toPlatformPath=ee.toWin32Path=ee.toPosixPath=void 0;var _k=Pk(require("path"));function Xk(A){return A.replace(/[\\]/g,"/")}ee.toPosixPath=Xk;function Zk(A){return A.replace(/[/]/g,"\\")}ee.toWin32Path=Zk;function jk(A){return A.replace(/[/\\]/g,_k.sep)}ee.toPlatformPath=jk});var Lg=h(N=>{"use strict";var Kk=N&&N.__createBinding||(Object.create?(function(A,e,t,r){r===void 0&&(r=t),Object.defineProperty(A,r,{enumerable:!0,get:function(){return e[t]}})}):(function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]})),zk=N&&N.__setModLine truncated
`);return{name:e,version:t}});P.platform=Nu.default.platform();P.arch=Nu.default.arch();P.isWindows=P.platform==="win32";P.isMacOS=P.platform==="darwin";P.isLinux=P.platform==="linux";function Db(){return so(this,void 0,void 0,function*(){return Object.assign(Object.assign({},yield P.isWindows?yb():P.isMacOS?pb():wb()),{platform:P.platform,arch:P.arch,isWindows:P.isWindows,isMacOS:P.isMacOS,isLinux:P.isLinux})})}P.getDetails=Db});var ns=h(D=>{"use strict";var Rb=D&&D.__createBinding||(Object.create?(function(A,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,r,s)}):(function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]})),Nb=D&&D.__setModuleDefault||(Object.create?(function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}):function(A,e){A.default=e}),Jg=D&&D.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.prototype.hasOwnProperty.call(A,t)&&Rb(e,A,t);return Nb(e,A),e},Fu=D&&D.__awaiter||function(A,e,t,r){function s(i){return i instanceof t?i:new t(function(n){n(i)})}return new(t||(t=Promise))(function(i,n){function o(a){try{g(r.next(a))}catch(Q){n(Q)}}function E(a){try{g(r.throw(a))}catch(Q){n(Q)}}function g(a){a.done?i(a.value):s(a.value).then(o,E)}g((r=r.apply(A,e||[])).next())})};Object.defineProperty(D,"__esModule",{value:!0});D.platform=D.toPlatformPath=D.toWin32Path=D.toPosixPath=D.markdownSummary=D.summary=D.getIDToken=D.getState=D.saveState=D.group=D.endGroup=D.startGroup=D.info=D.notice=D.warning=D.error=D.debug=D.isDebug=D.setFailed=D.setCommandEcho=D.setOutput=D.getBooleanInput=D.getMultilineInput=D.getInput=D.addPath=D.setSecret=D.exportVariable=D.ExitCode=void 0;var Se=nQ(),ar=aQ(),Es=ii(),ku=Jg(require("os")),mb=Jg(require("path")),Fb=nu(),Gg;(function(A){A[A.Success=0]="Success",A[A.Failure=1]="Failure"})(Gg||(D.ExitCode=Gg={}));function kb(A,e){let t=(0,Es.toCommandValue)(e);if(process.env[A]=t,process.env.GITHUB_ENV||"")return(0,ar.issueFileCommand)("ENV",(0,ar.prepareKeyValueMessage)(A,e));(0,Se.issueCommand)("set-env",{name:A},t)}D.exportVariable=kb;function bb(A){(0,Se.issueCommand)("add-mask",{},A)}D.setSecret=bb;function Sb(A){process.env.GITHUB_PATH||""?(0,ar.issueFileCommand)("PATH",A):(0,Se.issueCommand)("add-path",{},A),process.env.PATH=`${A}${mb.delimiter}${process.env.PATH}`}D.addPath=Sb;function vg(A,e){let t=process.env[`INPUT_${A.replace(/ /g,"_").toUpperCase()}`]||"";if(e&&e.required&&!t)throw new Error(`Input required and not supplied: ${A}`);return e&&e.trimWhitespace===!1?t:t.trim()}D.getInput=vg;function Ub(A,e){let t=vg(A,e).split(` `);return{name:e,version:t}});O.platform=Fu.default.platform();O.arch=Fu.default.arch();O.isWindows=O.platform==="win32";O.isMacOS=O.platform==="darwin";O.isLinux=O.platform==="linux";function kb(){return so(this,void 0,void 0,function*(){return Object.assign(Object.assign({},yield O.isWindows?Nb():O.isMacOS?mb():Fb()),{platform:O.platform,arch:O.arch,isWindows:O.isWindows,isMacOS:O.isMacOS,isLinux:O.isLinux})})}O.getDetails=kb});var es=h(D=>{"use strict";var bb=D&&D.__createBinding||(Object.create?(function(A,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,r,s)}):(function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]})),Sb=D&&D.__setModuleDefault||(Object.create?(function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}):function(A,e){A.default=e}),vg=D&&D.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.prototype.hasOwnProperty.call(A,t)&&bb(e,A,t);return Sb(e,A),e},bu=D&&D.__awaiter||function(A,e,t,r){function s(n){return n instanceof t?n:new t(function(i){i(n)})}return new(t||(t=Promise))(function(n,i){function o(a){try{g(r.next(a))}catch(Q){i(Q)}}function E(a){try{g(r.throw(a))}catch(Q){i(Q)}}function g(a){a.done?n(a.value):s(a.value).then(o,E)}g((r=r.apply(A,e||[])).next())})};Object.defineProperty(D,"__esModule",{value:!0});D.platform=D.toPlatformPath=D.toWin32Path=D.toPosixPath=D.markdownSummary=D.summary=D.getIDToken=D.getState=D.saveState=D.group=D.endGroup=D.startGroup=D.info=D.notice=D.warning=D.error=D.debug=D.isDebug=D.setFailed=D.setCommandEcho=D.setOutput=D.getBooleanInput=D.getMultilineInput=D.getInput=D.addPath=D.setSecret=D.exportVariable=D.ExitCode=void 0;var ke=EQ(),nr=QQ(),rs=nn(),Su=vg(require("os")),Ub=vg(require("path")),Lb=Eu(),Jg;(function(A){A[A.Success=0]="Success",A[A.Failure=1]="Failure"})(Jg||(D.ExitCode=Jg={}));function Mb(A,e){let t=(0,rs.toCommandValue)(e);if(process.env[A]=t,process.env.GITHUB_ENV||"")return(0,nr.issueFileCommand)("ENV",(0,nr.prepareKeyValueMessage)(A,e));(0,ke.issueCommand)("set-env",{name:A},t)}D.exportVariable=Mb;function xb(A){(0,ke.issueCommand)("add-mask",{},A)}D.setSecret=xb;function Yb(A){process.env.GITHUB_PATH||""?(0,nr.issueFileCommand)("PATH",A):(0,ke.issueCommand)("add-path",{},A),process.env.PATH=`${A}${Ub.delimiter}${process.env.PATH}`}D.addPath=Yb;function Hg(A,e){let t=process.env[`INPUT_${A.replace(/ /g,"_").toUpperCase()}`]||"";if(e&&e.required&&!t)throw new Error(`Input required and not supplied: ${A}`);return e&&e.trimWhitespace===!1?t:t.trim()}D.getInput=Hg;function Tb(A,e){let t=Hg(A,e).split(`
`).filter(r=>r!=="");return e&&e.trimWhitespace===!1?t:t.map(r=>r.trim())}D.getMultilineInput=Ub;function Lb(A,e){let t=["true","True","TRUE"],r=["false","False","FALSE"],s=vg(A,e);if(t.includes(s))return!0;if(r.includes(s))return!1;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${A} `).filter(r=>r!=="");return e&&e.trimWhitespace===!1?t:t.map(r=>r.trim())}D.getMultilineInput=Tb;function Gb(A,e){let t=["true","True","TRUE"],r=["false","False","FALSE"],s=Hg(A,e);if(t.includes(s))return!0;if(r.includes(s))return!1;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${A}
Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}D.getBooleanInput=Lb;function Mb(A,e){if(process.env.GITHUB_OUTPUT||"")return(0,ar.issueFileCommand)("OUTPUT",(0,ar.prepareKeyValueMessage)(A,e));process.stdout.write(ku.EOL),(0,Se.issueCommand)("set-output",{name:A},(0,Es.toCommandValue)(e))}D.setOutput=Mb;function xb(A){(0,Se.issue)("echo",A?"on":"off")}D.setCommandEcho=xb;function Yb(A){process.exitCode=Gg.Failure,bu(A)}D.setFailed=Yb;function Tb(){return process.env.RUNNER_DEBUG==="1"}D.isDebug=Tb;function Gb(A){(0,Se.issueCommand)("debug",{},A)}D.debug=Gb;function bu(A,e={}){(0,Se.issueCommand)("error",(0,Es.toCommandProperties)(e),A instanceof Error?A.toString():A)}D.error=bu;function Jb(A,e={}){(0,Se.issueCommand)("warning",(0,Es.toCommandProperties)(e),A instanceof Error?A.toString():A)}D.warning=Jb;function vb(A,e={}){(0,Se.issueCommand)("notice",(0,Es.toCommandProperties)(e),A instanceof Error?A.toString():A)}D.notice=vb;function Hb(A){process.stdout.write(A+ku.EOL)}D.info=Hb;function Su(A){(0,Se.issue)("group",A)}D.startGroup=Su;function Uu(){(0,Se.issue)("endgroup")}D.endGroup=Uu;function Vb(A,e){return Fu(this,void 0,void 0,function*(){Su(A);let t;try{t=yield e()}finally{Uu()}return t})}D.group=Vb;function qb(A,e){if(process.env.GITHUB_STATE||"")return(0,ar.issueFileCommand)("STATE",(0,ar.prepareKeyValueMessage)(A,e));(0,Se.issueCommand)("save-state",{name:A},(0,Es.toCommandValue)(e))}D.saveState=qb;function Ob(A){return process.env[`STATE_${A}`]||""}D.getState=Ob;function Wb(A){return Fu(this,void 0,void 0,function*(){return yield Fb.OidcClient.getIDToken(A)})}D.getIDToken=Wb;var Pb=bg();Object.defineProperty(D,"summary",{enumerable:!0,get:function(){return Pb.summary}});var _b=bg();Object.defineProperty(D,"markdownSummary",{enumerable:!0,get:function(){return _b.markdownSummary}});var Hg=Eu();Object.defineProperty(D,"toPosixPath",{enumerable:!0,get:function(){return Hg.toPosixPath}});Object.defineProperty(D,"toWin32Path",{enumerable:!0,get:function(){return Hg.toWin32Path}});Object.defineProperty(D,"toPlatformPath",{enumerable:!0,get:function(){return Hg.toPlatformPath}});D.platform=Jg(mu())});var Zg=h((L,Tu)=>{L=Tu.exports=J;var z;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?z=function(){var A=Array.prototype.slice.call(arguments,0);A.unshift("SEMVER"),console.log.apply(console,A)}:z=function(){};L.SEMVER_SPEC_VERSION="2.0.0";var Ai=256,io=Number.MAX_SAFE_INTEGER||9007199254740991,Vg=16,Xb=Ai-6,as=L.re=[],K=L.safeRe=[],l=L.src=[],I=L.tokens={},xu=0;function H(A){I[A]=xu++}var Og="[a-zA-Z0-9-]",qg=[["\\s",1],["\\d",Ai],[Og,Xb]];function ti(A){for(var e=0;e<qg.length;e++){var t=qg[e][0],r=qg[e][1];A=A.split(t+"*").join(t+"{0,"+r+"}").split(t+"+").join(t+"{1,"+r+"}")}return A}H("NUMERICIDENTIFIER");l[I.NUMERICIDENTIFIER]="0|[1-9]\\d*";H("NUMERICIDENTIFIERLOOSE");l[I.NUMERICIDENTIFIERLOOSE]="\\d+";H("NONNUMERICIDENTIFIER");l[I.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+Og+"*";H("MAINVERSION");l[I.MAINVERSION]="("+l[I.NUMERICIDENTIFIER]+")\\.("+l[I.NUMERICIDENTIFIER]+")\\.("+l[I.NUMERICIDENTIFIER]+")";H("MAINVERSIONLOOSE");l[I.MAINVERSIONLOOSE]="("+l[I.NUMERICIDENTIFIERLOOSE]+")\\.("+l[I.NUMERICIDENTIFIERLOOSE]+")\\.("+l[I.NUMERICIDENTIFIERLOOSE]+")";H("PRERELEASEIDENTIFIER");l[I.PRERELEASEIDENTIFIER]="(?:"+l[I.NUMERICIDENTIFIER]+"|"+l[I.NONNUMERICIDENTIFIER]+")";H("PRERELEASEIDENTIFIERLOOSE");l[I.PRERELEASEIDENTIFIERLOOSE]="(?:"+l[I.NUMERICIDENTIFIERLOOSE]+"|"+l[I.NONNUMERICIDENTIFIER]+")";H("PRERELEASE");l[I.PRERELEASE]="(?:-("+l[I.PRERELEASEIDENTIFIER]+"(?:\\."+l[I.PRERELEASEIDENTIFIER]+")*))";H("PRERELEASELOOSE");l[I.PRERELEASELOOSE]="(?:-?("+l[I.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+l[I.PRERELEASEIDENTIFIERLOOSE]+")*))";H("BUILDIDENTIFIER");l[I.BUILDIDENTIFIER]=Og+"+";H("BUILD");l[I.BUILD]="(?:\\+("+l[I.BUILDIDENTIFIER]+"(?:\\."+l[I.BUILDIDENTIFIER]+")*))";H("FULL");H("FULLPLAIN");l[I.FULLPLAIN]="v?"+l[I.MAINVERSION]+l[I.PRERELEASE]+"?"+l[I.BUILD]+"?";l[I.FULL]="^"+l[I.FULLPLAIN]+"$";H("LOOSEPLAIN");l[I.LOOSEPLAIN]="[v=\\s]*"+l[I.MAINVERSIONLOOSE]+l[I.PRERELEASELOOSE]+"?"+l[I.BUILD]+"?";H("LOOSE");l[I.LOOSE]="^"+l[I.LOOSEPLAIN]+"$";H("GTLT");l[I.GTLT]="((?:<|>)?=?)";H("XRANGEIDENTIFIERLOOSE");l[I.XRANGEIDENTIFIERLOOSE]=l[I.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*";H("XRANGEIDENTIFIER");l[I.XRANGEIDENTIFIER]=l[I.NUMERICIDENTIFIER]+"|x|X|\\*";H("XRANGEPLAIN");l[I.XRANGEPLAIN]="[v=\\s]*("+l[I.XRANGEIDENTIFIER]+")(?:\\.("+l[I.XRANGEIDENTIFIER]+")(?:\\.("+l[I.XRANGEIDENTIFIER]+")(?:"+l[I.PRERELEASE]+")?"+l[I.BUILD]+"?)?)?";H("XRANGEPLAINLOOSE");l[I.XRANGEPLAINLOOSE]="[v=\\s]*("+l[I.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+l[I.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+l[I.XRANGEIDENTIFIERLOOSE]+")(?:"+l[I.PRERELEASELOOSE]+")?"+l[I.BUILD]+"?)?)?";H("XRANGE");l[I.XRANGE]="^"+l[I.GTLT]+"\\s*"+l[I.XRANGEPLAIN]+"$";H("XRANGELOOSE");l[I.XRANGELOOSE]="^"+l[I.GTLT]+"\\s*"+l[I.XRANGEPLAINLOOSE]+"$";H("COERCE");l[I.COERCE]="(^|[^\\d])(\\d{1,"+Vg+"})Line truncated Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}D.getBooleanInput=Gb;function Jb(A,e){if(process.env.GITHUB_OUTPUT||"")return(0,nr.issueFileCommand)("OUTPUT",(0,nr.prepareKeyValueMessage)(A,e));process.stdout.write(Su.EOL),(0,ke.issueCommand)("set-output",{name:A},(0,rs.toCommandValue)(e))}D.setOutput=Jb;function vb(A){(0,ke.issue)("echo",A?"on":"off")}D.setCommandEcho=vb;function Hb(A){process.exitCode=Jg.Failure,Uu(A)}D.setFailed=Hb;function Vb(){return process.env.RUNNER_DEBUG==="1"}D.isDebug=Vb;function qb(A){(0,ke.issueCommand)("debug",{},A)}D.debug=qb;function Uu(A,e={}){(0,ke.issueCommand)("error",(0,rs.toCommandProperties)(e),A instanceof Error?A.toString():A)}D.error=Uu;function Ob(A,e={}){(0,ke.issueCommand)("warning",(0,rs.toCommandProperties)(e),A instanceof Error?A.toString():A)}D.warning=Ob;function Wb(A,e={}){(0,ke.issueCommand)("notice",(0,rs.toCommandProperties)(e),A instanceof Error?A.toString():A)}D.notice=Wb;function Pb(A){process.stdout.write(A+Su.EOL)}D.info=Pb;function Lu(A){(0,ke.issue)("group",A)}D.startGroup=Lu;function Mu(){(0,ke.issue)("endgroup")}D.endGroup=Mu;function _b(A,e){return bu(this,void 0,void 0,function*(){Lu(A);let t;try{t=yield e()}finally{Mu()}return t})}D.group=_b;function Xb(A,e){if(process.env.GITHUB_STATE||"")return(0,nr.issueFileCommand)("STATE",(0,nr.prepareKeyValueMessage)(A,e));(0,ke.issueCommand)("save-state",{name:A},(0,rs.toCommandValue)(e))}D.saveState=Xb;function Zb(A){return process.env[`STATE_${A}`]||""}D.getState=Zb;function jb(A){return bu(this,void 0,void 0,function*(){return yield Lb.OidcClient.getIDToken(A)})}D.getIDToken=jb;var Kb=Sg();Object.defineProperty(D,"summary",{enumerable:!0,get:function(){return Kb.summary}});var zb=Sg();Object.defineProperty(D,"markdownSummary",{enumerable:!0,get:function(){return zb.markdownSummary}});var Vg=gu();Object.defineProperty(D,"toPosixPath",{enumerable:!0,get:function(){return Vg.toPosixPath}});Object.defineProperty(D,"toWin32Path",{enumerable:!0,get:function(){return Vg.toWin32Path}});Object.defineProperty(D,"toPlatformPath",{enumerable:!0,get:function(){return Vg.toPlatformPath}});D.platform=vg(ku())});var jg=h((M,Ju)=>{M=Ju.exports=G;var K;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?K=function(){var A=Array.prototype.slice.call(arguments,0);A.unshift("SEMVER"),console.log.apply(console,A)}:K=function(){};M.SEMVER_SPEC_VERSION="2.0.0";var Ks=256,no=Number.MAX_SAFE_INTEGER||9007199254740991,qg=16,$b=Ks-6,ss=M.re=[],j=M.safeRe=[],u=M.src=[],I=M.tokens={},Tu=0;function v(A){I[A]=Tu++}var Wg="[a-zA-Z0-9-]",Og=[["\\s",1],["\\d",Ks],[Wg,$b]];function $s(A){for(var e=0;e<Og.length;e++){var t=Og[e][0],r=Og[e][1];A=A.split(t+"*").join(t+"{0,"+r+"}").split(t+"+").join(t+"{1,"+r+"}")}return A}v("NUMERICIDENTIFIER");u[I.NUMERICIDENTIFIER]="0|[1-9]\\d*";v("NUMERICIDENTIFIERLOOSE");u[I.NUMERICIDENTIFIERLOOSE]="\\d+";v("NONNUMERICIDENTIFIER");u[I.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+Wg+"*";v("MAINVERSION");u[I.MAINVERSION]="("+u[I.NUMERICIDENTIFIER]+")\\.("+u[I.NUMERICIDENTIFIER]+")\\.("+u[I.NUMERICIDENTIFIER]+")";v("MAINVERSIONLOOSE");u[I.MAINVERSIONLOOSE]="("+u[I.NUMERICIDENTIFIERLOOSE]+")\\.("+u[I.NUMERICIDENTIFIERLOOSE]+")\\.("+u[I.NUMERICIDENTIFIERLOOSE]+")";v("PRERELEASEIDENTIFIER");u[I.PRERELEASEIDENTIFIER]="(?:"+u[I.NUMERICIDENTIFIER]+"|"+u[I.NONNUMERICIDENTIFIER]+")";v("PRERELEASEIDENTIFIERLOOSE");u[I.PRERELEASEIDENTIFIERLOOSE]="(?:"+u[I.NUMERICIDENTIFIERLOOSE]+"|"+u[I.NONNUMERICIDENTIFIER]+")";v("PRERELEASE");u[I.PRERELEASE]="(?:-("+u[I.PRERELEASEIDENTIFIER]+"(?:\\."+u[I.PRERELEASEIDENTIFIER]+")*))";v("PRERELEASELOOSE");u[I.PRERELEASELOOSE]="(?:-?("+u[I.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+u[I.PRERELEASEIDENTIFIERLOOSE]+")*))";v("BUILDIDENTIFIER");u[I.BUILDIDENTIFIER]=Wg+"+";v("BUILD");u[I.BUILD]="(?:\\+("+u[I.BUILDIDENTIFIER]+"(?:\\."+u[I.BUILDIDENTIFIER]+")*))";v("FULL");v("FULLPLAIN");u[I.FULLPLAIN]="v?"+u[I.MAINVERSION]+u[I.PRERELEASE]+"?"+u[I.BUILD]+"?";u[I.FULL]="^"+u[I.FULLPLAIN]+"$";v("LOOSEPLAIN");u[I.LOOSEPLAIN]="[v=\\s]*"+u[I.MAINVERSIONLOOSE]+u[I.PRERELEASELOOSE]+"?"+u[I.BUILD]+"?";v("LOOSE");u[I.LOOSE]="^"+u[I.LOOSEPLAIN]+"$";v("GTLT");u[I.GTLT]="((?:<|>)?=?)";v("XRANGEIDENTIFIERLOOSE");u[I.XRANGEIDENTIFIERLOOSE]=u[I.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*";v("XRANGEIDENTIFIER");u[I.XRANGEIDENTIFIER]=u[I.NUMERICIDENTIFIER]+"|x|X|\\*";v("XRANGEPLAIN");u[I.XRANGEPLAIN]="[v=\\s]*("+u[I.XRANGEIDENTIFIER]+")(?:\\.("+u[I.XRANGEIDENTIFIER]+")(?:\\.("+u[I.XRANGEIDENTIFIER]+")(?:"+u[I.PRERELEASE]+")?"+u[I.BUILD]+"?)?)?";v("XRANGEPLAINLOOSE");u[I.XRANGEPLAINLOOSE]="[v=\\s]*("+u[I.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+u[I.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+u[I.XRANGEIDENTIFIERLOOSE]+")(?:"+u[I.PRERELEASELOOSE]+")?"+u[I.BUILD]+"?)?)?";v("XRANGE");u[I.XRANGE]="^"+u[I.GTLT]+"\\s*"+u[I.XRANGEPLAIN]+"$";v("XRANGELOOSE");u[I.XRANGELOOSE]="^"+u[I.GTLT]+"\\s*"+u[I.XRANGEPLAINLOOSE]+"$";v("COERCE");u[I.COERCE]="(^|[^\\d])(\\d{1,"+qg+"})Line truncated
`);for(let s of r){let i=s.split("=");if(i.length===2&&(i[0].trim()==="VERSION_ID"||i[0].trim()==="DISTRIB_RELEASE")){e=i[1].trim().replace(/^"/,"").replace(/"$/,"");break}}}}return e}qA._getOsVersion=TS;function GS(){let A="/etc/lsb-release",e="/etc/os-release",t="";return ao.existsSync(A)?t=ao.readFileSync(A).toString():ao.existsSync(e)&&(t=ao.readFileSync(e).toString()),t}qA._readLinuxVersionFile=GS});var qu=h(Le=>{"use strict";var JS=Le&&Le.__createBinding||(Object.create?(function(A,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,r,s)}):(function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]})),vS=Le&&Le.__setModuleDefault||(Object.create?(function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}):function(A,e){A.default=e}),HS=Le&&Le.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.prototype.hasOwnProperty.call(A,t)&&JS(e,A,t);return vS(e,A),e},Hu=Le&&Le.__awaiter||function(A,e,t,r){function s(i){return i instanceof t?i:new t(function(n){n(i)})}return new(t||(t=Promise))(function(i,n){function o(a){try{g(r.next(a))}catch(Q){n(Q)}}function E(a){try{g(r.throw(a))}catch(Q){n(Q)}}function g(a){a.done?i(a.value):s(a.value).then(o,E)}g((r=r.apply(A,e||[])).next())})};Object.defineProperty(Le,"__esModule",{value:!0});Le.RetryHelper=void 0;var Vu=HS(ns()),zg=class{constructor(e,t,r){if(e<1)throw new Error("max attempts should be greater than or equal to 1");if(this.maxAttempts=e,this.minSeconds=Math.floor(t),this.maxSeconds=Math.floor(r),this.minSeconds>this.maxSeconds)throw new Error("min seconds should be less than or equal to max seconds")}execute(e,t){return Hu(this,void 0,void 0,function*(){let r=1;for(;r<this.maxAttempts;){try{return yield e()}catch(i){if(t&&!t(i))throw i;Vu.info(i.message)}let s=this.getSleepAmount();Vu.info(`Waiting ${s} seconds before trying again`),yield this.sleep(s),r++}return yield e()})}getSleepAmount(){return Math.floor(Math.random()*(this.maxSeconds-this.minSeconds+1))+this.minSeconds}sleep(e){return Hu(this,void 0,void 0,function*(){return new Promise(t=>setTimeout(t,e*1e3))})}};Le.RetryHelper=zg});var Ku=h(V=>{"use strict";var VS=V&&V.__createBinding||(Object.create?(function(A,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,r,s)}):(function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]})),qS=V&&V.__setModuleDefault||(Object.create?(function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}):function(A,e){A.default=e}),Ve=V&&V.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.prototype.hasOwnProperty.call(A,t)&&VS(e,A,t);return qS(e,A),e},zA=V&&V.__awaiter||function(A,e,t,r){function s(i){return i instanceof t?i:new t(function(n){n(i)})}return new(t||(t=Promise))(function(i,n){function o(a){try{g(r.next(a))}catch(Q){n(Q)}}function E(a){try{g(r.throw(a))}catch(Q){n(Q)}}function g(a){a.done?i(a.value):s(a.value).then(o,E)}g((r=r.apply(A,e||[])).next())})};Object.defineProperty(V,"__esModule",{value:!0});V.evaluateVersions=V.isExplicitVersion=V.findFromManifest=V.getManifestFromRepo=V.findAllVersions=V.find=V.cacheFile=V.cacheDir=V.extractZip=V.extractXar=V.extractTar=V.extract7z=V.downloadTool=V.HTTPError=void 0;var _=Ve(ns()),de=Ve(Mg()),Ou=Ve(require("crypto")),Me=Ve(require("fs")),OS=Ve(vu()),si=Ve(require("os")),He=Ve(require("path")),Wu=Ve(yg()),pt=Ve(Zg()),WS=Ve(require("stream")),PS=Ve(require("util")),Qs=require("assert"),Jt=Tg(),_S=qu(),ri=class extends Error{constructor(e){super(`Unexpected HTTP response: ${e}`),this.httpStatusCode=e,Object.setPrototypeOf(this,new.target.prototype)}};V.HTTPError=ri;var AQ=process.platform==="win32",XS=process.platform==="darwin",ZS="actions/tool-cache";function jS(A,e,t,r){return zA(this,void 0,void 0,function*(){e=e||He.join(ju(),Ou.randomUUID()),yield de.mkdirP(He.dirname(e)),_.debug(`Downloading ${A}`),_.debug(`Destination ${e}`);let s=3,i=$g("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS",10),n=$g("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS",20);return yield new _S.RetryHelper(s,i,n).execute(()=>zA(this,void 0,void 0,function*(){return yield KS(A,e||"",t,r)}),E=>!(E instanceof ri&&E.httpStatusCode&&E.httpStatusCode<500&&E.httpStatusCode!==408&&E.httpStatusCode!==429))})}V.downloadTool=jS;function KS(A,e,t,r){return zA(this,void 0,void 0,function*(){if(Me.existsSync(e))throw new Error(`Destination file path ${e} already exists`);let s=new Wu.HttpClient(ZS,[],{allowRetries:!1});t&&(_.debug("set auth"),r===void 0&&(r={}),r.authorization=t);let i=yield s.get(A,r);if(i.message.statusCode!==200){let a=new ri(i.message.statusCode);throw _.debug(`Failed to download from "${A}". Code(${i.message.statusCode}) Message(${i.Line truncated `);for(let s of r){let n=s.split("=");if(n.length===2&&(n[0].trim()==="VERSION_ID"||n[0].trim()==="DISTRIB_RELEASE")){e=n[1].trim().replace(/^"/,"").replace(/"$/,"");break}}}}return e}TA._getOsVersion=VS;function qS(){let A="/etc/lsb-release",e="/etc/os-release",t="";return ao.existsSync(A)?t=ao.readFileSync(A).toString():ao.existsSync(e)&&(t=ao.readFileSync(e).toString()),t}TA._readLinuxVersionFile=qS});var Wu=h(Se=>{"use strict";var OS=Se&&Se.__createBinding||(Object.create?(function(A,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,r,s)}):(function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]})),WS=Se&&Se.__setModuleDefault||(Object.create?(function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}):function(A,e){A.default=e}),PS=Se&&Se.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.prototype.hasOwnProperty.call(A,t)&&OS(e,A,t);return WS(e,A),e},qu=Se&&Se.__awaiter||function(A,e,t,r){function s(n){return n instanceof t?n:new t(function(i){i(n)})}return new(t||(t=Promise))(function(n,i){function o(a){try{g(r.next(a))}catch(Q){i(Q)}}function E(a){try{g(r.throw(a))}catch(Q){i(Q)}}function g(a){a.done?n(a.value):s(a.value).then(o,E)}g((r=r.apply(A,e||[])).next())})};Object.defineProperty(Se,"__esModule",{value:!0});Se.RetryHelper=void 0;var Ou=PS(es()),$g=class{constructor(e,t,r){if(e<1)throw new Error("max attempts should be greater than or equal to 1");if(this.maxAttempts=e,this.minSeconds=Math.floor(t),this.maxSeconds=Math.floor(r),this.minSeconds>this.maxSeconds)throw new Error("min seconds should be less than or equal to max seconds")}execute(e,t){return qu(this,void 0,void 0,function*(){let r=1;for(;r<this.maxAttempts;){try{return yield e()}catch(n){if(t&&!t(n))throw n;Ou.info(n.message)}let s=this.getSleepAmount();Ou.info(`Waiting ${s} seconds before trying again`),yield this.sleep(s),r++}return yield e()})}getSleepAmount(){return Math.floor(Math.random()*(this.maxSeconds-this.minSeconds+1))+this.minSeconds}sleep(e){return qu(this,void 0,void 0,function*(){return new Promise(t=>setTimeout(t,e*1e3))})}};Se.RetryHelper=$g});var $u=h(H=>{"use strict";var _S=H&&H.__createBinding||(Object.create?(function(A,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,r,s)}):(function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]})),XS=H&&H.__setModuleDefault||(Object.create?(function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}):function(A,e){A.default=e}),ve=H&&H.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.prototype.hasOwnProperty.call(A,t)&&_S(e,A,t);return XS(e,A),e},PA=H&&H.__awaiter||function(A,e,t,r){function s(n){return n instanceof t?n:new t(function(i){i(n)})}return new(t||(t=Promise))(function(n,i){function o(a){try{g(r.next(a))}catch(Q){i(Q)}}function E(a){try{g(r.throw(a))}catch(Q){i(Q)}}function g(a){a.done?n(a.value):s(a.value).then(o,E)}g((r=r.apply(A,e||[])).next())})};Object.defineProperty(H,"__esModule",{value:!0});H.evaluateVersions=H.isExplicitVersion=H.findFromManifest=H.getManifestFromRepo=H.findAllVersions=H.find=H.cacheFile=H.cacheDir=H.extractZip=H.extractXar=H.extractTar=H.extract7z=H.downloadTool=H.HTTPError=void 0;var P=ve(es()),ue=ve(xg()),Pu=ve(require("crypto")),Ue=ve(require("fs")),ZS=ve(Vu()),en=ve(require("os")),Je=ve(require("path")),_u=ve(pg()),ft=ve(jg()),jS=ve(require("stream")),KS=ve(require("util")),is=require("assert"),Tt=Gg(),zS=Wu(),An=class extends Error{constructor(e){super(`Unexpected HTTP response: ${e}`),this.httpStatusCode=e,Object.setPrototypeOf(this,new.target.prototype)}};H.HTTPError=An;var eQ=process.platform==="win32",$S=process.platform==="darwin",AU="actions/tool-cache";function eU(A,e,t,r){return PA(this,void 0,void 0,function*(){e=e||Je.join(zu(),Pu.randomUUID()),yield ue.mkdirP(Je.dirname(e)),P.debug(`Downloading ${A}`),P.debug(`Destination ${e}`);let s=3,n=AQ("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS",10),i=AQ("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS",20);return yield new zS.RetryHelper(s,n,i).execute(()=>PA(this,void 0,void 0,function*(){return yield tU(A,e||"",t,r)}),E=>!(E instanceof An&&E.httpStatusCode&&E.httpStatusCode<500&&E.httpStatusCode!==408&&E.httpStatusCode!==429))})}H.downloadTool=eU;function tU(A,e,t,r){return PA(this,void 0,void 0,function*(){if(Ue.existsSync(e))throw new Error(`Destination file path ${e} already exists`);let s=new _u.HttpClient(AU,[],{allowRetries:!1});t&&(P.debug("set auth"),r===void 0&&(r={}),r.authorization=t);let n=yield s.get(A,r);if(n.message.statusCode!==200){let a=new An(n.message.statusCode);throw P.debug(`Failed to download from "${A}". Code(${n.message.statusCode}) Message(${n.Line truncated
/*! Bundled license information: /*! Bundled license information:
undici/lib/fetch/body.js: undici/lib/fetch/body.js:
+8 -3
View File
@@ -1,10 +1,15 @@
{ {
"name": "setup-github-release", "name": "install-github-release",
"version": "1.0.0", "version": "1.0.0",
"description": "A GitHub Action to download a tool", "description": "A GitHub Action and CLI tool to download and install binaries from GitHub releases",
"main": "dist/index.js", "main": "dist/index.js",
"bin": {
"install-github-release": "dist/cli.js"
},
"scripts": { "scripts": {
"build": "esbuild src/index.ts --bundle --platform=node --target=node24 --outfile=dist/index.js --minify", "build:action": "esbuild src/index.ts --bundle --platform=node --target=node24 --outfile=dist/index.js --minify",
"build:cli": "esbuild src/cli.ts --bundle --platform=node --target=node24 --outfile=dist/cli.js --minify --banner:js=\"#!/usr/bin/env node\"",
"build": "npm run build:action && npm run build:cli",
"format": "prettier --write '**/*.ts'", "format": "prettier --write '**/*.ts'",
"format-check": "prettier --check '**/*.ts'", "format-check": "prettier --check '**/*.ts'",
"lint": "eslint src/**/*.ts", "lint": "eslint src/**/*.ts",
+130
View File
@@ -0,0 +1,130 @@
import { parseArgs } from 'util';
import * as path from 'path';
import * as fs from 'fs';
import * as os from 'os';
import { getPlatformInfo } from './core/platform';
import { getMatchingAsset } from './core/matcher';
import { findBinary } from './core/finder';
import { fetchLatestRelease, downloadAsset } from './core/downloader';
import { extractAsset } from './core/extractor';
async function run() {
const { values, positionals } = parseArgs({
options: {
'file-name': { type: 'string', short: 'f' },
'binary-name': { type: 'string', short: 'b' },
'file-type': { type: 'string', short: 't', default: 'archive' },
'token': { type: 'string', short: 'k' },
'debug': { type: 'boolean', short: 'd', default: false },
'help': { type: 'boolean', short: 'h' }
},
allowPositionals: true
});
if (values.help || positionals.length === 0) {
console.log(`
Usage: install-github-release [options] <repository>
Arguments:
repository The GitHub repository (owner/repo)
Options:
-f, --file-name <name> Asset file name or regex pattern (prefixed with ~)
-b, --binary-name <name> Binary to search for (prefixed with ~ for regex)
-t, --file-type <type> 'archive', 'package', or custom regex (default: archive)
-k, --token <token> GitHub token
-d, --debug Enable debug logging
-h, --help Show this help message
`);
process.exit(0);
}
const repository = positionals[0];
if (!repository) {
console.error('Error: Repository is required.');
process.exit(1);
}
const fileNameInput = values['file-name'];
const binaryInput = values['binary-name'];
const fileType = values['file-type'];
const debug = !!values.debug;
const token = values.token || process.env.GITHUB_TOKEN;
try {
const platformInfo = getPlatformInfo();
const toolName = repository.split('/').pop() || repository;
console.log(`Fetching latest release for ${repository}...`);
const release = await fetchLatestRelease(repository, token);
const asset = getMatchingAsset(release.assets, platformInfo, {
fileName: fileNameInput,
fileType: fileType
});
console.log(`Selected asset: ${asset.name}`);
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'setup-gh-release-'));
const downloadPath = path.join(tempDir, asset.name);
console.log(`Downloading ${asset.name}...`);
await downloadAsset(asset.browser_download_url, downloadPath, token);
const extractDir = path.join(tempDir, 'extract');
console.log(`Extracting ${asset.name}...`);
await extractAsset(downloadPath, extractDir);
const binaryName = binaryInput || toolName;
let binaryPattern: string | RegExp;
if (binaryName.startsWith('~')) {
binaryPattern = new RegExp(binaryName.substring(1), 'i');
} else {
binaryPattern = binaryName;
}
const binaryPath = findBinary(extractDir, binaryPattern, debug, console.log);
if (!binaryPath) {
throw new Error(`Could not find binary "${binaryName}" in the extracted asset.`);
}
// Determine install directory
let installDir: string;
const isRoot = process.getuid && process.getuid() === 0;
if (isRoot) {
installDir = '/usr/local/bin';
} else {
const homeBin = path.join(os.homedir(), 'bin');
if (fs.existsSync(homeBin)) {
installDir = homeBin;
} else {
// Fallback or error? Let's use a local bin if possible or /usr/local/bin (might fail)
installDir = '/usr/local/bin';
}
}
if (!fs.existsSync(installDir)) {
fs.mkdirSync(installDir, { recursive: true });
}
const finalName = path.basename(binaryPath);
const destPath = path.join(installDir, finalName);
console.log(`Installing ${finalName} to ${destPath}...`);
fs.copyFileSync(binaryPath, destPath);
if (process.platform !== 'win32') {
fs.chmodSync(destPath, '755');
}
// Cleanup
fs.rmSync(tempDir, { recursive: true, force: true });
console.log('Installation successful!');
} catch (error: any) {
console.error(`Error: ${error.message}`);
process.exit(1);
}
}
run();
+52
View File
@@ -0,0 +1,52 @@
import { getMatchingAsset } from './matcher';
import { PlatformInfo } from './platform';
export interface ReleaseAsset {
name: string;
browser_download_url: string;
}
export interface ReleaseInfo {
tag_name: string;
assets: ReleaseAsset[];
}
export async function fetchLatestRelease(repository: string, token?: string): Promise<ReleaseInfo> {
const url = `https://api.github.com/repos/${repository}/releases/latest`;
const headers: Record<string, string> = {
'Accept': 'application/vnd.github.v3+json',
'User-Agent': 'setup-github-release-action'
};
if (token) {
headers['Authorization'] = `token ${token}`;
}
const response = await fetch(url, { headers });
if (!response.ok) {
const errorBody = await response.text();
throw new Error(`Failed to fetch latest release for ${repository}: ${response.statusText}. ${errorBody}`);
}
return await response.json() as ReleaseInfo;
}
export async function downloadAsset(url: string, destPath: string, token?: string): Promise<void> {
const headers: Record<string, string> = {
'User-Agent': 'setup-github-release-action'
};
if (token) {
headers['Authorization'] = `token ${token}`;
}
const response = await fetch(url, { headers });
if (!response.ok) {
throw new Error(`Failed to download asset: ${response.statusText}`);
}
const fs = await import('fs');
const { Readable } = await import('stream');
const { finished } = await import('stream/promises');
const fileStream = fs.createWriteStream(destPath);
await finished(Readable.fromWeb(response.body as any).pipe(fileStream));
}
+42
View File
@@ -0,0 +1,42 @@
import { spawnSync } from 'child_process';
import * as path from 'path';
import * as fs from 'fs';
export async function extractAsset(filePath: string, destDir: string): Promise<void> {
const ext = path.extname(filePath).toLowerCase();
const name = path.basename(filePath).toLowerCase();
if (!fs.existsSync(destDir)) {
fs.mkdirSync(destDir, { recursive: true });
}
if (name.endsWith('.tar.gz') || name.endsWith('.tgz') || name.endsWith('.tar')) {
const args = ['-xf', filePath, '-C', destDir];
const result = spawnSync('tar', args);
if (result.status !== 0) {
throw new Error(`tar failed with status ${result.status}: ${result.stderr.toString()}`);
}
} else if (name.endsWith('.zip')) {
if (process.platform === 'win32') {
const command = `Expand-Archive -Path "${filePath}" -DestinationPath "${destDir}" -Force`;
const result = spawnSync('powershell', ['-Command', command]);
if (result.status !== 0) {
throw new Error(`powershell Expand-Archive failed with status ${result.status}: ${result.stderr.toString()}`);
}
} else {
const result = spawnSync('unzip', ['-q', filePath, '-d', destDir]);
if (result.status !== 0) {
throw new Error(`unzip failed with status ${result.status}: ${result.stderr.toString()}`);
}
}
} else if (name.endsWith('.7z')) {
const result = spawnSync('7z', ['x', filePath, `-o${destDir}`, '-y']);
if (result.status !== 0) {
throw new Error(`7z failed with status ${result.status}. Make sure 7z is installed.`);
}
} else {
// For other files, we just copy them to the destination directory
const destPath = path.join(destDir, path.basename(filePath));
fs.copyFileSync(filePath, destPath);
}
}
+38
View File
@@ -0,0 +1,38 @@
import * as fs from 'fs';
import * as path from 'path';
export function findBinary(dir: string, pattern: string | RegExp, debug: boolean, logger: (msg: string) => void): string | undefined {
const items = fs.readdirSync(dir);
if (debug) {
logger(`Searching for binary in ${dir}...`);
items.forEach(item => logger(` - ${item}`));
}
for (const item of items) {
const fullPath = path.join(dir, item);
const stat = fs.statSync(fullPath);
if (stat.isDirectory()) {
const found = findBinary(fullPath, pattern, debug, logger);
if (found) return found;
} else {
let isMatch = false;
if (pattern instanceof RegExp) {
isMatch = pattern.test(item);
} else {
isMatch = item === pattern;
// On Windows, also check for .exe extension if the pattern doesn't have it
if (!isMatch && process.platform === 'win32' && !pattern.toLowerCase().endsWith('.exe')) {
isMatch = item.toLowerCase() === `${pattern.toLowerCase()}.exe`;
}
}
if (isMatch) return fullPath;
}
}
return undefined;
}
export function setExecutable(filePath: string): void {
if (process.platform !== 'win32') {
fs.chmodSync(filePath, '755');
}
}
+67
View File
@@ -0,0 +1,67 @@
import { PlatformInfo } from './platform';
export interface MatchOptions {
fileName?: string;
fileType?: string;
}
export function getMatchingAsset(assets: any[], platform: PlatformInfo, options: MatchOptions): any {
const { fileName, fileType = 'archive' } = options;
let extPattern: string;
if (fileType === 'archive') {
extPattern = '\\.(zip|tar\\.gz|tar|tgz|7z)';
} else if (fileType === 'package') {
extPattern = '\\.(deb|rpm|pkg)';
} else {
extPattern = fileType;
}
if (!fileName) {
// Rule 1: Default matching rule
const pattern = `${platform.systemPattern}[_-]${platform.archPattern}.*${extPattern}$`;
const regex = new RegExp(pattern, 'i');
const matchingAssets = assets.filter((a: any) => regex.test(a.name));
if (matchingAssets.length === 0) {
throw new Error(`No assets matched the default criteria: ${pattern}`);
}
if (matchingAssets.length > 1) {
throw new Error(`Multiple assets matched the default criteria: ${matchingAssets.map((a: any) => a.name).join(', ')}`);
}
return matchingAssets[0];
} else if (fileName.startsWith('~')) {
// Rule 3: Regex matching rule
let pattern = fileName.substring(1);
const hasSystem = pattern.includes('{{SYSTEM}}');
const hasArch = pattern.includes('{{ARCH}}');
const hasExt = pattern.includes('{{EXT_PATTERN}}');
const hasEnd = pattern.endsWith('$');
if (!hasSystem && !hasArch && !hasExt && !hasEnd) {
pattern += `.*{{SYSTEM}}[_-]{{ARCH}}.*{{EXT_PATTERN}}$`;
} else if (hasSystem && hasArch && !hasExt && !hasEnd) {
pattern += `.*{{EXT_PATTERN}}$`;
}
const finalPattern = pattern
.replace(/{{SYSTEM}}/g, platform.systemPattern)
.replace(/{{ARCH}}/g, platform.archPattern)
.replace(/{{EXT_PATTERN}}/g, extPattern);
const regex = new RegExp(finalPattern, 'i');
const matchingAssets = assets.filter((a: any) => regex.test(a.name));
if (matchingAssets.length === 0) {
throw new Error(`No assets matched the regex: ${finalPattern}`);
}
if (matchingAssets.length > 1) {
throw new Error(`Multiple assets matched the criteria: ${matchingAssets.map((a: any) => a.name).join(', ')}`);
}
return matchingAssets[0];
} else {
// Rule 2: Literal matching rule
const asset = assets.find((a: any) => a.name === fileName);
if (!asset) {
throw new Error(`No asset found matching the exact name: ${fileName}`);
}
return asset;
}
}
+31
View File
@@ -0,0 +1,31 @@
import * as os from 'os';
export interface PlatformInfo {
system: string;
arch: string;
systemPattern: string;
archPattern: string;
}
export const systemPatterns: Record<string, string> = {
linux: 'linux',
darwin: '(darwin|macos|mac|osx)',
win32: '(windows|win)'
};
export const archPatterns: Record<string, string> = {
x64: '(x86_64|x64|amd64)',
arm64: '(aarch64|arm64)'
};
export function getPlatformInfo(): PlatformInfo {
const system = os.platform();
const arch = os.arch();
return {
system,
arch,
systemPattern: systemPatterns[system] || system,
archPattern: archPatterns[arch] || arch
};
}
+20 -135
View File
@@ -3,61 +3,31 @@ import * as tc from '@actions/tool-cache';
import * as path from 'path'; import * as path from 'path';
import * as os from 'os'; import * as os from 'os';
import * as fs from 'fs'; import * as fs from 'fs';
import { getPlatformInfo } from './core/platform';
function findBinary(dir: string, pattern: string | RegExp, debug: boolean): string | undefined { import { getMatchingAsset } from './core/matcher';
const items = fs.readdirSync(dir); import { findBinary } from './core/finder';
if (debug) { import { fetchLatestRelease } from './core/downloader';
core.info(`Searching for binary in ${dir}...`);
items.forEach(item => core.info(` - ${item}`));
}
for (const item of items) {
const fullPath = path.join(dir, item);
const stat = fs.statSync(fullPath);
if (stat.isDirectory()) {
const found = findBinary(fullPath, pattern, debug);
if (found) return found;
} else {
let isMatch = false;
if (pattern instanceof RegExp) {
isMatch = pattern.test(item);
} else {
isMatch = item === pattern;
// On Windows, also check for .exe extension if the pattern doesn't have it
if (!isMatch && process.platform === 'win32' && !pattern.toLowerCase().endsWith('.exe')) {
isMatch = item.toLowerCase() === `${pattern.toLowerCase()}.exe`;
}
}
if (isMatch) return fullPath;
}
}
return undefined;
}
async function run() { async function run() {
try { try {
const repository = core.getInput('repository', { required: true }); const repository = core.getInput('repository', { required: true });
let fileName = core.getInput('file-name'); const fileNameInput = core.getInput('file-name');
const binaryInput = core.getInput('binary-name'); const binaryInput = core.getInput('binary-name');
const fileType = core.getInput('file-type') || 'archive'; const fileType = core.getInput('file-type') || 'archive';
const updateCache = core.getInput('update-cache') || 'false'; const updateCache = core.getInput('update-cache') || 'false';
const debug = core.getBooleanInput('debug'); const debug = core.getBooleanInput('debug');
const token = core.getInput('token') || process.env.GITHUB_TOKEN; const token = core.getInput('token') || process.env.GITHUB_TOKEN;
// Detect system and architecture const platformInfo = getPlatformInfo();
const platform = os.platform(); // 'linux', 'darwin', 'win32'
const arch = os.arch(); // 'x64', 'arm64'
const toolName = repository.split('/').pop() || repository; const toolName = repository.split('/').pop() || repository;
// Rule for update-cache: 'false' means use ANY cached version if available // Rule for update-cache: 'false' means use ANY cached version if available
if (updateCache === 'false') { if (updateCache === 'false') {
const allVersions = tc.findAllVersions(toolName, arch); const allVersions = tc.findAllVersions(toolName, platformInfo.arch);
if (allVersions.length > 0) { if (allVersions.length > 0) {
// Simple sort to pick the 'latest' local version
const latestVersion = allVersions.sort().pop(); const latestVersion = allVersions.sort().pop();
if (latestVersion) { if (latestVersion) {
const cachedDir = tc.find(toolName, latestVersion, arch); const cachedDir = tc.find(toolName, latestVersion, platformInfo.arch);
if (cachedDir) { if (cachedDir) {
core.info(`Found ${toolName} version ${latestVersion} in local cache (update-cache: false)`); core.info(`Found ${toolName} version ${latestVersion} in local cache (update-cache: false)`);
core.addPath(cachedDir); core.addPath(cachedDir);
@@ -67,105 +37,21 @@ async function run() {
} }
} }
const systemPatterns: Record<string, string> = {
linux: 'linux',
darwin: '(darwin|macos|mac)',
win32: '(windows|win)'
};
const archPatterns: Record<string, string> = {
x64: '(x86_64|x64|amd64)',
arm64: '(aarch64|arm64)'
};
const systemPattern = systemPatterns[platform] || platform;
const archPattern = archPatterns[arch] || arch;
let extPattern: string;
if (fileType === 'archive') {
extPattern = '\\.(zip|tar\\.gz|tar|tgz|7z)';
} else if (fileType === 'package') {
extPattern = '\\.(deb|rpm|pkg)';
} else {
extPattern = fileType;
}
const url = `https://api.github.com/repos/${repository}/releases/latest`;
const headers: Record<string, string> = {
'Accept': 'application/vnd.github.v3+json',
'User-Agent': 'setup-github-release-action'
};
if (token) {
headers['Authorization'] = `token ${token}`;
}
core.info(`Fetching latest release information for ${repository}...`); core.info(`Fetching latest release information for ${repository}...`);
const response = await fetch(url, { headers }); const release = await fetchLatestRelease(repository, token);
if (!response.ok) { const asset = getMatchingAsset(release.assets, platformInfo, {
throw new Error(`Failed to fetch release: ${response.statusText} (${response.status})`); fileName: fileNameInput,
} fileType: fileType
});
const data: any = await response.json(); core.info(`Selected asset: ${asset.name}`);
let asset;
if (!fileName) { const version = release.tag_name.replace(/^v/, '');
// Rule 1: Default matching rule
const pattern = `${systemPattern}[_-]${archPattern}.*${extPattern}$`;
const regex = new RegExp(pattern, 'i');
core.info(`No file-name provided. Using default pattern: ${pattern}`);
const matchingAssets = data.assets.filter((a: any) => regex.test(a.name));
if (matchingAssets.length === 0) {
throw new Error(`No assets matched the default criteria: ${pattern}`);
}
if (matchingAssets.length > 1) {
throw new Error(`Multiple assets matched the default criteria: ${matchingAssets.map((a: any) => a.name).join(', ')}`);
}
asset = matchingAssets[0];
} else if (fileName.startsWith('~')) {
// Rule 3: Regex matching rule
let pattern = fileName.substring(1);
const hasSystem = pattern.includes('{{SYSTEM}}');
const hasArch = pattern.includes('{{ARCH}}');
const hasExt = pattern.includes('{{EXT_PATTERN}}');
const hasEnd = pattern.endsWith('$');
if (!hasSystem && !hasArch && !hasExt && !hasEnd) {
pattern += `.*{{SYSTEM}}[_-]{{ARCH}}.*{{EXT_PATTERN}}$`;
} else if (hasSystem && hasArch && !hasExt && !hasEnd) {
pattern += `.*{{EXT_PATTERN}}$`;
}
const finalPattern = pattern
.replace(/{{SYSTEM}}/g, systemPattern)
.replace(/{{ARCH}}/g, archPattern)
.replace(/{{EXT_PATTERN}}/g, extPattern);
const regex = new RegExp(finalPattern, 'i');
core.info(`Using regex pattern: ${finalPattern}`);
const matchingAssets = data.assets.filter((a: any) => regex.test(a.name));
if (matchingAssets.length === 0) {
throw new Error(`No assets matched the regex: ${finalPattern}`);
}
if (matchingAssets.length > 1) {
throw new Error(`Multiple assets matched the criteria: ${matchingAssets.map((a: any) => a.name).join(', ')}`);
}
asset = matchingAssets[0];
} else {
// Literal matching rule
core.info(`Using literal match for: ${fileName}`);
asset = data.assets.find((a: any) => a.name === fileName);
}
if (!asset) {
throw new Error(`No asset found matching the criteria in release ${data.tag_name}`);
}
const version = data.tag_name.replace(/^v/, '');
const binaryName = binaryInput || toolName; const binaryName = binaryInput || toolName;
// Check if the tool is already in the cache (if not 'always' update) // Check if the tool is already in the cache (if not 'always' update)
if (updateCache !== 'always') { if (updateCache !== 'always') {
const cachedDir = tc.find(toolName, version, arch); const cachedDir = tc.find(toolName, version, platformInfo.arch);
if (cachedDir) { if (cachedDir) {
core.info(`Found ${toolName} version ${version} in cache at ${cachedDir}`); core.info(`Found ${toolName} version ${version} in cache at ${cachedDir}`);
core.addPath(cachedDir); core.addPath(cachedDir);
@@ -176,7 +62,7 @@ async function run() {
const downloadUrl = asset.browser_download_url; const downloadUrl = asset.browser_download_url;
core.info(`Downloading ${asset.name} from ${downloadUrl}...`); core.info(`Downloading ${asset.name} from ${downloadUrl}...`);
const downloadPath = await tc.downloadTool(downloadUrl); const downloadPath = await tc.downloadTool(downloadUrl, undefined, token ? `token ${token}` : undefined);
const nameLower = asset.name.toLowerCase(); const nameLower = asset.name.toLowerCase();
let toolDir: string; let toolDir: string;
@@ -200,7 +86,6 @@ async function run() {
} }
fs.renameSync(downloadPath, destPath); fs.renameSync(downloadPath, destPath);
// Make it executable on Linux/macOS
if (process.platform !== 'win32') { if (process.platform !== 'win32') {
fs.chmodSync(destPath, '755'); fs.chmodSync(destPath, '755');
} }
@@ -216,14 +101,14 @@ async function run() {
core.info(`Searching for binary named: ${binaryName}`); core.info(`Searching for binary named: ${binaryName}`);
} }
const binaryPath = findBinary(toolDir, binaryPattern, debug); const binaryPath = findBinary(toolDir, binaryPattern, debug, (msg) => core.info(msg));
if (!binaryPath) { if (!binaryPath) {
throw new Error(`Could not find binary "${binaryName}" in the extracted asset.`); throw new Error(`Could not find binary "${binaryName}" in the extracted asset.`);
} }
// The tool directory is the one containing the binary // The tool directory is the one containing the binary
toolDir = path.dirname(binaryPath); toolDir = path.dirname(binaryPath);
core.info(`Binary found at ${binaryPath}. Setting tool directory to ${toolDir}`); core.info(`Binary found at ${binaryPath}.`);
// Make binary executable just in case it's not // Make binary executable just in case it's not
if (process.platform !== 'win32') { if (process.platform !== 'win32') {
@@ -231,7 +116,7 @@ async function run() {
} }
// Cache the tool // Cache the tool
const finalCachedDir = await tc.cacheDir(toolDir, toolName, version, arch); const finalCachedDir = await tc.cacheDir(toolDir, toolName, version, platformInfo.arch);
core.info(`Cached ${toolName} version ${version} to ${finalCachedDir}`); core.info(`Cached ${toolName} version ${version} to ${finalCachedDir}`);
core.addPath(finalCachedDir); core.addPath(finalCachedDir);