├── requirements.txt ├── .gitattributes ├── .eslintignore ├── .prettierignore ├── .prettierrc ├── changelog.md ├── images ├── failure.png └── success.png ├── jest.config.js ├── tsconfig.json ├── .github ├── dependabot.yml └── workflows │ └── ci.yml ├── my_strategy.ini ├── pyproject.toml ├── __test__ └── main.test.ts ├── action.yml ├── .pre-commit-config.yaml ├── LICENSE ├── package.json ├── .eslintrc.json ├── .gitignore ├── src └── main.ts ├── dist ├── licenses.txt └── sourcemap-register.js └── README.md /requirements.txt: -------------------------------------------------------------------------------- 1 | future>=0.17 2 | pandas 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | dist/** -diff linguist-generated=true 2 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | lib/ 3 | node_modules/ 4 | jest.config.js 5 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | **/node_modules 3 | **/lib 4 | **/package.json 5 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "semi": false, 4 | "tabWidth": 2 5 | } 6 | -------------------------------------------------------------------------------- /changelog.md: -------------------------------------------------------------------------------- 1 | # Change log 2 | 3 | ## gh-action-py-liccheck v2021.2.17 4 | 5 | - First release 6 | -------------------------------------------------------------------------------- /images/failure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersy005/gh-action-py-liccheck/main/images/failure.png -------------------------------------------------------------------------------- /images/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersy005/gh-action-py-liccheck/main/images/success.png -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | clearMocks: true, 3 | moduleFileExtensions: ['js', 'ts'], 4 | testEnvironment: 'node', 5 | testMatch: ['**/*.test.ts'], 6 | testRunner: 'jest-circus/runner', 7 | transform: { 8 | '^.+\\.ts$': 'ts-jest', 9 | }, 10 | verbose: true, 11 | } 12 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "module": "commonjs", 5 | "outDir": "./lib", 6 | "rootDir": "./src", 7 | "strict": true, 8 | "useUnknownInCatchVariables": false, 9 | "noImplicitAny": true, 10 | "esModuleInterop": true 11 | }, 12 | "exclude": ["node_modules", "**/*.test.ts"] 13 | } 14 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: 'github-actions' 4 | directory: '/' 5 | schedule: 6 | # Check for updates once a week 7 | interval: 'monthly' 8 | groups: 9 | actions: 10 | patterns: 11 | - '*' 12 | 13 | # Maintain dependencies for npm 14 | - package-ecosystem: 'npm' 15 | directory: '/' 16 | schedule: 17 | interval: 'monthly' 18 | groups: 19 | dependencies: 20 | patterns: 21 | - '*' 22 | -------------------------------------------------------------------------------- /my_strategy.ini: -------------------------------------------------------------------------------- 1 | # Authorized and unauthorized licenses in LOWER CASE 2 | [Licenses] 3 | authorized_licenses: 4 | bsd 5 | new bsd 6 | bsd license 7 | new bsd license 8 | simplified bsd 9 | apache 10 | apache 2.0 11 | apache software license 12 | apache software 13 | gnu lgpl 14 | lgpl with exceptions or zpl 15 | isc license 16 | isc license (iscl) 17 | mit 18 | mit license 19 | python software foundation license 20 | zpl 2.1 21 | 22 | unauthorized_licenses: 23 | gpl v3 24 | 25 | [Authorized Packages] 26 | uuid: 1.30 27 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.liccheck] 2 | # Authorized and unauthorized licenses in LOWER CASE 3 | authorized_licenses = [ 4 | "bsd", 5 | "new bsd", 6 | "bsd license", 7 | "new bsd license", 8 | "simplified bsd", 9 | "apache", 10 | "apache 2.0", 11 | "apache software license", 12 | "apache software", 13 | "gnu lgpl", 14 | "lgpl with exceptions or zpl", 15 | "isc license", 16 | "isc license (iscl)", 17 | "mit", 18 | "mit license", 19 | "python software foundation license", 20 | "zpl 2.1" 21 | ] 22 | 23 | unauthorized_licenses = [ 24 | "gpl v3" 25 | ] 26 | 27 | [tool.liccheck.authorized_packages] 28 | uuid = "<=1.30" 29 | -------------------------------------------------------------------------------- /__test__/main.test.ts: -------------------------------------------------------------------------------- 1 | // import { wait } from '../src/wait' 2 | // import * as process from 'process' 3 | // import * as cp from 'child_process' 4 | // import * as path from 'path' 5 | 6 | // test('throws invalid number', async () => { 7 | // const input = parseInt('foo', 10) 8 | // await expect(wait(input)).rejects.toThrow('milliseconds not a number') 9 | // }) 10 | 11 | // test('wait 500 ms', async () => { 12 | // const start = new Date() 13 | // await wait(500) 14 | // const end = new Date() 15 | // var delta = Math.abs(end.getTime() - start.getTime()) 16 | // expect(delta).toBeGreaterThan(450) 17 | // }) 18 | 19 | // // shows how the runner will run a javascript action with env / stdout protocol 20 | // test('test runs', () => { 21 | // process.env['INPUT_MILLISECONDS'] = '500' 22 | // const np = process.execPath 23 | // const ip = path.join(__dirname, '..', 'lib', 'main.js') 24 | // const options: cp.ExecFileSyncOptions = { 25 | // env: process.env, 26 | // } 27 | // console.log(cp.execFileSync(np, [ip], options).toString()) 28 | // }) 29 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: py-liccheck 2 | author: Anderson Banihirwe 3 | description: Check license of Python packages and their dependencies. 4 | inputs: 5 | strategy-ini-file: 6 | description: Path to a strategy ini file or pyproject.toml file to use. 7 | required: false 8 | default: ./pyproject.toml 9 | level: 10 | description: Level for testing compliance of packages. 11 | required: false 12 | default: STANDARD 13 | requirements-txt-file: 14 | description: Path to a requirements.txt file to use. 15 | required: false 16 | default: ./requirements.txt 17 | reporting-txt-file: 18 | description: Path to a reporting.txt file to use. 19 | required: false 20 | default: liccheck-report.txt 21 | no-deps: 22 | description: Whether not to check dependencies. 23 | required: false 24 | liccheck-version: 25 | description: Set the liccheck package version. 26 | required: false 27 | default: 0.6.4 28 | 29 | runs: 30 | using: 'node16' 31 | main: 'dist/index.js' 32 | 33 | branding: 34 | icon: check-square 35 | color: 'green' 36 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | ci: 2 | autoupdate_schedule: quarterly 3 | 4 | exclude: ^dist/ 5 | 6 | repos: 7 | - repo: https://github.com/pre-commit/pre-commit-hooks 8 | rev: v5.0.0 9 | hooks: 10 | - id: trailing-whitespace 11 | - id: end-of-file-fixer 12 | - id: check-json 13 | - id: check-added-large-files 14 | args: ['--maxkb=20000'] 15 | - id: check-yaml 16 | - id: double-quote-string-fixer 17 | 18 | - repo: https://github.com/pre-commit/mirrors-prettier 19 | rev: 'v4.0.0-alpha.8' 20 | hooks: 21 | - id: prettier 22 | 23 | files: "\\.(\ 24 | css|less|scss\ 25 | |graphql|gql\ 26 | |html\ 27 | |js|jsx\ 28 | |json\ 29 | |ts|tsx\ 30 | |vue\ 31 | |yaml|yml\ 32 | )$" 33 | - repo: https://github.com/pre-commit/mirrors-prettier 34 | rev: 'v4.0.0-alpha.8' 35 | hooks: 36 | - id: prettier 37 | 38 | name: prettier-markdown 39 | entry: prettier --write --parser mdx 40 | files: "\\.(\ 41 | |md|markdown|mdown|mkdn\ 42 | |mdx\ 43 | )$" 44 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Onwards Anderson Banihirwe 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gh-action-py-liccheck", 3 | "version": "2023.03.13", 4 | "private": true, 5 | "description": "Verify the licenses of dependencies of a Python package and report issues.", 6 | "main": "lib/main.js", 7 | "scripts": { 8 | "build": "tsc", 9 | "package": "ncc build --source-map --license licenses.txt", 10 | "test": "echo no tests.", 11 | "all": "npm run build && npm run package && npm test" 12 | }, 13 | "repository": { 14 | "type": "git", 15 | "url": "git+https://github.com/andersy005/gh-action-py-licensed.git" 16 | }, 17 | "keywords": [ 18 | "action", 19 | "conda", 20 | "license", 21 | "github", 22 | "python", 23 | "liccheck" 24 | ], 25 | "author": "Anderson Banihirwe", 26 | "license": "MIT", 27 | "bugs": { 28 | "url": "https://github.com/andersy005/gh-action-py-licensed" 29 | }, 30 | "homepage": "https://github.com/andersy005/gh-action-py-licensed#readme", 31 | "dependencies": { 32 | "@actions/core": "^1.11.1", 33 | "@actions/exec": "^1.1.1", 34 | "@actions/io": "^1.1.3", 35 | "ansi-styles": "^6.2.1" 36 | }, 37 | "devDependencies": { 38 | "@types/jest": "^29.5.14", 39 | "@types/node": "^22.13.0", 40 | "@typescript-eslint/parser": "^8.22.0", 41 | "@vercel/ncc": "^0.38.3", 42 | "eslint": "^9.19.0", 43 | "eslint-plugin-github": "^5.1.7", 44 | "eslint-plugin-i18n-text": "^1.0.1", 45 | "eslint-plugin-jest": "^28.11.0", 46 | "eslint-plugin-sort-imports-es6-autofix": "^0.6.0", 47 | "jest": "^29.7.0", 48 | "jest-circus": "^29.7.0", 49 | "js-yaml": "^4.1.0", 50 | "prettier": "3.4.2", 51 | "ts-jest": "^29.2.5", 52 | "typescript": "^5.7.3" 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "jest", 4 | "@typescript-eslint", 5 | "sort-imports-es6-autofix", 6 | "i18n-text" 7 | ], 8 | "extends": ["plugin:github/recommended", "plugin:jest/recommended"], 9 | 10 | "env": { 11 | "node": true, 12 | "es6": true, 13 | "jest/globals": true 14 | }, 15 | "parser": "@typescript-eslint/parser", 16 | "parserOptions": { 17 | "ecmaVersion": 9, 18 | "sourceType": "module", 19 | "project": "./tsconfig.json" 20 | }, 21 | "rules": { 22 | "i18n-text/no-en": 2, 23 | "sort-imports-es6-autofix/sort-imports-es6": [ 24 | 2, 25 | { 26 | "ignoreCase": false, 27 | "ignoreMemberSort": false, 28 | "memberSyntaxSortOrder": ["none", "all", "multiple", "single"] 29 | } 30 | ], 31 | "eslint-comments/no-use": "off", 32 | "import/no-namespace": "off", 33 | "no-unused-vars": "off", 34 | "@typescript-eslint/no-unused-vars": "error", 35 | "@typescript-eslint/explicit-member-accessibility": [ 36 | "error", 37 | { "accessibility": "no-public" } 38 | ], 39 | "@typescript-eslint/no-require-imports": "error", 40 | "@typescript-eslint/array-type": "error", 41 | "@typescript-eslint/await-thenable": "error", 42 | "@typescript-eslint/ban-ts-comment": "error", 43 | "camelcase": "off", 44 | "@typescript-eslint/consistent-type-assertions": "error", 45 | "@typescript-eslint/explicit-function-return-type": [ 46 | "error", 47 | { "allowExpressions": true } 48 | ], 49 | "@typescript-eslint/func-call-spacing": ["error", "never"], 50 | "@typescript-eslint/no-array-constructor": "error", 51 | "@typescript-eslint/no-empty-interface": "error", 52 | "@typescript-eslint/no-explicit-any": "error", 53 | "@typescript-eslint/no-extraneous-class": "error", 54 | "@typescript-eslint/no-for-in-array": "error", 55 | "@typescript-eslint/no-inferrable-types": "error", 56 | "@typescript-eslint/no-misused-new": "error", 57 | "@typescript-eslint/no-namespace": "error", 58 | "@typescript-eslint/no-non-null-assertion": "warn", 59 | "@typescript-eslint/no-unnecessary-qualifier": "error", 60 | "@typescript-eslint/no-unnecessary-type-assertion": "error", 61 | "@typescript-eslint/no-useless-constructor": "error", 62 | "@typescript-eslint/no-var-requires": "error", 63 | "@typescript-eslint/prefer-for-of": "warn", 64 | "@typescript-eslint/prefer-function-type": "warn", 65 | "@typescript-eslint/prefer-includes": "error", 66 | "@typescript-eslint/prefer-string-starts-ends-with": "error", 67 | "@typescript-eslint/promise-function-async": "error", 68 | "@typescript-eslint/require-array-sort-compare": "error", 69 | "@typescript-eslint/restrict-plus-operands": "error", 70 | "semi": "off", 71 | "@typescript-eslint/semi": ["error", "never"], 72 | "@typescript-eslint/type-annotation-spacing": "error", 73 | "@typescript-eslint/unbound-method": "error" 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: # rebuild any PRs and main branch changes 3 | push: 4 | branches: [main] 5 | paths-ignore: 6 | - 'README.md' 7 | - 'docs/**' 8 | pull_request: 9 | branches: [main] 10 | paths-ignore: 11 | - 'README.md' 12 | - 'docs/**' 13 | 14 | jobs: 15 | build: # make sure build/ci work properly 16 | runs-on: ubuntu-latest 17 | steps: 18 | - uses: actions/checkout@v4 19 | - uses: actions/setup-python@v5 20 | with: 21 | python-version: '3.11' 22 | - name: Install dependencies 23 | run: | 24 | python -m pip install --upgrade pip 25 | python -m pip install -r requirements.txt 26 | - run: | 27 | npm install 28 | - run: | 29 | npm run all 30 | - uses: actions/upload-artifact@v4 31 | with: 32 | name: dist 33 | path: dist 34 | - uses: actions/upload-artifact@v4 35 | with: 36 | name: action.yml 37 | path: action.yml 38 | test: # make sure the action works on a clean machine without building 39 | needs: [build] 40 | runs-on: ubuntu-latest 41 | strategy: 42 | matrix: 43 | target: [built, committed] 44 | steps: 45 | - uses: actions/checkout@v4 46 | - uses: actions/setup-python@v5 47 | with: 48 | python-version: '3.11' 49 | - name: Install dependencies 50 | run: | 51 | python -m pip install --upgrade pip 52 | python -m pip install -r requirements.txt 53 | 54 | - if: matrix.target == 'built' || github.event_name == 'pull_request' 55 | uses: actions/download-artifact@v4 56 | with: 57 | name: dist 58 | path: dist 59 | - if: matrix.target == 'built' || github.event_name == 'pull_request' 60 | uses: actions/download-artifact@v4 61 | with: 62 | name: action.yml 63 | path: . 64 | 65 | - name: default inputs 66 | uses: ./ 67 | 68 | - name: user inputs 69 | uses: ./ 70 | with: 71 | strategy-ini-file: ./my_strategy.ini 72 | level: cautious 73 | requirements-txt-file: ./requirements.txt 74 | no-deps: true 75 | liccheck-version: 0.9.2 76 | 77 | - name: user inputs (paranoid) 78 | continue-on-error: true 79 | uses: ./ 80 | with: 81 | level: paranoid 82 | 83 | package: 84 | if: github.event_name == 'push' && github.ref == 'refs/heads/main' 85 | needs: [test] 86 | runs-on: ubuntu-latest 87 | steps: 88 | - uses: actions/checkout@v4 89 | with: 90 | ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} 91 | - uses: actions/download-artifact@v4 92 | with: 93 | name: dist 94 | path: dist 95 | - name: Create Pull Request 96 | uses: peter-evans/create-pull-request@v7 97 | with: 98 | commit-message: 'build: update distribution' 99 | committer: GitHub 100 | author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> 101 | title: Update distribution 102 | body: | 103 | - Updates the distribution for changes on `main` 104 | - Auto-generated by [create-pull-request][1] 105 | 106 | [1]: https://github.com/peter-evans/create-pull-request 107 | branch: update-distribution 108 | delete-branch: true 109 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | downloads/ 14 | eggs/ 15 | .eggs/ 16 | lib/ 17 | lib64/ 18 | parts/ 19 | sdist/ 20 | var/ 21 | wheels/ 22 | pip-wheel-metadata/ 23 | share/python-wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | MANIFEST 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | htmlcov/ 41 | .tox/ 42 | .nox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *.cover 49 | *.py,cover 50 | .hypothesis/ 51 | .pytest_cache/ 52 | 53 | # Translations 54 | *.mo 55 | *.pot 56 | 57 | # Django stuff: 58 | *.log 59 | local_settings.py 60 | db.sqlite3 61 | db.sqlite3-journal 62 | 63 | # Flask stuff: 64 | instance/ 65 | .webassets-cache 66 | 67 | # Scrapy stuff: 68 | .scrapy 69 | 70 | # Sphinx documentation 71 | docs/_build/ 72 | 73 | # PyBuilder 74 | target/ 75 | 76 | # Jupyter Notebook 77 | .ipynb_checkpoints 78 | 79 | # IPython 80 | profile_default/ 81 | ipython_config.py 82 | 83 | # pyenv 84 | .python-version 85 | 86 | # pipenv 87 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 88 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 89 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 90 | # install all needed dependencies. 91 | #Pipfile.lock 92 | 93 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 94 | __pypackages__/ 95 | 96 | # Celery stuff 97 | celerybeat-schedule 98 | celerybeat.pid 99 | 100 | # SageMath parsed files 101 | *.sage.py 102 | 103 | # Environments 104 | .env 105 | .venv 106 | env/ 107 | venv/ 108 | ENV/ 109 | env.bak/ 110 | venv.bak/ 111 | 112 | # Spyder project settings 113 | .spyderproject 114 | .spyproject 115 | 116 | # Rope project settings 117 | .ropeproject 118 | 119 | # mkdocs documentation 120 | /site 121 | 122 | # mypy 123 | .mypy_cache/ 124 | .dmypy.json 125 | dmypy.json 126 | 127 | # Pyre type checker 128 | .pyre/ 129 | 130 | 131 | # Logs 132 | logs 133 | *.log 134 | npm-debug.log* 135 | yarn-debug.log* 136 | yarn-error.log* 137 | lerna-debug.log* 138 | 139 | # Diagnostic reports (https://nodejs.org/api/report.html) 140 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 141 | 142 | # Runtime data 143 | pids 144 | *.pid 145 | *.seed 146 | *.pid.lock 147 | 148 | # Directory for instrumented libs generated by jscoverage/JSCover 149 | lib-cov 150 | 151 | # Coverage directory used by tools like istanbul 152 | coverage 153 | *.lcov 154 | 155 | # nyc test coverage 156 | .nyc_output 157 | 158 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 159 | .grunt 160 | 161 | # Bower dependency directory (https://bower.io/) 162 | bower_components 163 | 164 | # node-waf configuration 165 | .lock-wscript 166 | 167 | # Compiled binary addons (https://nodejs.org/api/addons.html) 168 | build/Release 169 | 170 | # Dependency directories 171 | node_modules/ 172 | jspm_packages/ 173 | 174 | # Snowpack dependency directory (https://snowpack.dev/) 175 | web_modules/ 176 | 177 | # TypeScript cache 178 | *.tsbuildinfo 179 | 180 | # Optional npm cache directory 181 | .npm 182 | 183 | # Optional eslint cache 184 | .eslintcache 185 | 186 | # Microbundle cache 187 | .rpt2_cache/ 188 | .rts2_cache_cjs/ 189 | .rts2_cache_es/ 190 | .rts2_cache_umd/ 191 | 192 | # Optional REPL history 193 | .node_repl_history 194 | 195 | # Output of 'npm pack' 196 | *.tgz 197 | 198 | # Yarn Integrity file 199 | .yarn-integrity 200 | 201 | # dotenv environment variables file 202 | .env 203 | .env.test 204 | 205 | # parcel-bundler cache (https://parceljs.org/) 206 | .cache 207 | .parcel-cache 208 | 209 | # Next.js build output 210 | .next 211 | out 212 | 213 | # Nuxt.js build / generate output 214 | .nuxt 215 | 216 | # Gatsby files 217 | .cache/ 218 | # Comment in the public line in if your project uses Gatsby and not Next.js 219 | # https://nextjs.org/blog/next-9-1#public-directory-support 220 | # public 221 | 222 | # vuepress build output 223 | .vuepress/dist 224 | 225 | # Serverless directories 226 | .serverless/ 227 | 228 | # FuseBox cache 229 | .fusebox/ 230 | 231 | # DynamoDB Local files 232 | .dynamodb/ 233 | 234 | # TernJS port file 235 | .tern-port 236 | 237 | # Stores VSCode versions used for testing VSCode extensions 238 | .vscode-test 239 | 240 | # yarn v2 241 | .yarn/cache 242 | .yarn/unplugged 243 | .yarn/build-state.yml 244 | .yarn/install-state.gz 245 | .pnp.* 246 | 247 | # for WebStorm 248 | .idea 249 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable i18n-text/no-en */ 2 | import * as core from '@actions/core' 3 | import * as exec from '@actions/exec' 4 | import * as fs from 'fs' 5 | import * as io from '@actions/io' 6 | import styles from 'ansi-styles' 7 | // eslint-disable-next-line no-undef 8 | import ErrnoException = NodeJS.ErrnoException 9 | 10 | export interface IActionInputs { 11 | readonly strategyIniFile: string 12 | readonly level: string 13 | readonly requirementsTxtFile: string 14 | readonly reportingTxtFile: string 15 | readonly noDeps: string 16 | readonly liccheckVersion: string 17 | } 18 | 19 | export async function parseInputs(): Promise { 20 | try { 21 | const inputs: IActionInputs = Object.freeze({ 22 | strategyIniFile: core.getInput('strategy-ini-file'), 23 | level: core.getInput('level').toUpperCase(), 24 | requirementsTxtFile: core.getInput('requirements-txt-file'), 25 | reportingTxtFile: core.getInput('reporting-txt-file'), 26 | noDeps: core.getInput('no-deps'), 27 | liccheckVersion: core.getInput('liccheck-version'), 28 | }) 29 | return inputs 30 | } catch (error) { 31 | throw error 32 | } 33 | } 34 | 35 | async function readFileAndApplyStyle( 36 | file: string, 37 | style_open: string, 38 | style_close: string, 39 | ): Promise { 40 | try { 41 | const content = fs 42 | .readFileSync(file, 'utf-8') 43 | .trim() 44 | .split('\n') 45 | .map((line) => `${style_open}${line}${style_close}`) 46 | .join('\n') 47 | 48 | return content 49 | } catch (error) { 50 | throw error 51 | } 52 | } 53 | 54 | async function run(): Promise { 55 | try { 56 | const inputs = await core.group('Gathering Inputs...', parseInputs) 57 | 58 | const PythonPath: string = await core.group( 59 | 'Getting python executable path ...', 60 | async () => { 61 | const pythonExe: string = await io.which('python', true) 62 | core.info( 63 | `${styles.cyan.open}Python path: ${pythonExe}${styles.cyan.close}`, 64 | ) 65 | return pythonExe 66 | }, 67 | ) 68 | 69 | await core.group('Installing liccheck...', async () => { 70 | await exec.exec(`"${PythonPath}"`, [ 71 | '-m', 72 | 'pip', 73 | 'install', 74 | `liccheck==${inputs.liccheckVersion}`, 75 | ]) 76 | }) 77 | 78 | const liccheckPath: string = await core.group( 79 | 'Getting liccheck executable path ...', 80 | async () => { 81 | const liccheckExe: string = await io.which('liccheck', true) 82 | core.info( 83 | `${styles.cyan.open}liccheck path: ${liccheckExe}${styles.cyan.close}`, 84 | ) 85 | return liccheckExe 86 | }, 87 | ) 88 | 89 | await core.group('Strategy to use...', async () => { 90 | core.info(typeof styles.bold) 91 | const strategy = await readFileAndApplyStyle( 92 | inputs.strategyIniFile, 93 | styles.bold.open, 94 | styles.bold.close, 95 | ) 96 | core.info(strategy) 97 | }) 98 | 99 | await core.group('Checking licenses for ...', async () => { 100 | const requirements = await readFileAndApplyStyle( 101 | inputs.requirementsTxtFile, 102 | styles.bold.open, 103 | styles.bold.close, 104 | ) 105 | core.info(requirements) 106 | }) 107 | 108 | const commandOptions: string[] = [] 109 | const tomls = ['pyproject.toml', './pyproject.toml'] 110 | if (!tomls.includes(inputs.strategyIniFile)) { 111 | commandOptions.push(...['-s', inputs.strategyIniFile]) 112 | } 113 | 114 | if (!pathExists(inputs.reportingTxtFile)) { 115 | createFile(inputs.reportingTxtFile) 116 | } 117 | 118 | commandOptions.push( 119 | ...[ 120 | '-r', 121 | inputs.requirementsTxtFile, 122 | '-l', 123 | inputs.level, 124 | '-R', 125 | inputs.reportingTxtFile, 126 | ], 127 | ) 128 | 129 | if (inputs.noDeps === 'true') { 130 | commandOptions.push('--no-deps') 131 | } 132 | 133 | type customError = { 134 | message: string 135 | status: boolean 136 | } 137 | 138 | const errors: customError = { message: '', status: false } 139 | 140 | await core.group('Running the license checker...', async () => { 141 | try { 142 | await exec.exec(`"${liccheckPath}"`, commandOptions) 143 | } catch (error) { 144 | errors.message = error.message 145 | errors.status = true 146 | } 147 | }) 148 | core.info( 149 | `${styles.cyan.open}License Checker Report ...${styles.cyan.close}`, 150 | ) 151 | const report = await readFileAndApplyStyle( 152 | inputs.reportingTxtFile, 153 | styles.bold.open, 154 | styles.bold.close, 155 | ) 156 | core.info(report) 157 | if (errors.status === true) { 158 | core.setFailed( 159 | `${errors.message}. ${styles.bold.open}Found incompatible and/or unknown licenses. For more information, check the 'Running the license checker' and 'License checker report' sections.${styles.bold.close}`, 160 | ) 161 | } 162 | } catch (error) { 163 | core.setFailed(error.message) 164 | } 165 | } 166 | 167 | function pathExists(path: string): boolean { 168 | let returnVal = false 169 | fs.stat(path, (exists: ErrnoException | null) => { 170 | if (exists == null) { 171 | returnVal = true 172 | } else if (exists.code === 'ENOENT') { 173 | core.info(`${path} was not found...`) 174 | returnVal = false 175 | } 176 | }) 177 | return returnVal 178 | } 179 | 180 | function createFile(path: string): void { 181 | fs.writeFile(path, '', (err: ErrnoException | null) => { 182 | if (!err) { 183 | core.info(`Creating ${path}...`) 184 | } 185 | }) 186 | } 187 | 188 | run() 189 | -------------------------------------------------------------------------------- /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/http-client 26 | MIT 27 | Actions Http Client for Node.js 28 | 29 | Copyright (c) GitHub, Inc. 30 | 31 | All rights reserved. 32 | 33 | MIT License 34 | 35 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 36 | associated documentation files (the "Software"), to deal in the Software without restriction, 37 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 38 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 39 | subject to the following conditions: 40 | 41 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 42 | 43 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 44 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 45 | NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 46 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 47 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 48 | 49 | 50 | @actions/io 51 | MIT 52 | The MIT License (MIT) 53 | 54 | Copyright 2019 GitHub 55 | 56 | 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: 57 | 58 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 59 | 60 | 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. 61 | 62 | ansi-styles 63 | MIT 64 | MIT License 65 | 66 | Copyright (c) Sindre Sorhus (https://sindresorhus.com) 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 | 75 | tunnel 76 | MIT 77 | The MIT License (MIT) 78 | 79 | Copyright (c) 2012 Koichi Kobayashi 80 | 81 | Permission is hereby granted, free of charge, to any person obtaining a copy 82 | of this software and associated documentation files (the "Software"), to deal 83 | in the Software without restriction, including without limitation the rights 84 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 85 | copies of the Software, and to permit persons to whom the Software is 86 | furnished to do so, subject to the following conditions: 87 | 88 | The above copyright notice and this permission notice shall be included in 89 | all copies or substantial portions of the Software. 90 | 91 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 92 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 93 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 94 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 95 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 96 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 97 | THE SOFTWARE. 98 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/andersy005/gh-action-py-liccheck/main.svg)](https://results.pre-commit.ci/latest/github/andersy005/gh-action-py-liccheck/main) 2 | 3 | # `andersy005/gh-action-py-liccheck` 4 | 5 | - [`andersy005/gh-action-py-liccheck`](#andersy005gh-action-py-liccheck) 6 | - [Usage](#usage) 7 | - [Basic](#basic) 8 | - [With custom locations for strategy and requirements files](#with-custom-locations-for-strategy-and-requirements-files) 9 | - [GitHub action outcomes](#github-action-outcomes) 10 | - [Arguments](#arguments) 11 | - [How `liccheck` works](#how-liccheck-works) 12 | - [Example strategy files](#example-strategy-files) 13 | - [Contributing](#contributing) 14 | - [License](#license) 15 | 16 | This GitHub action checks license of Python packages and their dependencies via the [liccheck](https://github.com/dhatim/python-license-check) package. 17 | 18 | ## Usage 19 | 20 | To integrate this action with your action pipelines, add the following step to your workflow file (e.g. `.github/workflows/ci.yml`). 21 | 22 | ### Basic 23 | 24 | The basic usage uses the default values defined in table below. Therefore, as a user you don't have to specify any argument: 25 | 26 | ```yaml 27 | - name: License Checker 28 | uses: andersy005/gh-action-py-liccheck@main 29 | ``` 30 | 31 | ### With custom locations for strategy and requirements files 32 | 33 | ```yaml 34 | - name: License Checker 35 | uses: andersy005/gh-action-py-liccheck@main 36 | with: 37 | strategy-ini-file: ./my-strategy.ini 38 | level: standard 39 | requirements-txt-file: ./my-requirements.txt 40 | no-deps: true 41 | liccheck-version: 0.6.4 42 | ``` 43 | 44 | ## GitHub action outcomes 45 | 46 | Once this action finishes running, it reports the status of compliance of packages. Depending on your settings (strategy, level, etc), you should see something of this sort in your workflow's logs: 47 | 48 |
49 | Outcome 1 - Success 50 | 51 | 52 | 53 |
54 | 55 |
56 | Outcome 2 - Failure 57 | 58 | 59 | 60 |
61 | 62 | ## Arguments 63 | 64 | This action currently supports four inputs from the user: `strategy-ini-file`, `level`, `requirements-txt-file`, and `no-deps`. 65 | 66 | These inputs, along with their descriptions and usage contexts, are listed in the table below: 67 | 68 | | Input | Description | Usage | Default | 69 | | :---------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------: | :----------------: | 70 | | `strategy-ini-file` | Path to a strategy ini file or a pyproject.toml file to use. See [examples](#example-strategy-files) below. | Optional | `pyproject.toml` | 71 | | `requirements-txt-file` | Path to a requirements.txt file to use. | Optional | `requirements.txt` | 72 | | `no-deps` | Whether **not** to check dependencies. | Optional | `false` | 73 | | `level` | Level for testing compliance of packages, where: `standard` - At least one authorized license (default); `cautious` - Per standard but no unauthorized licenses; `paranoid` - All licenses must be authorized. | Optional | `standard` | 74 | | `liccheck-version` | Set the liccheck package version. | Optional | `0.6.4` | 75 | 76 | ## How `liccheck` works 77 | 78 | `liccheck` verifies compliance of packages defined in a `requirements.txt` file against a strategy defined in either a `pyproject.toml` or `.ini` file. To use this GitHub action, you have to define the following three items in your strategy file: 79 | 80 | - authorized license list 81 | - unauthorized license list 82 | - authorized package list (optional) 83 | 84 | **NOTE:** The packages from your `requirements.txt` need to all be installed in a Python environment prior to using this GitHub action. 85 | 86 | ## Example strategy files 87 | 88 | Here are some examples showcasing how to define a strategy in both `pyproject.toml` and `.ini` files: 89 | 90 |
91 | Example pyproject.toml 92 | 93 | ```toml 94 | [tool.liccheck] 95 | # Authorized and unauthorized licenses in LOWER CASE 96 | authorized_licenses = [ 97 | "bsd", 98 | "new bsd", 99 | "bsd license", 100 | "new bsd license", 101 | "simplified bsd", 102 | "apache", 103 | "apache 2.0", 104 | "apache software license", 105 | "apache software", 106 | "gnu lgpl", 107 | "lgpl with exceptions or zpl", 108 | "isc license", 109 | "isc license (iscl)", 110 | "mit", 111 | "mit license", 112 | "python software foundation license", 113 | "zpl 2.1" 114 | ] 115 | 116 | unauthorized_licenses = [ 117 | "gpl v3" 118 | ] 119 | 120 | [tool.liccheck.authorized_packages] 121 | uuid = "<=1.30" 122 | ``` 123 | 124 |
125 | 126 |
127 | Example strategy.ini 128 | 129 | ```ini 130 | # Authorized and unauthorized licenses in LOWER CASE 131 | [Licenses] 132 | authorized_licenses: 133 | bsd 134 | new bsd 135 | bsd license 136 | new bsd license 137 | simplified bsd 138 | apache 139 | apache 2.0 140 | apache software license 141 | apache software 142 | gnu lgpl 143 | lgpl with exceptions or zpl 144 | isc license 145 | isc license (iscl) 146 | mit 147 | mit license 148 | python software foundation license 149 | zpl 2.1 150 | 151 | unauthorized_licenses: 152 | gpl v3 153 | 154 | [Authorized Packages] 155 | uuid: 1.30 156 | 157 | ``` 158 | 159 |
160 | 161 | ## Contributing 162 | 163 | Contributions are welcome! 164 | 165 | ## License 166 | 167 | The code and documentation in this project are released under the 168 | [MIT License](LICENSE). 169 | -------------------------------------------------------------------------------- /dist/sourcemap-register.js: -------------------------------------------------------------------------------- 1 | (()=>{var e={296:e=>{var r=Object.prototype.toString;var n=typeof Buffer!=="undefined"&&typeof Buffer.alloc==="function"&&typeof Buffer.allocUnsafe==="function"&&typeof Buffer.from==="function";function isArrayBuffer(e){return r.call(e).slice(8,-1)==="ArrayBuffer"}function fromArrayBuffer(e,r,t){r>>>=0;var o=e.byteLength-r;if(o<0){throw new RangeError("'offset' is out of bounds")}if(t===undefined){t=o}else{t>>>=0;if(t>o){throw new RangeError("'length' is out of bounds")}}return n?Buffer.from(e.slice(r,r+t)):new Buffer(new Uint8Array(e.slice(r,r+t)))}function fromString(e,r){if(typeof r!=="string"||r===""){r="utf8"}if(!Buffer.isEncoding(r)){throw new TypeError('"encoding" must be a valid string encoding')}return n?Buffer.from(e,r):new Buffer(e,r)}function bufferFrom(e,r,t){if(typeof e==="number"){throw new TypeError('"value" argument must not be a number')}if(isArrayBuffer(e)){return fromArrayBuffer(e,r,t)}if(typeof e==="string"){return fromString(e,r)}return n?Buffer.from(e):new Buffer(e)}e.exports=bufferFrom},599:(e,r,n)=>{e=n.nmd(e);var t=n(927).SourceMapConsumer;var o=n(928);var i;try{i=n(896);if(!i.existsSync||!i.readFileSync){i=null}}catch(e){}var a=n(296);function dynamicRequire(e,r){return e.require(r)}var u=false;var s=false;var l=false;var c="auto";var p={};var f={};var g=/^data:application\/json[^,]+base64,/;var d=[];var h=[];function isInBrowser(){if(c==="browser")return true;if(c==="node")return false;return typeof window!=="undefined"&&typeof XMLHttpRequest==="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}function hasGlobalProcessEventEmitter(){return typeof process==="object"&&process!==null&&typeof process.on==="function"}function globalProcessVersion(){if(typeof process==="object"&&process!==null){return process.version}else{return""}}function globalProcessStderr(){if(typeof process==="object"&&process!==null){return process.stderr}}function globalProcessExit(e){if(typeof process==="object"&&process!==null&&typeof process.exit==="function"){return process.exit(e)}}function handlerExec(e){return function(r){for(var n=0;n"}var n=this.getLineNumber();if(n!=null){r+=":"+n;var t=this.getColumnNumber();if(t){r+=":"+t}}}var o="";var i=this.getFunctionName();var a=true;var u=this.isConstructor();var s=!(this.isToplevel()||u);if(s){var l=this.getTypeName();if(l==="[object Object]"){l="null"}var c=this.getMethodName();if(i){if(l&&i.indexOf(l)!=0){o+=l+"."}o+=i;if(c&&i.indexOf("."+c)!=i.length-c.length-1){o+=" [as "+c+"]"}}else{o+=l+"."+(c||"")}}else if(u){o+="new "+(i||"")}else if(i){o+=i}else{o+=r;a=false}if(a){o+=" ("+r+")"}return o}function cloneCallSite(e){var r={};Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(n){r[n]=/^(?:is|get)/.test(n)?function(){return e[n].call(e)}:e[n]}));r.toString=CallSiteToString;return r}function wrapCallSite(e,r){if(r===undefined){r={nextPosition:null,curPosition:null}}if(e.isNative()){r.curPosition=null;return e}var n=e.getFileName()||e.getScriptNameOrSourceURL();if(n){var t=e.getLineNumber();var o=e.getColumnNumber()-1;var i=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/;var a=i.test(globalProcessVersion())?0:62;if(t===1&&o>a&&!isInBrowser()&&!e.isEval()){o-=a}var u=mapSourcePosition({source:n,line:t,column:o});r.curPosition=u;e=cloneCallSite(e);var s=e.getFunctionName;e.getFunctionName=function(){if(r.nextPosition==null){return s()}return r.nextPosition.name||s()};e.getFileName=function(){return u.source};e.getLineNumber=function(){return u.line};e.getColumnNumber=function(){return u.column+1};e.getScriptNameOrSourceURL=function(){return u.source};return e}var l=e.isEval()&&e.getEvalOrigin();if(l){l=mapEvalOrigin(l);e=cloneCallSite(e);e.getEvalOrigin=function(){return l};return e}return e}function prepareStackTrace(e,r){if(l){p={};f={}}var n=e.name||"Error";var t=e.message||"";var o=n+": "+t;var i={nextPosition:null,curPosition:null};var a=[];for(var u=r.length-1;u>=0;u--){a.push("\n at "+wrapCallSite(r[u],i));i.nextPosition=i.curPosition}i.curPosition=i.nextPosition=null;return o+a.reverse().join("")}function getErrorSource(e){var r=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(e.stack);if(r){var n=r[1];var t=+r[2];var o=+r[3];var a=p[n];if(!a&&i&&i.existsSync(n)){try{a=i.readFileSync(n,"utf8")}catch(e){a=""}}if(a){var u=a.split(/(?:\r\n|\r|\n)/)[t-1];if(u){return n+":"+t+"\n"+u+"\n"+new Array(o).join(" ")+"^"}}}return null}function printErrorAndExit(e){var r=getErrorSource(e);var n=globalProcessStderr();if(n&&n._handle&&n._handle.setBlocking){n._handle.setBlocking(true)}if(r){console.error();console.error(r)}console.error(e.stack);globalProcessExit(1)}function shimEmitUncaughtException(){var e=process.emit;process.emit=function(r){if(r==="uncaughtException"){var n=arguments[1]&&arguments[1].stack;var t=this.listeners(r).length>0;if(n&&!t){return printErrorAndExit(arguments[1])}}return e.apply(this,arguments)}}var S=d.slice(0);var _=h.slice(0);r.wrapCallSite=wrapCallSite;r.getErrorSource=getErrorSource;r.mapSourcePosition=mapSourcePosition;r.retrieveSourceMap=v;r.install=function(r){r=r||{};if(r.environment){c=r.environment;if(["node","browser","auto"].indexOf(c)===-1){throw new Error("environment "+c+" was unknown. Available options are {auto, browser, node}")}}if(r.retrieveFile){if(r.overrideRetrieveFile){d.length=0}d.unshift(r.retrieveFile)}if(r.retrieveSourceMap){if(r.overrideRetrieveSourceMap){h.length=0}h.unshift(r.retrieveSourceMap)}if(r.hookRequire&&!isInBrowser()){var n=dynamicRequire(e,"module");var t=n.prototype._compile;if(!t.__sourceMapSupport){n.prototype._compile=function(e,r){p[r]=e;f[r]=undefined;return t.call(this,e,r)};n.prototype._compile.__sourceMapSupport=true}}if(!l){l="emptyCacheBetweenOperations"in r?r.emptyCacheBetweenOperations:false}if(!u){u=true;Error.prepareStackTrace=prepareStackTrace}if(!s){var o="handleUncaughtExceptions"in r?r.handleUncaughtExceptions:true;try{var i=dynamicRequire(e,"worker_threads");if(i.isMainThread===false){o=false}}catch(e){}if(o&&hasGlobalProcessEventEmitter()){s=true;shimEmitUncaughtException()}}};r.resetRetrieveHandlers=function(){d.length=0;h.length=0;d=S.slice(0);h=_.slice(0);v=handlerExec(h);m=handlerExec(d)}},517:(e,r,n)=>{var t=n(297);var o=Object.prototype.hasOwnProperty;var i=typeof Map!=="undefined";function ArraySet(){this._array=[];this._set=i?new Map:Object.create(null)}ArraySet.fromArray=function ArraySet_fromArray(e,r){var n=new ArraySet;for(var t=0,o=e.length;t=0){return r}}else{var n=t.toSetString(e);if(o.call(this._set,n)){return this._set[n]}}throw new Error('"'+e+'" is not in the set.')};ArraySet.prototype.at=function ArraySet_at(e){if(e>=0&&e{var t=n(158);var o=5;var i=1<>1;return r?-n:n}r.encode=function base64VLQ_encode(e){var r="";var n;var i=toVLQSigned(e);do{n=i&a;i>>>=o;if(i>0){n|=u}r+=t.encode(n)}while(i>0);return r};r.decode=function base64VLQ_decode(e,r,n){var i=e.length;var s=0;var l=0;var c,p;do{if(r>=i){throw new Error("Expected more digits in base 64 VLQ value.")}p=t.decode(e.charCodeAt(r++));if(p===-1){throw new Error("Invalid base64 digit: "+e.charAt(r-1))}c=!!(p&u);p&=a;s=s+(p<{var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");r.encode=function(e){if(0<=e&&e{r.GREATEST_LOWER_BOUND=1;r.LEAST_UPPER_BOUND=2;function recursiveSearch(e,n,t,o,i,a){var u=Math.floor((n-e)/2)+e;var s=i(t,o[u],true);if(s===0){return u}else if(s>0){if(n-u>1){return recursiveSearch(u,n,t,o,i,a)}if(a==r.LEAST_UPPER_BOUND){return n1){return recursiveSearch(e,u,t,o,i,a)}if(a==r.LEAST_UPPER_BOUND){return u}else{return e<0?-1:e}}}r.search=function search(e,n,t,o){if(n.length===0){return-1}var i=recursiveSearch(-1,n.length,e,n,t,o||r.GREATEST_LOWER_BOUND);if(i<0){return-1}while(i-1>=0){if(t(n[i],n[i-1],true)!==0){break}--i}return i}},24:(e,r,n)=>{var t=n(297);function generatedPositionAfter(e,r){var n=e.generatedLine;var o=r.generatedLine;var i=e.generatedColumn;var a=r.generatedColumn;return o>n||o==n&&a>=i||t.compareByGeneratedPositionsInflated(e,r)<=0}function MappingList(){this._array=[];this._sorted=true;this._last={generatedLine:-1,generatedColumn:0}}MappingList.prototype.unsortedForEach=function MappingList_forEach(e,r){this._array.forEach(e,r)};MappingList.prototype.add=function MappingList_add(e){if(generatedPositionAfter(this._last,e)){this._last=e;this._array.push(e)}else{this._sorted=false;this._array.push(e)}};MappingList.prototype.toArray=function MappingList_toArray(){if(!this._sorted){this._array.sort(t.compareByGeneratedPositionsInflated);this._sorted=true}return this._array};r.P=MappingList},299:(e,r)=>{function swap(e,r,n){var t=e[r];e[r]=e[n];e[n]=t}function randomIntInRange(e,r){return Math.round(e+Math.random()*(r-e))}function doQuickSort(e,r,n,t){if(n{var t;var o=n(297);var i=n(197);var a=n(517).C;var u=n(818);var s=n(299).g;function SourceMapConsumer(e,r){var n=e;if(typeof e==="string"){n=o.parseSourceMapInput(e)}return n.sections!=null?new IndexedSourceMapConsumer(n,r):new BasicSourceMapConsumer(n,r)}SourceMapConsumer.fromSourceMap=function(e,r){return BasicSourceMapConsumer.fromSourceMap(e,r)};SourceMapConsumer.prototype._version=3;SourceMapConsumer.prototype.__generatedMappings=null;Object.defineProperty(SourceMapConsumer.prototype,"_generatedMappings",{configurable:true,enumerable:true,get:function(){if(!this.__generatedMappings){this._parseMappings(this._mappings,this.sourceRoot)}return this.__generatedMappings}});SourceMapConsumer.prototype.__originalMappings=null;Object.defineProperty(SourceMapConsumer.prototype,"_originalMappings",{configurable:true,enumerable:true,get:function(){if(!this.__originalMappings){this._parseMappings(this._mappings,this.sourceRoot)}return this.__originalMappings}});SourceMapConsumer.prototype._charIsMappingSeparator=function SourceMapConsumer_charIsMappingSeparator(e,r){var n=e.charAt(r);return n===";"||n===","};SourceMapConsumer.prototype._parseMappings=function SourceMapConsumer_parseMappings(e,r){throw new Error("Subclasses must implement _parseMappings")};SourceMapConsumer.GENERATED_ORDER=1;SourceMapConsumer.ORIGINAL_ORDER=2;SourceMapConsumer.GREATEST_LOWER_BOUND=1;SourceMapConsumer.LEAST_UPPER_BOUND=2;SourceMapConsumer.prototype.eachMapping=function SourceMapConsumer_eachMapping(e,r,n){var t=r||null;var i=n||SourceMapConsumer.GENERATED_ORDER;var a;switch(i){case SourceMapConsumer.GENERATED_ORDER:a=this._generatedMappings;break;case SourceMapConsumer.ORIGINAL_ORDER:a=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var u=this.sourceRoot;a.map((function(e){var r=e.source===null?null:this._sources.at(e.source);r=o.computeSourceURL(u,r,this._sourceMapURL);return{source:r,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:e.name===null?null:this._names.at(e.name)}}),this).forEach(e,t)};SourceMapConsumer.prototype.allGeneratedPositionsFor=function SourceMapConsumer_allGeneratedPositionsFor(e){var r=o.getArg(e,"line");var n={source:o.getArg(e,"source"),originalLine:r,originalColumn:o.getArg(e,"column",0)};n.source=this._findSourceIndex(n.source);if(n.source<0){return[]}var t=[];var a=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",o.compareByOriginalPositions,i.LEAST_UPPER_BOUND);if(a>=0){var u=this._originalMappings[a];if(e.column===undefined){var s=u.originalLine;while(u&&u.originalLine===s){t.push({line:o.getArg(u,"generatedLine",null),column:o.getArg(u,"generatedColumn",null),lastColumn:o.getArg(u,"lastGeneratedColumn",null)});u=this._originalMappings[++a]}}else{var l=u.originalColumn;while(u&&u.originalLine===r&&u.originalColumn==l){t.push({line:o.getArg(u,"generatedLine",null),column:o.getArg(u,"generatedColumn",null),lastColumn:o.getArg(u,"lastGeneratedColumn",null)});u=this._originalMappings[++a]}}}return t};r.SourceMapConsumer=SourceMapConsumer;function BasicSourceMapConsumer(e,r){var n=e;if(typeof e==="string"){n=o.parseSourceMapInput(e)}var t=o.getArg(n,"version");var i=o.getArg(n,"sources");var u=o.getArg(n,"names",[]);var s=o.getArg(n,"sourceRoot",null);var l=o.getArg(n,"sourcesContent",null);var c=o.getArg(n,"mappings");var p=o.getArg(n,"file",null);if(t!=this._version){throw new Error("Unsupported version: "+t)}if(s){s=o.normalize(s)}i=i.map(String).map(o.normalize).map((function(e){return s&&o.isAbsolute(s)&&o.isAbsolute(e)?o.relative(s,e):e}));this._names=a.fromArray(u.map(String),true);this._sources=a.fromArray(i,true);this._absoluteSources=this._sources.toArray().map((function(e){return o.computeSourceURL(s,e,r)}));this.sourceRoot=s;this.sourcesContent=l;this._mappings=c;this._sourceMapURL=r;this.file=p}BasicSourceMapConsumer.prototype=Object.create(SourceMapConsumer.prototype);BasicSourceMapConsumer.prototype.consumer=SourceMapConsumer;BasicSourceMapConsumer.prototype._findSourceIndex=function(e){var r=e;if(this.sourceRoot!=null){r=o.relative(this.sourceRoot,r)}if(this._sources.has(r)){return this._sources.indexOf(r)}var n;for(n=0;n1){v.source=l+_[1];l+=_[1];v.originalLine=i+_[2];i=v.originalLine;v.originalLine+=1;v.originalColumn=a+_[3];a=v.originalColumn;if(_.length>4){v.name=c+_[4];c+=_[4]}}m.push(v);if(typeof v.originalLine==="number"){h.push(v)}}}s(m,o.compareByGeneratedPositionsDeflated);this.__generatedMappings=m;s(h,o.compareByOriginalPositions);this.__originalMappings=h};BasicSourceMapConsumer.prototype._findMapping=function SourceMapConsumer_findMapping(e,r,n,t,o,a){if(e[n]<=0){throw new TypeError("Line must be greater than or equal to 1, got "+e[n])}if(e[t]<0){throw new TypeError("Column must be greater than or equal to 0, got "+e[t])}return i.search(e,r,o,a)};BasicSourceMapConsumer.prototype.computeColumnSpans=function SourceMapConsumer_computeColumnSpans(){for(var e=0;e=0){var t=this._generatedMappings[n];if(t.generatedLine===r.generatedLine){var i=o.getArg(t,"source",null);if(i!==null){i=this._sources.at(i);i=o.computeSourceURL(this.sourceRoot,i,this._sourceMapURL)}var a=o.getArg(t,"name",null);if(a!==null){a=this._names.at(a)}return{source:i,line:o.getArg(t,"originalLine",null),column:o.getArg(t,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}};BasicSourceMapConsumer.prototype.hasContentsOfAllSources=function BasicSourceMapConsumer_hasContentsOfAllSources(){if(!this.sourcesContent){return false}return this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some((function(e){return e==null}))};BasicSourceMapConsumer.prototype.sourceContentFor=function SourceMapConsumer_sourceContentFor(e,r){if(!this.sourcesContent){return null}var n=this._findSourceIndex(e);if(n>=0){return this.sourcesContent[n]}var t=e;if(this.sourceRoot!=null){t=o.relative(this.sourceRoot,t)}var i;if(this.sourceRoot!=null&&(i=o.urlParse(this.sourceRoot))){var a=t.replace(/^file:\/\//,"");if(i.scheme=="file"&&this._sources.has(a)){return this.sourcesContent[this._sources.indexOf(a)]}if((!i.path||i.path=="/")&&this._sources.has("/"+t)){return this.sourcesContent[this._sources.indexOf("/"+t)]}}if(r){return null}else{throw new Error('"'+t+'" is not in the SourceMap.')}};BasicSourceMapConsumer.prototype.generatedPositionFor=function SourceMapConsumer_generatedPositionFor(e){var r=o.getArg(e,"source");r=this._findSourceIndex(r);if(r<0){return{line:null,column:null,lastColumn:null}}var n={source:r,originalLine:o.getArg(e,"line"),originalColumn:o.getArg(e,"column")};var t=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",o.compareByOriginalPositions,o.getArg(e,"bias",SourceMapConsumer.GREATEST_LOWER_BOUND));if(t>=0){var i=this._originalMappings[t];if(i.source===n.source){return{line:o.getArg(i,"generatedLine",null),column:o.getArg(i,"generatedColumn",null),lastColumn:o.getArg(i,"lastGeneratedColumn",null)}}}return{line:null,column:null,lastColumn:null}};t=BasicSourceMapConsumer;function IndexedSourceMapConsumer(e,r){var n=e;if(typeof e==="string"){n=o.parseSourceMapInput(e)}var t=o.getArg(n,"version");var i=o.getArg(n,"sections");if(t!=this._version){throw new Error("Unsupported version: "+t)}this._sources=new a;this._names=new a;var u={line:-1,column:0};this._sections=i.map((function(e){if(e.url){throw new Error("Support for url field in sections not implemented.")}var n=o.getArg(e,"offset");var t=o.getArg(n,"line");var i=o.getArg(n,"column");if(t{var t=n(818);var o=n(297);var i=n(517).C;var a=n(24).P;function SourceMapGenerator(e){if(!e){e={}}this._file=o.getArg(e,"file",null);this._sourceRoot=o.getArg(e,"sourceRoot",null);this._skipValidation=o.getArg(e,"skipValidation",false);this._sources=new i;this._names=new i;this._mappings=new a;this._sourcesContents=null}SourceMapGenerator.prototype._version=3;SourceMapGenerator.fromSourceMap=function SourceMapGenerator_fromSourceMap(e){var r=e.sourceRoot;var n=new SourceMapGenerator({file:e.file,sourceRoot:r});e.eachMapping((function(e){var t={generated:{line:e.generatedLine,column:e.generatedColumn}};if(e.source!=null){t.source=e.source;if(r!=null){t.source=o.relative(r,t.source)}t.original={line:e.originalLine,column:e.originalColumn};if(e.name!=null){t.name=e.name}}n.addMapping(t)}));e.sources.forEach((function(t){var i=t;if(r!==null){i=o.relative(r,t)}if(!n._sources.has(i)){n._sources.add(i)}var a=e.sourceContentFor(t);if(a!=null){n.setSourceContent(t,a)}}));return n};SourceMapGenerator.prototype.addMapping=function SourceMapGenerator_addMapping(e){var r=o.getArg(e,"generated");var n=o.getArg(e,"original",null);var t=o.getArg(e,"source",null);var i=o.getArg(e,"name",null);if(!this._skipValidation){this._validateMapping(r,n,t,i)}if(t!=null){t=String(t);if(!this._sources.has(t)){this._sources.add(t)}}if(i!=null){i=String(i);if(!this._names.has(i)){this._names.add(i)}}this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:t,name:i})};SourceMapGenerator.prototype.setSourceContent=function SourceMapGenerator_setSourceContent(e,r){var n=e;if(this._sourceRoot!=null){n=o.relative(this._sourceRoot,n)}if(r!=null){if(!this._sourcesContents){this._sourcesContents=Object.create(null)}this._sourcesContents[o.toSetString(n)]=r}else if(this._sourcesContents){delete this._sourcesContents[o.toSetString(n)];if(Object.keys(this._sourcesContents).length===0){this._sourcesContents=null}}};SourceMapGenerator.prototype.applySourceMap=function SourceMapGenerator_applySourceMap(e,r,n){var t=r;if(r==null){if(e.file==null){throw new Error("SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, "+'or the source map\'s "file" property. Both were omitted.')}t=e.file}var a=this._sourceRoot;if(a!=null){t=o.relative(a,t)}var u=new i;var s=new i;this._mappings.unsortedForEach((function(r){if(r.source===t&&r.originalLine!=null){var i=e.originalPositionFor({line:r.originalLine,column:r.originalColumn});if(i.source!=null){r.source=i.source;if(n!=null){r.source=o.join(n,r.source)}if(a!=null){r.source=o.relative(a,r.source)}r.originalLine=i.line;r.originalColumn=i.column;if(i.name!=null){r.name=i.name}}}var l=r.source;if(l!=null&&!u.has(l)){u.add(l)}var c=r.name;if(c!=null&&!s.has(c)){s.add(c)}}),this);this._sources=u;this._names=s;e.sources.forEach((function(r){var t=e.sourceContentFor(r);if(t!=null){if(n!=null){r=o.join(n,r)}if(a!=null){r=o.relative(a,r)}this.setSourceContent(r,t)}}),this)};SourceMapGenerator.prototype._validateMapping=function SourceMapGenerator_validateMapping(e,r,n,t){if(r&&typeof r.line!=="number"&&typeof r.column!=="number"){throw new Error("original.line and original.column are not numbers -- you probably meant to omit "+"the original mapping entirely and only map the generated position. If so, pass "+"null for the original mapping instead of an object with empty or null values.")}if(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!r&&!n&&!t){return}else if(e&&"line"in e&&"column"in e&&r&&"line"in r&&"column"in r&&e.line>0&&e.column>=0&&r.line>0&&r.column>=0&&n){return}else{throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:r,name:t}))}};SourceMapGenerator.prototype._serializeMappings=function SourceMapGenerator_serializeMappings(){var e=0;var r=1;var n=0;var i=0;var a=0;var u=0;var s="";var l;var c;var p;var f;var g=this._mappings.toArray();for(var d=0,h=g.length;d0){if(!o.compareByGeneratedPositionsInflated(c,g[d-1])){continue}l+=","}}l+=t.encode(c.generatedColumn-e);e=c.generatedColumn;if(c.source!=null){f=this._sources.indexOf(c.source);l+=t.encode(f-u);u=f;l+=t.encode(c.originalLine-1-i);i=c.originalLine-1;l+=t.encode(c.originalColumn-n);n=c.originalColumn;if(c.name!=null){p=this._names.indexOf(c.name);l+=t.encode(p-a);a=p}}s+=l}return s};SourceMapGenerator.prototype._generateSourcesContent=function SourceMapGenerator_generateSourcesContent(e,r){return e.map((function(e){if(!this._sourcesContents){return null}if(r!=null){e=o.relative(r,e)}var n=o.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null}),this)};SourceMapGenerator.prototype.toJSON=function SourceMapGenerator_toJSON(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null){e.file=this._file}if(this._sourceRoot!=null){e.sourceRoot=this._sourceRoot}if(this._sourcesContents){e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)}return e};SourceMapGenerator.prototype.toString=function SourceMapGenerator_toString(){return JSON.stringify(this.toJSON())};r.x=SourceMapGenerator},565:(e,r,n)=>{var t;var o=n(163).x;var i=n(297);var a=/(\r?\n)/;var u=10;var s="$$$isSourceNode$$$";function SourceNode(e,r,n,t,o){this.children=[];this.sourceContents={};this.line=e==null?null:e;this.column=r==null?null:r;this.source=n==null?null:n;this.name=o==null?null:o;this[s]=true;if(t!=null)this.add(t)}SourceNode.fromStringWithSourceMap=function SourceNode_fromStringWithSourceMap(e,r,n){var t=new SourceNode;var o=e.split(a);var u=0;var shiftNextLine=function(){var e=getNextLine();var r=getNextLine()||"";return e+r;function getNextLine(){return u=0;r--){this.prepend(e[r])}}else if(e[s]||typeof e==="string"){this.children.unshift(e)}else{throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e)}return this};SourceNode.prototype.walk=function SourceNode_walk(e){var r;for(var n=0,t=this.children.length;n0){r=[];for(n=0;n{function getArg(e,r,n){if(r in e){return e[r]}else if(arguments.length===3){return n}else{throw new Error('"'+r+'" is a required argument.')}}r.getArg=getArg;var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;var t=/^data:.+\,.+$/;function urlParse(e){var r=e.match(n);if(!r){return null}return{scheme:r[1],auth:r[2],host:r[3],port:r[4],path:r[5]}}r.urlParse=urlParse;function urlGenerate(e){var r="";if(e.scheme){r+=e.scheme+":"}r+="//";if(e.auth){r+=e.auth+"@"}if(e.host){r+=e.host}if(e.port){r+=":"+e.port}if(e.path){r+=e.path}return r}r.urlGenerate=urlGenerate;function normalize(e){var n=e;var t=urlParse(e);if(t){if(!t.path){return e}n=t.path}var o=r.isAbsolute(n);var i=n.split(/\/+/);for(var a,u=0,s=i.length-1;s>=0;s--){a=i[s];if(a==="."){i.splice(s,1)}else if(a===".."){u++}else if(u>0){if(a===""){i.splice(s+1,u);u=0}else{i.splice(s,2);u--}}}n=i.join("/");if(n===""){n=o?"/":"."}if(t){t.path=n;return urlGenerate(t)}return n}r.normalize=normalize;function join(e,r){if(e===""){e="."}if(r===""){r="."}var n=urlParse(r);var o=urlParse(e);if(o){e=o.path||"/"}if(n&&!n.scheme){if(o){n.scheme=o.scheme}return urlGenerate(n)}if(n||r.match(t)){return r}if(o&&!o.host&&!o.path){o.host=r;return urlGenerate(o)}var i=r.charAt(0)==="/"?r:normalize(e.replace(/\/+$/,"")+"/"+r);if(o){o.path=i;return urlGenerate(o)}return i}r.join=join;r.isAbsolute=function(e){return e.charAt(0)==="/"||n.test(e)};function relative(e,r){if(e===""){e="."}e=e.replace(/\/$/,"");var n=0;while(r.indexOf(e+"/")!==0){var t=e.lastIndexOf("/");if(t<0){return r}e=e.slice(0,t);if(e.match(/^([^\/]+:\/)?\/*$/)){return r}++n}return Array(n+1).join("../")+r.substr(e.length+1)}r.relative=relative;var o=function(){var e=Object.create(null);return!("__proto__"in e)}();function identity(e){return e}function toSetString(e){if(isProtoString(e)){return"$"+e}return e}r.toSetString=o?identity:toSetString;function fromSetString(e){if(isProtoString(e)){return e.slice(1)}return e}r.fromSetString=o?identity:fromSetString;function isProtoString(e){if(!e){return false}var r=e.length;if(r<9){return false}if(e.charCodeAt(r-1)!==95||e.charCodeAt(r-2)!==95||e.charCodeAt(r-3)!==111||e.charCodeAt(r-4)!==116||e.charCodeAt(r-5)!==111||e.charCodeAt(r-6)!==114||e.charCodeAt(r-7)!==112||e.charCodeAt(r-8)!==95||e.charCodeAt(r-9)!==95){return false}for(var n=r-10;n>=0;n--){if(e.charCodeAt(n)!==36){return false}}return true}function compareByOriginalPositions(e,r,n){var t=strcmp(e.source,r.source);if(t!==0){return t}t=e.originalLine-r.originalLine;if(t!==0){return t}t=e.originalColumn-r.originalColumn;if(t!==0||n){return t}t=e.generatedColumn-r.generatedColumn;if(t!==0){return t}t=e.generatedLine-r.generatedLine;if(t!==0){return t}return strcmp(e.name,r.name)}r.compareByOriginalPositions=compareByOriginalPositions;function compareByGeneratedPositionsDeflated(e,r,n){var t=e.generatedLine-r.generatedLine;if(t!==0){return t}t=e.generatedColumn-r.generatedColumn;if(t!==0||n){return t}t=strcmp(e.source,r.source);if(t!==0){return t}t=e.originalLine-r.originalLine;if(t!==0){return t}t=e.originalColumn-r.originalColumn;if(t!==0){return t}return strcmp(e.name,r.name)}r.compareByGeneratedPositionsDeflated=compareByGeneratedPositionsDeflated;function strcmp(e,r){if(e===r){return 0}if(e===null){return 1}if(r===null){return-1}if(e>r){return 1}return-1}function compareByGeneratedPositionsInflated(e,r){var n=e.generatedLine-r.generatedLine;if(n!==0){return n}n=e.generatedColumn-r.generatedColumn;if(n!==0){return n}n=strcmp(e.source,r.source);if(n!==0){return n}n=e.originalLine-r.originalLine;if(n!==0){return n}n=e.originalColumn-r.originalColumn;if(n!==0){return n}return strcmp(e.name,r.name)}r.compareByGeneratedPositionsInflated=compareByGeneratedPositionsInflated;function parseSourceMapInput(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}r.parseSourceMapInput=parseSourceMapInput;function computeSourceURL(e,r,n){r=r||"";if(e){if(e[e.length-1]!=="/"&&r[0]!=="/"){e+="/"}r=e+r}if(n){var t=urlParse(n);if(!t){throw new Error("sourceMapURL could not be parsed")}if(t.path){var o=t.path.lastIndexOf("/");if(o>=0){t.path=t.path.substring(0,o+1)}}r=join(urlGenerate(t),r)}return normalize(r)}r.computeSourceURL=computeSourceURL},927:(e,r,n)=>{n(163).x;r.SourceMapConsumer=n(684).SourceMapConsumer;n(565)},896:e=>{"use strict";e.exports=require("fs")},928:e=>{"use strict";e.exports=require("path")}};var r={};function __webpack_require__(n){var t=r[n];if(t!==undefined){return t.exports}var o=r[n]={id:n,loaded:false,exports:{}};var i=true;try{e[n](o,o.exports,__webpack_require__);i=false}finally{if(i)delete r[n]}o.loaded=true;return o.exports}(()=>{__webpack_require__.nmd=e=>{e.paths=[];if(!e.children)e.children=[];return e}})();if(typeof __webpack_require__!=="undefined")__webpack_require__.ab=__dirname+"/";var n={};__webpack_require__(599).install();module.exports=n})(); --------------------------------------------------------------------------------