├── .nvmrc ├── .gitattributes ├── dist ├── package.json ├── licenses.txt └── sourcemap-register.cjs ├── renovate.json ├── vitest.config.ts ├── .vscode └── settings.json ├── src ├── github-types.ts ├── constants.ts ├── main.ts ├── main.test.ts ├── biber.ts ├── release.ts ├── setup-tectonic.ts ├── biber.test.ts └── release.test.ts ├── .github └── workflows │ ├── follow-version-tag.yml │ ├── test.yml │ └── update-dist.yml ├── tsconfig.json ├── action.yml ├── biome.json ├── LICENSE ├── package.json ├── .gitignore ├── CODE_OF_CONDUCT.md └── README.md /.nvmrc: -------------------------------------------------------------------------------- 1 | 24.11.1 -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | dist/** -diff linguist-generated=true -------------------------------------------------------------------------------- /dist/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "module" 3 | } 4 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["github>wtfjoke/renovate-config-ts"], 3 | "commitMessagePrefix": "⬆️" 4 | } 5 | -------------------------------------------------------------------------------- /vitest.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "vitest/config"; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | dir: "./src", 7 | }, 8 | }); 9 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "[typescript]": { 3 | "editor.defaultFormatter": "biomejs.biome" 4 | }, 5 | "[json]": { 6 | "editor.defaultFormatter": "biomejs.biome" 7 | }, 8 | "[jsonc]": { 9 | "editor.defaultFormatter": "biomejs.biome" 10 | }, 11 | "cSpell.words": ["biber"] 12 | } 13 | -------------------------------------------------------------------------------- /src/github-types.ts: -------------------------------------------------------------------------------- 1 | import type { getOctokit } from "@actions/github"; 2 | import type { Endpoints } from "@octokit/types"; 3 | 4 | export type GithubReleaseAssets = 5 | Endpoints["GET /repos/{owner}/{repo}/releases/{release_id}"]["response"]["data"]["assets"]; 6 | export type GithubOktokit = ReturnType; 7 | -------------------------------------------------------------------------------- /src/constants.ts: -------------------------------------------------------------------------------- 1 | export const RELEASE_TAG_IDENTIFIER = "tectonic@"; 2 | export const REPO_OWNER = "tectonic-typesetting"; 3 | export const TECTONIC = "tectonic"; 4 | export const BIBER_DL_BASE_PATH = 5 | "https://sourceforge.net/projects/biblatex-biber/files/biblatex-biber"; 6 | export const BINARIES = "binaries"; 7 | export const DOWNLOAD = "download"; 8 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import { setFailed } from "@actions/core"; 2 | import { setUpTectonic } from "./setup-tectonic.js"; 3 | 4 | const run = async () => { 5 | try { 6 | await setUpTectonic(); 7 | } catch (error: unknown) { 8 | if (error instanceof Error || typeof error === "string") { 9 | const message = error instanceof Error ? error.message : error; 10 | setFailed(message); 11 | } else { 12 | setFailed("Unknown error"); 13 | } 14 | } 15 | }; 16 | 17 | void run(); 18 | -------------------------------------------------------------------------------- /src/main.test.ts: -------------------------------------------------------------------------------- 1 | import { type ExecFileSyncOptions, execFileSync } from "node:child_process"; 2 | import { join } from "node:path"; 3 | import { env, execPath } from "node:process"; 4 | 5 | // shows how the runner will run a javascript action with env / stdout protocol 6 | test.skip("runs", () => { 7 | env["INPUT_GITHUB-TOKEN"] = "IAMAGITHUBTOKEN"; 8 | const np = execPath; 9 | const ip = join(__dirname, "..", "lib", "main.js"); 10 | const options: ExecFileSyncOptions = { 11 | env, 12 | }; 13 | console.log(execFileSync(np, [ip], options).toString()); 14 | }); 15 | -------------------------------------------------------------------------------- /.github/workflows/follow-version-tag.yml: -------------------------------------------------------------------------------- 1 | name: 'On Release' 2 | on: 3 | release: 4 | types: [published] 5 | 6 | permissions: 7 | contents: write 8 | 9 | jobs: 10 | update-tag: 11 | name: 'Update major version tag to latest version' 12 | runs-on: ubuntu-latest 13 | env: 14 | TAG_NAME: ${{github.event.release.tag_name}} 15 | steps: 16 | - uses: actions/checkout@v6 17 | - name: Update major version tag 18 | run: | 19 | major=`echo $TAG_NAME | cut -d. -f1` 20 | git tag $major 21 | git push -f origin $major 22 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "esModuleInterop": true, 4 | "skipLibCheck": true, 5 | "target": "es2022", 6 | "allowJs": true, 7 | "resolveJsonModule": true, 8 | "moduleDetection": "force", 9 | "isolatedModules": true, 10 | "verbatimModuleSyntax": true, 11 | 12 | /* Strictness */ 13 | "strict": true, 14 | "noUncheckedIndexedAccess": true, 15 | "noImplicitOverride": true, 16 | 17 | /* If transpiling with TypeScript: */ 18 | "module": "NodeNext", 19 | "outDir": "lib", 20 | "sourceMap": true, 21 | 22 | /* AND if you're building for a library: */ 23 | "declaration": true, 24 | 25 | /* If your code doesn't run in the DOM: */ 26 | "lib": ["es2022"], 27 | 28 | /* vitest globals */ 29 | "types": ["vitest/globals"] 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: 'Setup Tectonic' 2 | description: 'Sets up Tectonic for Github Actions to compile your LaTeX documents' 3 | author: 'WtfJoke (Manuel)' 4 | 5 | inputs: 6 | github-token: 7 | required: false 8 | description: 'The GITHUB_TOKEN secret. Used for querying tectonic releases' 9 | default: ${{ github.token }} 10 | tectonic-version: 11 | required: false 12 | description: 'The version of tectonic to install. A value of `latest` will install the latest version of tectonic. Defaults to `latest`.' 13 | default: 'latest' 14 | biber-version: 15 | required: false 16 | description: 'The version of biber to install. A value of `latest` will install the latest version of biber.' 17 | 18 | runs: 19 | using: 'node24' 20 | main: 'dist/index.js' 21 | branding: 22 | icon: book-open 23 | color: gray-dark 24 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: 'CI' 2 | on: 3 | pull_request: 4 | push: 5 | 6 | jobs: 7 | build: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@v6 11 | - name: Setup Node.js 12 | uses: actions/setup-node@v6 13 | with: 14 | node-version-file: '.nvmrc' 15 | cache: 'npm' 16 | - name: Install dependencies 17 | run: | 18 | npm install 19 | - name: Build + package + tests 20 | run: | 21 | npm run all 22 | test: # make sure the action works on a clean machine without building 23 | strategy: 24 | matrix: 25 | os: [windows-latest, ubuntu-latest, macos-latest] 26 | runs-on: ${{ matrix.os }} 27 | steps: 28 | - uses: actions/checkout@v6 29 | - uses: ./ 30 | with: 31 | github-token: ${{ secrets.GITHUB_TOKEN }} 32 | tectonic-version: 0.15.0 33 | biber-version: 2.17 34 | - name: Tectonic version 35 | run: tectonic --version 36 | - name: Biber version 37 | run: biber --version 38 | -------------------------------------------------------------------------------- /biome.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://biomejs.dev/schemas/2.3.8/schema.json", 3 | "vcs": { 4 | "enabled": true, 5 | "clientKind": "git", 6 | "useIgnoreFile": true 7 | }, 8 | "files": { 9 | "ignoreUnknown": false, 10 | "includes": ["**", "!dist"] 11 | }, 12 | "formatter": { 13 | "enabled": true, 14 | "indentStyle": "space" 15 | }, 16 | "linter": { 17 | "enabled": true, 18 | "rules": { 19 | "nursery": { 20 | "noFloatingPromises": "error", 21 | "noMisusedPromises": "error", 22 | "noShadow": "error", 23 | "noUnnecessaryConditions": "error" 24 | }, 25 | "style": { 26 | "useConsistentTypeDefinitions": "error" 27 | }, 28 | "suspicious": { 29 | "noNonNullAssertedOptionalChain": "error" 30 | } 31 | } 32 | }, 33 | "javascript": { 34 | "formatter": { 35 | "quoteStyle": "double" 36 | } 37 | }, 38 | "assist": { 39 | "enabled": true, 40 | "actions": { 41 | "source": { 42 | "organizeImports": "on" 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2021 WtfJoke (Manuel) 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. -------------------------------------------------------------------------------- /.github/workflows/update-dist.yml: -------------------------------------------------------------------------------- 1 | name: 'Update dist folder' 2 | on: 3 | push: 4 | branches-ignore: renovate/* 5 | 6 | jobs: 7 | dist-changed: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@v6 11 | - name: Setup Node.js 12 | uses: actions/setup-node@v6 13 | with: 14 | node-version-file: '.nvmrc' 15 | cache: 'npm' 16 | - name: Install dependencies 17 | run: | 18 | npm install 19 | - name: Package (update dist folder) 20 | run: | 21 | npm run update-dist 22 | - name: Did dist folder changed? 23 | run: | 24 | EXIT_CODE=0 25 | git update-index --refresh dist/* && git diff-index --quiet HEAD dist || EXIT_CODE=$? 26 | # Set environment variable 27 | echo "EXIT_CODE_DIST_CHANGED=$EXIT_CODE" >> $GITHUB_ENV 28 | - name: Commit dist folder 29 | if: ${{ env.EXIT_CODE_DIST_CHANGED == 1 }} 30 | run: | 31 | git config --global user.name 'Octocat' 32 | git config --global user.email 'octocat@users.noreply.github.com' 33 | git add dist/ 34 | git commit -m "🧹 Update dist folder" 35 | git push 36 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "setup-tectonic", 3 | "version": "1.1.0", 4 | "private": true, 5 | "description": "Sets up Tectonic for Github Actions", 6 | "main": "lib/src/main.js", 7 | "type": "module", 8 | "scripts": { 9 | "build": "tsc", 10 | "format": "npx biome format --write", 11 | "format-check": "npx biome format", 12 | "lint": "npx biome lint --write", 13 | "format+lint": "npx biome check --write", 14 | "package": "ncc build --source-map --license licenses.txt", 15 | "test": "vitest", 16 | "coverage": "vitest run --coverage", 17 | "update-dist": "npm run build && npm run package", 18 | "all": "npm run build && npm run format+lint && npm run lint && npm run package && npm test" 19 | }, 20 | "repository": { 21 | "type": "git", 22 | "url": "git+https://github.com/WtfJoke/setup-tectonic" 23 | }, 24 | "keywords": [ 25 | "actions", 26 | "tectonic", 27 | "setup" 28 | ], 29 | "author": "", 30 | "license": "MIT", 31 | "dependencies": { 32 | "@actions/core": "1.11.1", 33 | "@actions/github": "6.0.1", 34 | "@actions/io": "2.0.0", 35 | "@actions/tool-cache": "2.0.2", 36 | "semver": "7.7.3" 37 | }, 38 | "devDependencies": { 39 | "@biomejs/biome": "2.3.8", 40 | "@octokit/types": "16.0.0", 41 | "@types/node": "24.10.1", 42 | "@types/semver": "7.7.1", 43 | "@vercel/ncc": "0.38.4", 44 | "@vitest/coverage-v8": "4.0.15", 45 | "js-yaml": "4.1.1", 46 | "typescript": "5.9.3", 47 | "vitest": "4.0.15", 48 | "webpack": "5.103.0" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Dependency directory 2 | node_modules 3 | 4 | # Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore 5 | # Logs 6 | logs 7 | *.log 8 | npm-debug.log* 9 | yarn-debug.log* 10 | yarn-error.log* 11 | lerna-debug.log* 12 | 13 | # Diagnostic reports (https://nodejs.org/api/report.html) 14 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 15 | 16 | # Runtime data 17 | pids 18 | *.pid 19 | *.seed 20 | *.pid.lock 21 | 22 | # Directory for instrumented libs generated by jscoverage/JSCover 23 | lib-cov 24 | 25 | # Coverage directory used by tools like istanbul 26 | coverage 27 | *.lcov 28 | 29 | # nyc test coverage 30 | .nyc_output 31 | 32 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 33 | .grunt 34 | 35 | # Bower dependency directory (https://bower.io/) 36 | bower_components 37 | 38 | # node-waf configuration 39 | .lock-wscript 40 | 41 | # Compiled binary addons (https://nodejs.org/api/addons.html) 42 | build/Release 43 | 44 | # Dependency directories 45 | jspm_packages/ 46 | 47 | # TypeScript v1 declaration files 48 | typings/ 49 | 50 | # TypeScript cache 51 | *.tsbuildinfo 52 | 53 | # Optional npm cache directory 54 | .npm 55 | 56 | # Optional eslint cache 57 | .eslintcache 58 | 59 | # Optional REPL history 60 | .node_repl_history 61 | 62 | # Output of 'npm pack' 63 | *.tgz 64 | 65 | # Yarn Integrity file 66 | .yarn-integrity 67 | 68 | # dotenv environment variables file 69 | .env 70 | .env.test 71 | 72 | # parcel-bundler cache (https://parceljs.org/) 73 | .cache 74 | 75 | # next.js build output 76 | .next 77 | 78 | # nuxt.js build output 79 | .nuxt 80 | 81 | # vuepress build output 82 | .vuepress/dist 83 | 84 | # Serverless directories 85 | .serverless/ 86 | 87 | # FuseBox cache 88 | .fusebox/ 89 | 90 | # DynamoDB Local files 91 | .dynamodb/ 92 | 93 | # OS metadata 94 | .DS_Store 95 | Thumbs.db 96 | 97 | # Ignore built ts files 98 | src/runner/* 99 | lib/**/* -------------------------------------------------------------------------------- /src/biber.ts: -------------------------------------------------------------------------------- 1 | import os from "node:os"; 2 | import { debug } from "@actions/core"; 3 | import { downloadTool, extractTar, extractZip } from "@actions/tool-cache"; 4 | import { coerce, satisfies } from "semver"; 5 | import { BIBER_DL_BASE_PATH, BINARIES, DOWNLOAD } from "./constants.js"; 6 | 7 | export const validBiberVersion = (biberVersion: string) => { 8 | const biberSemVer = coerce(biberVersion); 9 | 10 | if (biberSemVer === null) { 11 | debug( 12 | `Invalid biber version: "${biberVersion}". Defaulting to latest version`, 13 | ); 14 | return "current"; 15 | } 16 | if (biberSemVer.patch !== 0) { 17 | return biberSemVer.version; 18 | } 19 | 20 | return `${biberSemVer.major.toFixed()}.${biberSemVer.minor.toFixed()}`; 21 | }; 22 | 23 | export const downloadBiber = async (biberVersion: string) => { 24 | const validVersion = validBiberVersion(biberVersion); 25 | const platform = os.platform(); 26 | const fileName = mapOsToFileName(platform); 27 | const url = buildDownloadURL(validVersion, fileName, platform); 28 | debug(`Downloading Biber from ${url}`); 29 | const archivePath = await downloadTool(url); 30 | 31 | debug("Extracting Biber"); 32 | let biberPath: string; 33 | if (fileName.endsWith(".zip")) { 34 | biberPath = await extractZip(archivePath); 35 | } else if (fileName.endsWith(".tar.gz")) { 36 | biberPath = await extractTar(archivePath); 37 | } else { 38 | throw new Error(`Unsupported archive format for biber: ${fileName}`); 39 | } 40 | debug(`Biber path is ${biberPath}`); 41 | 42 | return biberPath; 43 | }; 44 | 45 | export const buildDownloadURL = ( 46 | version: string, 47 | fileName: string, 48 | platform: string, 49 | ) => 50 | [ 51 | BIBER_DL_BASE_PATH, 52 | version, 53 | BINARIES, 54 | mapOsToIdentifier(platform, version), 55 | fileName, 56 | DOWNLOAD, 57 | ].join("/"); 58 | 59 | const mapOsToIdentifier = (platform: string, version: string) => { 60 | const mappings: Record = { 61 | win32: "Windows", 62 | darwin: isUsingNewMacOsNaming(version) ? "MacOS" : "OSX_Intel", 63 | linux: "Linux", 64 | }; 65 | return mappings[platform] ?? platform; 66 | }; 67 | 68 | const mapOsToFileName = (platform: string): string => { 69 | const platformFileNames: Record = { 70 | win32: "biber-MSWIN64.zip", 71 | darwin: "biber-darwin_x86_64.tar.gz", 72 | linux: "biber-linux_x86_64.tar.gz", 73 | }; 74 | const fileName = platformFileNames[platform]; 75 | if (!fileName) { 76 | throw new Error(`Unsupported platform for biber: ${platform}`); 77 | } 78 | return fileName; 79 | }; 80 | 81 | /** 82 | * Versions beginning with 2.17 uses 'MacOS' instead of 'OSX_Intel' as their platform identifier. 83 | * @see https://sourceforge.net/projects/biblatex-biber/files/biblatex-biber/2.17/ compared to https://sourceforge.net/projects/biblatex-biber/files/biblatex-biber/2.16/ 84 | * @param version - the validated biber version (semver or 'current') 85 | * @returns true if using the new naming scheme 86 | */ 87 | const isUsingNewMacOsNaming = (version: string) => 88 | // biome-ignore lint/style/noNonNullAssertion: we check version already before 89 | version === "current" || satisfies(coerce(version)!, ">=2.17"); 90 | -------------------------------------------------------------------------------- /src/release.ts: -------------------------------------------------------------------------------- 1 | import { getOctokit } from "@actions/github"; 2 | import { coerce, type SemVer, valid } from "semver"; 3 | import { RELEASE_TAG_IDENTIFIER, REPO_OWNER, TECTONIC } from "./constants.js"; 4 | import type { GithubOktokit, GithubReleaseAssets } from "./github-types.js"; 5 | 6 | export interface ReleaseAsset { 7 | name: string; 8 | url: string; 9 | } 10 | 11 | export class Release { 12 | id: number; 13 | name: string | null; 14 | version: string; 15 | semVerVersion: SemVer | null; 16 | tagName: string; 17 | assets: ReleaseAsset[]; 18 | 19 | constructor( 20 | id: number, 21 | tagName: string, 22 | assets: ReleaseAsset[], 23 | name: string | null, 24 | ) { 25 | this.id = id; 26 | this.name = name; 27 | this.version = tagName.replace(RELEASE_TAG_IDENTIFIER, ""); 28 | this.semVerVersion = coerce(this.version); 29 | this.tagName = tagName; 30 | this.assets = assets; 31 | } 32 | 33 | getAsset(platform: string): ReleaseAsset | undefined { 34 | const versionPrefix = `tectonic-${this.version}-x86_64`; 35 | const favourLinuxAppImage = 36 | this.semVerVersion != null && this.semVerVersion.minor <= 10; 37 | const platformFileNames: Record = { 38 | windows: `${versionPrefix}-pc-${platform}-msvc.zip`, 39 | darwin: `${versionPrefix}-apple-${platform}.tar.gz`, 40 | linux: favourLinuxAppImage 41 | ? `${versionPrefix}.AppImage` 42 | : `${versionPrefix}-unknown-linux-gnu.tar.gz`, 43 | }; 44 | const fileName = platformFileNames[platform]; 45 | return this.assets.find((ghAsset) => ghAsset.name === fileName); 46 | } 47 | } 48 | 49 | export const getTectonicRelease = async ( 50 | githubToken: string, 51 | version?: string, 52 | ) => { 53 | const octo = getOctokit(githubToken); 54 | const validVersion = valid(version); 55 | 56 | if (validVersion) { 57 | const { data: releaseData } = await octo.rest.repos.getReleaseByTag({ 58 | owner: REPO_OWNER, 59 | repo: TECTONIC, 60 | tag: `${RELEASE_TAG_IDENTIFIER}${validVersion}`, 61 | }); 62 | 63 | const { id, tag_name, name, assets } = releaseData; 64 | 65 | return new Release(id, tag_name, asReleaseAsset(assets), name); 66 | } 67 | return getLatestRelease(octo); 68 | }; 69 | 70 | const getLatestRelease = async (octo: GithubOktokit) => { 71 | const releases = await octo.rest.repos.listReleases({ 72 | owner: REPO_OWNER, 73 | repo: TECTONIC, 74 | }); 75 | const release = releases.data.find((currentRelease: { tag_name: string }) => 76 | currentRelease.tag_name.startsWith(RELEASE_TAG_IDENTIFIER), 77 | ); 78 | 79 | if (release) { 80 | return new Release( 81 | release.id, 82 | release.tag_name, 83 | asReleaseAsset(release.assets), 84 | release.name, 85 | ); 86 | } else { 87 | throw new Error("Couldnt get latest tectonic release"); 88 | } 89 | }; 90 | 91 | const asReleaseAsset = ( 92 | assets: readonly Pick< 93 | GithubReleaseAssets[number], 94 | "name" | "browser_download_url" 95 | >[], 96 | ): ReleaseAsset[] => { 97 | return assets.map((ghAsset) => ({ 98 | name: ghAsset.name, 99 | url: ghAsset.browser_download_url, 100 | })); 101 | }; 102 | -------------------------------------------------------------------------------- /src/setup-tectonic.ts: -------------------------------------------------------------------------------- 1 | import { randomUUID } from "node:crypto"; 2 | import { chmodSync } from "node:fs"; 3 | import { platform as os_platform } from "node:os"; 4 | import { dirname, join, resolve } from "node:path"; 5 | import { addPath, debug, error, getInput } from "@actions/core"; 6 | import { mkdirP, mv } from "@actions/io"; 7 | import { downloadTool, extractTar, extractZip } from "@actions/tool-cache"; 8 | import { downloadBiber } from "./biber.js"; 9 | import { getTectonicRelease } from "./release.js"; 10 | 11 | const mapOS = (osKey: string) => { 12 | const mappings: Record = { 13 | win32: "windows", 14 | }; 15 | return mappings[osKey] ?? osKey; 16 | }; 17 | 18 | const downloadTectonic = async (url: string) => { 19 | debug(`Downloading Tectonic from ${url}`); 20 | const archivePath = await downloadTool(url); 21 | 22 | debug("Extracting Tectonic"); 23 | let tectonicPath: string; 24 | if (url.endsWith(".zip")) { 25 | tectonicPath = await extractZip(archivePath); 26 | } else if (url.endsWith(".tar.gz")) { 27 | tectonicPath = await extractTar(archivePath); 28 | } else if (url.endsWith(".AppImage")) { 29 | tectonicPath = await createPathForAppImage(archivePath); 30 | } else { 31 | throw new Error(`Unsupported archive format for tectonic: ${url}`); 32 | } 33 | debug(`Tectonic path is ${tectonicPath}`); 34 | 35 | return tectonicPath; 36 | }; 37 | 38 | const createPathForAppImage = async (appPath: string) => { 39 | const tectonicPath = await createTempFolder(appPath); 40 | const newAppPath = resolve(tectonicPath, "tectonic"); 41 | await mv(appPath, newAppPath); 42 | 43 | debug(`Moved Tectonic from ${appPath} to ${newAppPath}`); 44 | 45 | // make it executable 46 | chmodSync(newAppPath, "750"); 47 | 48 | return tectonicPath; 49 | }; 50 | 51 | const createTempFolder = async (pathToExecutable: string) => { 52 | const destFolder = join(dirname(pathToExecutable), randomUUID()); 53 | await mkdirP(destFolder); 54 | return destFolder; 55 | }; 56 | 57 | export const setUpTectonic = async () => { 58 | try { 59 | const githubToken = getInput("github-token", { required: true }); 60 | const version = getInput("tectonic-version"); 61 | const biberVersion = getInput("biber-version"); 62 | 63 | debug(`Finding releases for Tectonic version ${version}`); 64 | const release = await getTectonicRelease(githubToken, version); 65 | const platform = mapOS(os_platform()); 66 | debug(`Getting build for Tectonic version ${release.version}: ${platform}`); 67 | debug(`Release: ${JSON.stringify(release)}`); 68 | const asset = release.getAsset(platform); 69 | if (!asset) { 70 | throw new Error( 71 | `Tectonic version ${version} not available for ${platform}`, 72 | ); 73 | } 74 | 75 | const tectonicPath = await downloadTectonic(asset.url); 76 | 77 | addPath(tectonicPath); 78 | 79 | if (biberVersion) { 80 | // optionally download biber 81 | debug(`Biber version: ${biberVersion}`); 82 | const biberPath = await downloadBiber(biberVersion); 83 | addPath(biberPath); 84 | } 85 | 86 | return release; 87 | } catch (exception: unknown) { 88 | if (exception instanceof Error || typeof exception === "string") { 89 | error(exception); 90 | } 91 | throw exception; 92 | } 93 | }; 94 | -------------------------------------------------------------------------------- /src/biber.test.ts: -------------------------------------------------------------------------------- 1 | import { execFileSync } from "node:child_process"; 2 | import { existsSync, rmSync } from "node:fs"; 3 | import { platform } from "node:os"; 4 | import { join, resolve } from "node:path"; 5 | import { buildDownloadURL, downloadBiber, validBiberVersion } from "./biber.js"; 6 | 7 | describe("build download link", () => { 8 | test("should build download link on windows for biber version 'current'", () => { 9 | const url = buildDownloadURL("current", "biber-MSWIN64.zip", "win32"); 10 | 11 | expect(url).toBe( 12 | "https://sourceforge.net/projects/biblatex-biber/files/biblatex-biber/current/binaries/Windows/biber-MSWIN64.zip/download", 13 | ); 14 | }); 15 | 16 | test("should build download link on mac os biber <=2.16", () => { 17 | const url = buildDownloadURL( 18 | "2.16", 19 | "biber-darwin_x86_64.tar.gz", 20 | "darwin", 21 | ); 22 | 23 | expect(url).toBe( 24 | "https://sourceforge.net/projects/biblatex-biber/files/biblatex-biber/2.16/binaries/OSX_Intel/biber-darwin_x86_64.tar.gz/download", 25 | ); 26 | }); 27 | 28 | test("should build download link on mac os biber >=2.17", () => { 29 | const url = buildDownloadURL( 30 | "2.17", 31 | "biber-darwin_x86_64.tar.gz", 32 | "darwin", 33 | ); 34 | 35 | expect(url).toBe( 36 | "https://sourceforge.net/projects/biblatex-biber/files/biblatex-biber/2.17/binaries/MacOS/biber-darwin_x86_64.tar.gz/download", 37 | ); 38 | }); 39 | 40 | test("should build download link on mac os biber 2.18", () => { 41 | const url = buildDownloadURL( 42 | "2.18", 43 | "biber-darwin_x86_64.tar.gz", 44 | "darwin", 45 | ); 46 | 47 | expect(url).toBe( 48 | "https://sourceforge.net/projects/biblatex-biber/files/biblatex-biber/2.18/binaries/MacOS/biber-darwin_x86_64.tar.gz/download", 49 | ); 50 | }); 51 | }); 52 | 53 | test("get biber version from invalid input", () => { 54 | expect(validBiberVersion("")).toBe("current"); 55 | expect(validBiberVersion("invalid")).toBe("current"); 56 | expect(validBiberVersion("current")).toBe("current"); 57 | expect(validBiberVersion("; sudo shutdown -h now #")).toBe("current"); 58 | expect(validBiberVersion('" SELECT * FROM super_secret_db ;')).toBe( 59 | "current", 60 | ); 61 | }); 62 | 63 | test("get biber version as major.minor", () => { 64 | expect(validBiberVersion(" 1.0 ")).toBe("1.0"); 65 | expect(validBiberVersion(" 0.6.0 ")).toBe("0.6"); 66 | expect(validBiberVersion(" v 0.0.0 ")).toBe("0.0"); 67 | }); 68 | 69 | test("get biber version as major.minor.patch", () => { 70 | expect(validBiberVersion(" 0.9.8 ")).toBe("0.9.8"); 71 | expect(validBiberVersion(" 0.9.9 ")).toBe("0.9.9"); 72 | expect(validBiberVersion(" 0.9.10 ")).toBe("0.9.10"); 73 | expect(validBiberVersion(" 2.16.1")).toBe("2.16.1"); 74 | }); 75 | 76 | describe.sequential("Download biber versions", () => { 77 | const tempDir = join(import.meta.dirname, "runner", "temp"); 78 | 79 | beforeAll(() => { 80 | console.log("tempDir: ", tempDir); 81 | vi.stubEnv("RUNNER_TEMP", tempDir); 82 | }); 83 | 84 | afterAll(() => { 85 | rmSync(tempDir, { recursive: true }); 86 | vi.unstubAllEnvs(); 87 | }); 88 | 89 | test("download non-existent biber version", async () => { 90 | await expect(downloadBiber("0.0.0")).rejects.toThrow(); 91 | }, 20000); 92 | 93 | test("download specific biber version", { timeout: 60_000 }, async () => { 94 | const biberPath = await downloadBiber("2.15"); 95 | const fileExtension = platform() === "win32" ? ".exe" : ""; 96 | const expectedBinaryPath = resolve(biberPath, `biber${fileExtension}`); 97 | 98 | expect(existsSync(biberPath)).toBe(true); 99 | expect(existsSync(expectedBinaryPath)).toBe(true); 100 | expect(execFileSync(expectedBinaryPath, ["--version"]).toString()).toMatch( 101 | /2\.15/, 102 | ); 103 | }); 104 | 105 | test( 106 | "download invalid biber version, should install current", 107 | { timeout: 60_000 }, 108 | async () => { 109 | const biberPath = await downloadBiber("invalidVersion"); 110 | const fileExtension = platform() === "win32" ? ".exe" : ""; 111 | const expectedBinaryPath = resolve(biberPath, `biber${fileExtension}`); 112 | 113 | expect(existsSync(biberPath)).toBe(true); 114 | expect(existsSync(expectedBinaryPath)).toBe(true); 115 | }, 116 | ); 117 | }); 118 | -------------------------------------------------------------------------------- /src/release.test.ts: -------------------------------------------------------------------------------- 1 | import { Release, type ReleaseAsset } from "./release.js"; 2 | 3 | describe("release", () => { 4 | const tectonic012Assets: ReleaseAsset[] = [ 5 | { 6 | name: "tectonic-0.12.0-aarch64-apple-darwin.tar.gz", 7 | url: "https://github.com/tectonic-typesetting/tectonic/releases/download/tectonic%400.12.0/tectonic-0.12.0-aarch64-apple-darwin.tar.gz", 8 | }, 9 | { 10 | name: "tectonic-0.12.0-arm-unknown-linux-musleabihf.tar.gz", 11 | url: "https://github.com/tectonic-typesetting/tectonic/releases/download/tectonic%400.12.0/tectonic-0.12.0-arm-unknown-linux-musleabihf.tar.gz", 12 | }, 13 | { 14 | name: "tectonic-0.12.0-i686-unknown-linux-gnu.tar.gz", 15 | url: "https://github.com/tectonic-typesetting/tectonic/releases/download/tectonic%400.12.0/tectonic-0.12.0-i686-unknown-linux-gnu.tar.gz", 16 | }, 17 | { 18 | name: "tectonic-0.12.0-mips-unknown-linux-gnu.tar.gz", 19 | url: "https://github.com/tectonic-typesetting/tectonic/releases/download/tectonic%400.12.0/tectonic-0.12.0-mips-unknown-linux-gnu.tar.gz", 20 | }, 21 | { 22 | name: "tectonic-0.12.0-x86_64-apple-darwin.tar.gz", 23 | url: "https://github.com/tectonic-typesetting/tectonic/releases/download/tectonic%400.12.0/tectonic-0.12.0-x86_64-apple-darwin.tar.gz", 24 | }, 25 | { 26 | name: "tectonic-0.12.0-x86_64-pc-windows-gnu.zip", 27 | url: "https://github.com/tectonic-typesetting/tectonic/releases/download/tectonic%400.12.0/tectonic-0.12.0-x86_64-pc-windows-gnu.zip", 28 | }, 29 | { 30 | name: "tectonic-0.12.0-x86_64-pc-windows-msvc.zip", 31 | url: "https://github.com/tectonic-typesetting/tectonic/releases/download/tectonic%400.12.0/tectonic-0.12.0-x86_64-pc-windows-msvc.zip", 32 | }, 33 | { 34 | name: "tectonic-0.12.0-x86_64-unknown-linux-gnu.tar.gz", 35 | url: "https://github.com/tectonic-typesetting/tectonic/releases/download/tectonic%400.12.0/tectonic-0.12.0-x86_64-unknown-linux-gnu.tar.gz", 36 | }, 37 | { 38 | name: "tectonic-0.12.0-x86_64-unknown-linux-musl.tar.gz", 39 | url: "https://github.com/tectonic-typesetting/tectonic/releases/download/tectonic%400.12.0/tectonic-0.12.0-x86_64-unknown-linux-musl.tar.gz", 40 | }, 41 | { 42 | name: "tectonic-0.12.0-x86_64.AppImage", 43 | url: "https://github.com/tectonic-typesetting/tectonic/releases/download/tectonic%400.12.0/tectonic-0.12.0-x86_64.AppImage", 44 | }, 45 | ]; 46 | 47 | const tectonic012Release = new Release( 48 | 81233082, 49 | "tectonic@0.12.0", 50 | tectonic012Assets, 51 | "tectonic 0.12.0", 52 | ); 53 | 54 | describe("getAsset", () => { 55 | it("should return .zip filename on windows", () => { 56 | expect(tectonic012Release.getAsset("windows")).toStrictEqual({ 57 | name: "tectonic-0.12.0-x86_64-pc-windows-msvc.zip", 58 | url: "https://github.com/tectonic-typesetting/tectonic/releases/download/tectonic%400.12.0/tectonic-0.12.0-x86_64-pc-windows-msvc.zip", 59 | }); 60 | }); 61 | 62 | it("should return .tar.gz filename on linux", () => { 63 | expect(tectonic012Release.getAsset("linux")).toStrictEqual({ 64 | name: "tectonic-0.12.0-x86_64-unknown-linux-gnu.tar.gz", 65 | url: "https://github.com/tectonic-typesetting/tectonic/releases/download/tectonic%400.12.0/tectonic-0.12.0-x86_64-unknown-linux-gnu.tar.gz", 66 | }); 67 | }); 68 | 69 | it("should return .tar.gz filename on mac", () => { 70 | expect(tectonic012Release.getAsset("darwin")).toStrictEqual({ 71 | name: "tectonic-0.12.0-x86_64-apple-darwin.tar.gz", 72 | url: "https://github.com/tectonic-typesetting/tectonic/releases/download/tectonic%400.12.0/tectonic-0.12.0-x86_64-apple-darwin.tar.gz", 73 | }); 74 | }); 75 | 76 | it("should return .AppImage filename on linux releases up to 0.10.0", () => { 77 | const fakeTectonic010Assets = tectonic012Assets.map((asset) => ({ 78 | name: asset.name.replace(/0.12.0/g, "0.10.0"), 79 | url: asset.url.replace(/0.12.0/g, "0.10.0"), 80 | })); 81 | const tectonic010Release = new Release( 82 | 81233083, 83 | "tectonic@0.10.0", 84 | fakeTectonic010Assets, 85 | "tectonic 0.10.0", 86 | ); 87 | expect(tectonic010Release.getAsset("linux")).toStrictEqual({ 88 | name: "tectonic-0.10.0-x86_64.AppImage", 89 | url: "https://github.com/tectonic-typesetting/tectonic/releases/download/tectonic%400.10.0/tectonic-0.10.0-x86_64.AppImage", 90 | }); 91 | }); 92 | }); 93 | }); 94 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | wtfjoke@livenet.ch. 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 120 | 121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 122 | enforcement ladder](https://github.com/mozilla/diversity). 123 | 124 | [homepage]: https://www.contributor-covenant.org 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | https://www.contributor-covenant.org/faq. Translations are available at 128 | https://www.contributor-covenant.org/translations. 129 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![CI](https://github.com/WtfJoke/setup-tectonic/actions/workflows/test.yml/badge.svg)](https://github.com/WtfJoke/setup-tectonic/actions/workflows/test.yml) 2 | [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=WtfJoke_setup-tectonic&metric=security_rating)](https://sonarcloud.io/dashboard?id=WtfJoke_setup-tectonic) 3 | [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=WtfJoke_setup-tectonic&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=WtfJoke_setup-tectonic) 4 | [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=WtfJoke_setup-tectonic&metric=bugs)](https://sonarcloud.io/dashboard?id=WtfJoke_setup-tectonic) 5 | [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=WtfJoke_setup-tectonic&metric=code_smells)](https://sonarcloud.io/dashboard?id=WtfJoke_setup-tectonic) 6 | [![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=WtfJoke_setup-tectonic&metric=sqale_index)](https://sonarcloud.io/dashboard?id=WtfJoke_setup-tectonic) 7 | [![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=WtfJoke_setup-tectonic&metric=ncloc)](https://sonarcloud.io/dashboard?id=WtfJoke_setup-tectonic) 8 | 9 | The `wtfjoke/setup-tectonic` action is a JavaScript action that sets up [Tectonic](https://github.com/tectonic-typesetting/tectonic) in your GitHub Actions workflow by: 10 | 11 | - Downloading a requested version of Tectonic and adding it to the `PATH`. 12 | - (Optionally) downloading a requested version of [Biber](https://sourceforge.net/projects/biblatex-biber/) and adding it to the `PATH`. 13 | 14 | # 🔧 Usage 15 | 16 | This action can be run on `ubuntu-latest`, `windows-latest`, and `macos-latest` GitHub Actions runners. 17 | 18 | The default configuration installs the latest version of Tectonic. The `GITHUB_TOKEN` is needed to query the Github Releases of `tectonic-typesetting/tectonic` to download tectonic. 19 | 20 | You can even use caching (see example below) to speed up your workflow 🎉. 21 | 22 | See [action.yml](https://github.com/WtfJoke/setup-tectonic/blob/main/action.yml) for a full description of all parameters. 23 | 24 | ```yml 25 | steps: 26 | - uses: wtfjoke/setup-tectonic@v4 27 | - run: tectonic main.tex 28 | ``` 29 | 30 | You can also download a specific version of Tectonic 31 | 32 | ```yml 33 | steps: 34 | - uses: wtfjoke/setup-tectonic@v4 35 | with: 36 | tectonic-version: 0.14.1 37 | - run: tectonic main.tex 38 | ``` 39 | 40 | If you want to use biber, specify a biber version (for a full example see [below](https://github.com/WtfJoke/setup-tectonic#with-biber)) 41 | 42 | ```yml 43 | steps: 44 | - uses: wtfjoke/setup-tectonic@v4 45 | with: 46 | biber-version: 2.17 47 | - run: biber --version 48 | ``` 49 | 50 | ## Upload pdf (using `actions/upload-artifact`) 51 | 52 | ```yml 53 | name: "Build LaTex Document" 54 | on: 55 | push: 56 | jobs: 57 | build: 58 | runs-on: ubuntu-latest 59 | 60 | steps: 61 | - name: Checkout 62 | uses: actions/checkout@v4 63 | - uses: wtfjoke/setup-tectonic@v4 64 | - name: Run Tectonic 65 | run: tectonic main.tex 66 | - name: Upload pdf 67 | uses: actions/upload-artifact@v3 68 | with: 69 | name: main 70 | path: main.pdf 71 | ``` 72 | 73 | ## With enabled cache (using `actions/cache`) 74 | 75 | ```yml 76 | name: "Build LaTex Document" 77 | on: 78 | push: 79 | jobs: 80 | build: 81 | runs-on: ubuntu-latest 82 | 83 | steps: 84 | - name: Checkout 85 | uses: actions/checkout@v4 86 | - uses: actions/cache@v3 87 | name: Tectonic Cache 88 | with: 89 | path: ~/.cache/Tectonic 90 | key: ${{ runner.os }}-tectonic-${{ hashFiles('**/*.tex') }} 91 | restore-keys: | 92 | ${{ runner.os }}-tectonic- 93 | - uses: wtfjoke/setup-tectonic@v4 94 | - name: Run Tectonic 95 | run: tectonic main.tex 96 | - name: Upload pdf 97 | uses: actions/upload-artifact@v3 98 | with: 99 | name: main 100 | path: main.pdf 101 | ``` 102 | 103 | ## With biber 104 | 105 | ```yml 106 | name: "Build LaTex Document with Biber" 107 | on: 108 | push: 109 | jobs: 110 | build: 111 | runs-on: ubuntu-latest 112 | 113 | steps: 114 | - name: Checkout 115 | uses: actions/checkout@v4 116 | - uses: actions/cache@v3 117 | name: Tectonic Cache 118 | with: 119 | path: ~/.cache/Tectonic 120 | key: ${{ runner.os }}-tectonic-${{ hashFiles('**/*.tex') }} 121 | restore-keys: | 122 | ${{ runner.os }}-tectonic- 123 | - uses: wtfjoke/setup-tectonic@v4 124 | with: 125 | biber-version: "latest" 126 | - name: Run Tectonic + Biber 127 | run: tectonic main.tex 128 | - name: Upload pdf 129 | uses: actions/upload-artifact@v3 130 | with: 131 | name: main 132 | path: main.pdf 133 | ``` 134 | 135 | **Note**: Tectonic has added biber support in `0.7.1` (see [changelog](https://github.com/tectonic-typesetting/tectonic/releases/tag/tectonic%400.7.1)). Prior to that version you need to run following commands: 136 | 137 | ```yml 138 | run: | 139 | tectonic --keep-intermediates --reruns 0 main.tex 140 | biber main 141 | tectonic main.tex 142 | ``` 143 | 144 | # 📊 Comparison to other LaTeX/Tectonic actions like [vinay0410/tectonic-action](https://github.com/vinay0410/tectonic-action) 145 | 146 | | Pro | Description | 147 | | ---------------------- | :--------------------------------------------------------------------------------------------------- | 148 | | :zap: Performance | - Supports caching
- Native Javascript Action's are faster than docker (:whale:) based actions | 149 | | :robot: Future proofed | New tectonic versions right on release without code changes | 150 | | :art: Customizability | Do one thing and do it well - let other actions do what they can do best | 151 | 152 |
153 | 154 | ## Explanation 155 | 156 | This action was created because all existing Github Actions for compiling LaTeX documents I came across are docker based actions, which are [slower than Javascript based actions](https://docs.github.com/en/actions/creating-actions/about-actions#docker-container-actions). 157 | 158 | LaTex Docker images tend to be huge (2gb+). Tectonic images are an exception but they need to be maintained and updated with new Tectonic versions. This is not often the case, at the time of writing [my docker image](https://github.com/WtfJoke/tectonic-docker) is the only one up to date with the latest tectonic version. 159 | 160 | In comparison, this github action doesn't need an update if a new release of tectonic is released, it just works. 161 | 162 | The existing github actions doesn't support biber (notable exception: [birjolaxew/tectonic-biber-action](https://github.com/birjolaxew/tectonic-biber-action)). 163 | 164 | Additionally most of the github actions tend to do too much or are too strict. 165 | 166 | This github action has one job, to setup tectonic (and optionally biber). You can choose on your own how you want to call tectonic, how and if you want to cache your dependencies, how and if you want to upload your pdf. Depending on your decisions you can choose the best action to do the corresponding job (eg. [actions/cache](https://github.com/actions/cache) for caching, [actions/upload-artifact](https://github.com/actions/upload-artifact) or [actions/create-release](https://github.com/actions/create-release) for publishing your pdf) 167 | 168 | # 🤓 How does the cache works? 169 | 170 | The official cache action [actions/cache](https://github.com/actions/cache) has three parameters: 171 | 172 | - `path` - A list of files, directories, and wildcard patterns to cache and restore. 173 | - `key` - Primary cache key - If the key has a cache-hit, it means the cache is up to date. The execution of a tool should'nt change the cache anymore. 174 | - `restore-keys` - If there is no key hit with `key` - These will be used to restore the cache. The execution of a tool most likely will change the cache. 175 | 176 | ## Path 177 | 178 | For tectonic the cache directories (`path`) are as follows (see also [tectonic-typesetting/tectonic#159](https://github.com/tectonic-typesetting/tectonic/issues/159)): 179 | 180 | | OS | Cache-Directory | Run-Command to export it as environment variable | 181 | | ------- | ----------------------------------------- | ------------------------------------------------------------------------- | ----------------------------------------------------------------- | 182 | | Linux | `~/.cache/Tectonic` | `echo TECTONIC_CACHE_PATH=~/.cache/Tectonic >> $GITHUB_ENV` | 183 | | Mac | `~/Library/Caches/Tectonic` | `echo TECTONIC_CACHE_PATH=~/Library/Caches/Tectonic >> $GITHUB_ENV` | 184 | | Windows | `%LOCALAPPDATA%\TectonicProject\Tectonic` | echo TECTONIC_CACHE_PATH=$env:LOCALAPPDATA\TectonicProject\Tectonic | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append` | 185 | 186 | ## Key 187 | 188 | By calculate the hash all .tex files (see `hashFiles('**/*.tex')`) and integrate that into the cache-`key` we can make sure, that another execution of tectonic wont change the result. 189 | 190 | Simpler put, as long as no `.tex` files are changing, the cache wont change. 191 | 192 | ## Restore-Keys 193 | 194 | We change our `.tex` files but still want to use a cache? `restore-keys` to the rescue :muscle: 195 |
196 | 197 | When we change our .tex files (either by using a new package or just change the text), the exact cache `key` wont hit. Still we want to use the cache from the previous runs, as we most likely still use the same packages. So `restore keys` will use the cache from the previous run and then (at the end of the job execution) will update the existing cache with `key`. 198 | 199 |
200 | Thats how the cache works :) 201 | -------------------------------------------------------------------------------- /dist/licenses.txt: -------------------------------------------------------------------------------- 1 | @actions/core 2 | MIT 3 | The MIT License (MIT) 4 | 5 | Copyright 2019 GitHub 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | 13 | @actions/exec 14 | MIT 15 | The MIT License (MIT) 16 | 17 | Copyright 2019 GitHub 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 20 | 21 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | 25 | @actions/github 26 | MIT 27 | The MIT License (MIT) 28 | 29 | Copyright 2019 GitHub 30 | 31 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 32 | 33 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 34 | 35 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 36 | 37 | @actions/http-client 38 | MIT 39 | Actions Http Client for Node.js 40 | 41 | Copyright (c) GitHub, Inc. 42 | 43 | All rights reserved. 44 | 45 | MIT License 46 | 47 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 48 | associated documentation files (the "Software"), to deal in the Software without restriction, 49 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 50 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 51 | subject to the following conditions: 52 | 53 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 54 | 55 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 56 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 57 | NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 58 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 59 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 60 | 61 | 62 | @actions/io 63 | MIT 64 | The MIT License (MIT) 65 | 66 | Copyright 2019 GitHub 67 | 68 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 69 | 70 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 71 | 72 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 73 | 74 | @actions/tool-cache 75 | MIT 76 | The MIT License (MIT) 77 | 78 | Copyright 2019 GitHub 79 | 80 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 81 | 82 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 83 | 84 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 85 | 86 | @fastify/busboy 87 | MIT 88 | Copyright Brian White. All rights reserved. 89 | 90 | Permission is hereby granted, free of charge, to any person obtaining a copy 91 | of this software and associated documentation files (the "Software"), to 92 | deal in the Software without restriction, including without limitation the 93 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 94 | sell copies of the Software, and to permit persons to whom the Software is 95 | furnished to do so, subject to the following conditions: 96 | 97 | The above copyright notice and this permission notice shall be included in 98 | all copies or substantial portions of the Software. 99 | 100 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 101 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 102 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 103 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 104 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 105 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 106 | IN THE SOFTWARE. 107 | 108 | @octokit/auth-token 109 | MIT 110 | The MIT License 111 | 112 | Copyright (c) 2019 Octokit contributors 113 | 114 | Permission is hereby granted, free of charge, to any person obtaining a copy 115 | of this software and associated documentation files (the "Software"), to deal 116 | in the Software without restriction, including without limitation the rights 117 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 118 | copies of the Software, and to permit persons to whom the Software is 119 | furnished to do so, subject to the following conditions: 120 | 121 | The above copyright notice and this permission notice shall be included in 122 | all copies or substantial portions of the Software. 123 | 124 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 125 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 126 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 127 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 128 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 129 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 130 | THE SOFTWARE. 131 | 132 | 133 | @octokit/core 134 | MIT 135 | The MIT License 136 | 137 | Copyright (c) 2019 Octokit contributors 138 | 139 | Permission is hereby granted, free of charge, to any person obtaining a copy 140 | of this software and associated documentation files (the "Software"), to deal 141 | in the Software without restriction, including without limitation the rights 142 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 143 | copies of the Software, and to permit persons to whom the Software is 144 | furnished to do so, subject to the following conditions: 145 | 146 | The above copyright notice and this permission notice shall be included in 147 | all copies or substantial portions of the Software. 148 | 149 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 150 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 151 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 152 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 153 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 154 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 155 | THE SOFTWARE. 156 | 157 | 158 | @octokit/endpoint 159 | MIT 160 | The MIT License 161 | 162 | Copyright (c) 2018 Octokit contributors 163 | 164 | Permission is hereby granted, free of charge, to any person obtaining a copy 165 | of this software and associated documentation files (the "Software"), to deal 166 | in the Software without restriction, including without limitation the rights 167 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 168 | copies of the Software, and to permit persons to whom the Software is 169 | furnished to do so, subject to the following conditions: 170 | 171 | The above copyright notice and this permission notice shall be included in 172 | all copies or substantial portions of the Software. 173 | 174 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 175 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 176 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 177 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 178 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 179 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 180 | THE SOFTWARE. 181 | 182 | 183 | @octokit/graphql 184 | MIT 185 | The MIT License 186 | 187 | Copyright (c) 2018 Octokit contributors 188 | 189 | Permission is hereby granted, free of charge, to any person obtaining a copy 190 | of this software and associated documentation files (the "Software"), to deal 191 | in the Software without restriction, including without limitation the rights 192 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 193 | copies of the Software, and to permit persons to whom the Software is 194 | furnished to do so, subject to the following conditions: 195 | 196 | The above copyright notice and this permission notice shall be included in 197 | all copies or substantial portions of the Software. 198 | 199 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 200 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 201 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 202 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 203 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 204 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 205 | THE SOFTWARE. 206 | 207 | 208 | @octokit/plugin-paginate-rest 209 | MIT 210 | MIT License Copyright (c) 2019 Octokit contributors 211 | 212 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 213 | 214 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 215 | 216 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 217 | 218 | 219 | @octokit/plugin-rest-endpoint-methods 220 | MIT 221 | MIT License Copyright (c) 2019 Octokit contributors 222 | 223 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 224 | 225 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 226 | 227 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 228 | 229 | 230 | @octokit/request 231 | MIT 232 | The MIT License 233 | 234 | Copyright (c) 2018 Octokit contributors 235 | 236 | Permission is hereby granted, free of charge, to any person obtaining a copy 237 | of this software and associated documentation files (the "Software"), to deal 238 | in the Software without restriction, including without limitation the rights 239 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 240 | copies of the Software, and to permit persons to whom the Software is 241 | furnished to do so, subject to the following conditions: 242 | 243 | The above copyright notice and this permission notice shall be included in 244 | all copies or substantial portions of the Software. 245 | 246 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 247 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 248 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 249 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 250 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 251 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 252 | THE SOFTWARE. 253 | 254 | 255 | @octokit/request-error 256 | MIT 257 | The MIT License 258 | 259 | Copyright (c) 2019 Octokit contributors 260 | 261 | Permission is hereby granted, free of charge, to any person obtaining a copy 262 | of this software and associated documentation files (the "Software"), to deal 263 | in the Software without restriction, including without limitation the rights 264 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 265 | copies of the Software, and to permit persons to whom the Software is 266 | furnished to do so, subject to the following conditions: 267 | 268 | The above copyright notice and this permission notice shall be included in 269 | all copies or substantial portions of the Software. 270 | 271 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 272 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 273 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 274 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 275 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 276 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 277 | THE SOFTWARE. 278 | 279 | 280 | before-after-hook 281 | Apache-2.0 282 | Apache License 283 | Version 2.0, January 2004 284 | http://www.apache.org/licenses/ 285 | 286 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 287 | 288 | 1. Definitions. 289 | 290 | "License" shall mean the terms and conditions for use, reproduction, 291 | and distribution as defined by Sections 1 through 9 of this document. 292 | 293 | "Licensor" shall mean the copyright owner or entity authorized by 294 | the copyright owner that is granting the License. 295 | 296 | "Legal Entity" shall mean the union of the acting entity and all 297 | other entities that control, are controlled by, or are under common 298 | control with that entity. For the purposes of this definition, 299 | "control" means (i) the power, direct or indirect, to cause the 300 | direction or management of such entity, whether by contract or 301 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 302 | outstanding shares, or (iii) beneficial ownership of such entity. 303 | 304 | "You" (or "Your") shall mean an individual or Legal Entity 305 | exercising permissions granted by this License. 306 | 307 | "Source" form shall mean the preferred form for making modifications, 308 | including but not limited to software source code, documentation 309 | source, and configuration files. 310 | 311 | "Object" form shall mean any form resulting from mechanical 312 | transformation or translation of a Source form, including but 313 | not limited to compiled object code, generated documentation, 314 | and conversions to other media types. 315 | 316 | "Work" shall mean the work of authorship, whether in Source or 317 | Object form, made available under the License, as indicated by a 318 | copyright notice that is included in or attached to the work 319 | (an example is provided in the Appendix below). 320 | 321 | "Derivative Works" shall mean any work, whether in Source or Object 322 | form, that is based on (or derived from) the Work and for which the 323 | editorial revisions, annotations, elaborations, or other modifications 324 | represent, as a whole, an original work of authorship. For the purposes 325 | of this License, Derivative Works shall not include works that remain 326 | separable from, or merely link (or bind by name) to the interfaces of, 327 | the Work and Derivative Works thereof. 328 | 329 | "Contribution" shall mean any work of authorship, including 330 | the original version of the Work and any modifications or additions 331 | to that Work or Derivative Works thereof, that is intentionally 332 | submitted to Licensor for inclusion in the Work by the copyright owner 333 | or by an individual or Legal Entity authorized to submit on behalf of 334 | the copyright owner. For the purposes of this definition, "submitted" 335 | means any form of electronic, verbal, or written communication sent 336 | to the Licensor or its representatives, including but not limited to 337 | communication on electronic mailing lists, source code control systems, 338 | and issue tracking systems that are managed by, or on behalf of, the 339 | Licensor for the purpose of discussing and improving the Work, but 340 | excluding communication that is conspicuously marked or otherwise 341 | designated in writing by the copyright owner as "Not a Contribution." 342 | 343 | "Contributor" shall mean Licensor and any individual or Legal Entity 344 | on behalf of whom a Contribution has been received by Licensor and 345 | subsequently incorporated within the Work. 346 | 347 | 2. Grant of Copyright License. Subject to the terms and conditions of 348 | this License, each Contributor hereby grants to You a perpetual, 349 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 350 | copyright license to reproduce, prepare Derivative Works of, 351 | publicly display, publicly perform, sublicense, and distribute the 352 | Work and such Derivative Works in Source or Object form. 353 | 354 | 3. Grant of Patent License. Subject to the terms and conditions of 355 | this License, each Contributor hereby grants to You a perpetual, 356 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 357 | (except as stated in this section) patent license to make, have made, 358 | use, offer to sell, sell, import, and otherwise transfer the Work, 359 | where such license applies only to those patent claims licensable 360 | by such Contributor that are necessarily infringed by their 361 | Contribution(s) alone or by combination of their Contribution(s) 362 | with the Work to which such Contribution(s) was submitted. If You 363 | institute patent litigation against any entity (including a 364 | cross-claim or counterclaim in a lawsuit) alleging that the Work 365 | or a Contribution incorporated within the Work constitutes direct 366 | or contributory patent infringement, then any patent licenses 367 | granted to You under this License for that Work shall terminate 368 | as of the date such litigation is filed. 369 | 370 | 4. Redistribution. You may reproduce and distribute copies of the 371 | Work or Derivative Works thereof in any medium, with or without 372 | modifications, and in Source or Object form, provided that You 373 | meet the following conditions: 374 | 375 | (a) You must give any other recipients of the Work or 376 | Derivative Works a copy of this License; and 377 | 378 | (b) You must cause any modified files to carry prominent notices 379 | stating that You changed the files; and 380 | 381 | (c) You must retain, in the Source form of any Derivative Works 382 | that You distribute, all copyright, patent, trademark, and 383 | attribution notices from the Source form of the Work, 384 | excluding those notices that do not pertain to any part of 385 | the Derivative Works; and 386 | 387 | (d) If the Work includes a "NOTICE" text file as part of its 388 | distribution, then any Derivative Works that You distribute must 389 | include a readable copy of the attribution notices contained 390 | within such NOTICE file, excluding those notices that do not 391 | pertain to any part of the Derivative Works, in at least one 392 | of the following places: within a NOTICE text file distributed 393 | as part of the Derivative Works; within the Source form or 394 | documentation, if provided along with the Derivative Works; or, 395 | within a display generated by the Derivative Works, if and 396 | wherever such third-party notices normally appear. The contents 397 | of the NOTICE file are for informational purposes only and 398 | do not modify the License. You may add Your own attribution 399 | notices within Derivative Works that You distribute, alongside 400 | or as an addendum to the NOTICE text from the Work, provided 401 | that such additional attribution notices cannot be construed 402 | as modifying the License. 403 | 404 | You may add Your own copyright statement to Your modifications and 405 | may provide additional or different license terms and conditions 406 | for use, reproduction, or distribution of Your modifications, or 407 | for any such Derivative Works as a whole, provided Your use, 408 | reproduction, and distribution of the Work otherwise complies with 409 | the conditions stated in this License. 410 | 411 | 5. Submission of Contributions. Unless You explicitly state otherwise, 412 | any Contribution intentionally submitted for inclusion in the Work 413 | by You to the Licensor shall be under the terms and conditions of 414 | this License, without any additional terms or conditions. 415 | Notwithstanding the above, nothing herein shall supersede or modify 416 | the terms of any separate license agreement you may have executed 417 | with Licensor regarding such Contributions. 418 | 419 | 6. Trademarks. This License does not grant permission to use the trade 420 | names, trademarks, service marks, or product names of the Licensor, 421 | except as required for reasonable and customary use in describing the 422 | origin of the Work and reproducing the content of the NOTICE file. 423 | 424 | 7. Disclaimer of Warranty. Unless required by applicable law or 425 | agreed to in writing, Licensor provides the Work (and each 426 | Contributor provides its Contributions) on an "AS IS" BASIS, 427 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 428 | implied, including, without limitation, any warranties or conditions 429 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 430 | PARTICULAR PURPOSE. You are solely responsible for determining the 431 | appropriateness of using or redistributing the Work and assume any 432 | risks associated with Your exercise of permissions under this License. 433 | 434 | 8. Limitation of Liability. In no event and under no legal theory, 435 | whether in tort (including negligence), contract, or otherwise, 436 | unless required by applicable law (such as deliberate and grossly 437 | negligent acts) or agreed to in writing, shall any Contributor be 438 | liable to You for damages, including any direct, indirect, special, 439 | incidental, or consequential damages of any character arising as a 440 | result of this License or out of the use or inability to use the 441 | Work (including but not limited to damages for loss of goodwill, 442 | work stoppage, computer failure or malfunction, or any and all 443 | other commercial damages or losses), even if such Contributor 444 | has been advised of the possibility of such damages. 445 | 446 | 9. Accepting Warranty or Additional Liability. While redistributing 447 | the Work or Derivative Works thereof, You may choose to offer, 448 | and charge a fee for, acceptance of support, warranty, indemnity, 449 | or other liability obligations and/or rights consistent with this 450 | License. However, in accepting such obligations, You may act only 451 | on Your own behalf and on Your sole responsibility, not on behalf 452 | of any other Contributor, and only if You agree to indemnify, 453 | defend, and hold each Contributor harmless for any liability 454 | incurred by, or claims asserted against, such Contributor by reason 455 | of your accepting any such warranty or additional liability. 456 | 457 | END OF TERMS AND CONDITIONS 458 | 459 | APPENDIX: How to apply the Apache License to your work. 460 | 461 | To apply the Apache License to your work, attach the following 462 | boilerplate notice, with the fields enclosed by brackets "{}" 463 | replaced with your own identifying information. (Don't include 464 | the brackets!) The text should be enclosed in the appropriate 465 | comment syntax for the file format. We also recommend that a 466 | file or class name and description of purpose be included on the 467 | same "printed page" as the copyright notice for easier 468 | identification within third-party archives. 469 | 470 | Copyright 2018 Gregor Martynus and other contributors. 471 | 472 | Licensed under the Apache License, Version 2.0 (the "License"); 473 | you may not use this file except in compliance with the License. 474 | You may obtain a copy of the License at 475 | 476 | http://www.apache.org/licenses/LICENSE-2.0 477 | 478 | Unless required by applicable law or agreed to in writing, software 479 | distributed under the License is distributed on an "AS IS" BASIS, 480 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 481 | See the License for the specific language governing permissions and 482 | limitations under the License. 483 | 484 | 485 | deprecation 486 | ISC 487 | The ISC License 488 | 489 | Copyright (c) Gregor Martynus and contributors 490 | 491 | Permission to use, copy, modify, and/or distribute this software for any 492 | purpose with or without fee is hereby granted, provided that the above 493 | copyright notice and this permission notice appear in all copies. 494 | 495 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 496 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 497 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 498 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 499 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 500 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 501 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 502 | 503 | 504 | once 505 | ISC 506 | The ISC License 507 | 508 | Copyright (c) Isaac Z. Schlueter and Contributors 509 | 510 | Permission to use, copy, modify, and/or distribute this software for any 511 | purpose with or without fee is hereby granted, provided that the above 512 | copyright notice and this permission notice appear in all copies. 513 | 514 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 515 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 516 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 517 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 518 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 519 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 520 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 521 | 522 | 523 | semver 524 | ISC 525 | The ISC License 526 | 527 | Copyright (c) Isaac Z. Schlueter and Contributors 528 | 529 | Permission to use, copy, modify, and/or distribute this software for any 530 | purpose with or without fee is hereby granted, provided that the above 531 | copyright notice and this permission notice appear in all copies. 532 | 533 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 534 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 535 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 536 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 537 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 538 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 539 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 540 | 541 | 542 | tunnel 543 | MIT 544 | The MIT License (MIT) 545 | 546 | Copyright (c) 2012 Koichi Kobayashi 547 | 548 | Permission is hereby granted, free of charge, to any person obtaining a copy 549 | of this software and associated documentation files (the "Software"), to deal 550 | in the Software without restriction, including without limitation the rights 551 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 552 | copies of the Software, and to permit persons to whom the Software is 553 | furnished to do so, subject to the following conditions: 554 | 555 | The above copyright notice and this permission notice shall be included in 556 | all copies or substantial portions of the Software. 557 | 558 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 559 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 560 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 561 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 562 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 563 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 564 | THE SOFTWARE. 565 | 566 | 567 | undici 568 | MIT 569 | MIT License 570 | 571 | Copyright (c) Matteo Collina and Undici contributors 572 | 573 | Permission is hereby granted, free of charge, to any person obtaining a copy 574 | of this software and associated documentation files (the "Software"), to deal 575 | in the Software without restriction, including without limitation the rights 576 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 577 | copies of the Software, and to permit persons to whom the Software is 578 | furnished to do so, subject to the following conditions: 579 | 580 | The above copyright notice and this permission notice shall be included in all 581 | copies or substantial portions of the Software. 582 | 583 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 584 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 585 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 586 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 587 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 588 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 589 | SOFTWARE. 590 | 591 | 592 | universal-user-agent 593 | ISC 594 | # [ISC License](https://spdx.org/licenses/ISC) 595 | 596 | Copyright (c) 2018, Gregor Martynus (https://github.com/gr2m) 597 | 598 | Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. 599 | 600 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 601 | 602 | 603 | wrappy 604 | ISC 605 | The ISC License 606 | 607 | Copyright (c) Isaac Z. Schlueter and Contributors 608 | 609 | Permission to use, copy, modify, and/or distribute this software for any 610 | purpose with or without fee is hereby granted, provided that the above 611 | copyright notice and this permission notice appear in all copies. 612 | 613 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 614 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 615 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 616 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 617 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 618 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 619 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 620 | -------------------------------------------------------------------------------- /dist/sourcemap-register.cjs: -------------------------------------------------------------------------------- 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})(); --------------------------------------------------------------------------------