├── .eslintignore ├── codecov.yml ├── .prettierignore ├── .github ├── setup-qemu-action.png ├── CODE_OF_CONDUCT.md ├── workflows │ ├── pr-assign-author.yml │ ├── publish.yml │ ├── test.yml │ ├── validate.yml │ └── ci.yml ├── dependabot.yml ├── ISSUE_TEMPLATE │ ├── feature.yml │ ├── config.yml │ └── bug.yml ├── SECURITY.md └── CONTRIBUTING.md ├── .gitattributes ├── .dockerignore ├── .prettierrc.json ├── .editorconfig ├── .yarnrc.yml ├── src ├── context.ts └── main.ts ├── tsconfig.json ├── .eslintrc.json ├── action.yml ├── jest.config.ts ├── .gitignore ├── docker-bake.hcl ├── package.json ├── __tests__ └── context.test.ts ├── dev.Dockerfile ├── README.md ├── LICENSE └── dist └── sourcemap-register.js /.eslintignore: -------------------------------------------------------------------------------- 1 | /dist/** 2 | /coverage/** 3 | /node_modules/** 4 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | comment: false 2 | github_checks: 3 | annotations: false 4 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # Dependency directories 2 | node_modules/ 3 | jspm_packages/ 4 | 5 | # yarn v2 6 | .yarn/ 7 | -------------------------------------------------------------------------------- /.github/setup-qemu-action.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker/setup-qemu-action/HEAD/.github/setup-qemu-action.png -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | /.yarn/releases/** binary 2 | /.yarn/plugins/** binary 3 | /dist/** linguist-generated=true 4 | /lib/** linguist-generated=true 5 | -------------------------------------------------------------------------------- /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of conduct 2 | 3 | - [Moby community guidelines](https://github.com/moby/moby/blob/master/CONTRIBUTING.md#moby-community-guidelines) 4 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | /coverage 2 | 3 | # Dependency directories 4 | node_modules/ 5 | jspm_packages/ 6 | 7 | # yarn v2 8 | .yarn/cache 9 | .yarn/unplugged 10 | .yarn/build-state.yml 11 | .yarn/install-state.gz 12 | .pnp.* 13 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 120, 3 | "tabWidth": 2, 4 | "useTabs": false, 5 | "semi": true, 6 | "singleQuote": true, 7 | "trailingComma": "none", 8 | "bracketSpacing": false, 9 | "arrowParens": "avoid", 10 | "parser": "typescript" 11 | } 12 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # This file is for unifying the coding style for different editors and IDEs. 2 | # More information at http://editorconfig.org 3 | 4 | root = true 5 | 6 | [*] 7 | indent_style = space 8 | indent_size = 2 9 | end_of_line = lf 10 | charset = utf-8 11 | trim_trailing_whitespace = true 12 | insert_final_newline = true 13 | 14 | [*.md] 15 | trim_trailing_whitespace = false 16 | -------------------------------------------------------------------------------- /.github/workflows/pr-assign-author.yml: -------------------------------------------------------------------------------- 1 | name: pr-assign-author 2 | 3 | permissions: 4 | contents: read 5 | 6 | on: 7 | pull_request_target: 8 | types: 9 | - opened 10 | - reopened 11 | 12 | jobs: 13 | run: 14 | uses: crazy-max/.github/.github/workflows/pr-assign-author.yml@1b673f36fad86812f538c1df9794904038a23cbf 15 | permissions: 16 | contents: read 17 | pull-requests: write 18 | -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | # https://yarnpkg.com/configuration/yarnrc 2 | 3 | compressionLevel: mixed 4 | enableGlobalCache: false 5 | enableHardenedMode: true 6 | 7 | logFilters: 8 | - code: YN0013 9 | level: discard 10 | - code: YN0019 11 | level: discard 12 | - code: YN0076 13 | level: discard 14 | - code: YN0086 15 | level: discard 16 | 17 | nodeLinker: node-modules 18 | 19 | npmAuthToken: "${NODE_AUTH_TOKEN:-fallback}" 20 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: publish 2 | 3 | on: 4 | release: 5 | types: 6 | - published 7 | 8 | jobs: 9 | publish: 10 | runs-on: ubuntu-latest 11 | permissions: 12 | contents: read 13 | id-token: write 14 | packages: write 15 | steps: 16 | - 17 | name: Checkout 18 | uses: actions/checkout@v5 19 | - 20 | name: Publish 21 | uses: actions/publish-immutable-action@v0.0.4 22 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | labels: 8 | - "dependencies" 9 | - "bot" 10 | - package-ecosystem: "npm" 11 | directory: "/" 12 | schedule: 13 | interval: "daily" 14 | versioning-strategy: "increase" 15 | allow: 16 | - dependency-type: "production" 17 | labels: 18 | - "dependencies" 19 | - "bot" 20 | -------------------------------------------------------------------------------- /src/context.ts: -------------------------------------------------------------------------------- 1 | import * as core from '@actions/core'; 2 | import {Util} from '@docker/actions-toolkit/lib/util'; 3 | 4 | export interface Inputs { 5 | image: string; 6 | platforms: string; 7 | cacheImage: boolean; 8 | } 9 | 10 | export function getInputs(): Inputs { 11 | return { 12 | image: core.getInput('image') || 'docker.io/tonistiigi/binfmt:latest', 13 | platforms: Util.getInputList('platforms').join(',') || 'all', 14 | cacheImage: core.getBooleanInput('cache-image') 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature.yml: -------------------------------------------------------------------------------- 1 | # https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema 2 | name: Feature request 3 | description: Missing functionality? Come tell us about it! 4 | labels: 5 | - kind/enhancement 6 | - status/triage 7 | 8 | body: 9 | - type: textarea 10 | id: description 11 | attributes: 12 | label: Description 13 | description: What is the feature you want to see? 14 | validations: 15 | required: true 16 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "esModuleInterop": true, 4 | "target": "es6", 5 | "module": "commonjs", 6 | "strict": true, 7 | "newLine": "lf", 8 | "outDir": "./lib", 9 | "rootDir": "./src", 10 | "forceConsistentCasingInFileNames": true, 11 | "noImplicitAny": false, 12 | "resolveJsonModule": true, 13 | "useUnknownInCatchVariables": false, 14 | }, 15 | "exclude": [ 16 | "./__tests__/**/*", 17 | "./lib/**/*", 18 | "node_modules", 19 | "jest.config.ts" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | # https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser 2 | blank_issues_enabled: true 3 | contact_links: 4 | - name: Questions and Discussions 5 | url: https://github.com/docker/setup-qemu-action/discussions/new 6 | about: Use Github Discussions to ask questions and/or open discussion topics. 7 | - name: Documentation 8 | url: https://docs.docker.com/build/ci/github-actions/ 9 | about: Read the documentation. 10 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "node": true, 4 | "es6": true, 5 | "jest": true 6 | }, 7 | "extends": [ 8 | "eslint:recommended", 9 | "plugin:@typescript-eslint/eslint-recommended", 10 | "plugin:@typescript-eslint/recommended", 11 | "plugin:jest/recommended", 12 | "plugin:prettier/recommended" 13 | ], 14 | "parser": "@typescript-eslint/parser", 15 | "parserOptions": { 16 | "ecmaVersion": "latest", 17 | "sourceType": "module" 18 | }, 19 | "plugins": [ 20 | "@typescript-eslint", 21 | "jest", 22 | "prettier" 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /.github/SECURITY.md: -------------------------------------------------------------------------------- 1 | # Reporting security issues 2 | 3 | The project maintainers take security seriously. If you discover a security 4 | issue, please bring it to their attention right away! 5 | 6 | **Please _DO NOT_ file a public issue**, instead send your report privately to 7 | [security@docker.com](mailto:security@docker.com). 8 | 9 | Security reports are greatly appreciated, and we will publicly thank you for it. 10 | We also like to send gifts—if you'd like Docker swag, make sure to let 11 | us know. We currently do not offer a paid security bounty program, but are not 12 | ruling it out in the future. 13 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: test 2 | 3 | concurrency: 4 | group: ${{ github.workflow }}-${{ github.ref }} 5 | cancel-in-progress: true 6 | 7 | on: 8 | push: 9 | branches: 10 | - 'master' 11 | - 'releases/v*' 12 | pull_request: 13 | 14 | jobs: 15 | test: 16 | runs-on: ubuntu-latest 17 | steps: 18 | - 19 | name: Checkout 20 | uses: actions/checkout@v5 21 | - 22 | name: Test 23 | uses: docker/bake-action@v6 24 | with: 25 | source: . 26 | targets: test 27 | - 28 | name: Upload coverage 29 | uses: codecov/codecov-action@v5 30 | with: 31 | files: ./coverage/clover.xml 32 | token: ${{ secrets.CODECOV_TOKEN }} 33 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | # https://help.github.com/en/articles/metadata-syntax-for-github-actions 2 | name: 'Docker Setup QEMU' 3 | description: 'Install QEMU static binaries' 4 | author: 'docker' 5 | branding: 6 | icon: 'anchor' 7 | color: 'blue' 8 | 9 | inputs: 10 | image: 11 | description: 'QEMU static binaries Docker image (e.g. tonistiigi/binfmt:latest)' 12 | default: 'docker.io/tonistiigi/binfmt:latest' 13 | required: false 14 | platforms: 15 | description: 'Platforms to install (e.g. arm64,riscv64,arm)' 16 | default: 'all' 17 | required: false 18 | cache-image: 19 | description: 'Cache binfmt image to GitHub Actions cache backend' 20 | default: 'true' 21 | required: false 22 | 23 | outputs: 24 | platforms: 25 | description: 'Available platforms (comma separated)' 26 | 27 | runs: 28 | using: 'node20' 29 | main: 'dist/index.js' 30 | post: 'dist/index.js' 31 | -------------------------------------------------------------------------------- /jest.config.ts: -------------------------------------------------------------------------------- 1 | import fs from 'fs'; 2 | import os from 'os'; 3 | import path from 'path'; 4 | 5 | const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-setup-qemu-action-')); 6 | 7 | process.env = Object.assign({}, process.env, { 8 | TEMP: tmpDir, 9 | GITHUB_REPOSITORY: 'docker/setup-qemu-action', 10 | RUNNER_TEMP: path.join(tmpDir, 'runner-temp'), 11 | RUNNER_TOOL_CACHE: path.join(tmpDir, 'runner-tool-cache') 12 | }) as { 13 | [key: string]: string; 14 | }; 15 | 16 | module.exports = { 17 | clearMocks: true, 18 | moduleFileExtensions: ['js', 'ts'], 19 | testMatch: ['**/*.test.ts'], 20 | transform: { 21 | '^.+\\.ts$': 'ts-jest' 22 | }, 23 | moduleNameMapper: { 24 | '^csv-parse/sync': '/node_modules/csv-parse/dist/cjs/sync.cjs' 25 | }, 26 | collectCoverageFrom: ['src/**/{!(main.ts),}.ts'], 27 | coveragePathIgnorePatterns: ['lib/', 'node_modules/', '__mocks__/', '__tests__/'], 28 | verbose: true 29 | }; 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore 2 | 3 | # Logs 4 | logs 5 | *.log 6 | npm-debug.log* 7 | yarn-debug.log* 8 | yarn-error.log* 9 | lerna-debug.log* 10 | .pnpm-debug.log* 11 | 12 | # Diagnostic reports (https://nodejs.org/api/report.html) 13 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 14 | 15 | # Runtime data 16 | pids 17 | *.pid 18 | *.seed 19 | *.pid.lock 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # Dependency directories 26 | node_modules/ 27 | jspm_packages/ 28 | 29 | # TypeScript cache 30 | *.tsbuildinfo 31 | 32 | # Optional npm cache directory 33 | .npm 34 | 35 | # Optional eslint cache 36 | .eslintcache 37 | 38 | # Yarn Integrity file 39 | .yarn-integrity 40 | 41 | # dotenv environment variable files 42 | .env 43 | .env.development.local 44 | .env.test.local 45 | .env.production.local 46 | .env.local 47 | 48 | # yarn v2 49 | .yarn/cache 50 | .yarn/unplugged 51 | .yarn/build-state.yml 52 | .yarn/install-state.gz 53 | .pnp.* 54 | -------------------------------------------------------------------------------- /.github/workflows/validate.yml: -------------------------------------------------------------------------------- 1 | name: validate 2 | 3 | concurrency: 4 | group: ${{ github.workflow }}-${{ github.ref }} 5 | cancel-in-progress: true 6 | 7 | on: 8 | push: 9 | branches: 10 | - 'master' 11 | - 'releases/v*' 12 | pull_request: 13 | 14 | jobs: 15 | prepare: 16 | runs-on: ubuntu-latest 17 | outputs: 18 | targets: ${{ steps.generate.outputs.targets }} 19 | steps: 20 | - 21 | name: Checkout 22 | uses: actions/checkout@v5 23 | - 24 | name: List targets 25 | id: generate 26 | uses: docker/bake-action/subaction/list-targets@v6 27 | with: 28 | target: validate 29 | 30 | validate: 31 | runs-on: ubuntu-latest 32 | needs: 33 | - prepare 34 | strategy: 35 | fail-fast: false 36 | matrix: 37 | target: ${{ fromJson(needs.prepare.outputs.targets) }} 38 | steps: 39 | - 40 | name: Validate 41 | uses: docker/bake-action@v6 42 | with: 43 | targets: ${{ matrix.target }} 44 | -------------------------------------------------------------------------------- /docker-bake.hcl: -------------------------------------------------------------------------------- 1 | target "_common" { 2 | args = { 3 | BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1 4 | } 5 | } 6 | 7 | group "default" { 8 | targets = ["build"] 9 | } 10 | 11 | group "pre-checkin" { 12 | targets = ["vendor", "format", "build"] 13 | } 14 | 15 | group "validate" { 16 | targets = ["lint", "build-validate", "vendor-validate"] 17 | } 18 | 19 | target "build" { 20 | inherits = ["_common"] 21 | dockerfile = "dev.Dockerfile" 22 | target = "build-update" 23 | output = ["."] 24 | } 25 | 26 | target "build-validate" { 27 | inherits = ["_common"] 28 | dockerfile = "dev.Dockerfile" 29 | target = "build-validate" 30 | output = ["type=cacheonly"] 31 | } 32 | 33 | target "format" { 34 | inherits = ["_common"] 35 | dockerfile = "dev.Dockerfile" 36 | target = "format-update" 37 | output = ["."] 38 | } 39 | 40 | target "lint" { 41 | inherits = ["_common"] 42 | dockerfile = "dev.Dockerfile" 43 | target = "lint" 44 | output = ["type=cacheonly"] 45 | } 46 | 47 | target "vendor" { 48 | inherits = ["_common"] 49 | dockerfile = "dev.Dockerfile" 50 | target = "vendor-update" 51 | output = ["."] 52 | } 53 | 54 | target "vendor-validate" { 55 | inherits = ["_common"] 56 | dockerfile = "dev.Dockerfile" 57 | target = "vendor-validate" 58 | output = ["type=cacheonly"] 59 | } 60 | 61 | target "test" { 62 | inherits = ["_common"] 63 | dockerfile = "dev.Dockerfile" 64 | target = "test-coverage" 65 | output = ["./coverage"] 66 | } 67 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "docker-setup-qemu", 3 | "description": "Install QEMU static binaries", 4 | "main": "src/main.ts", 5 | "scripts": { 6 | "build": "ncc build src/main.ts --source-map --minify --license licenses.txt", 7 | "lint": "yarn run prettier && yarn run eslint", 8 | "format": "yarn run prettier:fix && yarn run eslint:fix", 9 | "eslint": "eslint --max-warnings=0 .", 10 | "eslint:fix": "eslint --fix .", 11 | "prettier": "prettier --check \"./**/*.ts\"", 12 | "prettier:fix": "prettier --write \"./**/*.ts\"", 13 | "test": "jest" 14 | }, 15 | "repository": { 16 | "type": "git", 17 | "url": "git+https://github.com/docker/setup-qemu-action.git" 18 | }, 19 | "keywords": [ 20 | "actions", 21 | "docker", 22 | "qemu" 23 | ], 24 | "author": "Docker Inc.", 25 | "license": "Apache-2.0", 26 | "packageManager": "yarn@4.9.2", 27 | "dependencies": { 28 | "@actions/core": "^1.11.1", 29 | "@docker/actions-toolkit": "^0.67.0" 30 | }, 31 | "devDependencies": { 32 | "@types/node": "^20.19.9", 33 | "@typescript-eslint/eslint-plugin": "^7.18.0", 34 | "@typescript-eslint/parser": "^7.18.0", 35 | "@vercel/ncc": "^0.38.3", 36 | "eslint": "^8.57.1", 37 | "eslint-config-prettier": "^9.1.2", 38 | "eslint-plugin-jest": "^28.14.0", 39 | "eslint-plugin-prettier": "^5.5.4", 40 | "jest": "^29.7.0", 41 | "prettier": "^3.6.2", 42 | "ts-jest": "^29.4.1", 43 | "ts-node": "^10.9.2", 44 | "typescript": "^5.9.2" 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing 2 | 3 | Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great. 4 | 5 | Contributions to this project are [released](https://docs.github.com/en/github/site-policy/github-terms-of-service#6-contributions-under-repository-license) 6 | to the public under the [project's open source license](LICENSE). 7 | 8 | ## Submitting a pull request 9 | 10 | 1. [Fork](https://github.com/docker/setup-qemu-action/fork) and clone the repository 11 | 2. Configure and install the dependencies: `yarn install` 12 | 3. Create a new branch: `git checkout -b my-branch-name` 13 | 4. Make your changes 14 | 5. Format code and build javascript artifacts: `docker buildx bake pre-checkin` 15 | 6. Validate all code has correctly formatted and built: `docker buildx bake validate` 16 | 7. Push to your fork and [submit a pull request](https://github.com/docker/setup-qemu-action/compare) 17 | 8. Pat yourself on the back and wait for your pull request to be reviewed and merged. 18 | 19 | Here are a few things you can do that will increase the likelihood of your pull request being accepted: 20 | 21 | - Make sure the `README.md` and any other relevant **documentation are kept up-to-date**. 22 | - We try to follow [SemVer v2.0.0](https://semver.org/). Randomly breaking public APIs is not an option. 23 | - Keep your change as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as **separate pull requests**. 24 | - Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). 25 | 26 | ## Resources 27 | 28 | - [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/) 29 | - [Using Pull Requests](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests) 30 | - [GitHub Help](https://docs.github.com/en) 31 | -------------------------------------------------------------------------------- /__tests__/context.test.ts: -------------------------------------------------------------------------------- 1 | import {beforeEach, describe, expect, test} from '@jest/globals'; 2 | 3 | import * as context from '../src/context'; 4 | 5 | describe('getInputs', () => { 6 | beforeEach(() => { 7 | process.env = Object.keys(process.env).reduce((object, key) => { 8 | if (!key.startsWith('INPUT_')) { 9 | object[key] = process.env[key]; 10 | } 11 | return object; 12 | }, {}); 13 | }); 14 | 15 | // prettier-ignore 16 | test.each([ 17 | [ 18 | 0, 19 | new Map([ 20 | ['cache-image', 'true'], 21 | ]), 22 | { 23 | image: 'docker.io/tonistiigi/binfmt:latest', 24 | platforms: 'all', 25 | cacheImage: true, 26 | } as context.Inputs 27 | ], 28 | [ 29 | 1, 30 | new Map([ 31 | ['image', 'docker/binfmt:latest'], 32 | ['platforms', 'arm64,riscv64,arm'], 33 | ['cache-image', 'false'], 34 | ]), 35 | { 36 | image: 'docker/binfmt:latest', 37 | platforms: 'arm64,riscv64,arm', 38 | cacheImage: false, 39 | } as context.Inputs 40 | ], 41 | [ 42 | 2, 43 | new Map([ 44 | ['platforms', 'arm64, riscv64, arm '], 45 | ['cache-image', 'true'], 46 | ]), 47 | { 48 | image: 'docker.io/tonistiigi/binfmt:latest', 49 | platforms: 'arm64,riscv64,arm', 50 | cacheImage: true, 51 | } as context.Inputs 52 | ] 53 | ])( 54 | '[%d] given %p as inputs, returns %p', 55 | async (num: number, inputs: Map, expected: context.Inputs) => { 56 | inputs.forEach((value: string, name: string) => { 57 | setInput(name, value); 58 | }); 59 | const res = await context.getInputs(); 60 | expect(res).toEqual(expected); 61 | } 62 | ); 63 | }); 64 | 65 | // See: https://github.com/actions/toolkit/blob/master/packages/core/src/core.ts#L67 66 | function getInputName(name: string): string { 67 | return `INPUT_${name.replace(/ /g, '_').toUpperCase()}`; 68 | } 69 | 70 | function setInput(name: string, value: string): void { 71 | process.env[getInputName(name)] = value; 72 | } 73 | -------------------------------------------------------------------------------- /dev.Dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | 3 | ARG NODE_VERSION=20 4 | 5 | FROM node:${NODE_VERSION}-alpine AS base 6 | RUN apk add --no-cache cpio findutils git 7 | WORKDIR /src 8 | RUN --mount=type=bind,target=.,rw \ 9 | --mount=type=cache,target=/src/.yarn/cache <&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor"' 31 | git status --porcelain -- yarn.lock 32 | exit 1 33 | fi 34 | EOT 35 | 36 | FROM deps AS build 37 | RUN --mount=type=bind,target=.,rw \ 38 | --mount=type=cache,target=/src/.yarn/cache \ 39 | --mount=type=cache,target=/src/node_modules \ 40 | yarn run build && mkdir /out && cp -Rf dist /out/ 41 | 42 | FROM scratch AS build-update 43 | COPY --from=build /out / 44 | 45 | FROM build AS build-validate 46 | RUN --mount=type=bind,target=.,rw <&2 'ERROR: Build result differs. Please build first with "docker buildx bake build"' 52 | git status --porcelain -- dist 53 | exit 1 54 | fi 55 | EOT 56 | 57 | FROM deps AS format 58 | RUN --mount=type=bind,target=.,rw \ 59 | --mount=type=cache,target=/src/.yarn/cache \ 60 | --mount=type=cache,target=/src/node_modules \ 61 | yarn run format \ 62 | && mkdir /out && find . -name '*.ts' -not -path './node_modules/*' -not -path './.yarn/*' | cpio -pdm /out 63 | 64 | FROM scratch AS format-update 65 | COPY --from=format /out / 66 | 67 | FROM deps AS lint 68 | RUN --mount=type=bind,target=.,rw \ 69 | --mount=type=cache,target=/src/.yarn/cache \ 70 | --mount=type=cache,target=/src/node_modules \ 71 | yarn run lint 72 | 73 | FROM deps AS test 74 | RUN --mount=type=bind,target=.,rw \ 75 | --mount=type=cache,target=/src/.yarn/cache \ 76 | --mount=type=cache,target=/src/node_modules \ 77 | yarn run test --coverage --coverageDirectory=/tmp/coverage 78 | 79 | FROM scratch AS test-coverage 80 | COPY --from=test /tmp/coverage / 81 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import * as context from './context'; 2 | import * as core from '@actions/core'; 3 | import * as actionsToolkit from '@docker/actions-toolkit'; 4 | 5 | import {Docker} from '@docker/actions-toolkit/lib/docker/docker'; 6 | 7 | interface Platforms { 8 | supported: string[]; 9 | available: string[]; 10 | } 11 | 12 | actionsToolkit.run( 13 | // main 14 | async () => { 15 | const input: context.Inputs = context.getInputs(); 16 | 17 | await core.group(`Docker info`, async () => { 18 | await Docker.printVersion(); 19 | await Docker.printInfo(); 20 | }); 21 | 22 | await core.group(`Pulling binfmt Docker image`, async () => { 23 | await Docker.pull(input.image, input.cacheImage); 24 | }); 25 | 26 | await core.group(`Image info`, async () => { 27 | await Docker.getExecOutput(['image', 'inspect', input.image], { 28 | ignoreReturnCode: true 29 | }).then(res => { 30 | if (res.stderr.length > 0 && res.exitCode != 0) { 31 | throw new Error(res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error'); 32 | } 33 | }); 34 | }); 35 | 36 | await core.group(`Binfmt version`, async () => { 37 | await Docker.getExecOutput(['run', '--rm', '--privileged', input.image, '--version'], { 38 | ignoreReturnCode: true 39 | }).then(res => { 40 | if (res.stderr.length > 0 && res.exitCode != 0) { 41 | throw new Error(res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error'); 42 | } 43 | }); 44 | }); 45 | 46 | await core.group(`Installing QEMU static binaries`, async () => { 47 | await Docker.getExecOutput(['run', '--rm', '--privileged', input.image, '--install', input.platforms], { 48 | ignoreReturnCode: true 49 | }).then(res => { 50 | if (res.stderr.length > 0 && res.exitCode != 0) { 51 | throw new Error(res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error'); 52 | } 53 | }); 54 | }); 55 | 56 | await core.group(`Extracting available platforms`, async () => { 57 | await Docker.getExecOutput(['run', '--rm', '--privileged', input.image], { 58 | ignoreReturnCode: true, 59 | silent: true 60 | }).then(res => { 61 | if (res.stderr.length > 0 && res.exitCode != 0) { 62 | throw new Error(res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error'); 63 | } 64 | const platforms: Platforms = JSON.parse(res.stdout.trim()); 65 | core.info(`${platforms.supported.join(',')}`); 66 | core.setOutput('platforms', platforms.supported.join(',')); 67 | }); 68 | }); 69 | } 70 | ); 71 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: ci 2 | 3 | concurrency: 4 | group: ${{ github.workflow }}-${{ github.ref }} 5 | cancel-in-progress: true 6 | 7 | on: 8 | workflow_dispatch: 9 | schedule: 10 | - cron: '0 10 * * *' 11 | push: 12 | branches: 13 | - 'master' 14 | - 'releases/v*' 15 | tags: 16 | - 'v*' 17 | pull_request: 18 | 19 | jobs: 20 | default: 21 | runs-on: ubuntu-latest 22 | steps: 23 | - 24 | name: Checkout 25 | uses: actions/checkout@v5 26 | - 27 | name: Set up QEMU 28 | id: qemu 29 | uses: ./ 30 | - 31 | name: Available platforms 32 | run: echo ${{ steps.qemu.outputs.platforms }} 33 | 34 | main: 35 | runs-on: ubuntu-latest 36 | strategy: 37 | fail-fast: false 38 | matrix: 39 | image: 40 | - tonistiigi/binfmt:latest 41 | - tonistiigi/binfmt:master 42 | platforms: 43 | - all 44 | - arm64,riscv64,arm 45 | steps: 46 | - 47 | name: Checkout 48 | uses: actions/checkout@v5 49 | - 50 | name: Set up QEMU 51 | id: qemu 52 | uses: ./ 53 | with: 54 | image: ${{ matrix.image }} 55 | platforms: ${{ matrix.platforms }} 56 | - 57 | name: Available platforms 58 | run: echo ${{ steps.qemu.outputs.platforms }} 59 | 60 | error: 61 | runs-on: ubuntu-latest 62 | steps: 63 | - 64 | name: Checkout 65 | uses: actions/checkout@v5 66 | - 67 | name: Stop docker 68 | run: | 69 | sudo systemctl stop docker docker.socket 70 | - 71 | name: Set up QEMU 72 | id: qemu 73 | continue-on-error: true 74 | uses: ./ 75 | - 76 | name: Check 77 | run: | 78 | echo "${{ toJson(steps.qemu) }}" 79 | if [ "${{ steps.qemu.outcome }}" != "failure" ] || [ "${{ steps.qemu.conclusion }}" != "success" ]; then 80 | echo "::error::Should have failed" 81 | exit 1 82 | fi 83 | 84 | cache-image: 85 | runs-on: ubuntu-latest 86 | strategy: 87 | fail-fast: false 88 | matrix: 89 | cache: 90 | - true 91 | - false 92 | steps: 93 | - 94 | name: Checkout 95 | uses: actions/checkout@v5 96 | - 97 | name: Set up QEMU 98 | id: qemu 99 | uses: ./ 100 | with: 101 | image: tonistiigi/binfmt:master 102 | cache-image: ${{ matrix.cache }} 103 | - 104 | name: Available platforms 105 | run: echo ${{ steps.qemu.outputs.platforms }} 106 | 107 | version: 108 | runs-on: ubuntu-latest 109 | strategy: 110 | fail-fast: false 111 | matrix: 112 | image: 113 | - tonistiigi/binfmt:master 114 | - tonistiigi/binfmt:latest 115 | - tonistiigi/binfmt:qemu-v7.0.0 116 | steps: 117 | - 118 | name: Checkout 119 | uses: actions/checkout@v5 120 | - 121 | name: Set up QEMU 122 | uses: ./ 123 | with: 124 | image: ${{ matrix.image }} 125 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![GitHub release](https://img.shields.io/github/release/docker/setup-qemu-action.svg?style=flat-square)](https://github.com/docker/setup-qemu-action/releases/latest) 2 | [![GitHub marketplace](https://img.shields.io/badge/marketplace-docker--setup--qemu-blue?logo=github&style=flat-square)](https://github.com/marketplace/actions/docker-setup-qemu) 3 | [![CI workflow](https://img.shields.io/github/actions/workflow/status/docker/setup-qemu-action/ci.yml?branch=master&label=ci&logo=github&style=flat-square)](https://github.com/docker/setup-qemu-action/actions?workflow=ci) 4 | [![Test workflow](https://img.shields.io/github/actions/workflow/status/docker/setup-qemu-action/test.yml?branch=master&label=test&logo=github&style=flat-square)](https://github.com/docker/setup-qemu-action/actions?workflow=test) 5 | [![Codecov](https://img.shields.io/codecov/c/github/docker/setup-qemu-action?logo=codecov&style=flat-square)](https://codecov.io/gh/docker/setup-qemu-action) 6 | 7 | ## About 8 | 9 | GitHub Action to install [QEMU](https://github.com/qemu/qemu) static binaries. 10 | 11 | ![Screenshot](.github/setup-qemu-action.png) 12 | 13 | ___ 14 | 15 | * [Usage](#usage) 16 | * [Customizing](#customizing) 17 | * [inputs](#inputs) 18 | * [outputs](#outputs) 19 | * [Contributing](#contributing) 20 | 21 | ## Usage 22 | 23 | ```yaml 24 | name: ci 25 | 26 | on: 27 | push: 28 | 29 | jobs: 30 | qemu: 31 | runs-on: ubuntu-latest 32 | steps: 33 | - 34 | name: Set up QEMU 35 | uses: docker/setup-qemu-action@v3 36 | ``` 37 | 38 | > [!NOTE] 39 | > If you are using [`docker/setup-buildx-action`](https://github.com/docker/setup-buildx-action), 40 | > this action should come before it: 41 | > 42 | > ```yaml 43 | > - 44 | > name: Set up QEMU 45 | > uses: docker/setup-qemu-action@v3 46 | > - 47 | > name: Set up Docker Buildx 48 | > uses: docker/setup-buildx-action@v3 49 | > ``` 50 | 51 | ## Customizing 52 | 53 | ### inputs 54 | 55 | The following inputs can be used as `step.with` keys: 56 | 57 | | Name | Type | Default | Description | 58 | |---------------|--------|-------------------------------------------------------------------------------|----------------------------------------------------| 59 | | `image` | String | [`tonistiigi/binfmt:latest`](https://hub.docker.com/r/tonistiigi/binfmt/tags) | QEMU static binaries Docker image | 60 | | `platforms` | String | `all` | Platforms to install (e.g., `arm64,riscv64,arm`) | 61 | | `cache-image` | Bool | `true` | Cache binfmt image to GitHub Actions cache backend | 62 | 63 | ### outputs 64 | 65 | The following outputs are available: 66 | 67 | | Name | Type | Description | 68 | |---------------|---------|---------------------------------------| 69 | | `platforms` | String | Available platforms (comma separated) | 70 | 71 | ## Contributing 72 | 73 | Want to contribute? Awesome! You can find information about contributing to 74 | this project in the [CONTRIBUTING.md](/.github/CONTRIBUTING.md) 75 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug.yml: -------------------------------------------------------------------------------- 1 | # https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema 2 | name: Bug Report 3 | description: Report a bug 4 | labels: 5 | - status/triage 6 | 7 | body: 8 | - type: markdown 9 | attributes: 10 | value: | 11 | Thank you for taking the time to report a bug! 12 | If this is a security issue please report it to the [Docker Security team](mailto:security@docker.com). 13 | 14 | - type: checkboxes 15 | attributes: 16 | label: Contributing guidelines 17 | description: > 18 | Make sure you've read the contributing guidelines before proceeding. 19 | options: 20 | - label: I've read the [contributing guidelines](https://github.com/docker/setup-qemu-action/blob/master/.github/CONTRIBUTING.md) and wholeheartedly agree 21 | required: true 22 | 23 | - type: checkboxes 24 | attributes: 25 | label: "I've found a bug, and:" 26 | description: | 27 | Make sure that your request fulfills all of the following requirements. 28 | If one requirement cannot be satisfied, explain in detail why. 29 | options: 30 | - label: The documentation does not mention anything about my problem 31 | - label: There are no open or closed issues that are related to my problem 32 | 33 | - type: textarea 34 | attributes: 35 | label: Description 36 | description: > 37 | Provide a brief description of the bug in 1-2 sentences. 38 | validations: 39 | required: true 40 | 41 | - type: textarea 42 | attributes: 43 | label: Expected behaviour 44 | description: > 45 | Describe precisely what you'd expect to happen. 46 | validations: 47 | required: true 48 | 49 | - type: textarea 50 | attributes: 51 | label: Actual behaviour 52 | description: > 53 | Describe precisely what is actually happening. 54 | validations: 55 | required: true 56 | 57 | - type: input 58 | attributes: 59 | label: Repository URL 60 | description: > 61 | Enter the URL of the repository where you are experiencing the 62 | issue. If your repository is private, provide a link to a minimal 63 | repository that reproduces the issue. 64 | 65 | - type: input 66 | attributes: 67 | label: Workflow run URL 68 | description: > 69 | Enter the URL of the GitHub Action workflow run if public (e.g. 70 | `https://github.com///actions/runs/`) 71 | 72 | - type: textarea 73 | attributes: 74 | label: YAML workflow 75 | description: | 76 | Provide the YAML of the workflow that's causing the issue. 77 | Make sure to remove any sensitive information. 78 | render: yaml 79 | validations: 80 | required: true 81 | 82 | - type: textarea 83 | attributes: 84 | label: Workflow logs 85 | description: > 86 | [Attach](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/attaching-files) 87 | the [log file of your workflow run](https://docs.github.com/en/actions/managing-workflow-runs/using-workflow-run-logs#downloading-logs) 88 | and make sure to remove any sensitive information. 89 | 90 | - type: textarea 91 | attributes: 92 | label: BuildKit logs 93 | description: > 94 | If applicable, provide the [BuildKit container logs](https://docs.docker.com/build/ci/github-actions/configure-builder/#buildkit-container-logs) 95 | render: text 96 | 97 | - type: textarea 98 | attributes: 99 | label: Additional info 100 | description: | 101 | Provide any additional information that could be useful. 102 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | https://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | Copyright 2013-2018 Docker, Inc. 180 | 181 | Licensed under the Apache License, Version 2.0 (the "License"); 182 | you may not use this file except in compliance with the License. 183 | You may obtain a copy of the License at 184 | 185 | https://www.apache.org/licenses/LICENSE-2.0 186 | 187 | Unless required by applicable law or agreed to in writing, software 188 | distributed under the License is distributed on an "AS IS" BASIS, 189 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 190 | See the License for the specific language governing permissions and 191 | limitations under the License. 192 | -------------------------------------------------------------------------------- /dist/sourcemap-register.js: -------------------------------------------------------------------------------- 1 | (()=>{var e={296:e=>{var r=Object.prototype.toString;var n=typeof Buffer!=="undefined"&&typeof Buffer.alloc==="function"&&typeof Buffer.allocUnsafe==="function"&&typeof Buffer.from==="function";function isArrayBuffer(e){return r.call(e).slice(8,-1)==="ArrayBuffer"}function fromArrayBuffer(e,r,t){r>>>=0;var o=e.byteLength-r;if(o<0){throw new RangeError("'offset' is out of bounds")}if(t===undefined){t=o}else{t>>>=0;if(t>o){throw new RangeError("'length' is out of bounds")}}return n?Buffer.from(e.slice(r,r+t)):new Buffer(new Uint8Array(e.slice(r,r+t)))}function fromString(e,r){if(typeof r!=="string"||r===""){r="utf8"}if(!Buffer.isEncoding(r)){throw new TypeError('"encoding" must be a valid string encoding')}return n?Buffer.from(e,r):new Buffer(e,r)}function bufferFrom(e,r,t){if(typeof e==="number"){throw new TypeError('"value" argument must not be a number')}if(isArrayBuffer(e)){return fromArrayBuffer(e,r,t)}if(typeof e==="string"){return fromString(e,r)}return n?Buffer.from(e):new Buffer(e)}e.exports=bufferFrom},599:(e,r,n)=>{e=n.nmd(e);var t=n(927).SourceMapConsumer;var o=n(928);var i;try{i=n(896);if(!i.existsSync||!i.readFileSync){i=null}}catch(e){}var a=n(296);function dynamicRequire(e,r){return e.require(r)}var u=false;var s=false;var l=false;var c="auto";var p={};var f={};var g=/^data:application\/json[^,]+base64,/;var d=[];var h=[];function isInBrowser(){if(c==="browser")return true;if(c==="node")return false;return typeof window!=="undefined"&&typeof XMLHttpRequest==="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}function hasGlobalProcessEventEmitter(){return typeof process==="object"&&process!==null&&typeof process.on==="function"}function globalProcessVersion(){if(typeof process==="object"&&process!==null){return process.version}else{return""}}function globalProcessStderr(){if(typeof process==="object"&&process!==null){return process.stderr}}function globalProcessExit(e){if(typeof process==="object"&&process!==null&&typeof process.exit==="function"){return process.exit(e)}}function handlerExec(e){return function(r){for(var n=0;n"}var n=this.getLineNumber();if(n!=null){r+=":"+n;var t=this.getColumnNumber();if(t){r+=":"+t}}}var o="";var i=this.getFunctionName();var a=true;var u=this.isConstructor();var s=!(this.isToplevel()||u);if(s){var l=this.getTypeName();if(l==="[object Object]"){l="null"}var c=this.getMethodName();if(i){if(l&&i.indexOf(l)!=0){o+=l+"."}o+=i;if(c&&i.indexOf("."+c)!=i.length-c.length-1){o+=" [as "+c+"]"}}else{o+=l+"."+(c||"")}}else if(u){o+="new "+(i||"")}else if(i){o+=i}else{o+=r;a=false}if(a){o+=" ("+r+")"}return o}function cloneCallSite(e){var r={};Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(n){r[n]=/^(?:is|get)/.test(n)?function(){return e[n].call(e)}:e[n]}));r.toString=CallSiteToString;return r}function wrapCallSite(e,r){if(r===undefined){r={nextPosition:null,curPosition:null}}if(e.isNative()){r.curPosition=null;return e}var n=e.getFileName()||e.getScriptNameOrSourceURL();if(n){var t=e.getLineNumber();var o=e.getColumnNumber()-1;var i=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/;var a=i.test(globalProcessVersion())?0:62;if(t===1&&o>a&&!isInBrowser()&&!e.isEval()){o-=a}var u=mapSourcePosition({source:n,line:t,column:o});r.curPosition=u;e=cloneCallSite(e);var s=e.getFunctionName;e.getFunctionName=function(){if(r.nextPosition==null){return s()}return r.nextPosition.name||s()};e.getFileName=function(){return u.source};e.getLineNumber=function(){return u.line};e.getColumnNumber=function(){return u.column+1};e.getScriptNameOrSourceURL=function(){return u.source};return e}var l=e.isEval()&&e.getEvalOrigin();if(l){l=mapEvalOrigin(l);e=cloneCallSite(e);e.getEvalOrigin=function(){return l};return e}return e}function prepareStackTrace(e,r){if(l){p={};f={}}var n=e.name||"Error";var t=e.message||"";var o=n+": "+t;var i={nextPosition:null,curPosition:null};var a=[];for(var u=r.length-1;u>=0;u--){a.push("\n at "+wrapCallSite(r[u],i));i.nextPosition=i.curPosition}i.curPosition=i.nextPosition=null;return o+a.reverse().join("")}function getErrorSource(e){var r=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(e.stack);if(r){var n=r[1];var t=+r[2];var o=+r[3];var a=p[n];if(!a&&i&&i.existsSync(n)){try{a=i.readFileSync(n,"utf8")}catch(e){a=""}}if(a){var u=a.split(/(?:\r\n|\r|\n)/)[t-1];if(u){return n+":"+t+"\n"+u+"\n"+new Array(o).join(" ")+"^"}}}return null}function printErrorAndExit(e){var r=getErrorSource(e);var n=globalProcessStderr();if(n&&n._handle&&n._handle.setBlocking){n._handle.setBlocking(true)}if(r){console.error();console.error(r)}console.error(e.stack);globalProcessExit(1)}function shimEmitUncaughtException(){var e=process.emit;process.emit=function(r){if(r==="uncaughtException"){var n=arguments[1]&&arguments[1].stack;var t=this.listeners(r).length>0;if(n&&!t){return printErrorAndExit(arguments[1])}}return e.apply(this,arguments)}}var S=d.slice(0);var _=h.slice(0);r.wrapCallSite=wrapCallSite;r.getErrorSource=getErrorSource;r.mapSourcePosition=mapSourcePosition;r.retrieveSourceMap=v;r.install=function(r){r=r||{};if(r.environment){c=r.environment;if(["node","browser","auto"].indexOf(c)===-1){throw new Error("environment "+c+" was unknown. Available options are {auto, browser, node}")}}if(r.retrieveFile){if(r.overrideRetrieveFile){d.length=0}d.unshift(r.retrieveFile)}if(r.retrieveSourceMap){if(r.overrideRetrieveSourceMap){h.length=0}h.unshift(r.retrieveSourceMap)}if(r.hookRequire&&!isInBrowser()){var n=dynamicRequire(e,"module");var t=n.prototype._compile;if(!t.__sourceMapSupport){n.prototype._compile=function(e,r){p[r]=e;f[r]=undefined;return t.call(this,e,r)};n.prototype._compile.__sourceMapSupport=true}}if(!l){l="emptyCacheBetweenOperations"in r?r.emptyCacheBetweenOperations:false}if(!u){u=true;Error.prepareStackTrace=prepareStackTrace}if(!s){var o="handleUncaughtExceptions"in r?r.handleUncaughtExceptions:true;try{var i=dynamicRequire(e,"worker_threads");if(i.isMainThread===false){o=false}}catch(e){}if(o&&hasGlobalProcessEventEmitter()){s=true;shimEmitUncaughtException()}}};r.resetRetrieveHandlers=function(){d.length=0;h.length=0;d=S.slice(0);h=_.slice(0);v=handlerExec(h);m=handlerExec(d)}},517:(e,r,n)=>{var t=n(297);var o=Object.prototype.hasOwnProperty;var i=typeof Map!=="undefined";function ArraySet(){this._array=[];this._set=i?new Map:Object.create(null)}ArraySet.fromArray=function ArraySet_fromArray(e,r){var n=new ArraySet;for(var t=0,o=e.length;t=0){return r}}else{var n=t.toSetString(e);if(o.call(this._set,n)){return this._set[n]}}throw new Error('"'+e+'" is not in the set.')};ArraySet.prototype.at=function ArraySet_at(e){if(e>=0&&e{var t=n(158);var o=5;var i=1<>1;return r?-n:n}r.encode=function base64VLQ_encode(e){var r="";var n;var i=toVLQSigned(e);do{n=i&a;i>>>=o;if(i>0){n|=u}r+=t.encode(n)}while(i>0);return r};r.decode=function base64VLQ_decode(e,r,n){var i=e.length;var s=0;var l=0;var c,p;do{if(r>=i){throw new Error("Expected more digits in base 64 VLQ value.")}p=t.decode(e.charCodeAt(r++));if(p===-1){throw new Error("Invalid base64 digit: "+e.charAt(r-1))}c=!!(p&u);p&=a;s=s+(p<{var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");r.encode=function(e){if(0<=e&&e{r.GREATEST_LOWER_BOUND=1;r.LEAST_UPPER_BOUND=2;function recursiveSearch(e,n,t,o,i,a){var u=Math.floor((n-e)/2)+e;var s=i(t,o[u],true);if(s===0){return u}else if(s>0){if(n-u>1){return recursiveSearch(u,n,t,o,i,a)}if(a==r.LEAST_UPPER_BOUND){return n1){return recursiveSearch(e,u,t,o,i,a)}if(a==r.LEAST_UPPER_BOUND){return u}else{return e<0?-1:e}}}r.search=function search(e,n,t,o){if(n.length===0){return-1}var i=recursiveSearch(-1,n.length,e,n,t,o||r.GREATEST_LOWER_BOUND);if(i<0){return-1}while(i-1>=0){if(t(n[i],n[i-1],true)!==0){break}--i}return i}},24:(e,r,n)=>{var t=n(297);function generatedPositionAfter(e,r){var n=e.generatedLine;var o=r.generatedLine;var i=e.generatedColumn;var a=r.generatedColumn;return o>n||o==n&&a>=i||t.compareByGeneratedPositionsInflated(e,r)<=0}function MappingList(){this._array=[];this._sorted=true;this._last={generatedLine:-1,generatedColumn:0}}MappingList.prototype.unsortedForEach=function MappingList_forEach(e,r){this._array.forEach(e,r)};MappingList.prototype.add=function MappingList_add(e){if(generatedPositionAfter(this._last,e)){this._last=e;this._array.push(e)}else{this._sorted=false;this._array.push(e)}};MappingList.prototype.toArray=function MappingList_toArray(){if(!this._sorted){this._array.sort(t.compareByGeneratedPositionsInflated);this._sorted=true}return this._array};r.P=MappingList},299:(e,r)=>{function swap(e,r,n){var t=e[r];e[r]=e[n];e[n]=t}function randomIntInRange(e,r){return Math.round(e+Math.random()*(r-e))}function doQuickSort(e,r,n,t){if(n{var t;var o=n(297);var i=n(197);var a=n(517).C;var u=n(818);var s=n(299).g;function SourceMapConsumer(e,r){var n=e;if(typeof e==="string"){n=o.parseSourceMapInput(e)}return n.sections!=null?new IndexedSourceMapConsumer(n,r):new BasicSourceMapConsumer(n,r)}SourceMapConsumer.fromSourceMap=function(e,r){return BasicSourceMapConsumer.fromSourceMap(e,r)};SourceMapConsumer.prototype._version=3;SourceMapConsumer.prototype.__generatedMappings=null;Object.defineProperty(SourceMapConsumer.prototype,"_generatedMappings",{configurable:true,enumerable:true,get:function(){if(!this.__generatedMappings){this._parseMappings(this._mappings,this.sourceRoot)}return this.__generatedMappings}});SourceMapConsumer.prototype.__originalMappings=null;Object.defineProperty(SourceMapConsumer.prototype,"_originalMappings",{configurable:true,enumerable:true,get:function(){if(!this.__originalMappings){this._parseMappings(this._mappings,this.sourceRoot)}return this.__originalMappings}});SourceMapConsumer.prototype._charIsMappingSeparator=function SourceMapConsumer_charIsMappingSeparator(e,r){var n=e.charAt(r);return n===";"||n===","};SourceMapConsumer.prototype._parseMappings=function SourceMapConsumer_parseMappings(e,r){throw new Error("Subclasses must implement _parseMappings")};SourceMapConsumer.GENERATED_ORDER=1;SourceMapConsumer.ORIGINAL_ORDER=2;SourceMapConsumer.GREATEST_LOWER_BOUND=1;SourceMapConsumer.LEAST_UPPER_BOUND=2;SourceMapConsumer.prototype.eachMapping=function SourceMapConsumer_eachMapping(e,r,n){var t=r||null;var i=n||SourceMapConsumer.GENERATED_ORDER;var a;switch(i){case SourceMapConsumer.GENERATED_ORDER:a=this._generatedMappings;break;case SourceMapConsumer.ORIGINAL_ORDER:a=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var u=this.sourceRoot;a.map((function(e){var r=e.source===null?null:this._sources.at(e.source);r=o.computeSourceURL(u,r,this._sourceMapURL);return{source:r,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:e.name===null?null:this._names.at(e.name)}}),this).forEach(e,t)};SourceMapConsumer.prototype.allGeneratedPositionsFor=function SourceMapConsumer_allGeneratedPositionsFor(e){var r=o.getArg(e,"line");var n={source:o.getArg(e,"source"),originalLine:r,originalColumn:o.getArg(e,"column",0)};n.source=this._findSourceIndex(n.source);if(n.source<0){return[]}var t=[];var a=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",o.compareByOriginalPositions,i.LEAST_UPPER_BOUND);if(a>=0){var u=this._originalMappings[a];if(e.column===undefined){var s=u.originalLine;while(u&&u.originalLine===s){t.push({line:o.getArg(u,"generatedLine",null),column:o.getArg(u,"generatedColumn",null),lastColumn:o.getArg(u,"lastGeneratedColumn",null)});u=this._originalMappings[++a]}}else{var l=u.originalColumn;while(u&&u.originalLine===r&&u.originalColumn==l){t.push({line:o.getArg(u,"generatedLine",null),column:o.getArg(u,"generatedColumn",null),lastColumn:o.getArg(u,"lastGeneratedColumn",null)});u=this._originalMappings[++a]}}}return t};r.SourceMapConsumer=SourceMapConsumer;function BasicSourceMapConsumer(e,r){var n=e;if(typeof e==="string"){n=o.parseSourceMapInput(e)}var t=o.getArg(n,"version");var i=o.getArg(n,"sources");var u=o.getArg(n,"names",[]);var s=o.getArg(n,"sourceRoot",null);var l=o.getArg(n,"sourcesContent",null);var c=o.getArg(n,"mappings");var p=o.getArg(n,"file",null);if(t!=this._version){throw new Error("Unsupported version: "+t)}if(s){s=o.normalize(s)}i=i.map(String).map(o.normalize).map((function(e){return s&&o.isAbsolute(s)&&o.isAbsolute(e)?o.relative(s,e):e}));this._names=a.fromArray(u.map(String),true);this._sources=a.fromArray(i,true);this._absoluteSources=this._sources.toArray().map((function(e){return o.computeSourceURL(s,e,r)}));this.sourceRoot=s;this.sourcesContent=l;this._mappings=c;this._sourceMapURL=r;this.file=p}BasicSourceMapConsumer.prototype=Object.create(SourceMapConsumer.prototype);BasicSourceMapConsumer.prototype.consumer=SourceMapConsumer;BasicSourceMapConsumer.prototype._findSourceIndex=function(e){var r=e;if(this.sourceRoot!=null){r=o.relative(this.sourceRoot,r)}if(this._sources.has(r)){return this._sources.indexOf(r)}var n;for(n=0;n1){v.source=l+_[1];l+=_[1];v.originalLine=i+_[2];i=v.originalLine;v.originalLine+=1;v.originalColumn=a+_[3];a=v.originalColumn;if(_.length>4){v.name=c+_[4];c+=_[4]}}m.push(v);if(typeof v.originalLine==="number"){h.push(v)}}}s(m,o.compareByGeneratedPositionsDeflated);this.__generatedMappings=m;s(h,o.compareByOriginalPositions);this.__originalMappings=h};BasicSourceMapConsumer.prototype._findMapping=function SourceMapConsumer_findMapping(e,r,n,t,o,a){if(e[n]<=0){throw new TypeError("Line must be greater than or equal to 1, got "+e[n])}if(e[t]<0){throw new TypeError("Column must be greater than or equal to 0, got "+e[t])}return i.search(e,r,o,a)};BasicSourceMapConsumer.prototype.computeColumnSpans=function SourceMapConsumer_computeColumnSpans(){for(var e=0;e=0){var t=this._generatedMappings[n];if(t.generatedLine===r.generatedLine){var i=o.getArg(t,"source",null);if(i!==null){i=this._sources.at(i);i=o.computeSourceURL(this.sourceRoot,i,this._sourceMapURL)}var a=o.getArg(t,"name",null);if(a!==null){a=this._names.at(a)}return{source:i,line:o.getArg(t,"originalLine",null),column:o.getArg(t,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}};BasicSourceMapConsumer.prototype.hasContentsOfAllSources=function BasicSourceMapConsumer_hasContentsOfAllSources(){if(!this.sourcesContent){return false}return this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some((function(e){return e==null}))};BasicSourceMapConsumer.prototype.sourceContentFor=function SourceMapConsumer_sourceContentFor(e,r){if(!this.sourcesContent){return null}var n=this._findSourceIndex(e);if(n>=0){return this.sourcesContent[n]}var t=e;if(this.sourceRoot!=null){t=o.relative(this.sourceRoot,t)}var i;if(this.sourceRoot!=null&&(i=o.urlParse(this.sourceRoot))){var a=t.replace(/^file:\/\//,"");if(i.scheme=="file"&&this._sources.has(a)){return this.sourcesContent[this._sources.indexOf(a)]}if((!i.path||i.path=="/")&&this._sources.has("/"+t)){return this.sourcesContent[this._sources.indexOf("/"+t)]}}if(r){return null}else{throw new Error('"'+t+'" is not in the SourceMap.')}};BasicSourceMapConsumer.prototype.generatedPositionFor=function SourceMapConsumer_generatedPositionFor(e){var r=o.getArg(e,"source");r=this._findSourceIndex(r);if(r<0){return{line:null,column:null,lastColumn:null}}var n={source:r,originalLine:o.getArg(e,"line"),originalColumn:o.getArg(e,"column")};var t=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",o.compareByOriginalPositions,o.getArg(e,"bias",SourceMapConsumer.GREATEST_LOWER_BOUND));if(t>=0){var i=this._originalMappings[t];if(i.source===n.source){return{line:o.getArg(i,"generatedLine",null),column:o.getArg(i,"generatedColumn",null),lastColumn:o.getArg(i,"lastGeneratedColumn",null)}}}return{line:null,column:null,lastColumn:null}};t=BasicSourceMapConsumer;function IndexedSourceMapConsumer(e,r){var n=e;if(typeof e==="string"){n=o.parseSourceMapInput(e)}var t=o.getArg(n,"version");var i=o.getArg(n,"sections");if(t!=this._version){throw new Error("Unsupported version: "+t)}this._sources=new a;this._names=new a;var u={line:-1,column:0};this._sections=i.map((function(e){if(e.url){throw new Error("Support for url field in sections not implemented.")}var n=o.getArg(e,"offset");var t=o.getArg(n,"line");var i=o.getArg(n,"column");if(t{var t=n(818);var o=n(297);var i=n(517).C;var a=n(24).P;function SourceMapGenerator(e){if(!e){e={}}this._file=o.getArg(e,"file",null);this._sourceRoot=o.getArg(e,"sourceRoot",null);this._skipValidation=o.getArg(e,"skipValidation",false);this._sources=new i;this._names=new i;this._mappings=new a;this._sourcesContents=null}SourceMapGenerator.prototype._version=3;SourceMapGenerator.fromSourceMap=function SourceMapGenerator_fromSourceMap(e){var r=e.sourceRoot;var n=new SourceMapGenerator({file:e.file,sourceRoot:r});e.eachMapping((function(e){var t={generated:{line:e.generatedLine,column:e.generatedColumn}};if(e.source!=null){t.source=e.source;if(r!=null){t.source=o.relative(r,t.source)}t.original={line:e.originalLine,column:e.originalColumn};if(e.name!=null){t.name=e.name}}n.addMapping(t)}));e.sources.forEach((function(t){var i=t;if(r!==null){i=o.relative(r,t)}if(!n._sources.has(i)){n._sources.add(i)}var a=e.sourceContentFor(t);if(a!=null){n.setSourceContent(t,a)}}));return n};SourceMapGenerator.prototype.addMapping=function SourceMapGenerator_addMapping(e){var r=o.getArg(e,"generated");var n=o.getArg(e,"original",null);var t=o.getArg(e,"source",null);var i=o.getArg(e,"name",null);if(!this._skipValidation){this._validateMapping(r,n,t,i)}if(t!=null){t=String(t);if(!this._sources.has(t)){this._sources.add(t)}}if(i!=null){i=String(i);if(!this._names.has(i)){this._names.add(i)}}this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:t,name:i})};SourceMapGenerator.prototype.setSourceContent=function SourceMapGenerator_setSourceContent(e,r){var n=e;if(this._sourceRoot!=null){n=o.relative(this._sourceRoot,n)}if(r!=null){if(!this._sourcesContents){this._sourcesContents=Object.create(null)}this._sourcesContents[o.toSetString(n)]=r}else if(this._sourcesContents){delete this._sourcesContents[o.toSetString(n)];if(Object.keys(this._sourcesContents).length===0){this._sourcesContents=null}}};SourceMapGenerator.prototype.applySourceMap=function SourceMapGenerator_applySourceMap(e,r,n){var t=r;if(r==null){if(e.file==null){throw new Error("SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, "+'or the source map\'s "file" property. Both were omitted.')}t=e.file}var a=this._sourceRoot;if(a!=null){t=o.relative(a,t)}var u=new i;var s=new i;this._mappings.unsortedForEach((function(r){if(r.source===t&&r.originalLine!=null){var i=e.originalPositionFor({line:r.originalLine,column:r.originalColumn});if(i.source!=null){r.source=i.source;if(n!=null){r.source=o.join(n,r.source)}if(a!=null){r.source=o.relative(a,r.source)}r.originalLine=i.line;r.originalColumn=i.column;if(i.name!=null){r.name=i.name}}}var l=r.source;if(l!=null&&!u.has(l)){u.add(l)}var c=r.name;if(c!=null&&!s.has(c)){s.add(c)}}),this);this._sources=u;this._names=s;e.sources.forEach((function(r){var t=e.sourceContentFor(r);if(t!=null){if(n!=null){r=o.join(n,r)}if(a!=null){r=o.relative(a,r)}this.setSourceContent(r,t)}}),this)};SourceMapGenerator.prototype._validateMapping=function SourceMapGenerator_validateMapping(e,r,n,t){if(r&&typeof r.line!=="number"&&typeof r.column!=="number"){throw new Error("original.line and original.column are not numbers -- you probably meant to omit "+"the original mapping entirely and only map the generated position. If so, pass "+"null for the original mapping instead of an object with empty or null values.")}if(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!r&&!n&&!t){return}else if(e&&"line"in e&&"column"in e&&r&&"line"in r&&"column"in r&&e.line>0&&e.column>=0&&r.line>0&&r.column>=0&&n){return}else{throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:r,name:t}))}};SourceMapGenerator.prototype._serializeMappings=function SourceMapGenerator_serializeMappings(){var e=0;var r=1;var n=0;var i=0;var a=0;var u=0;var s="";var l;var c;var p;var f;var g=this._mappings.toArray();for(var d=0,h=g.length;d0){if(!o.compareByGeneratedPositionsInflated(c,g[d-1])){continue}l+=","}}l+=t.encode(c.generatedColumn-e);e=c.generatedColumn;if(c.source!=null){f=this._sources.indexOf(c.source);l+=t.encode(f-u);u=f;l+=t.encode(c.originalLine-1-i);i=c.originalLine-1;l+=t.encode(c.originalColumn-n);n=c.originalColumn;if(c.name!=null){p=this._names.indexOf(c.name);l+=t.encode(p-a);a=p}}s+=l}return s};SourceMapGenerator.prototype._generateSourcesContent=function SourceMapGenerator_generateSourcesContent(e,r){return e.map((function(e){if(!this._sourcesContents){return null}if(r!=null){e=o.relative(r,e)}var n=o.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null}),this)};SourceMapGenerator.prototype.toJSON=function SourceMapGenerator_toJSON(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null){e.file=this._file}if(this._sourceRoot!=null){e.sourceRoot=this._sourceRoot}if(this._sourcesContents){e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)}return e};SourceMapGenerator.prototype.toString=function SourceMapGenerator_toString(){return JSON.stringify(this.toJSON())};r.x=SourceMapGenerator},565:(e,r,n)=>{var t;var o=n(163).x;var i=n(297);var a=/(\r?\n)/;var u=10;var s="$$$isSourceNode$$$";function SourceNode(e,r,n,t,o){this.children=[];this.sourceContents={};this.line=e==null?null:e;this.column=r==null?null:r;this.source=n==null?null:n;this.name=o==null?null:o;this[s]=true;if(t!=null)this.add(t)}SourceNode.fromStringWithSourceMap=function SourceNode_fromStringWithSourceMap(e,r,n){var t=new SourceNode;var o=e.split(a);var u=0;var shiftNextLine=function(){var e=getNextLine();var r=getNextLine()||"";return e+r;function getNextLine(){return u=0;r--){this.prepend(e[r])}}else if(e[s]||typeof e==="string"){this.children.unshift(e)}else{throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e)}return this};SourceNode.prototype.walk=function SourceNode_walk(e){var r;for(var n=0,t=this.children.length;n0){r=[];for(n=0;n{function getArg(e,r,n){if(r in e){return e[r]}else if(arguments.length===3){return n}else{throw new Error('"'+r+'" is a required argument.')}}r.getArg=getArg;var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;var t=/^data:.+\,.+$/;function urlParse(e){var r=e.match(n);if(!r){return null}return{scheme:r[1],auth:r[2],host:r[3],port:r[4],path:r[5]}}r.urlParse=urlParse;function urlGenerate(e){var r="";if(e.scheme){r+=e.scheme+":"}r+="//";if(e.auth){r+=e.auth+"@"}if(e.host){r+=e.host}if(e.port){r+=":"+e.port}if(e.path){r+=e.path}return r}r.urlGenerate=urlGenerate;function normalize(e){var n=e;var t=urlParse(e);if(t){if(!t.path){return e}n=t.path}var o=r.isAbsolute(n);var i=n.split(/\/+/);for(var a,u=0,s=i.length-1;s>=0;s--){a=i[s];if(a==="."){i.splice(s,1)}else if(a===".."){u++}else if(u>0){if(a===""){i.splice(s+1,u);u=0}else{i.splice(s,2);u--}}}n=i.join("/");if(n===""){n=o?"/":"."}if(t){t.path=n;return urlGenerate(t)}return n}r.normalize=normalize;function join(e,r){if(e===""){e="."}if(r===""){r="."}var n=urlParse(r);var o=urlParse(e);if(o){e=o.path||"/"}if(n&&!n.scheme){if(o){n.scheme=o.scheme}return urlGenerate(n)}if(n||r.match(t)){return r}if(o&&!o.host&&!o.path){o.host=r;return urlGenerate(o)}var i=r.charAt(0)==="/"?r:normalize(e.replace(/\/+$/,"")+"/"+r);if(o){o.path=i;return urlGenerate(o)}return i}r.join=join;r.isAbsolute=function(e){return e.charAt(0)==="/"||n.test(e)};function relative(e,r){if(e===""){e="."}e=e.replace(/\/$/,"");var n=0;while(r.indexOf(e+"/")!==0){var t=e.lastIndexOf("/");if(t<0){return r}e=e.slice(0,t);if(e.match(/^([^\/]+:\/)?\/*$/)){return r}++n}return Array(n+1).join("../")+r.substr(e.length+1)}r.relative=relative;var o=function(){var e=Object.create(null);return!("__proto__"in e)}();function identity(e){return e}function toSetString(e){if(isProtoString(e)){return"$"+e}return e}r.toSetString=o?identity:toSetString;function fromSetString(e){if(isProtoString(e)){return e.slice(1)}return e}r.fromSetString=o?identity:fromSetString;function isProtoString(e){if(!e){return false}var r=e.length;if(r<9){return false}if(e.charCodeAt(r-1)!==95||e.charCodeAt(r-2)!==95||e.charCodeAt(r-3)!==111||e.charCodeAt(r-4)!==116||e.charCodeAt(r-5)!==111||e.charCodeAt(r-6)!==114||e.charCodeAt(r-7)!==112||e.charCodeAt(r-8)!==95||e.charCodeAt(r-9)!==95){return false}for(var n=r-10;n>=0;n--){if(e.charCodeAt(n)!==36){return false}}return true}function compareByOriginalPositions(e,r,n){var t=strcmp(e.source,r.source);if(t!==0){return t}t=e.originalLine-r.originalLine;if(t!==0){return t}t=e.originalColumn-r.originalColumn;if(t!==0||n){return t}t=e.generatedColumn-r.generatedColumn;if(t!==0){return t}t=e.generatedLine-r.generatedLine;if(t!==0){return t}return strcmp(e.name,r.name)}r.compareByOriginalPositions=compareByOriginalPositions;function compareByGeneratedPositionsDeflated(e,r,n){var t=e.generatedLine-r.generatedLine;if(t!==0){return t}t=e.generatedColumn-r.generatedColumn;if(t!==0||n){return t}t=strcmp(e.source,r.source);if(t!==0){return t}t=e.originalLine-r.originalLine;if(t!==0){return t}t=e.originalColumn-r.originalColumn;if(t!==0){return t}return strcmp(e.name,r.name)}r.compareByGeneratedPositionsDeflated=compareByGeneratedPositionsDeflated;function strcmp(e,r){if(e===r){return 0}if(e===null){return 1}if(r===null){return-1}if(e>r){return 1}return-1}function compareByGeneratedPositionsInflated(e,r){var n=e.generatedLine-r.generatedLine;if(n!==0){return n}n=e.generatedColumn-r.generatedColumn;if(n!==0){return n}n=strcmp(e.source,r.source);if(n!==0){return n}n=e.originalLine-r.originalLine;if(n!==0){return n}n=e.originalColumn-r.originalColumn;if(n!==0){return n}return strcmp(e.name,r.name)}r.compareByGeneratedPositionsInflated=compareByGeneratedPositionsInflated;function parseSourceMapInput(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}r.parseSourceMapInput=parseSourceMapInput;function computeSourceURL(e,r,n){r=r||"";if(e){if(e[e.length-1]!=="/"&&r[0]!=="/"){e+="/"}r=e+r}if(n){var t=urlParse(n);if(!t){throw new Error("sourceMapURL could not be parsed")}if(t.path){var o=t.path.lastIndexOf("/");if(o>=0){t.path=t.path.substring(0,o+1)}}r=join(urlGenerate(t),r)}return normalize(r)}r.computeSourceURL=computeSourceURL},927:(e,r,n)=>{n(163).x;r.SourceMapConsumer=n(684).SourceMapConsumer;n(565)},896:e=>{"use strict";e.exports=require("fs")},928:e=>{"use strict";e.exports=require("path")}};var r={};function __webpack_require__(n){var t=r[n];if(t!==undefined){return t.exports}var o=r[n]={id:n,loaded:false,exports:{}};var i=true;try{e[n](o,o.exports,__webpack_require__);i=false}finally{if(i)delete r[n]}o.loaded=true;return o.exports}(()=>{__webpack_require__.nmd=e=>{e.paths=[];if(!e.children)e.children=[];return e}})();if(typeof __webpack_require__!=="undefined")__webpack_require__.ab=__dirname+"/";var n={};__webpack_require__(599).install();module.exports=n})(); --------------------------------------------------------------------------------