diff --git a/.changeset/config.json b/.changeset/config.json new file mode 100644 index 0000000..ae82eba --- /dev/null +++ b/.changeset/config.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://unpkg.com/@changesets/config@3.0.2/schema.json", + "changelog": "@changesets/cli/changelog", + "commit": false, + "fixed": [], + "linked": [], + "access": "restricted", + "baseBranch": "main", + "updateInternalDependencies": "patch", + "ignore": [] +} diff --git a/.changeset/young-shoes-tell.md b/.changeset/young-shoes-tell.md new file mode 100644 index 0000000..5527957 --- /dev/null +++ b/.changeset/young-shoes-tell.md @@ -0,0 +1,5 @@ +--- +'venecodollar': patch +--- + +Fix BCV entity diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..0cb2689 --- /dev/null +++ b/.env.example @@ -0,0 +1,10 @@ +PORT= +URL="" +API="" +API_OLD="" +API_VER_URL="" +API_DOC="" +BASE_URL="" +BCV_URL="" +SERVICE_API="" +EMAIL="" \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..2975626 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,15 @@ +{ + "parser": "@typescript-eslint/parser", + "extends": ["plugin:@typescript-eslint/recommended"], + "parserOptions": { "ecmaVersion": 2018, "sourceType": "module" }, + "rules": {}, + "overrides": [ + { + "files": ["*/**/**.test.*"], + "env": { + "jest": true + } + } + ], + "ignores": [".changeset", ".husky", "coverage", "node_modules", "build", "dist"] +} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..04d119a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,24 @@ +name: Release +on: + push: + branches: + - main +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + - run: npm install + - run: npm run test + - name: Publish to npm + id: changesets + uses: changesets/action@v1 + with: + publish: npm run release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.gitignore b/.gitignore index 39d9722..6f7d31c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,11 @@ -node_modules - -yarn.lock package-lock.json +yarn.lock + +node_modules +public +build +dist .env -dist -build \ No newline at end of file +coverage \ No newline at end of file diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..9101836 --- /dev/null +++ b/.npmignore @@ -0,0 +1,21 @@ +.changeset +.github +.husky +coverage + +node_modules + +yarn.lock +package-lock.json + +.eslintrc.json +babel.config.js +eslint.config.mjs +jest.config.ts + +.gitignore +.npmignore +.prettierignore + +**/*/*.test.ts +**/*/*.test.js \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..4175c0a --- /dev/null +++ b/.prettierignore @@ -0,0 +1,7 @@ +dist +build +node_modules + +.changeset +.husky +coverage \ No newline at end of file diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..0c67073 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,7 @@ +{ + "semi": true, + "trailingComma": "all", + "singleQuote": true, + "printWidth": 120, + "tabWidth": 2 +} diff --git a/README-ES.md b/README-ES.md index 391d983..040e7ec 100644 --- a/README-ES.md +++ b/README-ES.md @@ -57,10 +57,10 @@ import * as Venecodollar from "venecodollar" o ```TypeScript -const { - getDollarPrices, - getDollarPricesWithAverage, - calculateBsToDollar, +const { + getDollarPrices, + getDollarPricesWithAverage, + calculateBsToDollar, calculateDollarToBs, getEuroPrices, getEuroPricesWithAverage, @@ -105,19 +105,19 @@ El paquete dispone de dos (4) funciones, getDollarPrices(), getDollarPricesWithA La librería tiene a su disposición ocho (9) funciones. Cuatro (4) para valores del dólar y cuatro (4) para valores del euro: -* Funciones para valores de dólares: - -- getDollarPrices() -- getDollarPricesWithAverage() -- calculateBsToDollar(bs: number) -- calculateDollarToBs(dollar: number) - -* Funciones para valores de euros: - -- getEuroPrices() -- getEuroPricesWithAverage() -- calculateBsToEuro(bs: number) -- calculateEuroToBs(euro: number) +- Funciones para valores de dólares: + +* getDollarPrices() +* getDollarPricesWithAverage() +* calculateBsToDollar(bs: number) +* calculateDollarToBs(dollar: number) + +- Funciones para valores de euros: + +* getEuroPrices() +* getEuroPricesWithAverage() +* calculateBsToEuro(bs: number) +* calculateEuroToBs(euro: number) #### Funciones para valores de dólares @@ -284,7 +284,7 @@ De forma similar a getEuroPrices(), esta función devuelve dos posibles valores. "difference": 0.01, "differencePercentage": "0.02%", "tendency": "Uptrend", - "tendencyColor": "green" + "tendencyColor": "green" } }, { @@ -330,7 +330,7 @@ Esta función representaría el cálculo similar al función calculateBsToEuro p Del mismo modo, el paquete fue diseñado utilizando TypeScript, por lo que es posible hacer uso de la tipificación de funciones. Para ello, es necesario importar los tipos de datos directamente desde su carpeta: ```TypeScript -import { DollarType, DollarArrayType, EntityType, DollarAverageType } from 'venecodollar/src/types/DollarType' +import { DollarType, DollarArrayType, EntityType, DollarAverageType } from 'venecodollar/src/types/DollarType' ``` O @@ -543,10 +543,10 @@ Este endpoint permite obtener todas las entidades de seguimiento del euro por el GET /api/v2/dollar/toBs?dollar=${dollar}&entity={entity} ``` -| Parameter | Type | Description | -| :-------- | :------- | :----------------------------------------- | -| `dollar` | `number` | **Required**. Monto en dólares a ser calculado en bolívares. | -| `entity` | `string` | Nombre de entidades a obtener | +| Parameter | Type | Description | +| :-------- | :------- | :----------------------------------------------------------- | +| `dollar` | `number` | **Required**. Monto en dólares a ser calculado en bolívares. | +| `entity` | `string` | Nombre de entidades a obtener | Este endpoint permite obtener todas las entidades de monitoreo de dólares calculando el valor del dólar pasado como parámetro en la ruta en términos de bolívares. Si se pasa como parámetro en la ruta el nombre de una entidad por la cual se desea filtrar, el endpoint devolverá sólo las entidades de monitoreo de dólares que coincidan con el parámetro pasado. @@ -556,10 +556,10 @@ Este endpoint permite obtener todas las entidades de monitoreo de dólares calcu GET /api/v2/euro/toBs?euro=${euro}&entity={entity} ``` -| Parameter | Type | Description | -| :-------- | :------- | :----------------------------------------- | -| `euro` | `number` | **Required**. Monto en euros a ser calculado en bolívares. | -| `entity` | `string` | Nombre de entidades a obtener | +| Parameter | Type | Description | +| :-------- | :------- | :--------------------------------------------------------- | +| `euro` | `number` | **Required**. Monto en euros a ser calculado en bolívares. | +| `entity` | `string` | Nombre de entidades a obtener | Este endpoint permite obtener todas las entidades de monitoreo de euros calculando el valor del euro pasado como parámetro en la ruta en términos de bolívares. Si se pasa como parámetro en la ruta el nombre de una entidad por la cual se desea filtrar, el endpoint devolverá sólo las entidades de monitoreo de dólares que coincidan con el parámetro pasado. @@ -569,10 +569,10 @@ Este endpoint permite obtener todas las entidades de monitoreo de euros calculan GET /api/v2/dollar/toDollar?bs=${bs}&entity={entity} ``` -| Parameter | Type | Description | -| :-------- | :------- | :----------------------------------------- | +| Parameter | Type | Description | +| :-------- | :------- | :----------------------------------------------------------- | | `bs` | `number` | **Required**. Monto en bolívares a ser calculado en dólares. | -| `entity` | `string` | Nombre de entidades a obtener. | +| `entity` | `string` | Nombre de entidades a obtener. | Este endpoint permite obtener todas las entidades de monitoreo de dólares calculando el valor del dólar pasado como parámetro en la ruta en términos de bolívares. Si se pasa como parámetro en la ruta el nombre de una entidad por la cual se desea filtrar, el endpoint devolverá sólo las entidades de monitoreo de dólares que coincidan con el parámetro pasado. @@ -582,10 +582,10 @@ Este endpoint permite obtener todas las entidades de monitoreo de dólares calcu GET /api/v2/euro/toEuro?bs=${bs}&entity={entity} ``` -| Parameter | Type | Description | -| :-------- | :------- | :----------------------------------------- | +| Parameter | Type | Description | +| :-------- | :------- | :--------------------------------------------------------- | | `bs` | `number` | **Required**. Monto en bolívares a ser calculado en euros. | -| `entity` | `string` | Nombre de entidades a obtener. | +| `entity` | `string` | Nombre de entidades a obtener. | Este endpoint permite obtener todas las entidades de monitoreo de euros calculando el valor del euro pasado como parámetro en la ruta en términos de bolívares. Si se pasa como parámetro en la ruta el nombre de una entidad por la cual se desea filtrar, el endpoint devolverá sólo las entidades de monitoreo de dólares que coincidan con el parámetro pasado. @@ -600,4 +600,5 @@ Por favor, asegúrese de actualizar las pruebas según corresponda. [MIT](https://choosealicense.com/licenses/mit/) --- -⌨️ hecho con ❤️ por [gustavoerivero](https://github.com/gustavoerivero) \ No newline at end of file + +⌨️ hecho con ❤️ por [gustavoerivero](https://github.com/gustavoerivero) diff --git a/README.md b/README.md index 5556169..ed58a27 100644 --- a/README.md +++ b/README.md @@ -57,10 +57,10 @@ import * as Venecodollar from "venecodollar" Or ```TypeScript -const { - getDollarPrices, - getDollarPricesWithAverage, - calculateBsToDollar, +const { + getDollarPrices, + getDollarPricesWithAverage, + calculateBsToDollar, calculateDollarToBs, getEuroPrices, getEuroPricesWithAverage, @@ -103,19 +103,19 @@ const getAverage = () => { The package has at its disposal eight (8) functions, four (4) to dollar values and four (4) to euro values: -* Dollar functions: - -- getDollarPrices() -- getDollarPricesWithAverage() -- calculateBsToDollar(bs: number) -- calculateDollarToBs(dollar: number) - -* Euro functions: - -- getEuroPrices() -- getEuroPricesWithAverage() -- calculateBsToEuro(bs: number) -- calculateEuroToBs(euro: number) +- Dollar functions: + +* getDollarPrices() +* getDollarPricesWithAverage() +* calculateBsToDollar(bs: number) +* calculateDollarToBs(dollar: number) + +- Euro functions: + +* getEuroPrices() +* getEuroPricesWithAverage() +* calculateBsToEuro(bs: number) +* calculateEuroToBs(euro: number) #### Dollar functions @@ -282,7 +282,7 @@ Similarly to getEuroPrices(), this function returns two possible values. In case "difference": 0.01, "differencePercentage": "0.02%", "tendency": "Uptrend", - "tendencyColor": "green" + "tendencyColor": "green" } }, { @@ -328,7 +328,7 @@ This function would represent the calculation similar to the calculateBsToEuro f Likewise, the package was designed using TypeScript, so it is possible to make use of function typing. To do so, it is necessary to import the data types directly from your folder: ```TypeScript -import { TDollar, TDollarEntity, TDollarAverage, TDollarCalculated, TBsCalculated, TDollarCalculatedAverage, TBsCalculatedAverage } from 'venecodollar/src/types/DollarType' +import { TDollar, TDollarEntity, TDollarAverage, TDollarCalculated, TBsCalculated, TDollarCalculatedAverage, TBsCalculatedAverage } from 'venecodollar/src/types/DollarType' ``` Or @@ -554,10 +554,10 @@ This endpoint allows obtaining all the dollar monitoring entities while calculat GET /api/v2/euro/toBs?euro=${euro}&entity={entity} ``` -| Parameter | Type | Description | -| :-------- | :------- | :------------------------------------------------------------ | -| `euro` | `number` | **Required**. Amount in euros to be calculated in bolivars. | -| `entity` | `string` | Name of entities to fetch | +| Parameter | Type | Description | +| :-------- | :------- | :---------------------------------------------------------- | +| `euro` | `number` | **Required**. Amount in euros to be calculated in bolivars. | +| `entity` | `string` | Name of entities to fetch | This endpoint allows obtaining all the euro monitoring entities while calculating the value of the euro passed as a parameter in the path in terms of bolivars. If the name of an entity to be filtered by is passed as a parameter in the path, the endpoint will return only the dollar monitoring entities that match the parameter passed. @@ -580,10 +580,10 @@ This endpoint allows obtaining all the dollar monitoring entities while calculat GET /api/v2/euro/toEuro?bs=${bs}&entity={entity} ``` -| Parameter | Type | Description | -| :-------- | :------- | :------------------------------------------------------------ | +| Parameter | Type | Description | +| :-------- | :------- | :---------------------------------------------------------- | | `bs` | `number` | **Required**. Amount in bolivars to be calculated in euros. | -| `entity` | `string` | Name of entities to fetch | +| `entity` | `string` | Name of entities to fetch | This endpoint allows obtaining all the euro monitoring entities while calculating the value of the euro passed as a parameter in the path in terms of bolivars. If the name of an entity to be filtered by is passed as a parameter in the path, the endpoint will return only the dollar monitoring entities that match the parameter passed. @@ -598,4 +598,5 @@ Please make sure to update tests as appropriate. [MIT](https://choosealicense.com/licenses/mit/) --- -⌨️ made with ❤️ by [gustavoerivero](https://github.com/gustavoerivero) \ No newline at end of file + +⌨️ made with ❤️ by [gustavoerivero](https://github.com/gustavoerivero) diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..e6ffbd4 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,3 @@ +module.exports = { + presets: [['@babel/preset-env', { targets: { node: 'current' } }], '@babel/preset-typescript'], +}; diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..d01da7a --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,26 @@ +import tsParser from '@typescript-eslint/parser'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import js from '@eslint/js'; +import { FlatCompat } from '@eslint/eslintrc'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all, +}); + +export default [ + ...compat.extends('plugin:@typescript-eslint/recommended'), + { + languageOptions: { + parser: tsParser, + ecmaVersion: 2018, + sourceType: 'module', + }, + + rules: {}, + }, +]; diff --git a/jest.config.ts b/jest.config.ts new file mode 100644 index 0000000..811dec2 --- /dev/null +++ b/jest.config.ts @@ -0,0 +1,196 @@ +/** + * For a detailed explanation regarding each configuration property, visit: + * https://jestjs.io/docs/configuration + */ + +import type { Config } from 'jest'; + +const config: Config = { + // All imported modules in your tests should be mocked automatically + // automock: false, + + // Stop running tests after `n` failures + // bail: 0, + + // The directory where Jest should store its cached dependency information + // cacheDirectory: "C:\\Users\\gusta\\AppData\\Local\\Temp\\jest", + + // Automatically clear mock calls, instances, contexts and results before every test + clearMocks: true, + + // Indicates whether the coverage information should be collected while executing the test + collectCoverage: true, + + // An array of glob patterns indicating a set of files for which coverage information should be collected + // collectCoverageFrom: undefined, + + // The directory where Jest should output its coverage files + coverageDirectory: 'coverage', + + // An array of regexp pattern strings used to skip coverage collection + // coveragePathIgnorePatterns: [ + // "\\\\node_modules\\\\" + // ], + + // Indicates which provider should be used to instrument code for coverage + // coverageProvider: "babel", + + // A list of reporter names that Jest uses when writing coverage reports + // coverageReporters: [ + // "json", + // "text", + // "lcov", + // "clover" + // ], + + // An object that configures minimum threshold enforcement for coverage results + // coverageThreshold: undefined, + + // A path to a custom dependency extractor + // dependencyExtractor: undefined, + + // Make calling deprecated APIs throw helpful error messages + // errorOnDeprecated: false, + + // The default configuration for fake timers + // fakeTimers: { + // "enableGlobally": false + // }, + + // Force coverage collection from ignored files using an array of glob patterns + // forceCoverageMatch: [], + + // A path to a module which exports an async function that is triggered once before all test suites + // globalSetup: undefined, + + // A path to a module which exports an async function that is triggered once after all test suites + // globalTeardown: undefined, + + // A set of global variables that need to be available in all test environments + // globals: {}, + + // The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers. + // maxWorkers: "50%", + + // An array of directory names to be searched recursively up from the requiring module's location + // moduleDirectories: [ + // "node_modules" + // ], + + // An array of file extensions your modules use + // moduleFileExtensions: [ + // "js", + // "mjs", + // "cjs", + // "jsx", + // "ts", + // "tsx", + // "json", + // "node" + // ], + + // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module + // moduleNameMapper: {}, + + // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader + // modulePathIgnorePatterns: [], + + // Activates notifications for test results + // notify: false, + + // An enum that specifies notification mode. Requires { notify: true } + // notifyMode: "failure-change", + + // A preset that is used as a base for Jest's configuration + // preset: undefined, + + // Run tests from one or more projects + // projects: undefined, + + // Use this configuration option to add custom reporters to Jest + // reporters: undefined, + + // Automatically reset mock state before every test + // resetMocks: false, + + // Reset the module registry before running each individual test + // resetModules: false, + + // A path to a custom resolver + // resolver: undefined, + + // Automatically restore mock state and implementation before every test + // restoreMocks: false, + + // The root directory that Jest should scan for tests and modules within + // rootDir: undefined, + + // A list of paths to directories that Jest should use to search for files in + // roots: [ + // "" + // ], + + // Allows you to use a custom runner instead of Jest's default test runner + // runner: "jest-runner", + + // The paths to modules that run some code to configure or set up the testing environment before each test + // setupFiles: [], + + // A list of paths to modules that run some code to configure or set up the testing framework before each test + // setupFilesAfterEnv: [], + + // The number of seconds after which a test is considered as slow and reported as such in the results. + // slowTestThreshold: 5, + + // A list of paths to snapshot serializer modules Jest should use for snapshot testing + // snapshotSerializers: [], + + // The test environment that will be used for testing + // testEnvironment: "jest-environment-node", + + // Options that will be passed to the testEnvironment + // testEnvironmentOptions: {}, + + // Adds a location field to test results + // testLocationInResults: false, + + // The glob patterns Jest uses to detect test files + testMatch: ['**/*/*.test.js', '**/*/*.test.ts'], + + // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped + // testPathIgnorePatterns: [ + // "\\\\node_modules\\\\" + // ], + + // The regexp pattern or array of patterns that Jest uses to detect test files + // testRegex: [], + + // This option allows the use of a custom results processor + // testResultsProcessor: undefined, + + // This option allows use of a custom test runner + // testRunner: "jest-circus/runner", + + // A map from regular expressions to paths to transformers + // transform: undefined, + + // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation + // transformIgnorePatterns: [ + // "\\\\node_modules\\\\", + // "\\.pnp\\.[^\\\\]+$" + // ], + + // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them + // unmockedModulePathPatterns: undefined, + + // Indicates whether each individual test should be reported during the run + // verbose: undefined, + + // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode + // watchPathIgnorePatterns: [], + + // Whether to use watchman for file crawling + // watchman: true, +}; + +export default config; diff --git a/nodemon.json b/nodemon.json index 77f6d20..42e8678 100644 --- a/nodemon.json +++ b/nodemon.json @@ -2,4 +2,4 @@ "watch": ["src"], "ext": "ts, js, json, yml", "exec": "ts-node ./src/index.ts" -} \ No newline at end of file +} diff --git a/package.json b/package.json index 8c0aaef..743d02c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "venecodollar", - "version": "2.2.2", + "version": "2.3.0", "description": "Library to consult the different dollar and euro values and their average in terms of bolivars. The data is obtained from https://monitordolarvenezuela.com/", "keywords": [ "dollar", @@ -17,9 +17,17 @@ "deploy-build": "ncc build src/index.ts -o public -m", "package-build": "rimraf ./build && tsc --project package.tsconfig.json", "build": "npm run deploy-build & npm run package-build", - "build:start": "npm run deploy-build & npm run package-build & @powershell -Command $env:DEBUG='bot*';dotenv -- -- nodemon -e ts -x ts-node src/index.ts", - "prettier": "prettier --write 'src/**/*.ts'", - "package-deploy": "npm publish --access public" + "build:start": "npm run deploy-build & npm run package-build & npm run devWindows", + "release": "npm run build && changeset publish", + "update:version": "changeset", + "publish": "npm publish --access=public", + "test": "jest", + "lint": "eslint src/**/*.ts", + "lint:fix": "eslint src/**/*.ts --fix", + "format:check": "prettier . --check", + "format:write": "prettier . --write", + "force:check": "eslint src/**/*.ts & prettier . --check", + "force:fix": "eslint src/**/*.ts --fix & prettier . --write" }, "author": "gustavoerivero", "license": "MIT", @@ -34,27 +42,42 @@ "cheerio": "^1.0.0-rc.12" }, "devDependencies": { + "@babel/core": "^7.25.8", + "@babel/preset-env": "^7.25.8", + "@babel/preset-typescript": "^7.25.7", + "@changesets/cli": "^2.27.9", "@types/cors": "^2.8.13", "@types/express": "^4.17.17", + "@types/jest": "^29.5.13", "@types/morgan": "^1.9.4", - "@types/node": "^20.2.6", + "@types/node": "^22.7.5", "@types/swagger-jsdoc": "^6.0.1", - "@types/swagger-ui-express": "^4.1.3", + "@types/swagger-ui-express": "^4.1.6", + "@typescript-eslint/eslint-plugin": "^8.8.1", + "@typescript-eslint/parser": "^8.8.1", "@vercel/ncc": "^0.36.1", "axios": "^1.5.1", + "babel-jest": "^29.7.0", "cors": "^2.8.5", "debug": "^4.3.4", "dotenv": "^16.1.4", "dotenv-cli": "^7.2.1", + "eslint": "^9.12.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-jest": "^28.8.3", + "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-unused-imports": "^4.1.4", "express": "^4.18.2", - "jest": "^29.5.0", + "jest": "^29.7.0", "morgan": "^1.10.0", "nodemon": "^2.0.22", "pre-commit": "^1.2.2", + "prettier": "^3.3.3", "rimraf": "^5.0.1", "swagger-jsdoc": "^6.2.8", "swagger-ui-express": "^4.6.3", - "ts-node": "^10.9.1", - "typescript": "^5.1.3" + "ts-jest": "^29.2.5", + "ts-node": "^10.9.2", + "typescript": "^5.6.3" } } diff --git a/package.tsconfig.json b/package.tsconfig.json index d576cbc..afc091f 100644 --- a/package.tsconfig.json +++ b/package.tsconfig.json @@ -9,19 +9,8 @@ "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, - "lib": [ - "es2017", - "es7", - "es6", - "ESNext", - "dom" - ] + "lib": ["es2017", "es7", "es6", "ESNext", "dom"] }, - "include": [ - "src" - ], - "exclude": [ - "node_modules", - "dist" - ] -} \ No newline at end of file + "include": ["src"], + "exclude": ["node_modules", "dist"] +} diff --git a/public/index.js b/public/index.js index ac594ed..d44b4a3 100644 --- a/public/index.js +++ b/public/index.js @@ -1,343 +1,128044 @@ -(()=>{var i={3113:(i,u,m)=>{"use strict";const v=m(9825);const _=m(6040);const M=m(1279);i.exports=bundle;function bundle(i,u){let m=[];crawl(i,"schema",i.$refs._root$Ref.path+"#","#",0,m,i.$refs,u);remap(m)}function crawl(i,u,m,M,j,$,W,Y){let Z=u===null?i:i[u];if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)){if(v.isAllowed$Ref(Z)){inventory$Ref(i,u,m,M,j,$,W,Y)}else{let i=Object.keys(Z).sort(((i,u)=>{if(i==="definitions"){return-1}else if(u==="definitions"){return 1}else{return i.length-u.length}}));for(let u of i){let i=_.join(m,u);let X=_.join(M,u);let ee=Z[u];if(v.isAllowed$Ref(ee)){inventory$Ref(Z,u,m,X,j,$,W,Y)}else{crawl(Z,u,i,X,j,$,W,Y)}}}}}function inventory$Ref(i,u,m,j,$,W,Y,Z){let X=u===null?i:i[u];let ee=M.resolve(m,X.$ref);let ie=Y._resolve(ee,j,Z);if(ie===null){return}let ae=_.parse(j).length;let ce=M.stripHash(ie.path);let le=M.getHash(ie.path);let pe=ce!==Y._root$Ref.path;let fe=v.isExtended$Ref(X);$+=ie.indirections;let de=findInInventory(W,i,u);if(de){if(ae{if(i.file!==u.file){return i.file{"use strict";const v=m(9825);const _=m(6040);const{ono:M}=m(3436);const j=m(1279);i.exports=dereference;function dereference(i,u){let m=crawl(i.schema,i.$refs._root$Ref.path,"#",new Set,new Set,new Map,i.$refs,u);i.$refs.circular=m.circular;i.schema=m.value}function crawl(i,u,m,M,j,$,W,Y){let Z;let X={value:i,circular:false};let ee=Y.dereference.excludedPathMatcher;if(Y.dereference.circular==="ignore"||!j.has(i)){if(i&&typeof i==="object"&&!ArrayBuffer.isView(i)&&!ee(m)){M.add(i);j.add(i);if(v.isAllowed$Ref(i,Y)){Z=dereference$Ref(i,u,m,M,j,$,W,Y);X.circular=Z.circular;X.value=Z.value}else{for(const ie of Object.keys(i)){let ae=_.join(u,ie);let ce=_.join(m,ie);if(ee(ce)){continue}let le=i[ie];let pe=false;if(v.isAllowed$Ref(le,Y)){Z=dereference$Ref(le,ae,ce,M,j,$,W,Y);pe=Z.circular;if(i[ie]!==Z.value){i[ie]=Z.value}}else{if(!M.has(le)){Z=crawl(le,ae,ce,M,j,$,W,Y);pe=Z.circular;if(i[ie]!==Z.value){i[ie]=Z.value}}else{pe=foundCircularReference(ae,W,Y)}}X.circular=X.circular||pe}}M.delete(i)}}return X}function dereference$Ref(i,u,m,_,M,$,W,Y){let Z=j.resolve(u,i.$ref);const X=$.get(Z);if(X){const u=Object.keys(i);if(u.length>1){const m={};for(let v of u){if(v!=="$ref"&&!(v in X.value)){m[v]=i[v]}}return{circular:X.circular,value:Object.assign({},X.value,m)}}return X}let ee=W._resolve(Z,u,Y);if(ee===null){return{circular:false,value:null}}let ie=ee.circular;let ae=ie||_.has(ee.value);ae&&foundCircularReference(u,W,Y);let ce=v.dereference(i,ee.value);if(!ae){let i=crawl(ce,ee.path,m,_,M,$,W,Y);ae=i.circular;ce=i.value}if(ae&&!ie&&Y.dereference.circular==="ignore"){ce=i}if(ie){ce.$ref=m}const le={circular:ae,value:ce};if(Object.keys(i).length===1){$.set(Z,le)}return le}function foundCircularReference(i,u,m){u.circular=true;if(!m.dereference.circular){throw M.reference(`Circular $ref pointer found at ${i}`)}return true}},5862:(i,u,m)=>{"use strict";const v=m(957);const _=m(2430);const M=m(4608);const j=m(5330);const $=m(3113);const W=m(2461);const Y=m(1279);const{JSONParserError:Z,InvalidPointerError:X,MissingPointerError:ee,ResolverError:ie,ParserError:ae,UnmatchedParserError:ce,UnmatchedResolverError:le,isHandledError:pe,JSONParserErrorGroup:fe}=m(1695);const de=m(3844);const{ono:ye}=m(3436);i.exports=$RefParser;i.exports["default"]=$RefParser;i.exports.JSONParserError=Z;i.exports.InvalidPointerError=X;i.exports.MissingPointerError=ee;i.exports.ResolverError=ie;i.exports.ParserError=ae;i.exports.UnmatchedParserError=ce;i.exports.UnmatchedResolverError=le;function $RefParser(){this.schema=null;this.$refs=new v}$RefParser.parse=function parse(i,u,m,v){let _=this;let M=new _;return M.parse.apply(M,arguments)};$RefParser.prototype.parse=async function parse(i,u,m,j){let $=M(arguments);let W;if(!$.path&&!$.schema){let i=ye(`Expected a file path, URL, or object. Got ${$.path||$.schema}`);return de($.callback,Promise.reject(i))}this.schema=null;this.$refs=new v;let Z="http";if(Y.isFileSystemPath($.path)){$.path=Y.fromFileSystemPath($.path);Z="file"}$.path=Y.resolve(Y.cwd(),$.path);if($.schema&&typeof $.schema==="object"){let i=this.$refs._add($.path);i.value=$.schema;i.pathType=Z;W=Promise.resolve($.schema)}else{W=_($.path,this.$refs,$.options)}let X=this;try{let i=await W;if(i!==null&&typeof i==="object"&&!Buffer.isBuffer(i)){X.schema=i;return de($.callback,Promise.resolve(X.schema))}else if($.options.continueOnError){X.schema=null;return de($.callback,Promise.resolve(X.schema))}else{throw ye.syntax(`"${X.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}}catch(i){if(!$.options.continueOnError||!pe(i)){return de($.callback,Promise.reject(i))}if(this.$refs._$refs[Y.stripHash($.path)]){this.$refs._$refs[Y.stripHash($.path)].addError(i)}return de($.callback,Promise.resolve(null))}};$RefParser.resolve=function resolve(i,u,m,v){let _=this;let M=new _;return M.resolve.apply(M,arguments)};$RefParser.prototype.resolve=async function resolve(i,u,m,v){let _=this;let $=M(arguments);try{await this.parse($.path,$.schema,$.options);await j(_,$.options);finalize(_);return de($.callback,Promise.resolve(_.$refs))}catch(i){return de($.callback,Promise.reject(i))}};$RefParser.bundle=function bundle(i,u,m,v){let _=this;let M=new _;return M.bundle.apply(M,arguments)};$RefParser.prototype.bundle=async function bundle(i,u,m,v){let _=this;let j=M(arguments);try{await this.resolve(j.path,j.schema,j.options);$(_,j.options);finalize(_);return de(j.callback,Promise.resolve(_.schema))}catch(i){return de(j.callback,Promise.reject(i))}};$RefParser.dereference=function dereference(i,u,m,v){let _=this;let M=new _;return M.dereference.apply(M,arguments)};$RefParser.prototype.dereference=async function dereference(i,u,m,v){let _=this;let j=M(arguments);try{await this.resolve(j.path,j.schema,j.options);W(_,j.options);finalize(_);return de(j.callback,Promise.resolve(_.schema))}catch(i){return de(j.callback,Promise.reject(i))}};function finalize(i){const u=fe.getParserErrors(i);if(u.length>0){throw new fe(i)}}},4608:(i,u,m)=>{"use strict";const v=m(6608);i.exports=normalizeArgs;function normalizeArgs(i){let u,m,_,M;i=Array.prototype.slice.call(i);if(typeof i[i.length-1]==="function"){M=i.pop()}if(typeof i[0]==="string"){u=i[0];if(typeof i[2]==="object"){m=i[1];_=i[2]}else{m=undefined;_=i[1]}}else{u="";m=i[0];_=i[1]}if(!(_ instanceof v)){_=new v(_)}return{path:u,schema:m,options:_,callback:M}}},6608:(i,u,m)=>{"use strict";const v=m(4683);const _=m(525);const M=m(164);const j=m(7922);const $=m(6859);const W=m(4147);i.exports=$RefParserOptions;function $RefParserOptions(i){merge(this,$RefParserOptions.defaults);merge(this,i)}$RefParserOptions.defaults={parse:{json:v,yaml:_,text:M,binary:j},resolve:{file:$,http:W,external:true},continueOnError:false,dereference:{circular:true,excludedPathMatcher:()=>false}};function merge(i,u){if(isMergeable(u)){let m=Object.keys(u);for(let v=0;v{"use strict";const{ono:v}=m(3436);const _=m(1279);const M=m(4601);const{ResolverError:j,ParserError:$,UnmatchedParserError:W,UnmatchedResolverError:Y,isHandledError:Z}=m(1695);i.exports=parse;async function parse(i,u,m){i=_.stripHash(i);let v=u._add(i);let M={url:i,extension:_.getExtension(i)};try{const i=await readFile(M,m,u);v.pathType=i.plugin.name;M.data=i.result;const _=await parseFile(M,m,u);v.value=_.result;return _.result}catch(i){if(Z(i)){v.value=i}throw i}}function readFile(i,u,m){return new Promise(((_,$)=>{let W=M.all(u.resolve);W=M.filter(W,"canRead",i);M.sort(W);M.run(W,"read",i,m).then(_,onError);function onError(m){if(!m&&u.continueOnError){$(new Y(i.url))}else if(!m||!("error"in m)){$(v.syntax(`Unable to resolve $ref pointer "${i.url}"`))}else if(m.error instanceof j){$(m.error)}else{$(new j(m,i.url))}}}))}function parseFile(i,u,m){return new Promise(((_,j)=>{let Y=M.all(u.parse);let Z=M.filter(Y,"canParse",i);let X=Z.length>0?Z:Y;M.sort(X);M.run(X,"parse",i,m).then(onParsed,onError);function onParsed(u){if(!u.plugin.allowEmpty&&isEmpty(u.result)){j(v.syntax(`Error parsing "${i.url}" as ${u.plugin.name}. \nParsed value is empty`))}else{_(u)}}function onError(m){if(!m&&u.continueOnError){j(new W(i.url))}else if(!m||!("error"in m)){j(v.syntax(`Unable to parse ${i.url}`))}else if(m.error instanceof $){j(m.error)}else{j(new $(m.error.message,i.url))}}}))}function isEmpty(i){return i===undefined||typeof i==="object"&&Object.keys(i).length===0||typeof i==="string"&&i.trim().length===0||Buffer.isBuffer(i)&&i.length===0}},7922:i=>{"use strict";let u=/\.(jpeg|jpg|gif|png|bmp|ico)$/i;i.exports={order:400,allowEmpty:true,canParse(i){return Buffer.isBuffer(i.data)&&u.test(i.url)},parse(i){if(Buffer.isBuffer(i.data)){return i.data}else{return Buffer.from(i.data)}}}},4683:(i,u,m)=>{"use strict";const{ParserError:v}=m(1695);i.exports={order:100,allowEmpty:true,canParse:".json",async parse(i){let u=i.data;if(Buffer.isBuffer(u)){u=u.toString()}if(typeof u==="string"){if(u.trim().length===0){return}else{try{return JSON.parse(u)}catch(u){throw new v(u.message,i.url)}}}else{return u}}}},164:(i,u,m)=>{"use strict";const{ParserError:v}=m(1695);let _=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i;i.exports={order:300,allowEmpty:true,encoding:"utf8",canParse(i){return(typeof i.data==="string"||Buffer.isBuffer(i.data))&&_.test(i.url)},parse(i){if(typeof i.data==="string"){return i.data}else if(Buffer.isBuffer(i.data)){return i.data.toString(this.encoding)}else{throw new v("data is not text",i.url)}}}},525:(i,u,m)=>{"use strict";const{ParserError:v}=m(1695);const _=m(5848);const{JSON_SCHEMA:M}=m(5848);i.exports={order:200,allowEmpty:true,canParse:[".yaml",".yml",".json"],async parse(i){let u=i.data;if(Buffer.isBuffer(u)){u=u.toString()}if(typeof u==="string"){try{return _.load(u,{schema:M})}catch(u){throw new v(u.message,i.url)}}else{return u}}}},6040:(i,u,m)=>{"use strict";i.exports=Pointer;const v=m(9825);const _=m(1279);const{JSONParserError:M,InvalidPointerError:j,MissingPointerError:$,isHandledError:W}=m(1695);const Y=/\//g;const Z=/~/g;const X=/~1/g;const ee=/~0/g;function Pointer(i,u,m){this.$ref=i;this.path=u;this.originalPath=m||u;this.value=undefined;this.circular=false;this.indirections=0}Pointer.prototype.resolve=function(i,u,m){let v=Pointer.parse(this.path,this.originalPath);this.value=unwrapOrThrow(i);for(let i=0;i{"use strict";i.exports=$Ref;const v=m(6040);const{InvalidPointerError:_,isHandledError:M,normalizeError:j}=m(1695);const{safePointerToPath:$,stripHash:W,getHash:Y}=m(1279);function $Ref(){this.path=undefined;this.value=undefined;this.$refs=undefined;this.pathType=undefined;this.errors=undefined}$Ref.prototype.addError=function(i){if(this.errors===undefined){this.errors=[]}const u=this.errors.map((({footprint:i})=>i));if(Array.isArray(i.errors)){this.errors.push(...i.errors.map(j).filter((({footprint:i})=>!u.includes(i))))}else if(!u.includes(i.footprint)){this.errors.push(j(i))}};$Ref.prototype.exists=function(i,u){try{this.resolve(i,u);return true}catch(i){return false}};$Ref.prototype.get=function(i,u){return this.resolve(i,u).value};$Ref.prototype.resolve=function(i,u,m,j){let Z=new v(this,i,m);try{return Z.resolve(this.value,u,j)}catch(i){if(!u||!u.continueOnError||!M(i)){throw i}if(i.path===null){i.path=$(Y(j))}if(i instanceof _){i.source=decodeURI(W(j))}this.addError(i);return null}};$Ref.prototype.set=function(i,u){let m=new v(this,i);this.value=m.set(this.value,u)};$Ref.is$Ref=function(i){return i&&typeof i==="object"&&typeof i.$ref==="string"&&i.$ref.length>0};$Ref.isExternal$Ref=function(i){return $Ref.is$Ref(i)&&i.$ref[0]!=="#"};$Ref.isAllowed$Ref=function(i,u){if($Ref.is$Ref(i)){if(i.$ref.substr(0,2)==="#/"||i.$ref==="#"){return true}else if(i.$ref[0]!=="#"&&(!u||u.resolve.external)){return true}}};$Ref.isExtended$Ref=function(i){return $Ref.is$Ref(i)&&Object.keys(i).length>1};$Ref.dereference=function(i,u){if(u&&typeof u==="object"&&$Ref.isExtended$Ref(i)){let m={};for(let u of Object.keys(i)){if(u!=="$ref"){m[u]=i[u]}}for(let i of Object.keys(u)){if(!(i in m)){m[i]=u[i]}}return m}else{return u}}},957:(i,u,m)=>{"use strict";const{ono:v}=m(3436);const _=m(9825);const M=m(1279);i.exports=$Refs;function $Refs(){this.circular=false;this._$refs={};this._root$Ref=null}$Refs.prototype.paths=function(i){let u=getPaths(this._$refs,arguments);return u.map((i=>i.decoded))};$Refs.prototype.values=function(i){let u=this._$refs;let m=getPaths(u,arguments);return m.reduce(((i,m)=>{i[m.decoded]=u[m.encoded].value;return i}),{})};$Refs.prototype.toJSON=$Refs.prototype.values;$Refs.prototype.exists=function(i,u){try{this._resolve(i,"",u);return true}catch(i){return false}};$Refs.prototype.get=function(i,u){return this._resolve(i,"",u).value};$Refs.prototype.set=function(i,u){let m=M.resolve(this._root$Ref.path,i);let _=M.stripHash(m);let j=this._$refs[_];if(!j){throw v(`Error resolving $ref pointer "${i}". \n"${_}" not found.`)}j.set(m,u)};$Refs.prototype._add=function(i){let u=M.stripHash(i);let m=new _;m.path=u;m.$refs=this;this._$refs[u]=m;this._root$Ref=this._root$Ref||m;return m};$Refs.prototype._resolve=function(i,u,m){let _=M.resolve(this._root$Ref.path,i);let j=M.stripHash(_);let $=this._$refs[j];if(!$){throw v(`Error resolving $ref pointer "${i}". \n"${j}" not found.`)}return $.resolve(_,m,i,u)};$Refs.prototype._get$Ref=function(i){i=M.resolve(this._root$Ref.path,i);let u=M.stripHash(i);return this._$refs[u]};function getPaths(i,u){let m=Object.keys(i);u=Array.isArray(u[0])?u[0]:Array.prototype.slice.call(u);if(u.length>0&&u[0]){m=m.filter((m=>u.indexOf(i[m].pathType)!==-1))}return m.map((u=>({encoded:u,decoded:i[u].pathType==="file"?M.toFileSystemPath(u,true):u})))}},5330:(i,u,m)=>{"use strict";const v=m(9825);const _=m(6040);const M=m(2430);const j=m(1279);const{isHandledError:$}=m(1695);i.exports=resolveExternal;function resolveExternal(i,u){if(!u.resolve.external){return Promise.resolve()}try{let m=crawl(i.schema,i.$refs._root$Ref.path+"#",i.$refs,u);return Promise.all(m)}catch(i){return Promise.reject(i)}}function crawl(i,u,m,M,j){j=j||new Set;let $=[];if(i&&typeof i==="object"&&!ArrayBuffer.isView(i)&&!j.has(i)){j.add(i);if(v.isExternal$Ref(i)){$.push(resolve$Ref(i,u,m,M))}else{for(let W of Object.keys(i)){let Y=_.join(u,W);let Z=i[W];if(v.isExternal$Ref(Z)){$.push(resolve$Ref(Z,Y,m,M))}else{$=$.concat(crawl(Z,Y,m,M,j))}}}}return $}async function resolve$Ref(i,u,m,v){let _=j.resolve(u,i.$ref);let W=j.stripHash(_);i=m._$refs[W];if(i){return Promise.resolve(i.value)}try{const i=await M(_,m,v);let u=crawl(i,W+"#",m,v);return Promise.all(u)}catch(i){if(!v.continueOnError||!$(i)){throw i}if(m._$refs[W]){i.source=decodeURI(j.stripHash(u));i.path=j.safePointerToPath(j.getHash(u))}return[]}}},6859:(i,u,m)=>{"use strict";const v=m(7147);const{ono:_}=m(3436);const M=m(1279);const{ResolverError:j}=m(1695);i.exports={order:100,canRead(i){return M.isFileSystemPath(i.url)},read(i){return new Promise(((u,m)=>{let $;try{$=M.toFileSystemPath(i.url)}catch(u){m(new j(_.uri(u,`Malformed URI: ${i.url}`),i.url))}try{v.readFile($,((i,v)=>{if(i){m(new j(_(i,`Error opening file "${$}"`),$))}else{u(v)}}))}catch(i){m(new j(_(i,`Error opening file "${$}"`),$))}}))}}},4147:(i,u,m)=>{"use strict";const v=m(3685);const _=m(5687);const{ono:M}=m(3436);const j=m(1279);const{ResolverError:$}=m(1695);i.exports={order:200,headers:null,timeout:5e3,redirects:5,withCredentials:false,canRead(i){return j.isHttp(i.url)},read(i){let u=j.parse(i.url);if(process.browser&&!u.protocol){u.protocol=j.parse(location.href).protocol}return download(u,this)}};function download(i,u,m){return new Promise(((v,_)=>{i=j.parse(i);m=m||[];m.push(i.href);get(i,u).then((W=>{if(W.statusCode>=400){throw M({status:W.statusCode},`HTTP ERROR ${W.statusCode}`)}else if(W.statusCode>=300){if(m.length>u.redirects){_(new $(M({status:W.statusCode},`Error downloading ${m[0]}. \nToo many redirects: \n ${m.join(" \n ")}`)))}else if(!W.headers.location){throw M({status:W.statusCode},`HTTP ${W.statusCode} redirect with no location header`)}else{let M=j.resolve(i,W.headers.location);download(M,u,m).then(v,_)}}else{v(W.body||Buffer.alloc(0))}})).catch((u=>{_(new $(M(u,`Error downloading ${i.href}`),i.href))}))}))}function get(i,u){return new Promise(((m,M)=>{let j=i.protocol==="https:"?_:v;let $=j.get({hostname:i.hostname,port:i.port,path:i.path,auth:i.auth,protocol:i.protocol,headers:u.headers||{},withCredentials:u.withCredentials});if(typeof $.setTimeout==="function"){$.setTimeout(u.timeout)}$.on("timeout",(()=>{$.abort()}));$.on("error",M);$.once("response",(i=>{i.body=Buffer.alloc(0);i.on("data",(u=>{i.body=Buffer.concat([i.body,Buffer.from(u)])}));i.on("error",M);i.on("end",(()=>{m(i)}))}))}))}},1695:(i,u,m)=>{"use strict";const{Ono:v}=m(3436);const{stripHash:_,toFileSystemPath:M}=m(1279);const j=u.JSONParserError=class JSONParserError extends Error{constructor(i,u){super();this.code="EUNKNOWN";this.message=i;this.source=u;this.path=null;v.extend(this)}get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};setErrorName(j);const $=u.JSONParserErrorGroup=class JSONParserErrorGroup extends Error{constructor(i){super();this.files=i;this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${M(i.$refs._root$Ref.path)}'`;v.extend(this)}static getParserErrors(i){const u=[];for(const m of Object.values(i.$refs._$refs)){if(m.errors){u.push(...m.errors)}}return u}get errors(){return JSONParserErrorGroup.getParserErrors(this.files)}};setErrorName($);const W=u.ParserError=class ParserError extends j{constructor(i,u){super(`Error parsing ${u}: ${i}`,u);this.code="EPARSER"}};setErrorName(W);const Y=u.UnmatchedParserError=class UnmatchedParserError extends j{constructor(i){super(`Could not find parser for "${i}"`,i);this.code="EUNMATCHEDPARSER"}};setErrorName(Y);const Z=u.ResolverError=class ResolverError extends j{constructor(i,u){super(i.message||`Error reading file "${u}"`,u);this.code="ERESOLVER";if("code"in i){this.ioErrorCode=String(i.code)}}};setErrorName(Z);const X=u.UnmatchedResolverError=class UnmatchedResolverError extends j{constructor(i){super(`Could not find resolver for "${i}"`,i);this.code="EUNMATCHEDRESOLVER"}};setErrorName(X);const ee=u.MissingPointerError=class MissingPointerError extends j{constructor(i,u){super(`Token "${i}" does not exist.`,_(u));this.code="EMISSINGPOINTER"}};setErrorName(ee);const ie=u.InvalidPointerError=class InvalidPointerError extends j{constructor(i,u){super(`Invalid $ref pointer "${i}". Pointers must begin with "#/"`,_(u));this.code="EINVALIDPOINTER"}};setErrorName(ie);function setErrorName(i){Object.defineProperty(i.prototype,"name",{value:i.name,enumerable:true})}u.isHandledError=function(i){return i instanceof j||i instanceof $};u.normalizeError=function(i){if(i.path===null){i.path=[]}return i}},4601:(i,u)=>{"use strict";u.all=function(i){return Object.keys(i).filter((u=>typeof i[u]==="object")).map((u=>{i[u].name=u;return i[u]}))};u.filter=function(i,u,m){return i.filter((i=>!!getResult(i,u,m)))};u.sort=function(i){for(let u of i){u.order=u.order||Number.MAX_SAFE_INTEGER}return i.sort(((i,u)=>i.order-u.order))};u.run=function(i,u,m,v){let _,M,j=0;return new Promise((($,W)=>{runNextPlugin();function runNextPlugin(){_=i[j++];if(!_){return W(M)}try{let M=getResult(_,u,m,callback,v);if(M&&typeof M.then==="function"){M.then(onSuccess,onError)}else if(M!==undefined){onSuccess(M)}else if(j===i.length){throw new Error("No promise has been returned or callback has been called.")}}catch(i){onError(i)}}function callback(i,u){if(i){onError(i)}else{onSuccess(u)}}function onSuccess(i){$({plugin:_,result:i})}function onError(i){M={plugin:_,error:i};runNextPlugin()}}))};function getResult(i,u,m,v,_){let M=i[u];if(typeof M==="function"){return M.apply(i,[m,v,_])}if(!v){if(M instanceof RegExp){return M.test(m.url)}else if(typeof M==="string"){return M===m.extension}else if(Array.isArray(M)){return M.indexOf(m.extension)!==-1}}return M}},1279:(i,u,m)=>{"use strict";let v=/^win/.test(process.platform),_=/\//g,M=/^(\w{2,}):\/\//i,j=i.exports,$=/~1/g,W=/~0/g;let Y=[/\?/g,"%3F",/\#/g,"%23"];let Z=[/\%23/g,"#",/\%24/g,"$",/\%26/g,"&",/\%2C/g,",",/\%40/g,"@"];u.parse=m(7310).parse;u.resolve=m(7310).resolve;u.cwd=function cwd(){if(process.browser){return location.href}let i=process.cwd();let u=i.slice(-1);if(u==="/"||u==="\\"){return i}else{return i+"/"}};u.getProtocol=function getProtocol(i){let u=M.exec(i);if(u){return u[1].toLowerCase()}};u.getExtension=function getExtension(i){let u=i.lastIndexOf(".");if(u>=0){return j.stripQuery(i.substr(u).toLowerCase())}return""};u.stripQuery=function stripQuery(i){let u=i.indexOf("?");if(u>=0){i=i.substr(0,u)}return i};u.getHash=function getHash(i){let u=i.indexOf("#");if(u>=0){return i.substr(u)}return"#"};u.stripHash=function stripHash(i){let u=i.indexOf("#");if(u>=0){i=i.substr(0,u)}return i};u.isHttp=function isHttp(i){let u=j.getProtocol(i);if(u==="http"||u==="https"){return true}else if(u===undefined){return process.browser}else{return false}};u.isFileSystemPath=function isFileSystemPath(i){if(process.browser){return false}let u=j.getProtocol(i);return u===undefined||u==="file"};u.fromFileSystemPath=function fromFileSystemPath(i){if(v){i=i.replace(/\\/g,"/")}i=encodeURI(i);for(let u=0;udecodeURIComponent(i).replace($,"/").replace(W,"~")))}},5848:(i,u,m)=>{"use strict";var v=m(2432);var _=m(9772);function renamed(i,u){return function(){throw new Error("Function yaml."+i+" is removed in js-yaml 4. "+"Use yaml."+u+" instead, which is now safe by default.")}}i.exports.Type=m(3820);i.exports.Schema=m(8583);i.exports.FAILSAFE_SCHEMA=m(9056);i.exports.JSON_SCHEMA=m(9531);i.exports.CORE_SCHEMA=m(4030);i.exports.DEFAULT_SCHEMA=m(1448);i.exports.load=v.load;i.exports.loadAll=v.loadAll;i.exports.dump=_.dump;i.exports.YAMLException=m(7987);i.exports.types={binary:m(7731),float:m(8155),map:m(3412),null:m(1471),pairs:m(1589),set:m(986),timestamp:m(5544),bool:m(8769),int:m(8884),merge:m(718),omap:m(564),seq:m(7331),str:m(8225)};i.exports.safeLoad=renamed("safeLoad","load");i.exports.safeLoadAll=renamed("safeLoadAll","loadAll");i.exports.safeDump=renamed("safeDump","dump")},3198:i=>{"use strict";function isNothing(i){return typeof i==="undefined"||i===null}function isObject(i){return typeof i==="object"&&i!==null}function toArray(i){if(Array.isArray(i))return i;else if(isNothing(i))return[];return[i]}function extend(i,u){var m,v,_,M;if(u){M=Object.keys(u);for(m=0,v=M.length;m{"use strict";var v=m(3198);var _=m(7987);var M=m(1448);var j=Object.prototype.toString;var $=Object.prototype.hasOwnProperty;var W=65279;var Y=9;var Z=10;var X=13;var ee=32;var ie=33;var ae=34;var ce=35;var le=37;var pe=38;var fe=39;var de=42;var ye=44;var be=45;var _e=58;var Se=61;var xe=62;var we=63;var Te=64;var Ie=91;var Pe=93;var Re=96;var qe=123;var He=124;var ze=125;var Ve={};Ve[0]="\\0";Ve[7]="\\a";Ve[8]="\\b";Ve[9]="\\t";Ve[10]="\\n";Ve[11]="\\v";Ve[12]="\\f";Ve[13]="\\r";Ve[27]="\\e";Ve[34]='\\"';Ve[92]="\\\\";Ve[133]="\\N";Ve[160]="\\_";Ve[8232]="\\L";Ve[8233]="\\P";var We=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];var Ye=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function compileStyleMap(i,u){var m,v,_,M,j,W,Y;if(u===null)return{};m={};v=Object.keys(u);for(_=0,M=v.length;_=55296&&m<=56319&&u+1=56320&&v<=57343){return(m-55296)*1024+v-56320+65536}}return m}function needIndentIndicator(i){var u=/^\n* /;return u.test(i)}var et=1,tt=2,rt=3,nt=4,it=5;function chooseScalarStyle(i,u,m,v,_,M,j,$){var W;var Y=0;var X=null;var ee=false;var ie=false;var ae=v!==-1;var ce=-1;var le=isPlainSafeFirst(codePointAt(i,0))&&isPlainSafeLast(codePointAt(i,i.length-1));if(u||j){for(W=0;W=65536?W+=2:W++){Y=codePointAt(i,W);if(!isPrintable(Y)){return it}le=le&&isPlainSafe(Y,X,$);X=Y}}else{for(W=0;W=65536?W+=2:W++){Y=codePointAt(i,W);if(Y===Z){ee=true;if(ae){ie=ie||W-ce-1>v&&i[ce+1]!==" ";ce=W}}else if(!isPrintable(Y)){return it}le=le&&isPlainSafe(Y,X,$);X=Y}ie=ie||ae&&(W-ce-1>v&&i[ce+1]!==" ")}if(!ee&&!ie){if(le&&!j&&!_(i)){return et}return M===Xe?it:tt}if(m>9&&needIndentIndicator(i)){return it}if(!j){return ie?nt:rt}return M===Xe?it:tt}function writeScalar(i,u,m,v,M){i.dump=function(){if(u.length===0){return i.quotingType===Xe?'""':"''"}if(!i.noCompatMode){if(We.indexOf(u)!==-1||Ye.test(u)){return i.quotingType===Xe?'"'+u+'"':"'"+u+"'"}}var j=i.indent*Math.max(1,m);var $=i.lineWidth===-1?-1:Math.max(Math.min(i.lineWidth,40),i.lineWidth-j);var W=v||i.flowLevel>-1&&m>=i.flowLevel;function testAmbiguity(u){return testImplicitResolving(i,u)}switch(chooseScalarStyle(u,W,i.indent,$,testAmbiguity,i.quotingType,i.forceQuotes&&!v,M)){case et:return u;case tt:return"'"+u.replace(/'/g,"''")+"'";case rt:return"|"+blockHeader(u,i.indent)+dropEndingNewline(indentString(u,j));case nt:return">"+blockHeader(u,i.indent)+dropEndingNewline(indentString(foldString(u,$),j));case it:return'"'+escapeString(u,$)+'"';default:throw new _("impossible error: invalid scalar style")}}()}function blockHeader(i,u){var m=needIndentIndicator(i)?String(u):"";var v=i[i.length-1]==="\n";var _=v&&(i[i.length-2]==="\n"||i==="\n");var M=_?"+":v?"":"-";return m+M+"\n"}function dropEndingNewline(i){return i[i.length-1]==="\n"?i.slice(0,-1):i}function foldString(i,u){var m=/(\n+)([^\n]*)/g;var v=function(){var v=i.indexOf("\n");v=v!==-1?v:i.length;m.lastIndex=v;return foldLine(i.slice(0,v),u)}();var _=i[0]==="\n"||i[0]===" ";var M;var j;while(j=m.exec(i)){var $=j[1],W=j[2];M=W[0]===" ";v+=$+(!_&&!M&&W!==""?"\n":"")+foldLine(W,u);_=M}return v}function foldLine(i,u){if(i===""||i[0]===" ")return i;var m=/ [^ ]/g;var v;var _=0,M,j=0,$=0;var W="";while(v=m.exec(i)){$=v.index;if($-_>u){M=j>_?j:$;W+="\n"+i.slice(_,M);_=M+1}j=$}W+="\n";if(i.length-_>u&&j>_){W+=i.slice(_,j)+"\n"+i.slice(j+1)}else{W+=i.slice(_)}return W.slice(1)}function escapeString(i){var u="";var m=0;var v;for(var _=0;_=65536?_+=2:_++){m=codePointAt(i,_);v=Ve[m];if(!v&&isPrintable(m)){u+=i[_];if(m>=65536)u+=i[_+1]}else{u+=v||encodeHex(m)}}return u}function writeFlowSequence(i,u,m){var v="",_=i.tag,M,j,$;for(M=0,j=m.length;M1024)Z+="? ";Z+=i.dump+(i.condenseFlow?'"':"")+":"+(i.condenseFlow?"":" ");if(!writeNode(i,u,Y,false,false)){continue}Z+=i.dump;v+=Z}i.tag=_;i.dump="{"+v+"}"}function writeBlockMapping(i,u,m,v){var M="",j=i.tag,$=Object.keys(m),W,Y,X,ee,ie,ae;if(i.sortKeys===true){$.sort()}else if(typeof i.sortKeys==="function"){$.sort(i.sortKeys)}else if(i.sortKeys){throw new _("sortKeys must be a boolean or a function")}for(W=0,Y=$.length;W1024;if(ie){if(i.dump&&Z===i.dump.charCodeAt(0)){ae+="?"}else{ae+="? "}}ae+=i.dump;if(ie){ae+=generateNextLine(i,u)}if(!writeNode(i,u+1,ee,true,ie)){continue}if(i.dump&&Z===i.dump.charCodeAt(0)){ae+=":"}else{ae+=": "}ae+=i.dump;M+=ae}i.tag=j;i.dump=M||"{}"}function detectType(i,u,m){var v,M,W,Y,Z,X;M=m?i.explicitTypes:i.implicitTypes;for(W=0,Y=M.length;W tag resolver accepts not "'+X+'" style')}i.dump=v}return true}}return false}function writeNode(i,u,m,v,M,$,W){i.tag=null;i.dump=m;if(!detectType(i,m,false)){detectType(i,m,true)}var Y=j.call(i.dump);var Z=v;var X;if(v){v=i.flowLevel<0||i.flowLevel>u}var ee=Y==="[object Object]"||Y==="[object Array]",ie,ae;if(ee){ie=i.duplicates.indexOf(m);ae=ie!==-1}if(i.tag!==null&&i.tag!=="?"||ae||i.indent!==2&&u>0){M=false}if(ae&&i.usedDuplicates[ie]){i.dump="*ref_"+ie}else{if(ee&&ae&&!i.usedDuplicates[ie]){i.usedDuplicates[ie]=true}if(Y==="[object Object]"){if(v&&Object.keys(i.dump).length!==0){writeBlockMapping(i,u,i.dump,M);if(ae){i.dump="&ref_"+ie+i.dump}}else{writeFlowMapping(i,u,i.dump);if(ae){i.dump="&ref_"+ie+" "+i.dump}}}else if(Y==="[object Array]"){if(v&&i.dump.length!==0){if(i.noArrayIndent&&!W&&u>0){writeBlockSequence(i,u-1,i.dump,M)}else{writeBlockSequence(i,u,i.dump,M)}if(ae){i.dump="&ref_"+ie+i.dump}}else{writeFlowSequence(i,u,i.dump);if(ae){i.dump="&ref_"+ie+" "+i.dump}}}else if(Y==="[object String]"){if(i.tag!=="?"){writeScalar(i,i.dump,u,$,Z)}}else if(Y==="[object Undefined]"){return false}else{if(i.skipInvalid)return false;throw new _("unacceptable kind of an object to dump "+Y)}if(i.tag!==null&&i.tag!=="?"){X=encodeURI(i.tag[0]==="!"?i.tag.slice(1):i.tag).replace(/!/g,"%21");if(i.tag[0]==="!"){X="!"+X}else if(X.slice(0,18)==="tag:yaml.org,2002:"){X="!!"+X.slice(18)}else{X="!<"+X+">"}i.dump=X+" "+i.dump}}return true}function getDuplicateReferences(i,u){var m=[],v=[],_,M;inspectNode(i,m,v);for(_=0,M=v.length;_{"use strict";function formatError(i,u){var m="",v=i.reason||"(unknown reason)";if(!i.mark)return v;if(i.mark.name){m+='in "'+i.mark.name+'" '}m+="("+(i.mark.line+1)+":"+(i.mark.column+1)+")";if(!u&&i.mark.snippet){m+="\n\n"+i.mark.snippet}return v+" "+m}function YAMLException(i,u){Error.call(this);this.name="YAMLException";this.reason=i;this.mark=u;this.message=formatError(this,false);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}else{this.stack=(new Error).stack||""}}YAMLException.prototype=Object.create(Error.prototype);YAMLException.prototype.constructor=YAMLException;YAMLException.prototype.toString=function toString(i){return this.name+": "+formatError(this,i)};i.exports=YAMLException},2432:(i,u,m)=>{"use strict";var v=m(3198);var _=m(7987);var M=m(9152);var j=m(1448);var $=Object.prototype.hasOwnProperty;var W=1;var Y=2;var Z=3;var X=4;var ee=1;var ie=2;var ae=3;var ce=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;var le=/[\x85\u2028\u2029]/;var pe=/[,\[\]\{\}]/;var fe=/^(?:!|!!|![a-z\-]+!)$/i;var de=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function _class(i){return Object.prototype.toString.call(i)}function is_EOL(i){return i===10||i===13}function is_WHITE_SPACE(i){return i===9||i===32}function is_WS_OR_EOL(i){return i===9||i===32||i===10||i===13}function is_FLOW_INDICATOR(i){return i===44||i===91||i===93||i===123||i===125}function fromHexCode(i){var u;if(48<=i&&i<=57){return i-48}u=i|32;if(97<=u&&u<=102){return u-97+10}return-1}function escapedHexLen(i){if(i===120){return 2}if(i===117){return 4}if(i===85){return 8}return 0}function fromDecimalCode(i){if(48<=i&&i<=57){return i-48}return-1}function simpleEscapeSequence(i){return i===48?"\0":i===97?"":i===98?"\b":i===116?"\t":i===9?"\t":i===110?"\n":i===118?"\v":i===102?"\f":i===114?"\r":i===101?"":i===32?" ":i===34?'"':i===47?"/":i===92?"\\":i===78?"…":i===95?" ":i===76?"\u2028":i===80?"\u2029":""}function charFromCodepoint(i){if(i<=65535){return String.fromCharCode(i)}return String.fromCharCode((i-65536>>10)+55296,(i-65536&1023)+56320)}var ye=new Array(256);var be=new Array(256);for(var _e=0;_e<256;_e++){ye[_e]=simpleEscapeSequence(_e)?1:0;be[_e]=simpleEscapeSequence(_e)}function State(i,u){this.input=i;this.filename=u["filename"]||null;this.schema=u["schema"]||j;this.onWarning=u["onWarning"]||null;this.legacy=u["legacy"]||false;this.json=u["json"]||false;this.listener=u["listener"]||null;this.implicitTypes=this.schema.compiledImplicit;this.typeMap=this.schema.compiledTypeMap;this.length=i.length;this.position=0;this.line=0;this.lineStart=0;this.lineIndent=0;this.firstTabInLine=-1;this.documents=[]}function generateError(i,u){var m={name:i.filename,buffer:i.input.slice(0,-1),position:i.position,line:i.line,column:i.position-i.lineStart};m.snippet=M(m);return new _(u,m)}function throwError(i,u){throw generateError(i,u)}function throwWarning(i,u){if(i.onWarning){i.onWarning.call(null,generateError(i,u))}}var Se={YAML:function handleYamlDirective(i,u,m){var v,_,M;if(i.version!==null){throwError(i,"duplication of %YAML directive")}if(m.length!==1){throwError(i,"YAML directive accepts exactly one argument")}v=/^([0-9]+)\.([0-9]+)$/.exec(m[0]);if(v===null){throwError(i,"ill-formed argument of the YAML directive")}_=parseInt(v[1],10);M=parseInt(v[2],10);if(_!==1){throwError(i,"unacceptable YAML version of the document")}i.version=m[0];i.checkLineBreaks=M<2;if(M!==1&&M!==2){throwWarning(i,"unsupported YAML version of the document")}},TAG:function handleTagDirective(i,u,m){var v,_;if(m.length!==2){throwError(i,"TAG directive accepts exactly two arguments")}v=m[0];_=m[1];if(!fe.test(v)){throwError(i,"ill-formed tag handle (first argument) of the TAG directive")}if($.call(i.tagMap,v)){throwError(i,'there is a previously declared suffix for "'+v+'" tag handle')}if(!de.test(_)){throwError(i,"ill-formed tag prefix (second argument) of the TAG directive")}try{_=decodeURIComponent(_)}catch(u){throwError(i,"tag prefix is malformed: "+_)}i.tagMap[v]=_}};function captureSegment(i,u,m,v){var _,M,j,$;if(u1){i.result+=v.repeat("\n",u-1)}}function readPlainScalar(i,u,m){var v,_,M,j,$,W,Y,Z,X=i.kind,ee=i.result,ie;ie=i.input.charCodeAt(i.position);if(is_WS_OR_EOL(ie)||is_FLOW_INDICATOR(ie)||ie===35||ie===38||ie===42||ie===33||ie===124||ie===62||ie===39||ie===34||ie===37||ie===64||ie===96){return false}if(ie===63||ie===45){_=i.input.charCodeAt(i.position+1);if(is_WS_OR_EOL(_)||m&&is_FLOW_INDICATOR(_)){return false}}i.kind="scalar";i.result="";M=j=i.position;$=false;while(ie!==0){if(ie===58){_=i.input.charCodeAt(i.position+1);if(is_WS_OR_EOL(_)||m&&is_FLOW_INDICATOR(_)){break}}else if(ie===35){v=i.input.charCodeAt(i.position-1);if(is_WS_OR_EOL(v)){break}}else if(i.position===i.lineStart&&testDocumentSeparator(i)||m&&is_FLOW_INDICATOR(ie)){break}else if(is_EOL(ie)){W=i.line;Y=i.lineStart;Z=i.lineIndent;skipSeparationSpace(i,false,-1);if(i.lineIndent>=u){$=true;ie=i.input.charCodeAt(i.position);continue}else{i.position=j;i.line=W;i.lineStart=Y;i.lineIndent=Z;break}}if($){captureSegment(i,M,j,false);writeFoldedLines(i,i.line-W);M=j=i.position;$=false}if(!is_WHITE_SPACE(ie)){j=i.position+1}ie=i.input.charCodeAt(++i.position)}captureSegment(i,M,j,false);if(i.result){return true}i.kind=X;i.result=ee;return false}function readSingleQuotedScalar(i,u){var m,v,_;m=i.input.charCodeAt(i.position);if(m!==39){return false}i.kind="scalar";i.result="";i.position++;v=_=i.position;while((m=i.input.charCodeAt(i.position))!==0){if(m===39){captureSegment(i,v,i.position,true);m=i.input.charCodeAt(++i.position);if(m===39){v=i.position;i.position++;_=i.position}else{return true}}else if(is_EOL(m)){captureSegment(i,v,_,true);writeFoldedLines(i,skipSeparationSpace(i,false,u));v=_=i.position}else if(i.position===i.lineStart&&testDocumentSeparator(i)){throwError(i,"unexpected end of the document within a single quoted scalar")}else{i.position++;_=i.position}}throwError(i,"unexpected end of the stream within a single quoted scalar")}function readDoubleQuotedScalar(i,u){var m,v,_,M,j,$;$=i.input.charCodeAt(i.position);if($!==34){return false}i.kind="scalar";i.result="";i.position++;m=v=i.position;while(($=i.input.charCodeAt(i.position))!==0){if($===34){captureSegment(i,m,i.position,true);i.position++;return true}else if($===92){captureSegment(i,m,i.position,true);$=i.input.charCodeAt(++i.position);if(is_EOL($)){skipSeparationSpace(i,false,u)}else if($<256&&ye[$]){i.result+=be[$];i.position++}else if((j=escapedHexLen($))>0){_=j;M=0;for(;_>0;_--){$=i.input.charCodeAt(++i.position);if((j=fromHexCode($))>=0){M=(M<<4)+j}else{throwError(i,"expected hexadecimal character")}}i.result+=charFromCodepoint(M);i.position++}else{throwError(i,"unknown escape sequence")}m=v=i.position}else if(is_EOL($)){captureSegment(i,m,v,true);writeFoldedLines(i,skipSeparationSpace(i,false,u));m=v=i.position}else if(i.position===i.lineStart&&testDocumentSeparator(i)){throwError(i,"unexpected end of the document within a double quoted scalar")}else{i.position++;v=i.position}}throwError(i,"unexpected end of the stream within a double quoted scalar")}function readFlowCollection(i,u){var m=true,v,_,M,j=i.tag,$,Y=i.anchor,Z,X,ee,ie,ae,ce=Object.create(null),le,pe,fe,de;de=i.input.charCodeAt(i.position);if(de===91){X=93;ae=false;$=[]}else if(de===123){X=125;ae=true;$={}}else{return false}if(i.anchor!==null){i.anchorMap[i.anchor]=$}de=i.input.charCodeAt(++i.position);while(de!==0){skipSeparationSpace(i,true,u);de=i.input.charCodeAt(i.position);if(de===X){i.position++;i.tag=j;i.anchor=Y;i.kind=ae?"mapping":"sequence";i.result=$;return true}else if(!m){throwError(i,"missed comma between flow collection entries")}else if(de===44){throwError(i,"expected the node content, but found ','")}pe=le=fe=null;ee=ie=false;if(de===63){Z=i.input.charCodeAt(i.position+1);if(is_WS_OR_EOL(Z)){ee=ie=true;i.position++;skipSeparationSpace(i,true,u)}}v=i.line;_=i.lineStart;M=i.position;composeNode(i,u,W,false,true);pe=i.tag;le=i.result;skipSeparationSpace(i,true,u);de=i.input.charCodeAt(i.position);if((ie||i.line===v)&&de===58){ee=true;de=i.input.charCodeAt(++i.position);skipSeparationSpace(i,true,u);composeNode(i,u,W,false,true);fe=i.result}if(ae){storeMappingPair(i,$,ce,pe,le,fe,v,_,M)}else if(ee){$.push(storeMappingPair(i,null,ce,pe,le,fe,v,_,M))}else{$.push(le)}skipSeparationSpace(i,true,u);de=i.input.charCodeAt(i.position);if(de===44){m=true;de=i.input.charCodeAt(++i.position)}else{m=false}}throwError(i,"unexpected end of the stream within a flow collection")}function readBlockScalar(i,u){var m,_,M=ee,j=false,$=false,W=u,Y=0,Z=false,X,ce;ce=i.input.charCodeAt(i.position);if(ce===124){_=false}else if(ce===62){_=true}else{return false}i.kind="scalar";i.result="";while(ce!==0){ce=i.input.charCodeAt(++i.position);if(ce===43||ce===45){if(ee===M){M=ce===43?ae:ie}else{throwError(i,"repeat of a chomping mode identifier")}}else if((X=fromDecimalCode(ce))>=0){if(X===0){throwError(i,"bad explicit indentation width of a block scalar; it cannot be less than one")}else if(!$){W=u+X-1;$=true}else{throwError(i,"repeat of an indentation width identifier")}}else{break}}if(is_WHITE_SPACE(ce)){do{ce=i.input.charCodeAt(++i.position)}while(is_WHITE_SPACE(ce));if(ce===35){do{ce=i.input.charCodeAt(++i.position)}while(!is_EOL(ce)&&ce!==0)}}while(ce!==0){readLineBreak(i);i.lineIndent=0;ce=i.input.charCodeAt(i.position);while((!$||i.lineIndentW){W=i.lineIndent}if(is_EOL(ce)){Y++;continue}if(i.lineIndentu)&&W!==0){throwError(i,"bad indentation of a sequence entry")}else if(i.lineIndentu){if(fe){j=i.line;$=i.lineStart;W=i.position}if(composeNode(i,u,X,true,_)){if(fe){le=i.result}else{pe=i.result}}if(!fe){storeMappingPair(i,ie,ae,ce,le,pe,j,$,W);ce=le=pe=null}skipSeparationSpace(i,true,-1);ye=i.input.charCodeAt(i.position)}if((i.line===M||i.lineIndent>u)&&ye!==0){throwError(i,"bad indentation of a mapping entry")}else if(i.lineIndentu){ie=1}else if(i.lineIndent===u){ie=0}else if(i.lineIndentu){ie=1}else if(i.lineIndent===u){ie=0}else if(i.lineIndent tag; it should be "scalar", not "'+i.kind+'"')}for(le=0,pe=i.implicitTypes.length;le")}if(i.result!==null&&de.kind!==i.kind){throwError(i,"unacceptable node kind for !<"+i.tag+'> tag; it should be "'+de.kind+'", not "'+i.kind+'"')}if(!de.resolve(i.result,i.tag)){throwError(i,"cannot resolve a node with !<"+i.tag+"> explicit tag")}else{i.result=de.construct(i.result,i.tag);if(i.anchor!==null){i.anchorMap[i.anchor]=i.result}}}if(i.listener!==null){i.listener("close",i)}return i.tag!==null||i.anchor!==null||ce}function readDocument(i){var u=i.position,m,v,_,M=false,j;i.version=null;i.checkLineBreaks=i.legacy;i.tagMap=Object.create(null);i.anchorMap=Object.create(null);while((j=i.input.charCodeAt(i.position))!==0){skipSeparationSpace(i,true,-1);j=i.input.charCodeAt(i.position);if(i.lineIndent>0||j!==37){break}M=true;j=i.input.charCodeAt(++i.position);m=i.position;while(j!==0&&!is_WS_OR_EOL(j)){j=i.input.charCodeAt(++i.position)}v=i.input.slice(m,i.position);_=[];if(v.length<1){throwError(i,"directive name must not be less than one character in length")}while(j!==0){while(is_WHITE_SPACE(j)){j=i.input.charCodeAt(++i.position)}if(j===35){do{j=i.input.charCodeAt(++i.position)}while(j!==0&&!is_EOL(j));break}if(is_EOL(j))break;m=i.position;while(j!==0&&!is_WS_OR_EOL(j)){j=i.input.charCodeAt(++i.position)}_.push(i.input.slice(m,i.position))}if(j!==0)readLineBreak(i);if($.call(Se,v)){Se[v](i,v,_)}else{throwWarning(i,'unknown document directive "'+v+'"')}}skipSeparationSpace(i,true,-1);if(i.lineIndent===0&&i.input.charCodeAt(i.position)===45&&i.input.charCodeAt(i.position+1)===45&&i.input.charCodeAt(i.position+2)===45){i.position+=3;skipSeparationSpace(i,true,-1)}else if(M){throwError(i,"directives end mark is expected")}composeNode(i,i.lineIndent-1,X,false,true);skipSeparationSpace(i,true,-1);if(i.checkLineBreaks&&le.test(i.input.slice(u,i.position))){throwWarning(i,"non-ASCII line breaks are interpreted as content")}i.documents.push(i.result);if(i.position===i.lineStart&&testDocumentSeparator(i)){if(i.input.charCodeAt(i.position)===46){i.position+=3;skipSeparationSpace(i,true,-1)}return}if(i.position{"use strict";var v=m(7987);var _=m(3820);function compileList(i,u){var m=[];i[u].forEach((function(i){var u=m.length;m.forEach((function(m,v){if(m.tag===i.tag&&m.kind===i.kind&&m.multi===i.multi){u=v}}));m[u]=i}));return m}function compileMap(){var i={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},u,m;function collectType(u){if(u.multi){i.multi[u.kind].push(u);i.multi["fallback"].push(u)}else{i[u.kind][u.tag]=i["fallback"][u.tag]=u}}for(u=0,m=arguments.length;u{"use strict";i.exports=m(9531)},1448:(i,u,m)=>{"use strict";i.exports=m(4030).extend({implicit:[m(5544),m(718)],explicit:[m(7731),m(564),m(1589),m(986)]})},9056:(i,u,m)=>{"use strict";var v=m(8583);i.exports=new v({explicit:[m(8225),m(7331),m(3412)]})},9531:(i,u,m)=>{"use strict";i.exports=m(9056).extend({implicit:[m(1471),m(8769),m(8884),m(8155)]})},9152:(i,u,m)=>{"use strict";var v=m(3198);function getLine(i,u,m,v,_){var M="";var j="";var $=Math.floor(_/2)-1;if(v-u>$){M=" ... ";u=v-$+M.length}if(m-v>$){j=" ...";m=v+$-j.length}return{str:M+i.slice(u,m).replace(/\t/g,"→")+j,pos:v-u+M.length}}function padStart(i,u){return v.repeat(" ",u-i.length)+i}function makeSnippet(i,u){u=Object.create(u||null);if(!i.buffer)return null;if(!u.maxLength)u.maxLength=79;if(typeof u.indent!=="number")u.indent=1;if(typeof u.linesBefore!=="number")u.linesBefore=3;if(typeof u.linesAfter!=="number")u.linesAfter=2;var m=/\r?\n|\r|\0/g;var _=[0];var M=[];var j;var $=-1;while(j=m.exec(i.buffer)){M.push(j.index);_.push(j.index+j[0].length);if(i.position<=j.index&&$<0){$=_.length-2}}if($<0)$=_.length-1;var W="",Y,Z;var X=Math.min(i.line+u.linesAfter,M.length).toString().length;var ee=u.maxLength-(u.indent+X+3);for(Y=1;Y<=u.linesBefore;Y++){if($-Y<0)break;Z=getLine(i.buffer,_[$-Y],M[$-Y],i.position-(_[$]-_[$-Y]),ee);W=v.repeat(" ",u.indent)+padStart((i.line-Y+1).toString(),X)+" | "+Z.str+"\n"+W}Z=getLine(i.buffer,_[$],M[$],i.position,ee);W+=v.repeat(" ",u.indent)+padStart((i.line+1).toString(),X)+" | "+Z.str+"\n";W+=v.repeat("-",u.indent+X+3+Z.pos)+"^"+"\n";for(Y=1;Y<=u.linesAfter;Y++){if($+Y>=M.length)break;Z=getLine(i.buffer,_[$+Y],M[$+Y],i.position-(_[$]-_[$+Y]),ee);W+=v.repeat(" ",u.indent)+padStart((i.line+Y+1).toString(),X)+" | "+Z.str+"\n"}return W.replace(/\n$/,"")}i.exports=makeSnippet},3820:(i,u,m)=>{"use strict";var v=m(7987);var _=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"];var M=["scalar","sequence","mapping"];function compileStyleAliases(i){var u={};if(i!==null){Object.keys(i).forEach((function(m){i[m].forEach((function(i){u[String(i)]=m}))}))}return u}function Type(i,u){u=u||{};Object.keys(u).forEach((function(u){if(_.indexOf(u)===-1){throw new v('Unknown option "'+u+'" is met in definition of "'+i+'" YAML type.')}}));this.options=u;this.tag=i;this.kind=u["kind"]||null;this.resolve=u["resolve"]||function(){return true};this.construct=u["construct"]||function(i){return i};this.instanceOf=u["instanceOf"]||null;this.predicate=u["predicate"]||null;this.represent=u["represent"]||null;this.representName=u["representName"]||null;this.defaultStyle=u["defaultStyle"]||null;this.multi=u["multi"]||false;this.styleAliases=compileStyleAliases(u["styleAliases"]||null);if(M.indexOf(this.kind)===-1){throw new v('Unknown kind "'+this.kind+'" is specified for "'+i+'" YAML type.')}}i.exports=Type},7731:(i,u,m)=>{"use strict";var v=m(3820);var _="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";function resolveYamlBinary(i){if(i===null)return false;var u,m,v=0,M=i.length,j=_;for(m=0;m64)continue;if(u<0)return false;v+=6}return v%8===0}function constructYamlBinary(i){var u,m,v=i.replace(/[\r\n=]/g,""),M=v.length,j=_,$=0,W=[];for(u=0;u>16&255);W.push($>>8&255);W.push($&255)}$=$<<6|j.indexOf(v.charAt(u))}m=M%4*6;if(m===0){W.push($>>16&255);W.push($>>8&255);W.push($&255)}else if(m===18){W.push($>>10&255);W.push($>>2&255)}else if(m===12){W.push($>>4&255)}return new Uint8Array(W)}function representYamlBinary(i){var u="",m=0,v,M,j=i.length,$=_;for(v=0;v>18&63];u+=$[m>>12&63];u+=$[m>>6&63];u+=$[m&63]}m=(m<<8)+i[v]}M=j%3;if(M===0){u+=$[m>>18&63];u+=$[m>>12&63];u+=$[m>>6&63];u+=$[m&63]}else if(M===2){u+=$[m>>10&63];u+=$[m>>4&63];u+=$[m<<2&63];u+=$[64]}else if(M===1){u+=$[m>>2&63];u+=$[m<<4&63];u+=$[64];u+=$[64]}return u}function isBinary(i){return Object.prototype.toString.call(i)==="[object Uint8Array]"}i.exports=new v("tag:yaml.org,2002:binary",{kind:"scalar",resolve:resolveYamlBinary,construct:constructYamlBinary,predicate:isBinary,represent:representYamlBinary})},8769:(i,u,m)=>{"use strict";var v=m(3820);function resolveYamlBoolean(i){if(i===null)return false;var u=i.length;return u===4&&(i==="true"||i==="True"||i==="TRUE")||u===5&&(i==="false"||i==="False"||i==="FALSE")}function constructYamlBoolean(i){return i==="true"||i==="True"||i==="TRUE"}function isBoolean(i){return Object.prototype.toString.call(i)==="[object Boolean]"}i.exports=new v("tag:yaml.org,2002:bool",{kind:"scalar",resolve:resolveYamlBoolean,construct:constructYamlBoolean,predicate:isBoolean,represent:{lowercase:function(i){return i?"true":"false"},uppercase:function(i){return i?"TRUE":"FALSE"},camelcase:function(i){return i?"True":"False"}},defaultStyle:"lowercase"})},8155:(i,u,m)=>{"use strict";var v=m(3198);var _=m(3820);var M=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?"+"|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?"+"|[-+]?\\.(?:inf|Inf|INF)"+"|\\.(?:nan|NaN|NAN))$");function resolveYamlFloat(i){if(i===null)return false;if(!M.test(i)||i[i.length-1]==="_"){return false}return true}function constructYamlFloat(i){var u,m;u=i.replace(/_/g,"").toLowerCase();m=u[0]==="-"?-1:1;if("+-".indexOf(u[0])>=0){u=u.slice(1)}if(u===".inf"){return m===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY}else if(u===".nan"){return NaN}return m*parseFloat(u,10)}var j=/^[-+]?[0-9]+e/;function representYamlFloat(i,u){var m;if(isNaN(i)){switch(u){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}}else if(Number.POSITIVE_INFINITY===i){switch(u){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}}else if(Number.NEGATIVE_INFINITY===i){switch(u){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}}else if(v.isNegativeZero(i)){return"-0.0"}m=i.toString(10);return j.test(m)?m.replace("e",".e"):m}function isFloat(i){return Object.prototype.toString.call(i)==="[object Number]"&&(i%1!==0||v.isNegativeZero(i))}i.exports=new _("tag:yaml.org,2002:float",{kind:"scalar",resolve:resolveYamlFloat,construct:constructYamlFloat,predicate:isFloat,represent:representYamlFloat,defaultStyle:"lowercase"})},8884:(i,u,m)=>{"use strict";var v=m(3198);var _=m(3820);function isHexCode(i){return 48<=i&&i<=57||65<=i&&i<=70||97<=i&&i<=102}function isOctCode(i){return 48<=i&&i<=55}function isDecCode(i){return 48<=i&&i<=57}function resolveYamlInteger(i){if(i===null)return false;var u=i.length,m=0,v=false,_;if(!u)return false;_=i[m];if(_==="-"||_==="+"){_=i[++m]}if(_==="0"){if(m+1===u)return true;_=i[++m];if(_==="b"){m++;for(;m=0?"0b"+i.toString(2):"-0b"+i.toString(2).slice(1)},octal:function(i){return i>=0?"0o"+i.toString(8):"-0o"+i.toString(8).slice(1)},decimal:function(i){return i.toString(10)},hexadecimal:function(i){return i>=0?"0x"+i.toString(16).toUpperCase():"-0x"+i.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},3412:(i,u,m)=>{"use strict";var v=m(3820);i.exports=new v("tag:yaml.org,2002:map",{kind:"mapping",construct:function(i){return i!==null?i:{}}})},718:(i,u,m)=>{"use strict";var v=m(3820);function resolveYamlMerge(i){return i==="<<"||i===null}i.exports=new v("tag:yaml.org,2002:merge",{kind:"scalar",resolve:resolveYamlMerge})},1471:(i,u,m)=>{"use strict";var v=m(3820);function resolveYamlNull(i){if(i===null)return true;var u=i.length;return u===1&&i==="~"||u===4&&(i==="null"||i==="Null"||i==="NULL")}function constructYamlNull(){return null}function isNull(i){return i===null}i.exports=new v("tag:yaml.org,2002:null",{kind:"scalar",resolve:resolveYamlNull,construct:constructYamlNull,predicate:isNull,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"})},564:(i,u,m)=>{"use strict";var v=m(3820);var _=Object.prototype.hasOwnProperty;var M=Object.prototype.toString;function resolveYamlOmap(i){if(i===null)return true;var u=[],m,v,j,$,W,Y=i;for(m=0,v=Y.length;m{"use strict";var v=m(3820);var _=Object.prototype.toString;function resolveYamlPairs(i){if(i===null)return true;var u,m,v,M,j,$=i;j=new Array($.length);for(u=0,m=$.length;u{"use strict";var v=m(3820);i.exports=new v("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(i){return i!==null?i:[]}})},986:(i,u,m)=>{"use strict";var v=m(3820);var _=Object.prototype.hasOwnProperty;function resolveYamlSet(i){if(i===null)return true;var u,m=i;for(u in m){if(_.call(m,u)){if(m[u]!==null)return false}}return true}function constructYamlSet(i){return i!==null?i:{}}i.exports=new v("tag:yaml.org,2002:set",{kind:"mapping",resolve:resolveYamlSet,construct:constructYamlSet})},8225:(i,u,m)=>{"use strict";var v=m(3820);i.exports=new v("tag:yaml.org,2002:str",{kind:"scalar",construct:function(i){return i!==null?i:""}})},5544:(i,u,m)=>{"use strict";var v=m(3820);var _=new RegExp("^([0-9][0-9][0-9][0-9])"+"-([0-9][0-9])"+"-([0-9][0-9])$");var M=new RegExp("^([0-9][0-9][0-9][0-9])"+"-([0-9][0-9]?)"+"-([0-9][0-9]?)"+"(?:[Tt]|[ \\t]+)"+"([0-9][0-9]?)"+":([0-9][0-9])"+":([0-9][0-9])"+"(?:\\.([0-9]*))?"+"(?:[ \\t]*(Z|([-+])([0-9][0-9]?)"+"(?::([0-9][0-9]))?))?$");function resolveYamlTimestamp(i){if(i===null)return false;if(_.exec(i)!==null)return true;if(M.exec(i)!==null)return true;return false}function constructYamlTimestamp(i){var u,m,v,j,$,W,Y,Z=0,X=null,ee,ie,ae;u=_.exec(i);if(u===null)u=M.exec(i);if(u===null)throw new Error("Date resolve error");m=+u[1];v=+u[2]-1;j=+u[3];if(!u[4]){return new Date(Date.UTC(m,v,j))}$=+u[4];W=+u[5];Y=+u[6];if(u[7]){Z=u[7].slice(0,3);while(Z.length<3){Z+="0"}Z=+Z}if(u[9]){ee=+u[10];ie=+(u[11]||0);X=(ee*60+ie)*6e4;if(u[9]==="-")X=-X}ae=new Date(Date.UTC(m,v,j,$,W,Y,Z));if(X)ae.setTime(ae.getTime()-X);return ae}function representYamlTimestamp(i){return i.toISOString()}i.exports=new v("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:resolveYamlTimestamp,construct:constructYamlTimestamp,instanceOf:Date,represent:representYamlTimestamp})},9198:(i,u,m)=>{"use strict";Object.defineProperty(u,"__esModule",{value:true});u.openapi=u.openapiV31=u.openapiV3=u.openapiV2=u.openapiV1=void 0;u.openapiV1=m(8479);u.openapiV2=m(499);u.openapiV3=m(3659);u.openapiV31=m(1201);u.openapi={v1:u.openapiV1,v2:u.openapiV2,v3:u.openapiV3,v31:u.openapiV31};u["default"]=u.openapi;if(true&&typeof i.exports==="object"){i.exports=Object.assign(i.exports.default,i.exports)}},935:i=>{"use strict";i.exports=["get","put","post","delete","options","head","patch"]},5999:(i,u,m)=>{"use strict";const v=m(5821);const _=m(6556);const M=m(4608);const j=m(1569);const $=m(4011);const W=m(3844);const{ono:Y}=m(3436);const Z=m(5862);const X=m(2461);i.exports=SwaggerParser;function SwaggerParser(){Z.apply(this,arguments)}j.inherits(SwaggerParser,Z);SwaggerParser.parse=Z.parse;SwaggerParser.resolve=Z.resolve;SwaggerParser.bundle=Z.bundle;SwaggerParser.dereference=Z.dereference;Object.defineProperty(SwaggerParser.prototype,"api",{configurable:true,enumerable:true,get(){return this.schema}});SwaggerParser.prototype.parse=async function(i,u,m,v){let _=M(arguments);_.options=new $(_.options);try{let i=await Z.prototype.parse.call(this,_.path,_.schema,_.options);if(i.swagger){if(i.swagger===undefined||i.info===undefined||i.paths===undefined){throw Y.syntax(`${_.path||_.schema} is not a valid Swagger API definition`)}else if(typeof i.swagger==="number"){throw Y.syntax('Swagger version number must be a string (e.g. "2.0") not a number.')}else if(typeof i.info.version==="number"){throw Y.syntax('API version number must be a string (e.g. "1.0.0") not a number.')}else if(i.swagger!=="2.0"){throw Y.syntax(`Unrecognized Swagger version: ${i.swagger}. Expected 2.0`)}}else{let u=["3.0.0","3.0.1","3.0.2","3.0.3"];if(i.openapi===undefined||i.info===undefined||i.paths===undefined){throw Y.syntax(`${_.path||_.schema} is not a valid Openapi API definition`)}else if(typeof i.openapi==="number"){throw Y.syntax('Openapi version number must be a string (e.g. "3.0.0") not a number.')}else if(typeof i.info.version==="number"){throw Y.syntax('API version number must be a string (e.g. "1.0.0") not a number.')}else if(u.indexOf(i.openapi)===-1){throw Y.syntax(`Unsupported OpenAPI version: ${i.openapi}. `+`Swagger Parser only supports versions ${u.join(", ")}`)}}return W(_.callback,Promise.resolve(i))}catch(i){return W(_.callback,Promise.reject(i))}};SwaggerParser.validate=function(i,u,m,v){let _=this;let M=new _;return M.validate.apply(M,arguments)};SwaggerParser.prototype.validate=async function(i,u,m,j){let Z=this;let ee=M(arguments);ee.options=new $(ee.options);let ie=ee.options.dereference.circular;ee.options.validate.schema&&(ee.options.dereference.circular="ignore");try{await this.dereference(ee.path,ee.schema,ee.options);ee.options.dereference.circular=ie;if(ee.options.validate.schema){v(Z.api);if(Z.$refs.circular){if(ie===true){X(Z,ee.options)}else if(ie===false){throw Y.reference("The API contains circular references")}}}if(ee.options.validate.spec){_(Z.api)}return W(ee.callback,Promise.resolve(Z.schema))}catch(i){return W(ee.callback,Promise.reject(i))}}},4011:(i,u,m)=>{"use strict";const v=m(6608);const _=m(5821);const M=m(6556);const j=m(3837);i.exports=ParserOptions;function ParserOptions(i){v.call(this,ParserOptions.defaults);v.apply(this,arguments)}ParserOptions.defaults={validate:{schema:_,spec:M}};j.inherits(ParserOptions,v)},1569:(i,u,m)=>{"use strict";const v=m(3837);u.format=v.format;u.inherits=v.inherits;u.swaggerParamRegExp=/\{([^/}]+)}/g},5821:(i,u,m)=>{"use strict";const v=m(1569);const{ono:_}=m(3436);const M=m(5502);const{openapi:j}=m(9198);i.exports=validateSchema;let $=initializeZSchema();function validateSchema(i){let u=i.swagger?j.v2:j.v3;let m=$.validate(i,u);if(!m){let i=$.getLastError();let u="Swagger schema validation failed. \n"+formatZSchemaError(i.details);throw _.syntax(i,{details:i.details},u)}}function initializeZSchema(){delete j.v2.id;delete j.v3.id;M.registerFormat("uri-reference",(i=>i.trim().length>0));return new M({breakOnFirstError:true,noExtraKeywords:true,ignoreUnknownFormats:false,reportPathAsArray:true})}function formatZSchemaError(i,u){u=u||" ";let m="";for(let _ of i){m+=v.format(`${u}${_.message} at #/${_.path.join("/")}\n`);if(_.inner){m+=formatZSchemaError(_.inner,u+" ")}}return m}},6556:(i,u,m)=>{"use strict";const v=m(1569);const{ono:_}=m(3436);const M=m(935);const j=["array","boolean","integer","number","string"];const $=["array","boolean","integer","number","string","object","null",undefined];i.exports=validateSpec;function validateSpec(i){if(i.openapi){return}let u=Object.keys(i.paths||{});let m=[];for(let v of u){let u=i.paths[v];let _="/paths"+v;if(u&&v.indexOf("/")===0){validatePath(i,u,_,m)}}let v=Object.keys(i.definitions||{});for(let u of v){let m=i.definitions[u];let v="/definitions/"+u;validateRequiredPropertiesExist(m,v)}}function validatePath(i,u,m,v){for(let j of M){let M=u[j];let $=m+"/"+j;if(M){let j=M.operationId;if(j){if(v.indexOf(j)===-1){v.push(j)}else{throw _.syntax(`Validation failed. Duplicate operation id '${j}'`)}}validateParameters(i,u,m,M,$);let W=Object.keys(M.responses||{});for(let i of W){let u=M.responses[i];let m=$+"/responses/"+i;validateResponse(i,u||{},m)}}}}function validateParameters(i,u,m,v,M){let j=u.parameters||[];let $=v.parameters||[];try{checkForDuplicates(j)}catch(i){throw _.syntax(i,`Validation failed. ${m} has duplicate parameters`)}try{checkForDuplicates($)}catch(i){throw _.syntax(i,`Validation failed. ${M} has duplicate parameters`)}let W=j.reduce(((i,u)=>{let m=i.some((i=>i.in===u.in&&i.name===u.name));if(!m){i.push(u)}return i}),$.slice());validateBodyParameters(W,M);validatePathParameters(W,m,M);validateParameterTypes(W,i,v,M)}function validateBodyParameters(i,u){let m=i.filter((i=>i.in==="body"));let v=i.filter((i=>i.in==="formData"));if(m.length>1){throw _.syntax(`Validation failed. ${u} has ${m.length} body parameters. Only one is allowed.`)}else if(m.length>0&&v.length>0){throw _.syntax(`Validation failed. ${u} has body parameters and formData parameters. Only one or the other is allowed.`)}}function validatePathParameters(i,u,m){let M=u.match(v.swaggerParamRegExp)||[];for(let i=0;ii.in==="path"));for(let u of i){if(u.required!==true){throw _.syntax("Validation failed. Path parameters cannot be optional. "+`Set required=true for the "${u.name}" parameter at ${m}`)}let i=M.indexOf("{"+u.name+"}");if(i===-1){throw _.syntax(`Validation failed. ${m} has a path parameter named "${u.name}", `+`but there is no corresponding {${u.name}} in the path string`)}M.splice(i,1)}if(M.length>0){throw _.syntax(`Validation failed. ${m} is missing path parameter(s) for ${M}`)}}function validateParameterTypes(i,u,m,v){for(let M of i){let i=v+"/parameters/"+M.name;let W,Y;switch(M.in){case"body":W=M.schema;Y=$;break;case"formData":W=M;Y=j.concat("file");break;default:W=M;Y=j}validateSchema(W,i,Y);validateRequiredPropertiesExist(W,i);if(W.type==="file"){let i=/multipart\/(.*\+)?form-data/;let M=/application\/(.*\+)?x-www-form-urlencoded/;let j=m.consumes||u.consumes||[];let $=j.some((u=>i.test(u)||M.test(u)));if(!$){throw _.syntax(`Validation failed. ${v} has a file parameter, so it must consume multipart/form-data `+"or application/x-www-form-urlencoded")}}}}function checkForDuplicates(i){for(let u=0;u599)){throw _.syntax(`Validation failed. ${m} has an invalid response code (${i})`)}let v=Object.keys(u.headers||{});for(let i of v){let v=u.headers[i];let _=m+"/headers/"+i;validateSchema(v,_,j)}if(u.schema){let i=$.concat("file");if(i.indexOf(u.schema.type)===-1){throw _.syntax(`Validation failed. ${m} has an invalid response schema type (${u.schema.type})`)}else{validateSchema(u.schema,m+"/schema",i)}}}function validateSchema(i,u,m){if(m.indexOf(i.type)===-1){throw _.syntax(`Validation failed. ${u} has an invalid type (${i.type})`)}if(i.type==="array"&&!i.items){throw _.syntax(`Validation failed. ${u} is an array, so it must include an "items" schema`)}}function validateRequiredPropertiesExist(i,u){function collectProperties(i,u){if(i.properties){for(let m in i.properties){if(i.properties.hasOwnProperty(m)){u[m]=i.properties[m]}}}if(i.allOf){for(let m of i.allOf){collectProperties(m,u)}}}if(i.required&&Array.isArray(i.required)){let m={};collectProperties(i,m);for(let v of i.required){if(!m[v]){throw _.syntax(`Validation failed. Property '${v}' listed as required but does not exist in '${u}'`)}}}}},326:(i,u,m)=>{"use strict";Object.defineProperty(u,"__esModule",{value:true});u.Ono=void 0;const v=m(942);const _=m(9322);const M=m(4833);const j=Ono;u.Ono=j;function Ono(i,u){u=_.normalizeOptions(u);function ono(...m){let{originalError:M,props:j,message:$}=_.normalizeArgs(m,u);let W=new i($);return v.extendError(W,M,j)}ono[Symbol.species]=i;return ono}Ono.toJSON=function toJSON(i){return M.toJSON.call(i)};Ono.extend=function extend(i,u,m){if(m||u instanceof Error){return v.extendError(i,u,m)}else if(u){return v.extendError(i,undefined,u)}else{return v.extendError(i)}}},942:(i,u,m)=>{"use strict";Object.defineProperty(u,"__esModule",{value:true});u.extendError=void 0;const v=m(6315);const _=m(5254);const M=m(4833);const j=["name","message","stack"];function extendError(i,u,m){let _=i;extendStack(_,u);if(u&&typeof u==="object"){mergeErrors(_,u)}_.toJSON=M.toJSON;if(v.addInspectMethod){v.addInspectMethod(_)}if(m&&typeof m==="object"){Object.assign(_,m)}return _}u.extendError=extendError;function extendStack(i,u){let m=Object.getOwnPropertyDescriptor(i,"stack");if(_.isLazyStack(m)){_.lazyJoinStacks(m,i,u)}else if(_.isWritableStack(m)){i.stack=_.joinStacks(i,u)}}function mergeErrors(i,u){let m=M.getDeepKeys(u,j);let v=i;let _=u;for(let i of m){if(v[i]===undefined){try{v[i]=_[i]}catch(i){}}}}},3436:function(i,u,m){"use strict";var v=this&&this.__createBinding||(Object.create?function(i,u,m,v){if(v===undefined)v=m;Object.defineProperty(i,v,{enumerable:true,get:function(){return u[m]}})}:function(i,u,m,v){if(v===undefined)v=m;i[v]=u[m]});var _=this&&this.__exportStar||function(i,u){for(var m in i)if(m!=="default"&&!u.hasOwnProperty(m))v(u,i,m)};Object.defineProperty(u,"__esModule",{value:true});u.ono=void 0;const M=m(4760);Object.defineProperty(u,"ono",{enumerable:true,get:function(){return M.ono}});var j=m(326);Object.defineProperty(u,"Ono",{enumerable:true,get:function(){return j.Ono}});_(m(7905),u);u["default"]=M.ono;if(true&&typeof i.exports==="object"){i.exports=Object.assign(i.exports.default,i.exports)}},6315:(i,u,m)=>{"use strict";Object.defineProperty(u,"__esModule",{value:true});u.addInspectMethod=u.format=void 0;const v=m(3837);const _=m(4833);const M=v.inspect.custom||Symbol.for("nodejs.util.inspect.custom");u.format=v.format;function addInspectMethod(i){i[M]=inspect}u.addInspectMethod=addInspectMethod;function inspect(){let i={};let u=this;for(let m of _.getDeepKeys(u)){let v=u[m];i[m]=v}delete i[M];return i}},9322:(i,u,m)=>{"use strict";Object.defineProperty(u,"__esModule",{value:true});u.normalizeArgs=u.normalizeOptions=void 0;const v=m(6315);function normalizeOptions(i){i=i||{};return{concatMessages:i.concatMessages===undefined?true:Boolean(i.concatMessages),format:i.format===undefined?v.format:typeof i.format==="function"?i.format:false}}u.normalizeOptions=normalizeOptions;function normalizeArgs(i,u){let m;let v;let _;let M="";if(typeof i[0]==="string"){_=i}else if(typeof i[1]==="string"){if(i[0]instanceof Error){m=i[0]}else{v=i[0]}_=i.slice(1)}else{m=i[0];v=i[1];_=i.slice(2)}if(_.length>0){if(u.format){M=u.format.apply(undefined,_)}else{M=_.join(" ")}}if(u.concatMessages&&m&&m.message){M+=(M?" \n":"")+m.message}return{originalError:m,props:v,message:M}}u.normalizeArgs=normalizeArgs},4760:(i,u,m)=>{"use strict";Object.defineProperty(u,"__esModule",{value:true});u.ono=void 0;const v=m(326);const _=ono;u.ono=_;ono.error=new v.Ono(Error);ono.eval=new v.Ono(EvalError);ono.range=new v.Ono(RangeError);ono.reference=new v.Ono(ReferenceError);ono.syntax=new v.Ono(SyntaxError);ono.type=new v.Ono(TypeError);ono.uri=new v.Ono(URIError);const M=ono;function ono(...i){let u=i[0];if(typeof u==="object"&&typeof u.name==="string"){for(let m of Object.values(M)){if(typeof m==="function"&&m.name==="ono"){let v=m[Symbol.species];if(v&&v!==Error&&(u instanceof v||u.name===v.name)){return m.apply(undefined,i)}}}}return ono.error.apply(undefined,i)}},5254:(i,u)=>{"use strict";Object.defineProperty(u,"__esModule",{value:true});u.lazyJoinStacks=u.joinStacks=u.isWritableStack=u.isLazyStack=void 0;const m=/\r?\n/;const v=/\bono[ @]/;function isLazyStack(i){return Boolean(i&&i.configurable&&typeof i.get==="function")}u.isLazyStack=isLazyStack;function isWritableStack(i){return Boolean(!i||i.writable||typeof i.set==="function")}u.isWritableStack=isWritableStack;function joinStacks(i,u){let m=popStack(i.stack);let v=u?u.stack:undefined;if(m&&v){return m+"\n\n"+v}else{return m||v}}u.joinStacks=joinStacks;function lazyJoinStacks(i,u,m){if(m){Object.defineProperty(u,"stack",{get:()=>{let v=i.get.apply(u);return joinStacks({stack:v},m)},enumerable:false,configurable:true})}else{lazyPopStack(u,i)}}u.lazyJoinStacks=lazyJoinStacks;function popStack(i){if(i){let u=i.split(m);let _;for(let i=0;i0){return u.join("\n")}}return i}function lazyPopStack(i,u){Object.defineProperty(i,"stack",{get:()=>popStack(u.get.apply(i)),enumerable:false,configurable:true})}},4833:(i,u)=>{"use strict";Object.defineProperty(u,"__esModule",{value:true});u.getDeepKeys=u.toJSON=void 0;const m=["function","symbol","undefined"];const v=["constructor","prototype","__proto__"];const _=Object.getPrototypeOf({});function toJSON(){let i={};let u=this;for(let v of getDeepKeys(u)){if(typeof v==="string"){let _=u[v];let M=typeof _;if(!m.includes(M)){i[v]=_}}}return i}u.toJSON=toJSON;function getDeepKeys(i,u=[]){let m=[];while(i&&i!==_){m=m.concat(Object.getOwnPropertyNames(i),Object.getOwnPropertySymbols(i));i=Object.getPrototypeOf(i)}let M=new Set(m);for(let i of u.concat(v)){M.delete(i)}return M}u.getDeepKeys=getDeepKeys},7905:(i,u,m)=>{"use strict";Object.defineProperty(u,"__esModule",{value:true});const v=m(3837)},3633:(i,u,m)=>{"use strict"; +/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ 53113: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const $Ref = __nccwpck_require__(59825); +const Pointer = __nccwpck_require__(26040); +const url = __nccwpck_require__(81279); + +module.exports = bundle; + +/** + * Bundles all external JSON references into the main JSON schema, thus resulting in a schema that + * only has *internal* references, not any *external* references. + * This method mutates the JSON schema object, adding new references and re-mapping existing ones. + * + * @param {$RefParser} parser + * @param {$RefParserOptions} options + */ +function bundle (parser, options) { + // console.log('Bundling $ref pointers in %s', parser.$refs._root$Ref.path); + + // Build an inventory of all $ref pointers in the JSON Schema + let inventory = []; + crawl(parser, "schema", parser.$refs._root$Ref.path + "#", "#", 0, inventory, parser.$refs, options); + + // Remap all $ref pointers + remap(inventory); +} + +/** + * Recursively crawls the given value, and inventories all JSON references. + * + * @param {object} parent - The object containing the value to crawl. If the value is not an object or array, it will be ignored. + * @param {string} key - The property key of `parent` to be crawled + * @param {string} path - The full path of the property being crawled, possibly with a JSON Pointer in the hash + * @param {string} pathFromRoot - The path of the property being crawled, from the schema root + * @param {object[]} inventory - An array of already-inventoried $ref pointers + * @param {$Refs} $refs + * @param {$RefParserOptions} options + */ +function crawl (parent, key, path, pathFromRoot, indirections, inventory, $refs, options) { + let obj = key === null ? parent : parent[key]; + + if (obj && typeof obj === "object" && !ArrayBuffer.isView(obj)) { + if ($Ref.isAllowed$Ref(obj)) { + inventory$Ref(parent, key, path, pathFromRoot, indirections, inventory, $refs, options); + } + else { + // Crawl the object in a specific order that's optimized for bundling. + // This is important because it determines how `pathFromRoot` gets built, + // which later determines which keys get dereferenced and which ones get remapped + let keys = Object.keys(obj) + .sort((a, b) => { + // Most people will expect references to be bundled into the the "definitions" property, + // so we always crawl that property first, if it exists. + if (a === "definitions") { + return -1; + } + else if (b === "definitions") { + return 1; + } + else { + // Otherwise, crawl the keys based on their length. + // This produces the shortest possible bundled references + return a.length - b.length; + } + }); + + // eslint-disable-next-line no-shadow + for (let key of keys) { + let keyPath = Pointer.join(path, key); + let keyPathFromRoot = Pointer.join(pathFromRoot, key); + let value = obj[key]; + + if ($Ref.isAllowed$Ref(value)) { + inventory$Ref(obj, key, path, keyPathFromRoot, indirections, inventory, $refs, options); + } + else { + crawl(obj, key, keyPath, keyPathFromRoot, indirections, inventory, $refs, options); + } + } + } + } +} + +/** + * Inventories the given JSON Reference (i.e. records detailed information about it so we can + * optimize all $refs in the schema), and then crawls the resolved value. + * + * @param {object} $refParent - The object that contains a JSON Reference as one of its keys + * @param {string} $refKey - The key in `$refParent` that is a JSON Reference + * @param {string} path - The full path of the JSON Reference at `$refKey`, possibly with a JSON Pointer in the hash + * @param {string} pathFromRoot - The path of the JSON Reference at `$refKey`, from the schema root + * @param {object[]} inventory - An array of already-inventoried $ref pointers + * @param {$Refs} $refs + * @param {$RefParserOptions} options + */ +function inventory$Ref ($refParent, $refKey, path, pathFromRoot, indirections, inventory, $refs, options) { + let $ref = $refKey === null ? $refParent : $refParent[$refKey]; + let $refPath = url.resolve(path, $ref.$ref); + let pointer = $refs._resolve($refPath, pathFromRoot, options); + if (pointer === null) { + return; + } + + let depth = Pointer.parse(pathFromRoot).length; + let file = url.stripHash(pointer.path); + let hash = url.getHash(pointer.path); + let external = file !== $refs._root$Ref.path; + let extended = $Ref.isExtended$Ref($ref); + indirections += pointer.indirections; + + let existingEntry = findInInventory(inventory, $refParent, $refKey); + if (existingEntry) { + // This $Ref has already been inventoried, so we don't need to process it again + if (depth < existingEntry.depth || indirections < existingEntry.indirections) { + removeFromInventory(inventory, existingEntry); + } + else { + return; + } + } + + inventory.push({ + $ref, // The JSON Reference (e.g. {$ref: string}) + parent: $refParent, // The object that contains this $ref pointer + key: $refKey, // The key in `parent` that is the $ref pointer + pathFromRoot, // The path to the $ref pointer, from the JSON Schema root + depth, // How far from the JSON Schema root is this $ref pointer? + file, // The file that the $ref pointer resolves to + hash, // The hash within `file` that the $ref pointer resolves to + value: pointer.value, // The resolved value of the $ref pointer + circular: pointer.circular, // Is this $ref pointer DIRECTLY circular? (i.e. it references itself) + extended, // Does this $ref extend its resolved value? (i.e. it has extra properties, in addition to "$ref") + external, // Does this $ref pointer point to a file other than the main JSON Schema file? + indirections, // The number of indirect references that were traversed to resolve the value + }); + + // Recursively crawl the resolved value + if (!existingEntry) { + crawl(pointer.value, null, pointer.path, pathFromRoot, indirections + 1, inventory, $refs, options); + } +} + +/** + * Re-maps every $ref pointer, so that they're all relative to the root of the JSON Schema. + * Each referenced value is dereferenced EXACTLY ONCE. All subsequent references to the same + * value are re-mapped to point to the first reference. + * + * @example: + * { + * first: { $ref: somefile.json#/some/part }, + * second: { $ref: somefile.json#/another/part }, + * third: { $ref: somefile.json }, + * fourth: { $ref: somefile.json#/some/part/sub/part } + * } + * + * In this example, there are four references to the same file, but since the third reference points + * to the ENTIRE file, that's the only one we need to dereference. The other three can just be + * remapped to point inside the third one. + * + * On the other hand, if the third reference DIDN'T exist, then the first and second would both need + * to be dereferenced, since they point to different parts of the file. The fourth reference does NOT + * need to be dereferenced, because it can be remapped to point inside the first one. + * + * @param {object[]} inventory + */ +function remap (inventory) { + // Group & sort all the $ref pointers, so they're in the order that we need to dereference/remap them + inventory.sort((a, b) => { + if (a.file !== b.file) { + // Group all the $refs that point to the same file + return a.file < b.file ? -1 : +1; + } + else if (a.hash !== b.hash) { + // Group all the $refs that point to the same part of the file + return a.hash < b.hash ? -1 : +1; + } + else if (a.circular !== b.circular) { + // If the $ref points to itself, then sort it higher than other $refs that point to this $ref + return a.circular ? -1 : +1; + } + else if (a.extended !== b.extended) { + // If the $ref extends the resolved value, then sort it lower than other $refs that don't extend the value + return a.extended ? +1 : -1; + } + else if (a.indirections !== b.indirections) { + // Sort direct references higher than indirect references + return a.indirections - b.indirections; + } + else if (a.depth !== b.depth) { + // Sort $refs by how close they are to the JSON Schema root + return a.depth - b.depth; + } + else { + // Determine how far each $ref is from the "definitions" property. + // Most people will expect references to be bundled into the the "definitions" property if possible. + let aDefinitionsIndex = a.pathFromRoot.lastIndexOf("/definitions"); + let bDefinitionsIndex = b.pathFromRoot.lastIndexOf("/definitions"); + + if (aDefinitionsIndex !== bDefinitionsIndex) { + // Give higher priority to the $ref that's closer to the "definitions" property + return bDefinitionsIndex - aDefinitionsIndex; + } + else { + // All else is equal, so use the shorter path, which will produce the shortest possible reference + return a.pathFromRoot.length - b.pathFromRoot.length; + } + } + }); + + let file, hash, pathFromRoot; + for (let entry of inventory) { + // console.log('Re-mapping $ref pointer "%s" at %s', entry.$ref.$ref, entry.pathFromRoot); + + if (!entry.external) { + // This $ref already resolves to the main JSON Schema file + entry.$ref.$ref = entry.hash; + } + else if (entry.file === file && entry.hash === hash) { + // This $ref points to the same value as the prevous $ref, so remap it to the same path + entry.$ref.$ref = pathFromRoot; + } + else if (entry.file === file && entry.hash.indexOf(hash + "/") === 0) { + // This $ref points to a sub-value of the prevous $ref, so remap it beneath that path + entry.$ref.$ref = Pointer.join(pathFromRoot, Pointer.parse(entry.hash.replace(hash, "#"))); + } + else { + // We've moved to a new file or new hash + file = entry.file; + hash = entry.hash; + pathFromRoot = entry.pathFromRoot; + + // This is the first $ref to point to this value, so dereference the value. + // Any other $refs that point to the same value will point to this $ref instead + entry.$ref = entry.parent[entry.key] = $Ref.dereference(entry.$ref, entry.value); + + if (entry.circular) { + // This $ref points to itself + entry.$ref.$ref = entry.pathFromRoot; + } + } + + // console.log(' new value: %s', (entry.$ref && entry.$ref.$ref) ? entry.$ref.$ref : '[object Object]'); + } +} + +/** + * TODO + */ +function findInInventory (inventory, $refParent, $refKey) { + for (let i = 0; i < inventory.length; i++) { + let existingEntry = inventory[i]; + if (existingEntry.parent === $refParent && existingEntry.key === $refKey) { + return existingEntry; + } + } +} + +function removeFromInventory (inventory, entry) { + let index = inventory.indexOf(entry); + inventory.splice(index, 1); +} + + +/***/ }), + +/***/ 82461: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const $Ref = __nccwpck_require__(59825); +const Pointer = __nccwpck_require__(26040); +const { ono } = __nccwpck_require__(33436); +const url = __nccwpck_require__(81279); + +module.exports = dereference; + +/** + * Crawls the JSON schema, finds all JSON references, and dereferences them. + * This method mutates the JSON schema object, replacing JSON references with their resolved value. + * + * @param {$RefParser} parser + * @param {$RefParserOptions} options + */ +function dereference (parser, options) { + // console.log('Dereferencing $ref pointers in %s', parser.$refs._root$Ref.path); + let dereferenced = crawl(parser.schema, parser.$refs._root$Ref.path, "#", new Set(), new Set(), new Map(), parser.$refs, options); + parser.$refs.circular = dereferenced.circular; + parser.schema = dereferenced.value; +} + +/** + * Recursively crawls the given value, and dereferences any JSON references. + * + * @param {*} obj - The value to crawl. If it's not an object or array, it will be ignored. + * @param {string} path - The full path of `obj`, possibly with a JSON Pointer in the hash + * @param {string} pathFromRoot - The path of `obj` from the schema root + * @param {Set} parents - An array of the parent objects that have already been dereferenced + * @param {Set} processedObjects - An array of all the objects that have already been processed + * @param {Map} dereferencedCache - An map of all the dereferenced objects + * @param {$Refs} $refs + * @param {$RefParserOptions} options + * @returns {{value: object, circular: boolean}} + */ +function crawl (obj, path, pathFromRoot, parents, processedObjects, dereferencedCache, $refs, options) { + let dereferenced; + let result = { + value: obj, + circular: false + }; + + let isExcludedPath = options.dereference.excludedPathMatcher; + + if (options.dereference.circular === "ignore" || !processedObjects.has(obj)) { + if (obj && typeof obj === "object" && !ArrayBuffer.isView(obj) && !isExcludedPath(pathFromRoot)) { + parents.add(obj); + processedObjects.add(obj); + + if ($Ref.isAllowed$Ref(obj, options)) { + dereferenced = dereference$Ref(obj, path, pathFromRoot, parents, processedObjects, dereferencedCache, $refs, options); + result.circular = dereferenced.circular; + result.value = dereferenced.value; + } + else { + for (const key of Object.keys(obj)) { + let keyPath = Pointer.join(path, key); + let keyPathFromRoot = Pointer.join(pathFromRoot, key); + + if (isExcludedPath(keyPathFromRoot)) { + continue; + } + + let value = obj[key]; + let circular = false; + + if ($Ref.isAllowed$Ref(value, options)) { + dereferenced = dereference$Ref(value, keyPath, keyPathFromRoot, parents, processedObjects, dereferencedCache, $refs, options); + circular = dereferenced.circular; + // Avoid pointless mutations; breaks frozen objects to no profit + if (obj[key] !== dereferenced.value) { + obj[key] = dereferenced.value; + } + } + else { + if (!parents.has(value)) { + dereferenced = crawl(value, keyPath, keyPathFromRoot, parents, processedObjects, dereferencedCache, $refs, options); + circular = dereferenced.circular; + // Avoid pointless mutations; breaks frozen objects to no profit + if (obj[key] !== dereferenced.value) { + obj[key] = dereferenced.value; + } + } + else { + circular = foundCircularReference(keyPath, $refs, options); + } + } + + // Set the "isCircular" flag if this or any other property is circular + result.circular = result.circular || circular; + } + } + + parents.delete(obj); + } + } + + return result; +} + +/** + * Dereferences the given JSON Reference, and then crawls the resulting value. + * + * @param {{$ref: string}} $ref - The JSON Reference to resolve + * @param {string} path - The full path of `$ref`, possibly with a JSON Pointer in the hash + * @param {string} pathFromRoot - The path of `$ref` from the schema root + * @param {Set} parents - An array of the parent objects that have already been dereferenced + * @param {Set} processedObjects - An array of all the objects that have already been dereferenced + * @param {Map} dereferencedCache - An map of all the dereferenced objects + * @param {$Refs} $refs + * @param {$RefParserOptions} options + * @returns {{value: object, circular: boolean}} + */ +function dereference$Ref ($ref, path, pathFromRoot, parents, processedObjects, dereferencedCache, $refs, options) { + // console.log('Dereferencing $ref pointer "%s" at %s', $ref.$ref, path); + + let $refPath = url.resolve(path, $ref.$ref); + + const cache = dereferencedCache.get($refPath); + if (cache) { + const refKeys = Object.keys($ref); + if (refKeys.length > 1) { + const extraKeys = {}; + for (let key of refKeys) { + if (key !== "$ref" && !(key in cache.value)) { + extraKeys[key] = $ref[key]; + } + } + return { + circular: cache.circular, + value: Object.assign({}, cache.value, extraKeys), + }; + } + + return cache; + } + + + let pointer = $refs._resolve($refPath, path, options); + + if (pointer === null) { + return { + circular: false, + value: null, + }; + } + + // Check for circular references + let directCircular = pointer.circular; + let circular = directCircular || parents.has(pointer.value); + circular && foundCircularReference(path, $refs, options); + + // Dereference the JSON reference + let dereferencedValue = $Ref.dereference($ref, pointer.value); + + // Crawl the dereferenced value (unless it's circular) + if (!circular) { + // Determine if the dereferenced value is circular + let dereferenced = crawl(dereferencedValue, pointer.path, pathFromRoot, parents, processedObjects, dereferencedCache, $refs, options); + circular = dereferenced.circular; + dereferencedValue = dereferenced.value; + } + + if (circular && !directCircular && options.dereference.circular === "ignore") { + // The user has chosen to "ignore" circular references, so don't change the value + dereferencedValue = $ref; + } + + if (directCircular) { + // The pointer is a DIRECT circular reference (i.e. it references itself). + // So replace the $ref path with the absolute path from the JSON Schema root + dereferencedValue.$ref = pathFromRoot; + } + + + const dereferencedObject = { + circular, + value: dereferencedValue + }; + + // only cache if no extra properties than $ref + if (Object.keys($ref).length === 1) { + dereferencedCache.set($refPath, dereferencedObject); + } + + return dereferencedObject; +} + +/** + * Called when a circular reference is found. + * It sets the {@link $Refs#circular} flag, and throws an error if options.dereference.circular is false. + * + * @param {string} keyPath - The JSON Reference path of the circular reference + * @param {$Refs} $refs + * @param {$RefParserOptions} options + * @returns {boolean} - always returns true, to indicate that a circular reference was found + */ +function foundCircularReference (keyPath, $refs, options) { + $refs.circular = true; + if (!options.dereference.circular) { + throw ono.reference(`Circular $ref pointer found at ${keyPath}`); + } + return true; +} + + +/***/ }), + +/***/ 85862: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +/* eslint-disable no-unused-vars */ + + +const $Refs = __nccwpck_require__(40957); +const _parse = __nccwpck_require__(52430); +const normalizeArgs = __nccwpck_require__(64608); +const resolveExternal = __nccwpck_require__(45330); +const _bundle = __nccwpck_require__(53113); +const _dereference = __nccwpck_require__(82461); +const url = __nccwpck_require__(81279); +const { JSONParserError, InvalidPointerError, MissingPointerError, ResolverError, ParserError, UnmatchedParserError, UnmatchedResolverError, isHandledError, JSONParserErrorGroup } = __nccwpck_require__(1695); +const maybe = __nccwpck_require__(63844); +const { ono } = __nccwpck_require__(33436); + +module.exports = $RefParser; +module.exports["default"] = $RefParser; +module.exports.JSONParserError = JSONParserError; +module.exports.InvalidPointerError = InvalidPointerError; +module.exports.MissingPointerError = MissingPointerError; +module.exports.ResolverError = ResolverError; +module.exports.ParserError = ParserError; +module.exports.UnmatchedParserError = UnmatchedParserError; +module.exports.UnmatchedResolverError = UnmatchedResolverError; + +/** + * This class parses a JSON schema, builds a map of its JSON references and their resolved values, + * and provides methods for traversing, manipulating, and dereferencing those references. + * + * @constructor + */ +function $RefParser () { + /** + * The parsed (and possibly dereferenced) JSON schema object + * + * @type {object} + * @readonly + */ + this.schema = null; + + /** + * The resolved JSON references + * + * @type {$Refs} + * @readonly + */ + this.$refs = new $Refs(); +} + +/** + * Parses the given JSON schema. + * This method does not resolve any JSON references. + * It just reads a single file in JSON or YAML format, and parse it as a JavaScript object. + * + * @param {string} [path] - The file path or URL of the JSON schema + * @param {object} [schema] - A JSON schema object. This object will be used instead of reading from `path`. + * @param {$RefParserOptions} [options] - Options that determine how the schema is parsed + * @param {function} [callback] - An error-first callback. The second parameter is the parsed JSON schema object. + * @returns {Promise} - The returned promise resolves with the parsed JSON schema object. + */ +$RefParser.parse = function parse (path, schema, options, callback) { + let Class = this; // eslint-disable-line consistent-this + let instance = new Class(); + return instance.parse.apply(instance, arguments); +}; + +/** + * Parses the given JSON schema. + * This method does not resolve any JSON references. + * It just reads a single file in JSON or YAML format, and parse it as a JavaScript object. + * + * @param {string} [path] - The file path or URL of the JSON schema + * @param {object} [schema] - A JSON schema object. This object will be used instead of reading from `path`. + * @param {$RefParserOptions} [options] - Options that determine how the schema is parsed + * @param {function} [callback] - An error-first callback. The second parameter is the parsed JSON schema object. + * @returns {Promise} - The returned promise resolves with the parsed JSON schema object. + */ +$RefParser.prototype.parse = async function parse (path, schema, options, callback) { + let args = normalizeArgs(arguments); + let promise; + + if (!args.path && !args.schema) { + let err = ono(`Expected a file path, URL, or object. Got ${args.path || args.schema}`); + return maybe(args.callback, Promise.reject(err)); + } + + // Reset everything + this.schema = null; + this.$refs = new $Refs(); + + // If the path is a filesystem path, then convert it to a URL. + // NOTE: According to the JSON Reference spec, these should already be URLs, + // but, in practice, many people use local filesystem paths instead. + // So we're being generous here and doing the conversion automatically. + // This is not intended to be a 100% bulletproof solution. + // If it doesn't work for your use-case, then use a URL instead. + let pathType = "http"; + if (url.isFileSystemPath(args.path)) { + args.path = url.fromFileSystemPath(args.path); + pathType = "file"; + } + + // Resolve the absolute path of the schema + args.path = url.resolve(url.cwd(), args.path); + + if (args.schema && typeof args.schema === "object") { + // A schema object was passed-in. + // So immediately add a new $Ref with the schema object as its value + let $ref = this.$refs._add(args.path); + $ref.value = args.schema; + $ref.pathType = pathType; + promise = Promise.resolve(args.schema); + } + else { + // Parse the schema file/url + promise = _parse(args.path, this.$refs, args.options); + } + + let me = this; + try { + let result = await promise; + + if (result !== null && typeof result === "object" && !Buffer.isBuffer(result)) { + me.schema = result; + return maybe(args.callback, Promise.resolve(me.schema)); + } + else if (args.options.continueOnError) { + me.schema = null; // it's already set to null at line 79, but let's set it again for the sake of readability + return maybe(args.callback, Promise.resolve(me.schema)); + } + else { + throw ono.syntax(`"${me.$refs._root$Ref.path || result}" is not a valid JSON Schema`); + } + } + catch (err) { + if (!args.options.continueOnError || !isHandledError(err)) { + return maybe(args.callback, Promise.reject(err)); + } + + if (this.$refs._$refs[url.stripHash(args.path)]) { + this.$refs._$refs[url.stripHash(args.path)].addError(err); + } + + return maybe(args.callback, Promise.resolve(null)); + } +}; + +/** + * Parses the given JSON schema and resolves any JSON references, including references in + * externally-referenced files. + * + * @param {string} [path] - The file path or URL of the JSON schema + * @param {object} [schema] - A JSON schema object. This object will be used instead of reading from `path`. + * @param {$RefParserOptions} [options] - Options that determine how the schema is parsed and resolved + * @param {function} [callback] + * - An error-first callback. The second parameter is a {@link $Refs} object containing the resolved JSON references + * + * @returns {Promise} + * The returned promise resolves with a {@link $Refs} object containing the resolved JSON references + */ +$RefParser.resolve = function resolve (path, schema, options, callback) { + let Class = this; // eslint-disable-line consistent-this + let instance = new Class(); + return instance.resolve.apply(instance, arguments); +}; + +/** + * Parses the given JSON schema and resolves any JSON references, including references in + * externally-referenced files. + * + * @param {string} [path] - The file path or URL of the JSON schema + * @param {object} [schema] - A JSON schema object. This object will be used instead of reading from `path`. + * @param {$RefParserOptions} [options] - Options that determine how the schema is parsed and resolved + * @param {function} [callback] + * - An error-first callback. The second parameter is a {@link $Refs} object containing the resolved JSON references + * + * @returns {Promise} + * The returned promise resolves with a {@link $Refs} object containing the resolved JSON references + */ +$RefParser.prototype.resolve = async function resolve (path, schema, options, callback) { + let me = this; + let args = normalizeArgs(arguments); + + try { + await this.parse(args.path, args.schema, args.options); + await resolveExternal(me, args.options); + finalize(me); + return maybe(args.callback, Promise.resolve(me.$refs)); + } + catch (err) { + return maybe(args.callback, Promise.reject(err)); + } +}; + +/** + * Parses the given JSON schema, resolves any JSON references, and bundles all external references + * into the main JSON schema. This produces a JSON schema that only has *internal* references, + * not any *external* references. + * + * @param {string} [path] - The file path or URL of the JSON schema + * @param {object} [schema] - A JSON schema object. This object will be used instead of reading from `path`. + * @param {$RefParserOptions} [options] - Options that determine how the schema is parsed, resolved, and dereferenced + * @param {function} [callback] - An error-first callback. The second parameter is the bundled JSON schema object + * @returns {Promise} - The returned promise resolves with the bundled JSON schema object. + */ +$RefParser.bundle = function bundle (path, schema, options, callback) { + let Class = this; // eslint-disable-line consistent-this + let instance = new Class(); + return instance.bundle.apply(instance, arguments); +}; + +/** + * Parses the given JSON schema, resolves any JSON references, and bundles all external references + * into the main JSON schema. This produces a JSON schema that only has *internal* references, + * not any *external* references. + * + * @param {string} [path] - The file path or URL of the JSON schema + * @param {object} [schema] - A JSON schema object. This object will be used instead of reading from `path`. + * @param {$RefParserOptions} [options] - Options that determine how the schema is parsed, resolved, and dereferenced + * @param {function} [callback] - An error-first callback. The second parameter is the bundled JSON schema object + * @returns {Promise} - The returned promise resolves with the bundled JSON schema object. + */ +$RefParser.prototype.bundle = async function bundle (path, schema, options, callback) { + let me = this; + let args = normalizeArgs(arguments); + + try { + await this.resolve(args.path, args.schema, args.options); + _bundle(me, args.options); + finalize(me); + return maybe(args.callback, Promise.resolve(me.schema)); + } + catch (err) { + return maybe(args.callback, Promise.reject(err)); + } +}; + +/** + * Parses the given JSON schema, resolves any JSON references, and dereferences the JSON schema. + * That is, all JSON references are replaced with their resolved values. + * + * @param {string} [path] - The file path or URL of the JSON schema + * @param {object} [schema] - A JSON schema object. This object will be used instead of reading from `path`. + * @param {$RefParserOptions} [options] - Options that determine how the schema is parsed, resolved, and dereferenced + * @param {function} [callback] - An error-first callback. The second parameter is the dereferenced JSON schema object + * @returns {Promise} - The returned promise resolves with the dereferenced JSON schema object. + */ +$RefParser.dereference = function dereference (path, schema, options, callback) { + let Class = this; // eslint-disable-line consistent-this + let instance = new Class(); + return instance.dereference.apply(instance, arguments); +}; + +/** + * Parses the given JSON schema, resolves any JSON references, and dereferences the JSON schema. + * That is, all JSON references are replaced with their resolved values. + * + * @param {string} [path] - The file path or URL of the JSON schema + * @param {object} [schema] - A JSON schema object. This object will be used instead of reading from `path`. + * @param {$RefParserOptions} [options] - Options that determine how the schema is parsed, resolved, and dereferenced + * @param {function} [callback] - An error-first callback. The second parameter is the dereferenced JSON schema object + * @returns {Promise} - The returned promise resolves with the dereferenced JSON schema object. + */ +$RefParser.prototype.dereference = async function dereference (path, schema, options, callback) { + let me = this; + let args = normalizeArgs(arguments); + + try { + await this.resolve(args.path, args.schema, args.options); + _dereference(me, args.options); + finalize(me); + return maybe(args.callback, Promise.resolve(me.schema)); + } + catch (err) { + return maybe(args.callback, Promise.reject(err)); + } +}; + +function finalize (parser) { + const errors = JSONParserErrorGroup.getParserErrors(parser); + if (errors.length > 0) { + throw new JSONParserErrorGroup(parser); + } +} + + +/***/ }), + +/***/ 64608: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const Options = __nccwpck_require__(36608); + +module.exports = normalizeArgs; + +/** + * Normalizes the given arguments, accounting for optional args. + * + * @param {Arguments} args + * @returns {object} + */ +function normalizeArgs (args) { + let path, schema, options, callback; + args = Array.prototype.slice.call(args); + + if (typeof args[args.length - 1] === "function") { + // The last parameter is a callback function + callback = args.pop(); + } + + if (typeof args[0] === "string") { + // The first parameter is the path + path = args[0]; + if (typeof args[2] === "object") { + // The second parameter is the schema, and the third parameter is the options + schema = args[1]; + options = args[2]; + } + else { + // The second parameter is the options + schema = undefined; + options = args[1]; + } + } + else { + // The first parameter is the schema + path = ""; + schema = args[0]; + options = args[1]; + } + + if (!(options instanceof Options)) { + options = new Options(options); + } + + return { + path, + schema, + options, + callback + }; +} + + +/***/ }), + +/***/ 36608: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +/* eslint lines-around-comment: [2, {beforeBlockComment: false}] */ + + +const jsonParser = __nccwpck_require__(74683); +const yamlParser = __nccwpck_require__(40525); +const textParser = __nccwpck_require__(80164); +const binaryParser = __nccwpck_require__(67922); +const fileResolver = __nccwpck_require__(36859); +const httpResolver = __nccwpck_require__(34147); + +module.exports = $RefParserOptions; + +/** + * Options that determine how JSON schemas are parsed, resolved, and dereferenced. + * + * @param {object|$RefParserOptions} [options] - Overridden options + * @constructor + */ +function $RefParserOptions (options) { + merge(this, $RefParserOptions.defaults); + merge(this, options); +} + +$RefParserOptions.defaults = { + /** + * Determines how different types of files will be parsed. + * + * You can add additional parsers of your own, replace an existing one with + * your own implementation, or disable any parser by setting it to false. + */ + parse: { + json: jsonParser, + yaml: yamlParser, + text: textParser, + binary: binaryParser, + }, + + /** + * Determines how JSON References will be resolved. + * + * You can add additional resolvers of your own, replace an existing one with + * your own implementation, or disable any resolver by setting it to false. + */ + resolve: { + file: fileResolver, + http: httpResolver, + + /** + * Determines whether external $ref pointers will be resolved. + * If this option is disabled, then none of above resolvers will be called. + * Instead, external $ref pointers will simply be ignored. + * + * @type {boolean} + */ + external: true, + }, + + /** + * By default, JSON Schema $Ref Parser throws the first error it encounters. Setting `continueOnError` to `true` + * causes it to keep processing as much as possible and then throw a single error that contains all errors + * that were encountered. + */ + continueOnError: false, + + /** + * Determines the types of JSON references that are allowed. + */ + dereference: { + /** + * Dereference circular (recursive) JSON references? + * If false, then a {@link ReferenceError} will be thrown if a circular reference is found. + * If "ignore", then circular references will not be dereferenced. + * + * @type {boolean|string} + */ + circular: true, + + /** + * A function, called for each path, which can return true to stop this path and all + * subpaths from being dereferenced further. This is useful in schemas where some + * subpaths contain literal $ref keys that should not be dereferenced. + * + * @type {function} + */ + excludedPathMatcher: () => false + }, +}; + +/** + * Merges the properties of the source object into the target object. + * + * @param {object} target - The object that we're populating + * @param {?object} source - The options that are being merged + * @returns {object} + */ +function merge (target, source) { + if (isMergeable(source)) { + let keys = Object.keys(source); + for (let i = 0; i < keys.length; i++) { + let key = keys[i]; + let sourceSetting = source[key]; + let targetSetting = target[key]; + + if (isMergeable(sourceSetting)) { + // It's a nested object, so merge it recursively + target[key] = merge(targetSetting || {}, sourceSetting); + } + else if (sourceSetting !== undefined) { + // It's a scalar value, function, or array. No merging necessary. Just overwrite the target value. + target[key] = sourceSetting; + } + } + } + return target; +} + +/** + * Determines whether the given value can be merged, + * or if it is a scalar value that should just override the target value. + * + * @param {*} val + * @returns {Boolean} + */ +function isMergeable (val) { + return val && + (typeof val === "object") && + !Array.isArray(val) && + !(val instanceof RegExp) && + !(val instanceof Date); +} + + +/***/ }), + +/***/ 52430: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { ono } = __nccwpck_require__(33436); +const url = __nccwpck_require__(81279); +const plugins = __nccwpck_require__(14601); +const { ResolverError, ParserError, UnmatchedParserError, UnmatchedResolverError, isHandledError } = __nccwpck_require__(1695); + +module.exports = parse; + +/** + * Reads and parses the specified file path or URL. + * + * @param {string} path - This path MUST already be resolved, since `read` doesn't know the resolution context + * @param {$Refs} $refs + * @param {$RefParserOptions} options + * + * @returns {Promise} + * The promise resolves with the parsed file contents, NOT the raw (Buffer) contents. + */ +async function parse (path, $refs, options) { + // Remove the URL fragment, if any + path = url.stripHash(path); + + // Add a new $Ref for this file, even though we don't have the value yet. + // This ensures that we don't simultaneously read & parse the same file multiple times + let $ref = $refs._add(path); + + // This "file object" will be passed to all resolvers and parsers. + let file = { + url: path, + extension: url.getExtension(path), + }; + + // Read the file and then parse the data + try { + const resolver = await readFile(file, options, $refs); + $ref.pathType = resolver.plugin.name; + file.data = resolver.result; + + const parser = await parseFile(file, options, $refs); + $ref.value = parser.result; + + return parser.result; + } + catch (err) { + if (isHandledError(err)) { + $ref.value = err; + } + + throw err; + } +} + +/** + * Reads the given file, using the configured resolver plugins + * + * @param {object} file - An object containing information about the referenced file + * @param {string} file.url - The full URL of the referenced file + * @param {string} file.extension - The lowercased file extension (e.g. ".txt", ".html", etc.) + * @param {$RefParserOptions} options + * + * @returns {Promise} + * The promise resolves with the raw file contents and the resolver that was used. + */ +function readFile (file, options, $refs) { + return new Promise(((resolve, reject) => { + // console.log('Reading %s', file.url); + + // Find the resolvers that can read this file + let resolvers = plugins.all(options.resolve); + resolvers = plugins.filter(resolvers, "canRead", file); + + // Run the resolvers, in order, until one of them succeeds + plugins.sort(resolvers); + plugins.run(resolvers, "read", file, $refs) + .then(resolve, onError); + + function onError (err) { + if (!err && options.continueOnError) { + // No resolver could be matched + reject(new UnmatchedResolverError(file.url)); + } + else if (!err || !("error" in err)) { + // Throw a generic, friendly error. + reject(ono.syntax(`Unable to resolve $ref pointer "${file.url}"`)); + } + // Throw the original error, if it's one of our own (user-friendly) errors. + else if (err.error instanceof ResolverError) { + reject(err.error); + } + else { + reject(new ResolverError(err, file.url)); + } + } + })); +} + +/** + * Parses the given file's contents, using the configured parser plugins. + * + * @param {object} file - An object containing information about the referenced file + * @param {string} file.url - The full URL of the referenced file + * @param {string} file.extension - The lowercased file extension (e.g. ".txt", ".html", etc.) + * @param {*} file.data - The file contents. This will be whatever data type was returned by the resolver + * @param {$RefParserOptions} options + * + * @returns {Promise} + * The promise resolves with the parsed file contents and the parser that was used. + */ +function parseFile (file, options, $refs) { + return new Promise(((resolve, reject) => { + // console.log('Parsing %s', file.url); + + // Find the parsers that can read this file type. + // If none of the parsers are an exact match for this file, then we'll try ALL of them. + // This handles situations where the file IS a supported type, just with an unknown extension. + let allParsers = plugins.all(options.parse); + let filteredParsers = plugins.filter(allParsers, "canParse", file); + let parsers = filteredParsers.length > 0 ? filteredParsers : allParsers; + + // Run the parsers, in order, until one of them succeeds + plugins.sort(parsers); + plugins.run(parsers, "parse", file, $refs) + .then(onParsed, onError); + + function onParsed (parser) { + if (!parser.plugin.allowEmpty && isEmpty(parser.result)) { + reject(ono.syntax(`Error parsing "${file.url}" as ${parser.plugin.name}. \nParsed value is empty`)); + } + else { + resolve(parser); + } + } + + function onError (err) { + if (!err && options.continueOnError) { + // No resolver could be matched + reject(new UnmatchedParserError(file.url)); + } + else if (!err || !("error" in err)) { + reject(ono.syntax(`Unable to parse ${file.url}`)); + } + else if (err.error instanceof ParserError) { + reject(err.error); + } + else { + reject(new ParserError(err.error.message, file.url)); + } + } + })); +} + +/** + * Determines whether the parsed value is "empty". + * + * @param {*} value + * @returns {boolean} + */ +function isEmpty (value) { + return value === undefined || + (typeof value === "object" && Object.keys(value).length === 0) || + (typeof value === "string" && value.trim().length === 0) || + (Buffer.isBuffer(value) && value.length === 0); +} + + +/***/ }), + +/***/ 67922: +/***/ ((module) => { + +"use strict"; + + +let BINARY_REGEXP = /\.(jpeg|jpg|gif|png|bmp|ico)$/i; + +module.exports = { + /** + * The order that this parser will run, in relation to other parsers. + * + * @type {number} + */ + order: 400, + + /** + * Whether to allow "empty" files (zero bytes). + * + * @type {boolean} + */ + allowEmpty: true, + + /** + * Determines whether this parser can parse a given file reference. + * Parsers that return true will be tried, in order, until one successfully parses the file. + * Parsers that return false will be skipped, UNLESS all parsers returned false, in which case + * every parser will be tried. + * + * @param {object} file - An object containing information about the referenced file + * @param {string} file.url - The full URL of the referenced file + * @param {string} file.extension - The lowercased file extension (e.g. ".txt", ".html", etc.) + * @param {*} file.data - The file contents. This will be whatever data type was returned by the resolver + * @returns {boolean} + */ + canParse (file) { + // Use this parser if the file is a Buffer, and has a known binary extension + return Buffer.isBuffer(file.data) && BINARY_REGEXP.test(file.url); + }, + + /** + * Parses the given data as a Buffer (byte array). + * + * @param {object} file - An object containing information about the referenced file + * @param {string} file.url - The full URL of the referenced file + * @param {string} file.extension - The lowercased file extension (e.g. ".txt", ".html", etc.) + * @param {*} file.data - The file contents. This will be whatever data type was returned by the resolver + * @returns {Buffer} + */ + parse (file) { + if (Buffer.isBuffer(file.data)) { + return file.data; + } + else { + // This will reject if data is anything other than a string or typed array + return Buffer.from(file.data); + } + } +}; + + +/***/ }), + +/***/ 74683: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { ParserError } = __nccwpck_require__(1695); + +module.exports = { + /** + * The order that this parser will run, in relation to other parsers. + * + * @type {number} + */ + order: 100, + + /** + * Whether to allow "empty" files. This includes zero-byte files, as well as empty JSON objects. + * + * @type {boolean} + */ + allowEmpty: true, + + /** + * Determines whether this parser can parse a given file reference. + * Parsers that match will be tried, in order, until one successfully parses the file. + * Parsers that don't match will be skipped, UNLESS none of the parsers match, in which case + * every parser will be tried. + * + * @type {RegExp|string|string[]|function} + */ + canParse: ".json", + + /** + * Parses the given file as JSON + * + * @param {object} file - An object containing information about the referenced file + * @param {string} file.url - The full URL of the referenced file + * @param {string} file.extension - The lowercased file extension (e.g. ".txt", ".html", etc.) + * @param {*} file.data - The file contents. This will be whatever data type was returned by the resolver + * @returns {Promise} + */ + async parse (file) { // eslint-disable-line require-await + let data = file.data; + if (Buffer.isBuffer(data)) { + data = data.toString(); + } + + if (typeof data === "string") { + if (data.trim().length === 0) { + return; // This mirrors the YAML behavior + } + else { + try { + return JSON.parse(data); + } + catch (e) { + throw new ParserError(e.message, file.url); + } + } + } + else { + // data is already a JavaScript value (object, array, number, null, NaN, etc.) + return data; + } + } +}; + + +/***/ }), + +/***/ 80164: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { ParserError } = __nccwpck_require__(1695); + +let TEXT_REGEXP = /\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i; + +module.exports = { + /** + * The order that this parser will run, in relation to other parsers. + * + * @type {number} + */ + order: 300, + + /** + * Whether to allow "empty" files (zero bytes). + * + * @type {boolean} + */ + allowEmpty: true, + + /** + * The encoding that the text is expected to be in. + * + * @type {string} + */ + encoding: "utf8", + + /** + * Determines whether this parser can parse a given file reference. + * Parsers that return true will be tried, in order, until one successfully parses the file. + * Parsers that return false will be skipped, UNLESS all parsers returned false, in which case + * every parser will be tried. + * + * @param {object} file - An object containing information about the referenced file + * @param {string} file.url - The full URL of the referenced file + * @param {string} file.extension - The lowercased file extension (e.g. ".txt", ".html", etc.) + * @param {*} file.data - The file contents. This will be whatever data type was returned by the resolver + * @returns {boolean} + */ + canParse (file) { + // Use this parser if the file is a string or Buffer, and has a known text-based extension + return (typeof file.data === "string" || Buffer.isBuffer(file.data)) && TEXT_REGEXP.test(file.url); + }, + + /** + * Parses the given file as text + * + * @param {object} file - An object containing information about the referenced file + * @param {string} file.url - The full URL of the referenced file + * @param {string} file.extension - The lowercased file extension (e.g. ".txt", ".html", etc.) + * @param {*} file.data - The file contents. This will be whatever data type was returned by the resolver + * @returns {string} + */ + parse (file) { + if (typeof file.data === "string") { + return file.data; + } + else if (Buffer.isBuffer(file.data)) { + return file.data.toString(this.encoding); + } + else { + throw new ParserError("data is not text", file.url); + } + } +}; + + +/***/ }), + +/***/ 40525: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { ParserError } = __nccwpck_require__(1695); +const yaml = __nccwpck_require__(55848); +const { JSON_SCHEMA } = __nccwpck_require__(55848); + +module.exports = { + /** + * The order that this parser will run, in relation to other parsers. + * + * @type {number} + */ + order: 200, + + /** + * Whether to allow "empty" files. This includes zero-byte files, as well as empty JSON objects. + * + * @type {boolean} + */ + allowEmpty: true, + + /** + * Determines whether this parser can parse a given file reference. + * Parsers that match will be tried, in order, until one successfully parses the file. + * Parsers that don't match will be skipped, UNLESS none of the parsers match, in which case + * every parser will be tried. + * + * @type {RegExp|string[]|function} + */ + canParse: [".yaml", ".yml", ".json"], // JSON is valid YAML + + /** + * Parses the given file as YAML + * + * @param {object} file - An object containing information about the referenced file + * @param {string} file.url - The full URL of the referenced file + * @param {string} file.extension - The lowercased file extension (e.g. ".txt", ".html", etc.) + * @param {*} file.data - The file contents. This will be whatever data type was returned by the resolver + * @returns {Promise} + */ + async parse (file) { // eslint-disable-line require-await + let data = file.data; + if (Buffer.isBuffer(data)) { + data = data.toString(); + } + + if (typeof data === "string") { + try { + return yaml.load(data, { schema: JSON_SCHEMA }); + } + catch (e) { + throw new ParserError(e.message, file.url); + } + } + else { + // data is already a JavaScript value (object, array, number, null, NaN, etc.) + return data; + } + } +}; + + +/***/ }), + +/***/ 26040: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +module.exports = Pointer; + +const $Ref = __nccwpck_require__(59825); +const url = __nccwpck_require__(81279); +const { JSONParserError, InvalidPointerError, MissingPointerError, isHandledError } = __nccwpck_require__(1695); +const slashes = /\//g; +const tildes = /~/g; +const escapedSlash = /~1/g; +const escapedTilde = /~0/g; + +/** + * This class represents a single JSON pointer and its resolved value. + * + * @param {$Ref} $ref + * @param {string} path + * @param {string} [friendlyPath] - The original user-specified path (used for error messages) + * @constructor + */ +function Pointer ($ref, path, friendlyPath) { + /** + * The {@link $Ref} object that contains this {@link Pointer} object. + * @type {$Ref} + */ + this.$ref = $ref; + + /** + * The file path or URL, containing the JSON pointer in the hash. + * This path is relative to the path of the main JSON schema file. + * @type {string} + */ + this.path = path; + + /** + * The original path or URL, used for error messages. + * @type {string} + */ + this.originalPath = friendlyPath || path; + + /** + * The value of the JSON pointer. + * Can be any JSON type, not just objects. Unknown file types are represented as Buffers (byte arrays). + * @type {?*} + */ + this.value = undefined; + + /** + * Indicates whether the pointer references itself. + * @type {boolean} + */ + this.circular = false; + + /** + * The number of indirect references that were traversed to resolve the value. + * Resolving a single pointer may require resolving multiple $Refs. + * @type {number} + */ + this.indirections = 0; +} + +/** + * Resolves the value of a nested property within the given object. + * + * @param {*} obj - The object that will be crawled + * @param {$RefParserOptions} options + * @param {string} pathFromRoot - the path of place that initiated resolving + * + * @returns {Pointer} + * Returns a JSON pointer whose {@link Pointer#value} is the resolved value. + * If resolving this value required resolving other JSON references, then + * the {@link Pointer#$ref} and {@link Pointer#path} will reflect the resolution path + * of the resolved value. + */ +Pointer.prototype.resolve = function (obj, options, pathFromRoot) { + let tokens = Pointer.parse(this.path, this.originalPath); + + // Crawl the object, one token at a time + this.value = unwrapOrThrow(obj); + + for (let i = 0; i < tokens.length; i++) { + if (resolveIf$Ref(this, options)) { + // The $ref path has changed, so append the remaining tokens to the path + this.path = Pointer.join(this.path, tokens.slice(i)); + } + + if (typeof this.value === "object" && this.value !== null && "$ref" in this.value) { + return this; + } + + let token = tokens[i]; + if (this.value[token] === undefined || this.value[token] === null) { + this.value = null; + throw new MissingPointerError(token, decodeURI(this.originalPath)); + } + else { + this.value = this.value[token]; + } + } + + // Resolve the final value + if (!this.value || this.value.$ref && url.resolve(this.path, this.value.$ref) !== pathFromRoot) { + resolveIf$Ref(this, options); + } + + return this; +}; + +/** + * Sets the value of a nested property within the given object. + * + * @param {*} obj - The object that will be crawled + * @param {*} value - the value to assign + * @param {$RefParserOptions} options + * + * @returns {*} + * Returns the modified object, or an entirely new object if the entire object is overwritten. + */ +Pointer.prototype.set = function (obj, value, options) { + let tokens = Pointer.parse(this.path); + let token; + + if (tokens.length === 0) { + // There are no tokens, replace the entire object with the new value + this.value = value; + return value; + } + + // Crawl the object, one token at a time + this.value = unwrapOrThrow(obj); + + for (let i = 0; i < tokens.length - 1; i++) { + resolveIf$Ref(this, options); + + token = tokens[i]; + if (this.value && this.value[token] !== undefined) { + // The token exists + this.value = this.value[token]; + } + else { + // The token doesn't exist, so create it + this.value = setValue(this, token, {}); + } + } + + // Set the value of the final token + resolveIf$Ref(this, options); + token = tokens[tokens.length - 1]; + setValue(this, token, value); + + // Return the updated object + return obj; +}; + +/** + * Parses a JSON pointer (or a path containing a JSON pointer in the hash) + * and returns an array of the pointer's tokens. + * (e.g. "schema.json#/definitions/person/name" => ["definitions", "person", "name"]) + * + * The pointer is parsed according to RFC 6901 + * {@link https://tools.ietf.org/html/rfc6901#section-3} + * + * @param {string} path + * @param {string} [originalPath] + * @returns {string[]} + */ +Pointer.parse = function (path, originalPath) { + // Get the JSON pointer from the path's hash + let pointer = url.getHash(path).substr(1); + + // If there's no pointer, then there are no tokens, + // so return an empty array + if (!pointer) { + return []; + } + + // Split into an array + pointer = pointer.split("/"); + + // Decode each part, according to RFC 6901 + for (let i = 0; i < pointer.length; i++) { + pointer[i] = decodeURIComponent(pointer[i].replace(escapedSlash, "/").replace(escapedTilde, "~")); + } + + if (pointer[0] !== "") { + throw new InvalidPointerError(pointer, originalPath === undefined ? path : originalPath); + } + + return pointer.slice(1); +}; + +/** + * Creates a JSON pointer path, by joining one or more tokens to a base path. + * + * @param {string} base - The base path (e.g. "schema.json#/definitions/person") + * @param {string|string[]} tokens - The token(s) to append (e.g. ["name", "first"]) + * @returns {string} + */ +Pointer.join = function (base, tokens) { + // Ensure that the base path contains a hash + if (base.indexOf("#") === -1) { + base += "#"; + } + + // Append each token to the base path + tokens = Array.isArray(tokens) ? tokens : [tokens]; + for (let i = 0; i < tokens.length; i++) { + let token = tokens[i]; + // Encode the token, according to RFC 6901 + base += "/" + encodeURIComponent(token.replace(tildes, "~0").replace(slashes, "~1")); + } + + return base; +}; + +/** + * If the given pointer's {@link Pointer#value} is a JSON reference, + * then the reference is resolved and {@link Pointer#value} is replaced with the resolved value. + * In addition, {@link Pointer#path} and {@link Pointer#$ref} are updated to reflect the + * resolution path of the new value. + * + * @param {Pointer} pointer + * @param {$RefParserOptions} options + * @returns {boolean} - Returns `true` if the resolution path changed + */ +function resolveIf$Ref (pointer, options) { + // Is the value a JSON reference? (and allowed?) + + if ($Ref.isAllowed$Ref(pointer.value, options)) { + let $refPath = url.resolve(pointer.path, pointer.value.$ref); + + if ($refPath === pointer.path) { + // The value is a reference to itself, so there's nothing to do. + pointer.circular = true; + } + else { + let resolved = pointer.$ref.$refs._resolve($refPath, pointer.path, options); + if (resolved === null) { + return false; + } + + pointer.indirections += resolved.indirections + 1; + + if ($Ref.isExtended$Ref(pointer.value)) { + // This JSON reference "extends" the resolved value, rather than simply pointing to it. + // So the resolved path does NOT change. Just the value does. + pointer.value = $Ref.dereference(pointer.value, resolved.value); + return false; + } + else { + // Resolve the reference + pointer.$ref = resolved.$ref; + pointer.path = resolved.path; + pointer.value = resolved.value; + } + + return true; + } + } +} + +/** + * Sets the specified token value of the {@link Pointer#value}. + * + * The token is evaluated according to RFC 6901. + * {@link https://tools.ietf.org/html/rfc6901#section-4} + * + * @param {Pointer} pointer - The JSON Pointer whose value will be modified + * @param {string} token - A JSON Pointer token that indicates how to modify `obj` + * @param {*} value - The value to assign + * @returns {*} - Returns the assigned value + */ +function setValue (pointer, token, value) { + if (pointer.value && typeof pointer.value === "object") { + if (token === "-" && Array.isArray(pointer.value)) { + pointer.value.push(value); + } + else { + pointer.value[token] = value; + } + } + else { + throw new JSONParserError(`Error assigning $ref pointer "${pointer.path}". \nCannot set "${token}" of a non-object.`); + } + return value; +} + + +function unwrapOrThrow (value) { + if (isHandledError(value)) { + throw value; + } + + return value; +} + + +/***/ }), + +/***/ 59825: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +module.exports = $Ref; + +const Pointer = __nccwpck_require__(26040); +const { InvalidPointerError, isHandledError, normalizeError } = __nccwpck_require__(1695); +const { safePointerToPath, stripHash, getHash } = __nccwpck_require__(81279); + +/** + * This class represents a single JSON reference and its resolved value. + * + * @class + */ +function $Ref () { + /** + * The file path or URL of the referenced file. + * This path is relative to the path of the main JSON schema file. + * + * This path does NOT contain document fragments (JSON pointers). It always references an ENTIRE file. + * Use methods such as {@link $Ref#get}, {@link $Ref#resolve}, and {@link $Ref#exists} to get + * specific JSON pointers within the file. + * + * @type {string} + */ + this.path = undefined; + + /** + * The resolved value of the JSON reference. + * Can be any JSON type, not just objects. Unknown file types are represented as Buffers (byte arrays). + * + * @type {?*} + */ + this.value = undefined; + + /** + * The {@link $Refs} object that contains this {@link $Ref} object. + * + * @type {$Refs} + */ + this.$refs = undefined; + + /** + * Indicates the type of {@link $Ref#path} (e.g. "file", "http", etc.) + * + * @type {?string} + */ + this.pathType = undefined; + + /** + * List of all errors. Undefined if no errors. + * + * @type {Array} + */ + this.errors = undefined; +} + +/** + * Pushes an error to errors array. + * + * @param {Array} err - The error to be pushed + * @returns {void} + */ +$Ref.prototype.addError = function (err) { + if (this.errors === undefined) { + this.errors = []; + } + + const existingErrors = this.errors.map(({ footprint }) => footprint); + + // the path has been almost certainly set at this point, + // but just in case something went wrong, normalizeError injects path if necessary + // moreover, certain errors might point at the same spot, so filter them out to reduce noise + if (Array.isArray(err.errors)) { + this.errors.push(...err.errors + .map(normalizeError) + .filter(({ footprint }) => !existingErrors.includes(footprint)), + ); + } + else if (!existingErrors.includes(err.footprint)) { + this.errors.push(normalizeError(err)); + } +}; + +/** + * Determines whether the given JSON reference exists within this {@link $Ref#value}. + * + * @param {string} path - The full path being resolved, optionally with a JSON pointer in the hash + * @param {$RefParserOptions} options + * @returns {boolean} + */ +$Ref.prototype.exists = function (path, options) { + try { + this.resolve(path, options); + return true; + } + catch (e) { + return false; + } +}; + +/** + * Resolves the given JSON reference within this {@link $Ref#value} and returns the resolved value. + * + * @param {string} path - The full path being resolved, optionally with a JSON pointer in the hash + * @param {$RefParserOptions} options + * @returns {*} - Returns the resolved value + */ +$Ref.prototype.get = function (path, options) { + return this.resolve(path, options).value; +}; + +/** + * Resolves the given JSON reference within this {@link $Ref#value}. + * + * @param {string} path - The full path being resolved, optionally with a JSON pointer in the hash + * @param {$RefParserOptions} options + * @param {string} friendlyPath - The original user-specified path (used for error messages) + * @param {string} pathFromRoot - The path of `obj` from the schema root + * @returns {Pointer | null} + */ +$Ref.prototype.resolve = function (path, options, friendlyPath, pathFromRoot) { + let pointer = new Pointer(this, path, friendlyPath); + try { + return pointer.resolve(this.value, options, pathFromRoot); + } + catch (err) { + if (!options || !options.continueOnError || !isHandledError(err)) { + throw err; + } + + if (err.path === null) { + err.path = safePointerToPath(getHash(pathFromRoot)); + } + + if (err instanceof InvalidPointerError) { + // this is a special case - InvalidPointerError is thrown when dereferencing external file, + // but the issue is caused by the source file that referenced the file that undergoes dereferencing + err.source = decodeURI(stripHash(pathFromRoot)); + } + + this.addError(err); + return null; + } +}; + +/** + * Sets the value of a nested property within this {@link $Ref#value}. + * If the property, or any of its parents don't exist, they will be created. + * + * @param {string} path - The full path of the property to set, optionally with a JSON pointer in the hash + * @param {*} value - The value to assign + */ +$Ref.prototype.set = function (path, value) { + let pointer = new Pointer(this, path); + this.value = pointer.set(this.value, value); +}; + +/** + * Determines whether the given value is a JSON reference. + * + * @param {*} value - The value to inspect + * @returns {boolean} + */ +$Ref.is$Ref = function (value) { + return value && typeof value === "object" && typeof value.$ref === "string" && value.$ref.length > 0; +}; + +/** + * Determines whether the given value is an external JSON reference. + * + * @param {*} value - The value to inspect + * @returns {boolean} + */ +$Ref.isExternal$Ref = function (value) { + return $Ref.is$Ref(value) && value.$ref[0] !== "#"; +}; + +/** + * Determines whether the given value is a JSON reference, and whether it is allowed by the options. + * For example, if it references an external file, then options.resolve.external must be true. + * + * @param {*} value - The value to inspect + * @param {$RefParserOptions} options + * @returns {boolean} + */ +$Ref.isAllowed$Ref = function (value, options) { + if ($Ref.is$Ref(value)) { + if (value.$ref.substr(0, 2) === "#/" || value.$ref === "#") { + // It's a JSON Pointer reference, which is always allowed + return true; + } + else if (value.$ref[0] !== "#" && (!options || options.resolve.external)) { + // It's an external reference, which is allowed by the options + return true; + } + } +}; + +/** + * Determines whether the given value is a JSON reference that "extends" its resolved value. + * That is, it has extra properties (in addition to "$ref"), so rather than simply pointing to + * an existing value, this $ref actually creates a NEW value that is a shallow copy of the resolved + * value, plus the extra properties. + * + * @example: + * { + * person: { + * properties: { + * firstName: { type: string } + * lastName: { type: string } + * } + * } + * employee: { + * properties: { + * $ref: #/person/properties + * salary: { type: number } + * } + * } + * } + * + * In this example, "employee" is an extended $ref, since it extends "person" with an additional + * property (salary). The result is a NEW value that looks like this: + * + * { + * properties: { + * firstName: { type: string } + * lastName: { type: string } + * salary: { type: number } + * } + * } + * + * @param {*} value - The value to inspect + * @returns {boolean} + */ +$Ref.isExtended$Ref = function (value) { + return $Ref.is$Ref(value) && Object.keys(value).length > 1; +}; + +/** + * Returns the resolved value of a JSON Reference. + * If necessary, the resolved value is merged with the JSON Reference to create a new object + * + * @example: + * { + * person: { + * properties: { + * firstName: { type: string } + * lastName: { type: string } + * } + * } + * employee: { + * properties: { + * $ref: #/person/properties + * salary: { type: number } + * } + * } + * } + * + * When "person" and "employee" are merged, you end up with the following object: + * + * { + * properties: { + * firstName: { type: string } + * lastName: { type: string } + * salary: { type: number } + * } + * } + * + * @param {object} $ref - The JSON reference object (the one with the "$ref" property) + * @param {*} resolvedValue - The resolved value, which can be any type + * @returns {*} - Returns the dereferenced value + */ +$Ref.dereference = function ($ref, resolvedValue) { + if (resolvedValue && typeof resolvedValue === "object" && $Ref.isExtended$Ref($ref)) { + let merged = {}; + for (let key of Object.keys($ref)) { + if (key !== "$ref") { + merged[key] = $ref[key]; + } + } + + for (let key of Object.keys(resolvedValue)) { + if (!(key in merged)) { + merged[key] = resolvedValue[key]; + } + } + + return merged; + } + else { + // Completely replace the original reference with the resolved value + return resolvedValue; + } +}; + + +/***/ }), + +/***/ 40957: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { ono } = __nccwpck_require__(33436); +const $Ref = __nccwpck_require__(59825); +const url = __nccwpck_require__(81279); + +module.exports = $Refs; + +/** + * This class is a map of JSON references and their resolved values. + */ +function $Refs () { + /** + * Indicates whether the schema contains any circular references. + * + * @type {boolean} + */ + this.circular = false; + + /** + * A map of paths/urls to {@link $Ref} objects + * + * @type {object} + * @protected + */ + this._$refs = {}; + + /** + * The {@link $Ref} object that is the root of the JSON schema. + * + * @type {$Ref} + * @protected + */ + this._root$Ref = null; +} + +/** + * Returns the paths of all the files/URLs that are referenced by the JSON schema, + * including the schema itself. + * + * @param {...string|string[]} [types] - Only return paths of the given types ("file", "http", etc.) + * @returns {string[]} + */ +$Refs.prototype.paths = function (types) { // eslint-disable-line no-unused-vars + let paths = getPaths(this._$refs, arguments); + return paths.map((path) => { + return path.decoded; + }); +}; + +/** + * Returns the map of JSON references and their resolved values. + * + * @param {...string|string[]} [types] - Only return references of the given types ("file", "http", etc.) + * @returns {object} + */ +$Refs.prototype.values = function (types) { // eslint-disable-line no-unused-vars + let $refs = this._$refs; + let paths = getPaths($refs, arguments); + return paths.reduce((obj, path) => { + obj[path.decoded] = $refs[path.encoded].value; + return obj; + }, {}); +}; + +/** + * Returns a POJO (plain old JavaScript object) for serialization as JSON. + * + * @returns {object} + */ +$Refs.prototype.toJSON = $Refs.prototype.values; + +/** + * Determines whether the given JSON reference exists. + * + * @param {string} path - The path being resolved, optionally with a JSON pointer in the hash + * @param {$RefParserOptions} [options] + * @returns {boolean} + */ +$Refs.prototype.exists = function (path, options) { + try { + this._resolve(path, "", options); + return true; + } + catch (e) { + return false; + } +}; + +/** + * Resolves the given JSON reference and returns the resolved value. + * + * @param {string} path - The path being resolved, with a JSON pointer in the hash + * @param {$RefParserOptions} [options] + * @returns {*} - Returns the resolved value + */ +$Refs.prototype.get = function (path, options) { + return this._resolve(path, "", options).value; +}; + +/** + * Sets the value of a nested property within this {@link $Ref#value}. + * If the property, or any of its parents don't exist, they will be created. + * + * @param {string} path - The path of the property to set, optionally with a JSON pointer in the hash + * @param {*} value - The value to assign + */ +$Refs.prototype.set = function (path, value) { + let absPath = url.resolve(this._root$Ref.path, path); + let withoutHash = url.stripHash(absPath); + let $ref = this._$refs[withoutHash]; + + if (!$ref) { + throw ono(`Error resolving $ref pointer "${path}". \n"${withoutHash}" not found.`); + } + + $ref.set(absPath, value); +}; + +/** + * Creates a new {@link $Ref} object and adds it to this {@link $Refs} object. + * + * @param {string} path - The file path or URL of the referenced file + */ +$Refs.prototype._add = function (path) { + let withoutHash = url.stripHash(path); + + let $ref = new $Ref(); + $ref.path = withoutHash; + $ref.$refs = this; + + this._$refs[withoutHash] = $ref; + this._root$Ref = this._root$Ref || $ref; + + return $ref; +}; + +/** + * Resolves the given JSON reference. + * + * @param {string} path - The path being resolved, optionally with a JSON pointer in the hash + * @param {string} pathFromRoot - The path of `obj` from the schema root + * @param {$RefParserOptions} [options] + * @returns {Pointer} + * @protected + */ +$Refs.prototype._resolve = function (path, pathFromRoot, options) { + let absPath = url.resolve(this._root$Ref.path, path); + let withoutHash = url.stripHash(absPath); + let $ref = this._$refs[withoutHash]; + + if (!$ref) { + throw ono(`Error resolving $ref pointer "${path}". \n"${withoutHash}" not found.`); + } + + return $ref.resolve(absPath, options, path, pathFromRoot); +}; + +/** + * Returns the specified {@link $Ref} object, or undefined. + * + * @param {string} path - The path being resolved, optionally with a JSON pointer in the hash + * @returns {$Ref|undefined} + * @protected + */ +$Refs.prototype._get$Ref = function (path) { + path = url.resolve(this._root$Ref.path, path); + let withoutHash = url.stripHash(path); + return this._$refs[withoutHash]; +}; + +/** + * Returns the encoded and decoded paths keys of the given object. + * + * @param {object} $refs - The object whose keys are URL-encoded paths + * @param {...string|string[]} [types] - Only return paths of the given types ("file", "http", etc.) + * @returns {object[]} + */ +function getPaths ($refs, types) { + let paths = Object.keys($refs); + + // Filter the paths by type + types = Array.isArray(types[0]) ? types[0] : Array.prototype.slice.call(types); + if (types.length > 0 && types[0]) { + paths = paths.filter((key) => { + return types.indexOf($refs[key].pathType) !== -1; + }); + } + + // Decode local filesystem paths + return paths.map((path) => { + return { + encoded: path, + decoded: $refs[path].pathType === "file" ? url.toFileSystemPath(path, true) : path + }; + }); +} + + +/***/ }), + +/***/ 45330: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const $Ref = __nccwpck_require__(59825); +const Pointer = __nccwpck_require__(26040); +const parse = __nccwpck_require__(52430); +const url = __nccwpck_require__(81279); +const { isHandledError } = __nccwpck_require__(1695); + +module.exports = resolveExternal; + +/** + * Crawls the JSON schema, finds all external JSON references, and resolves their values. + * This method does not mutate the JSON schema. The resolved values are added to {@link $RefParser#$refs}. + * + * NOTE: We only care about EXTERNAL references here. INTERNAL references are only relevant when dereferencing. + * + * @param {$RefParser} parser + * @param {$RefParserOptions} options + * + * @returns {Promise} + * The promise resolves once all JSON references in the schema have been resolved, + * including nested references that are contained in externally-referenced files. + */ +function resolveExternal (parser, options) { + if (!options.resolve.external) { + // Nothing to resolve, so exit early + return Promise.resolve(); + } + + try { + // console.log('Resolving $ref pointers in %s', parser.$refs._root$Ref.path); + let promises = crawl(parser.schema, parser.$refs._root$Ref.path + "#", parser.$refs, options); + return Promise.all(promises); + } + catch (e) { + return Promise.reject(e); + } +} + +/** + * Recursively crawls the given value, and resolves any external JSON references. + * + * @param {*} obj - The value to crawl. If it's not an object or array, it will be ignored. + * @param {string} path - The full path of `obj`, possibly with a JSON Pointer in the hash + * @param {$Refs} $refs + * @param {$RefParserOptions} options + * @param {Set} seen - Internal. + * + * @returns {Promise[]} + * Returns an array of promises. There will be one promise for each JSON reference in `obj`. + * If `obj` does not contain any JSON references, then the array will be empty. + * If any of the JSON references point to files that contain additional JSON references, + * then the corresponding promise will internally reference an array of promises. + */ +function crawl (obj, path, $refs, options, seen) { + seen = seen || new Set(); + let promises = []; + + if (obj && typeof obj === "object" && !ArrayBuffer.isView(obj) && !seen.has(obj)) { + seen.add(obj); // Track previously seen objects to avoid infinite recursion + if ($Ref.isExternal$Ref(obj)) { + promises.push(resolve$Ref(obj, path, $refs, options)); + } + else { + for (let key of Object.keys(obj)) { + let keyPath = Pointer.join(path, key); + let value = obj[key]; + + if ($Ref.isExternal$Ref(value)) { + promises.push(resolve$Ref(value, keyPath, $refs, options)); + } + else { + promises = promises.concat(crawl(value, keyPath, $refs, options, seen)); + } + } + } + } + + return promises; +} + +/** + * Resolves the given JSON Reference, and then crawls the resulting value. + * + * @param {{$ref: string}} $ref - The JSON Reference to resolve + * @param {string} path - The full path of `$ref`, possibly with a JSON Pointer in the hash + * @param {$Refs} $refs + * @param {$RefParserOptions} options + * + * @returns {Promise} + * The promise resolves once all JSON references in the object have been resolved, + * including nested references that are contained in externally-referenced files. + */ +async function resolve$Ref ($ref, path, $refs, options) { + // console.log('Resolving $ref pointer "%s" at %s', $ref.$ref, path); + + let resolvedPath = url.resolve(path, $ref.$ref); + let withoutHash = url.stripHash(resolvedPath); + + // Do we already have this $ref? + $ref = $refs._$refs[withoutHash]; + if ($ref) { + // We've already parsed this $ref, so use the existing value + return Promise.resolve($ref.value); + } + + // Parse the $referenced file/url + try { + const result = await parse(resolvedPath, $refs, options); + + // Crawl the parsed value + // console.log('Resolving $ref pointers in %s', withoutHash); + let promises = crawl(result, withoutHash + "#", $refs, options); + + return Promise.all(promises); + } + catch (err) { + if (!options.continueOnError || !isHandledError(err)) { + throw err; + } + + if ($refs._$refs[withoutHash]) { + err.source = decodeURI(url.stripHash(path)); + err.path = url.safePointerToPath(url.getHash(path)); + } + + return []; + } +} + + +/***/ }), + +/***/ 36859: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +const fs = __nccwpck_require__(57147); +const { ono } = __nccwpck_require__(33436); +const url = __nccwpck_require__(81279); +const { ResolverError } = __nccwpck_require__(1695); + +module.exports = { + /** + * The order that this resolver will run, in relation to other resolvers. + * + * @type {number} + */ + order: 100, + + /** + * Determines whether this resolver can read a given file reference. + * Resolvers that return true will be tried, in order, until one successfully resolves the file. + * Resolvers that return false will not be given a chance to resolve the file. + * + * @param {object} file - An object containing information about the referenced file + * @param {string} file.url - The full URL of the referenced file + * @param {string} file.extension - The lowercased file extension (e.g. ".txt", ".html", etc.) + * @returns {boolean} + */ + canRead (file) { + return url.isFileSystemPath(file.url); + }, + + /** + * Reads the given file and returns its raw contents as a Buffer. + * + * @param {object} file - An object containing information about the referenced file + * @param {string} file.url - The full URL of the referenced file + * @param {string} file.extension - The lowercased file extension (e.g. ".txt", ".html", etc.) + * @returns {Promise} + */ + read (file) { + return new Promise(((resolve, reject) => { + let path; + try { + path = url.toFileSystemPath(file.url); + } + catch (err) { + reject(new ResolverError(ono.uri(err, `Malformed URI: ${file.url}`), file.url)); + } + + // console.log('Opening file: %s', path); + + try { + fs.readFile(path, (err, data) => { + if (err) { + reject(new ResolverError(ono(err, `Error opening file "${path}"`), path)); + } + else { + resolve(data); + } + }); + } + catch (err) { + reject(new ResolverError(ono(err, `Error opening file "${path}"`), path)); + } + })); + } +}; + + +/***/ }), + +/***/ 34147: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const http = __nccwpck_require__(13685); +const https = __nccwpck_require__(95687); +const { ono } = __nccwpck_require__(33436); +const url = __nccwpck_require__(81279); +const { ResolverError } = __nccwpck_require__(1695); + +module.exports = { + /** + * The order that this resolver will run, in relation to other resolvers. + * + * @type {number} + */ + order: 200, + + /** + * HTTP headers to send when downloading files. + * + * @example: + * { + * "User-Agent": "JSON Schema $Ref Parser", + * Accept: "application/json" + * } + * + * @type {object} + */ + headers: null, + + /** + * HTTP request timeout (in milliseconds). + * + * @type {number} + */ + timeout: 5000, // 5 seconds + + /** + * The maximum number of HTTP redirects to follow. + * To disable automatic following of redirects, set this to zero. + * + * @type {number} + */ + redirects: 5, + + /** + * The `withCredentials` option of XMLHttpRequest. + * Set this to `true` if you're downloading files from a CORS-enabled server that requires authentication + * + * @type {boolean} + */ + withCredentials: false, + + /** + * Determines whether this resolver can read a given file reference. + * Resolvers that return true will be tried in order, until one successfully resolves the file. + * Resolvers that return false will not be given a chance to resolve the file. + * + * @param {object} file - An object containing information about the referenced file + * @param {string} file.url - The full URL of the referenced file + * @param {string} file.extension - The lowercased file extension (e.g. ".txt", ".html", etc.) + * @returns {boolean} + */ + canRead (file) { + return url.isHttp(file.url); + }, + + /** + * Reads the given URL and returns its raw contents as a Buffer. + * + * @param {object} file - An object containing information about the referenced file + * @param {string} file.url - The full URL of the referenced file + * @param {string} file.extension - The lowercased file extension (e.g. ".txt", ".html", etc.) + * @returns {Promise} + */ + read (file) { + let u = url.parse(file.url); + + if (process.browser && !u.protocol) { + // Use the protocol of the current page + u.protocol = url.parse(location.href).protocol; + } + + return download(u, this); + } +}; + +/** + * Downloads the given file. + * + * @param {Url|string} u - The url to download (can be a parsed {@link Url} object) + * @param {object} httpOptions - The `options.resolve.http` object + * @param {number} [redirects] - The redirect URLs that have already been followed + * + * @returns {Promise} + * The promise resolves with the raw downloaded data, or rejects if there is an HTTP error. + */ +function download (u, httpOptions, redirects) { + return new Promise(((resolve, reject) => { + u = url.parse(u); + redirects = redirects || []; + redirects.push(u.href); + + get(u, httpOptions) + .then((res) => { + if (res.statusCode >= 400) { + throw ono({ status: res.statusCode }, `HTTP ERROR ${res.statusCode}`); + } + else if (res.statusCode >= 300) { + if (redirects.length > httpOptions.redirects) { + reject(new ResolverError(ono({ status: res.statusCode }, + `Error downloading ${redirects[0]}. \nToo many redirects: \n ${redirects.join(" \n ")}`))); + } + else if (!res.headers.location) { + throw ono({ status: res.statusCode }, `HTTP ${res.statusCode} redirect with no location header`); + } + else { + // console.log('HTTP %d redirect %s -> %s', res.statusCode, u.href, res.headers.location); + let redirectTo = url.resolve(u, res.headers.location); + download(redirectTo, httpOptions, redirects).then(resolve, reject); + } + } + else { + resolve(res.body || Buffer.alloc(0)); + } + }) + .catch((err) => { + reject(new ResolverError(ono(err, `Error downloading ${u.href}`), u.href)); + }); + })); +} + +/** + * Sends an HTTP GET request. + * + * @param {Url} u - A parsed {@link Url} object + * @param {object} httpOptions - The `options.resolve.http` object + * + * @returns {Promise} + * The promise resolves with the HTTP Response object. + */ +function get (u, httpOptions) { + return new Promise(((resolve, reject) => { + // console.log('GET', u.href); + + let protocol = u.protocol === "https:" ? https : http; + let req = protocol.get({ + hostname: u.hostname, + port: u.port, + path: u.path, + auth: u.auth, + protocol: u.protocol, + headers: httpOptions.headers || {}, + withCredentials: httpOptions.withCredentials + }); + + if (typeof req.setTimeout === "function") { + req.setTimeout(httpOptions.timeout); + } + + req.on("timeout", () => { + req.abort(); + }); + + req.on("error", reject); + + req.once("response", (res) => { + res.body = Buffer.alloc(0); + + res.on("data", (data) => { + res.body = Buffer.concat([res.body, Buffer.from(data)]); + }); + + res.on("error", reject); + + res.on("end", () => { + resolve(res); + }); + }); + })); +} + + +/***/ }), + +/***/ 1695: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +const { Ono } = __nccwpck_require__(33436); + +const { stripHash, toFileSystemPath } = __nccwpck_require__(81279); + +const JSONParserError = exports.JSONParserError = class JSONParserError extends Error { + constructor (message, source) { + super(); + + this.code = "EUNKNOWN"; + this.message = message; + this.source = source; + this.path = null; + + Ono.extend(this); + } + + get footprint () { + return `${this.path}+${this.source}+${this.code}+${this.message}`; + } +}; + +setErrorName(JSONParserError); + +const JSONParserErrorGroup = exports.JSONParserErrorGroup = class JSONParserErrorGroup extends Error { + constructor (parser) { + super(); + + this.files = parser; + this.message = `${this.errors.length} error${this.errors.length > 1 ? "s" : ""} occurred while reading '${toFileSystemPath(parser.$refs._root$Ref.path)}'`; + + Ono.extend(this); + } + + static getParserErrors (parser) { + const errors = []; + + for (const $ref of Object.values(parser.$refs._$refs)) { + if ($ref.errors) { + errors.push(...$ref.errors); + } + } + + return errors; + } + + get errors () { + return JSONParserErrorGroup.getParserErrors(this.files); + } +}; + +setErrorName(JSONParserErrorGroup); + +const ParserError = exports.ParserError = class ParserError extends JSONParserError { + constructor (message, source) { + super(`Error parsing ${source}: ${message}`, source); + + this.code = "EPARSER"; + } +}; + +setErrorName(ParserError); + +const UnmatchedParserError = exports.UnmatchedParserError = class UnmatchedParserError extends JSONParserError { + constructor (source) { + super(`Could not find parser for "${source}"`, source); + + this.code = "EUNMATCHEDPARSER"; + } +}; + +setErrorName(UnmatchedParserError); + +const ResolverError = exports.ResolverError = class ResolverError extends JSONParserError { + constructor (ex, source) { + super(ex.message || `Error reading file "${source}"`, source); + + this.code = "ERESOLVER"; + + if ("code" in ex) { + this.ioErrorCode = String(ex.code); + } + } +}; + +setErrorName(ResolverError); + +const UnmatchedResolverError = exports.UnmatchedResolverError = class UnmatchedResolverError extends JSONParserError { + constructor (source) { + super(`Could not find resolver for "${source}"`, source); + + this.code = "EUNMATCHEDRESOLVER"; + } +}; + +setErrorName(UnmatchedResolverError); + +const MissingPointerError = exports.MissingPointerError = class MissingPointerError extends JSONParserError { + constructor (token, path) { + super(`Token "${token}" does not exist.`, stripHash(path)); + + this.code = "EMISSINGPOINTER"; + } +}; + +setErrorName(MissingPointerError); + +const InvalidPointerError = exports.InvalidPointerError = class InvalidPointerError extends JSONParserError { + constructor (pointer, path) { + super(`Invalid $ref pointer "${pointer}". Pointers must begin with "#/"`, stripHash(path)); + + this.code = "EINVALIDPOINTER"; + } +}; + +setErrorName(InvalidPointerError); + +function setErrorName (err) { + Object.defineProperty(err.prototype, "name", { + value: err.name, + enumerable: true, + }); +} + +exports.isHandledError = function (err) { + return err instanceof JSONParserError || err instanceof JSONParserErrorGroup; +}; + +exports.normalizeError = function (err) { + if (err.path === null) { + err.path = []; + } + + return err; +}; + + +/***/ }), + +/***/ 14601: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +/** + * Returns the given plugins as an array, rather than an object map. + * All other methods in this module expect an array of plugins rather than an object map. + * + * @param {object} plugins - A map of plugin objects + * @return {object[]} + */ +exports.all = function (plugins) { + return Object.keys(plugins) + .filter((key) => { + return typeof plugins[key] === "object"; + }) + .map((key) => { + plugins[key].name = key; + return plugins[key]; + }); +}; + +/** + * Filters the given plugins, returning only the ones return `true` for the given method. + * + * @param {object[]} plugins - An array of plugin objects + * @param {string} method - The name of the filter method to invoke for each plugin + * @param {object} file - A file info object, which will be passed to each method + * @return {object[]} + */ +exports.filter = function (plugins, method, file) { + return plugins + .filter((plugin) => { + return !!getResult(plugin, method, file); + }); +}; + +/** + * Sorts the given plugins, in place, by their `order` property. + * + * @param {object[]} plugins - An array of plugin objects + * @returns {object[]} + */ +exports.sort = function (plugins) { + for (let plugin of plugins) { + plugin.order = plugin.order || Number.MAX_SAFE_INTEGER; + } + + return plugins.sort((a, b) => { return a.order - b.order; }); +}; + +/** + * Runs the specified method of the given plugins, in order, until one of them returns a successful result. + * Each method can return a synchronous value, a Promise, or call an error-first callback. + * If the promise resolves successfully, or the callback is called without an error, then the result + * is immediately returned and no further plugins are called. + * If the promise rejects, or the callback is called with an error, then the next plugin is called. + * If ALL plugins fail, then the last error is thrown. + * + * @param {object[]} plugins - An array of plugin objects + * @param {string} method - The name of the method to invoke for each plugin + * @param {object} file - A file info object, which will be passed to each method + * @returns {Promise} + */ +exports.run = function (plugins, method, file, $refs) { + let plugin, lastError, index = 0; + + return new Promise(((resolve, reject) => { + runNextPlugin(); + + function runNextPlugin () { + plugin = plugins[index++]; + if (!plugin) { + // There are no more functions, so re-throw the last error + return reject(lastError); + } + + try { + // console.log(' %s', plugin.name); + let result = getResult(plugin, method, file, callback, $refs); + if (result && typeof result.then === "function") { + // A promise was returned + result.then(onSuccess, onError); + } + else if (result !== undefined) { + // A synchronous result was returned + onSuccess(result); + } + else if (index === plugins.length) { + throw new Error("No promise has been returned or callback has been called."); + } + } + catch (e) { + onError(e); + } + } + + function callback (err, result) { + if (err) { + onError(err); + } + else { + onSuccess(result); + } + } + + function onSuccess (result) { + // console.log(' success'); + resolve({ + plugin, + result + }); + } + + function onError (error) { + // console.log(' %s', err.message || err); + lastError = { + plugin, + error, + }; + runNextPlugin(); + } + })); +}; + +/** + * Returns the value of the given property. + * If the property is a function, then the result of the function is returned. + * If the value is a RegExp, then it will be tested against the file URL. + * If the value is an aray, then it will be compared against the file extension. + * + * @param {object} obj - The object whose property/method is called + * @param {string} prop - The name of the property/method to invoke + * @param {object} file - A file info object, which will be passed to the method + * @param {function} [callback] - A callback function, which will be passed to the method + * @returns {*} + */ +function getResult (obj, prop, file, callback, $refs) { + let value = obj[prop]; + + if (typeof value === "function") { + return value.apply(obj, [file, callback, $refs]); + } + + if (!callback) { + // The synchronous plugin functions (canParse and canRead) + // allow a "shorthand" syntax, where the user can match + // files by RegExp or by file extension. + if (value instanceof RegExp) { + return value.test(file.url); + } + else if (typeof value === "string") { + return value === file.extension; + } + else if (Array.isArray(value)) { + return value.indexOf(file.extension) !== -1; + } + } + + return value; +} + + +/***/ }), + +/***/ 81279: +/***/ ((module, exports, __nccwpck_require__) => { + +"use strict"; + + +let isWindows = /^win/.test(process.platform), + forwardSlashPattern = /\//g, + protocolPattern = /^(\w{2,}):\/\//i, + url = module.exports, + jsonPointerSlash = /~1/g, + jsonPointerTilde = /~0/g; + +// RegExp patterns to URL-encode special characters in local filesystem paths +let urlEncodePatterns = [ + /\?/g, "%3F", + /\#/g, "%23", +]; + +// RegExp patterns to URL-decode special characters for local filesystem paths +let urlDecodePatterns = [ + /\%23/g, "#", + /\%24/g, "$", + /\%26/g, "&", + /\%2C/g, ",", + /\%40/g, "@" +]; + +exports.parse = __nccwpck_require__(57310).parse; +exports.resolve = __nccwpck_require__(57310).resolve; + +/** + * Returns the current working directory (in Node) or the current page URL (in browsers). + * + * @returns {string} + */ +exports.cwd = function cwd () { + if (process.browser) { + return location.href; + } + + let path = process.cwd(); + + let lastChar = path.slice(-1); + if (lastChar === "/" || lastChar === "\\") { + return path; + } + else { + return path + "/"; + } +}; + +/** + * Returns the protocol of the given URL, or `undefined` if it has no protocol. + * + * @param {string} path + * @returns {?string} + */ +exports.getProtocol = function getProtocol (path) { + let match = protocolPattern.exec(path); + if (match) { + return match[1].toLowerCase(); + } +}; + +/** + * Returns the lowercased file extension of the given URL, + * or an empty string if it has no extension. + * + * @param {string} path + * @returns {string} + */ +exports.getExtension = function getExtension (path) { + let lastDot = path.lastIndexOf("."); + if (lastDot >= 0) { + return url.stripQuery(path.substr(lastDot).toLowerCase()); + } + return ""; +}; + +/** + * Removes the query, if any, from the given path. + * + * @param {string} path + * @returns {string} + */ +exports.stripQuery = function stripQuery (path) { + let queryIndex = path.indexOf("?"); + if (queryIndex >= 0) { + path = path.substr(0, queryIndex); + } + return path; +}; + +/** + * Returns the hash (URL fragment), of the given path. + * If there is no hash, then the root hash ("#") is returned. + * + * @param {string} path + * @returns {string} + */ +exports.getHash = function getHash (path) { + let hashIndex = path.indexOf("#"); + if (hashIndex >= 0) { + return path.substr(hashIndex); + } + return "#"; +}; + +/** + * Removes the hash (URL fragment), if any, from the given path. + * + * @param {string} path + * @returns {string} + */ +exports.stripHash = function stripHash (path) { + let hashIndex = path.indexOf("#"); + if (hashIndex >= 0) { + path = path.substr(0, hashIndex); + } + return path; +}; + +/** + * Determines whether the given path is an HTTP(S) URL. + * + * @param {string} path + * @returns {boolean} + */ +exports.isHttp = function isHttp (path) { + let protocol = url.getProtocol(path); + if (protocol === "http" || protocol === "https") { + return true; + } + else if (protocol === undefined) { + // There is no protocol. If we're running in a browser, then assume it's HTTP. + return process.browser; + } + else { + // It's some other protocol, such as "ftp://", "mongodb://", etc. + return false; + } +}; + +/** + * Determines whether the given path is a filesystem path. + * This includes "file://" URLs. + * + * @param {string} path + * @returns {boolean} + */ +exports.isFileSystemPath = function isFileSystemPath (path) { + if (process.browser) { + // We're running in a browser, so assume that all paths are URLs. + // This way, even relative paths will be treated as URLs rather than as filesystem paths + return false; + } + + let protocol = url.getProtocol(path); + return protocol === undefined || protocol === "file"; +}; + +/** + * Converts a filesystem path to a properly-encoded URL. + * + * This is intended to handle situations where JSON Schema $Ref Parser is called + * with a filesystem path that contains characters which are not allowed in URLs. + * + * @example + * The following filesystem paths would be converted to the following URLs: + * + * <"!@#$%^&*+=?'>.json ==> %3C%22!@%23$%25%5E&*+=%3F\'%3E.json + * C:\\My Documents\\File (1).json ==> C:/My%20Documents/File%20(1).json + * file://Project #42/file.json ==> file://Project%20%2342/file.json + * + * @param {string} path + * @returns {string} + */ +exports.fromFileSystemPath = function fromFileSystemPath (path) { + // Step 1: On Windows, replace backslashes with forward slashes, + // rather than encoding them as "%5C" + if (isWindows) { + path = path.replace(/\\/g, "/"); + } + + // Step 2: `encodeURI` will take care of MOST characters + path = encodeURI(path); + + // Step 3: Manually encode characters that are not encoded by `encodeURI`. + // This includes characters such as "#" and "?", which have special meaning in URLs, + // but are just normal characters in a filesystem path. + for (let i = 0; i < urlEncodePatterns.length; i += 2) { + path = path.replace(urlEncodePatterns[i], urlEncodePatterns[i + 1]); + } + + return path; +}; + +/** + * Converts a URL to a local filesystem path. + * + * @param {string} path + * @param {boolean} [keepFileProtocol] - If true, then "file://" will NOT be stripped + * @returns {string} + */ +exports.toFileSystemPath = function toFileSystemPath (path, keepFileProtocol) { + // Step 1: `decodeURI` will decode characters such as Cyrillic characters, spaces, etc. + path = decodeURI(path); + + // Step 2: Manually decode characters that are not decoded by `decodeURI`. + // This includes characters such as "#" and "?", which have special meaning in URLs, + // but are just normal characters in a filesystem path. + for (let i = 0; i < urlDecodePatterns.length; i += 2) { + path = path.replace(urlDecodePatterns[i], urlDecodePatterns[i + 1]); + } + + // Step 3: If it's a "file://" URL, then format it consistently + // or convert it to a local filesystem path + let isFileUrl = path.substr(0, 7).toLowerCase() === "file://"; + if (isFileUrl) { + // Strip-off the protocol, and the initial "/", if there is one + path = path[7] === "/" ? path.substr(8) : path.substr(7); + + // insert a colon (":") after the drive letter on Windows + if (isWindows && path[1] === "/") { + path = path[0] + ":" + path.substr(1); + } + + if (keepFileProtocol) { + // Return the consistently-formatted "file://" URL + path = "file:///" + path; + } + else { + // Convert the "file://" URL to a local filesystem path. + // On Windows, it will start with something like "C:/". + // On Posix, it will start with "/" + isFileUrl = false; + path = isWindows ? path : "/" + path; + } + } + + // Step 4: Normalize Windows paths (unless it's a "file://" URL) + if (isWindows && !isFileUrl) { + // Replace forward slashes with backslashes + path = path.replace(forwardSlashPattern, "\\"); + + // Capitalize the drive letter + if (path.substr(1, 2) === ":\\") { + path = path[0].toUpperCase() + path.substr(1); + } + } + + return path; +}; + +/** + * Converts a $ref pointer to a valid JSON Path. + * + * @param {string} pointer + * @returns {Array} + */ +exports.safePointerToPath = function safePointerToPath (pointer) { + if (pointer.length <= 1 || pointer[0] !== "#" || pointer[1] !== "/") { + return []; + } + + return pointer + .slice(2) + .split("/") + .map((value) => { + return decodeURIComponent(value) + .replace(jsonPointerSlash, "/") + .replace(jsonPointerTilde, "~"); + }); +}; + + +/***/ }), + +/***/ 55848: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + + +var loader = __nccwpck_require__(42432); +var dumper = __nccwpck_require__(99772); + + +function renamed(from, to) { + return function () { + throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' + + 'Use yaml.' + to + ' instead, which is now safe by default.'); + }; +} + + +module.exports.Type = __nccwpck_require__(63820); +module.exports.Schema = __nccwpck_require__(78583); +module.exports.FAILSAFE_SCHEMA = __nccwpck_require__(59056); +module.exports.JSON_SCHEMA = __nccwpck_require__(9531); +module.exports.CORE_SCHEMA = __nccwpck_require__(84030); +module.exports.DEFAULT_SCHEMA = __nccwpck_require__(81448); +module.exports.load = loader.load; +module.exports.loadAll = loader.loadAll; +module.exports.dump = dumper.dump; +module.exports.YAMLException = __nccwpck_require__(7987); + +// Re-export all types in case user wants to create custom schema +module.exports.types = { + binary: __nccwpck_require__(27731), + float: __nccwpck_require__(68155), + map: __nccwpck_require__(23412), + null: __nccwpck_require__(21471), + pairs: __nccwpck_require__(61589), + set: __nccwpck_require__(80986), + timestamp: __nccwpck_require__(65821), + bool: __nccwpck_require__(18769), + int: __nccwpck_require__(58884), + merge: __nccwpck_require__(50718), + omap: __nccwpck_require__(40564), + seq: __nccwpck_require__(37331), + str: __nccwpck_require__(98225) +}; + +// Removed functions from JS-YAML 3.0.x +module.exports.safeLoad = renamed('safeLoad', 'load'); +module.exports.safeLoadAll = renamed('safeLoadAll', 'loadAll'); +module.exports.safeDump = renamed('safeDump', 'dump'); + + +/***/ }), + +/***/ 33198: +/***/ ((module) => { + +"use strict"; + + + +function isNothing(subject) { + return (typeof subject === 'undefined') || (subject === null); +} + + +function isObject(subject) { + return (typeof subject === 'object') && (subject !== null); +} + + +function toArray(sequence) { + if (Array.isArray(sequence)) return sequence; + else if (isNothing(sequence)) return []; + + return [ sequence ]; +} + + +function extend(target, source) { + var index, length, key, sourceKeys; + + if (source) { + sourceKeys = Object.keys(source); + + for (index = 0, length = sourceKeys.length; index < length; index += 1) { + key = sourceKeys[index]; + target[key] = source[key]; + } + } + + return target; +} + + +function repeat(string, count) { + var result = '', cycle; + + for (cycle = 0; cycle < count; cycle += 1) { + result += string; + } + + return result; +} + + +function isNegativeZero(number) { + return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number); +} + + +module.exports.isNothing = isNothing; +module.exports.isObject = isObject; +module.exports.toArray = toArray; +module.exports.repeat = repeat; +module.exports.isNegativeZero = isNegativeZero; +module.exports.extend = extend; + + +/***/ }), + +/***/ 99772: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +/*eslint-disable no-use-before-define*/ + +var common = __nccwpck_require__(33198); +var YAMLException = __nccwpck_require__(7987); +var DEFAULT_SCHEMA = __nccwpck_require__(81448); + +var _toString = Object.prototype.toString; +var _hasOwnProperty = Object.prototype.hasOwnProperty; + +var CHAR_BOM = 0xFEFF; +var CHAR_TAB = 0x09; /* Tab */ +var CHAR_LINE_FEED = 0x0A; /* LF */ +var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */ +var CHAR_SPACE = 0x20; /* Space */ +var CHAR_EXCLAMATION = 0x21; /* ! */ +var CHAR_DOUBLE_QUOTE = 0x22; /* " */ +var CHAR_SHARP = 0x23; /* # */ +var CHAR_PERCENT = 0x25; /* % */ +var CHAR_AMPERSAND = 0x26; /* & */ +var CHAR_SINGLE_QUOTE = 0x27; /* ' */ +var CHAR_ASTERISK = 0x2A; /* * */ +var CHAR_COMMA = 0x2C; /* , */ +var CHAR_MINUS = 0x2D; /* - */ +var CHAR_COLON = 0x3A; /* : */ +var CHAR_EQUALS = 0x3D; /* = */ +var CHAR_GREATER_THAN = 0x3E; /* > */ +var CHAR_QUESTION = 0x3F; /* ? */ +var CHAR_COMMERCIAL_AT = 0x40; /* @ */ +var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ +var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ +var CHAR_GRAVE_ACCENT = 0x60; /* ` */ +var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ +var CHAR_VERTICAL_LINE = 0x7C; /* | */ +var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ + +var ESCAPE_SEQUENCES = {}; + +ESCAPE_SEQUENCES[0x00] = '\\0'; +ESCAPE_SEQUENCES[0x07] = '\\a'; +ESCAPE_SEQUENCES[0x08] = '\\b'; +ESCAPE_SEQUENCES[0x09] = '\\t'; +ESCAPE_SEQUENCES[0x0A] = '\\n'; +ESCAPE_SEQUENCES[0x0B] = '\\v'; +ESCAPE_SEQUENCES[0x0C] = '\\f'; +ESCAPE_SEQUENCES[0x0D] = '\\r'; +ESCAPE_SEQUENCES[0x1B] = '\\e'; +ESCAPE_SEQUENCES[0x22] = '\\"'; +ESCAPE_SEQUENCES[0x5C] = '\\\\'; +ESCAPE_SEQUENCES[0x85] = '\\N'; +ESCAPE_SEQUENCES[0xA0] = '\\_'; +ESCAPE_SEQUENCES[0x2028] = '\\L'; +ESCAPE_SEQUENCES[0x2029] = '\\P'; + +var DEPRECATED_BOOLEANS_SYNTAX = [ + 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', + 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' +]; + +var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/; + +function compileStyleMap(schema, map) { + var result, keys, index, length, tag, style, type; + + if (map === null) return {}; + + result = {}; + keys = Object.keys(map); + + for (index = 0, length = keys.length; index < length; index += 1) { + tag = keys[index]; + style = String(map[tag]); + + if (tag.slice(0, 2) === '!!') { + tag = 'tag:yaml.org,2002:' + tag.slice(2); + } + type = schema.compiledTypeMap['fallback'][tag]; + + if (type && _hasOwnProperty.call(type.styleAliases, style)) { + style = type.styleAliases[style]; + } + + result[tag] = style; + } + + return result; +} + +function encodeHex(character) { + var string, handle, length; + + string = character.toString(16).toUpperCase(); + + if (character <= 0xFF) { + handle = 'x'; + length = 2; + } else if (character <= 0xFFFF) { + handle = 'u'; + length = 4; + } else if (character <= 0xFFFFFFFF) { + handle = 'U'; + length = 8; + } else { + throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF'); + } + + return '\\' + handle + common.repeat('0', length - string.length) + string; +} + + +var QUOTING_TYPE_SINGLE = 1, + QUOTING_TYPE_DOUBLE = 2; + +function State(options) { + this.schema = options['schema'] || DEFAULT_SCHEMA; + this.indent = Math.max(1, (options['indent'] || 2)); + this.noArrayIndent = options['noArrayIndent'] || false; + this.skipInvalid = options['skipInvalid'] || false; + this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); + this.styleMap = compileStyleMap(this.schema, options['styles'] || null); + this.sortKeys = options['sortKeys'] || false; + this.lineWidth = options['lineWidth'] || 80; + this.noRefs = options['noRefs'] || false; + this.noCompatMode = options['noCompatMode'] || false; + this.condenseFlow = options['condenseFlow'] || false; + this.quotingType = options['quotingType'] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE; + this.forceQuotes = options['forceQuotes'] || false; + this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null; + + this.implicitTypes = this.schema.compiledImplicit; + this.explicitTypes = this.schema.compiledExplicit; + + this.tag = null; + this.result = ''; + + this.duplicates = []; + this.usedDuplicates = null; +} + +// Indents every line in a string. Empty lines (\n only) are not indented. +function indentString(string, spaces) { + var ind = common.repeat(' ', spaces), + position = 0, + next = -1, + result = '', + line, + length = string.length; + + while (position < length) { + next = string.indexOf('\n', position); + if (next === -1) { + line = string.slice(position); + position = length; + } else { + line = string.slice(position, next + 1); + position = next + 1; + } + + if (line.length && line !== '\n') result += ind; + + result += line; + } + + return result; +} + +function generateNextLine(state, level) { + return '\n' + common.repeat(' ', state.indent * level); +} + +function testImplicitResolving(state, str) { + var index, length, type; + + for (index = 0, length = state.implicitTypes.length; index < length; index += 1) { + type = state.implicitTypes[index]; + + if (type.resolve(str)) { + return true; + } + } + + return false; +} + +// [33] s-white ::= s-space | s-tab +function isWhitespace(c) { + return c === CHAR_SPACE || c === CHAR_TAB; +} + +// Returns true if the character can be printed without escaping. +// From YAML 1.2: "any allowed characters known to be non-printable +// should also be escaped. [However,] This isn’t mandatory" +// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029. +function isPrintable(c) { + return (0x00020 <= c && c <= 0x00007E) + || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) + || ((0x0E000 <= c && c <= 0x00FFFD) && c !== CHAR_BOM) + || (0x10000 <= c && c <= 0x10FFFF); +} + +// [34] ns-char ::= nb-char - s-white +// [27] nb-char ::= c-printable - b-char - c-byte-order-mark +// [26] b-char ::= b-line-feed | b-carriage-return +// Including s-white (for some reason, examples doesn't match specs in this aspect) +// ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark +function isNsCharOrWhitespace(c) { + return isPrintable(c) + && c !== CHAR_BOM + // - b-char + && c !== CHAR_CARRIAGE_RETURN + && c !== CHAR_LINE_FEED; +} + +// [127] ns-plain-safe(c) ::= c = flow-out ⇒ ns-plain-safe-out +// c = flow-in ⇒ ns-plain-safe-in +// c = block-key ⇒ ns-plain-safe-out +// c = flow-key ⇒ ns-plain-safe-in +// [128] ns-plain-safe-out ::= ns-char +// [129] ns-plain-safe-in ::= ns-char - c-flow-indicator +// [130] ns-plain-char(c) ::= ( ns-plain-safe(c) - “:” - “#” ) +// | ( /* An ns-char preceding */ “#” ) +// | ( “:” /* Followed by an ns-plain-safe(c) */ ) +function isPlainSafe(c, prev, inblock) { + var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c); + var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c); + return ( + // ns-plain-safe + inblock ? // c = flow-in + cIsNsCharOrWhitespace + : cIsNsCharOrWhitespace + // - c-flow-indicator + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + ) + // ns-plain-char + && c !== CHAR_SHARP // false on '#' + && !(prev === CHAR_COLON && !cIsNsChar) // false on ': ' + || (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) // change to true on '[^ ]#' + || (prev === CHAR_COLON && cIsNsChar); // change to true on ':[^ ]' +} + +// Simplified test for values allowed as the first character in plain style. +function isPlainSafeFirst(c) { + // Uses a subset of ns-char - c-indicator + // where ns-char = nb-char - s-white. + // No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part + return isPrintable(c) && c !== CHAR_BOM + && !isWhitespace(c) // - s-white + // - (c-indicator ::= + // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” + && c !== CHAR_MINUS + && c !== CHAR_QUESTION + && c !== CHAR_COLON + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “"” + && c !== CHAR_SHARP + && c !== CHAR_AMPERSAND + && c !== CHAR_ASTERISK + && c !== CHAR_EXCLAMATION + && c !== CHAR_VERTICAL_LINE + && c !== CHAR_EQUALS + && c !== CHAR_GREATER_THAN + && c !== CHAR_SINGLE_QUOTE + && c !== CHAR_DOUBLE_QUOTE + // | “%” | “@” | “`”) + && c !== CHAR_PERCENT + && c !== CHAR_COMMERCIAL_AT + && c !== CHAR_GRAVE_ACCENT; +} + +// Simplified test for values allowed as the last character in plain style. +function isPlainSafeLast(c) { + // just not whitespace or colon, it will be checked to be plain character later + return !isWhitespace(c) && c !== CHAR_COLON; +} + +// Same as 'string'.codePointAt(pos), but works in older browsers. +function codePointAt(string, pos) { + var first = string.charCodeAt(pos), second; + if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) { + second = string.charCodeAt(pos + 1); + if (second >= 0xDC00 && second <= 0xDFFF) { + // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; + } + } + return first; +} + +// Determines whether block indentation indicator is required. +function needIndentIndicator(string) { + var leadingSpaceRe = /^\n* /; + return leadingSpaceRe.test(string); +} + +var STYLE_PLAIN = 1, + STYLE_SINGLE = 2, + STYLE_LITERAL = 3, + STYLE_FOLDED = 4, + STYLE_DOUBLE = 5; + +// Determines which scalar styles are possible and returns the preferred style. +// lineWidth = -1 => no limit. +// Pre-conditions: str.length > 0. +// Post-conditions: +// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. +// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1). +// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1). +function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, + testAmbiguousType, quotingType, forceQuotes, inblock) { + + var i; + var char = 0; + var prevChar = null; + var hasLineBreak = false; + var hasFoldableLine = false; // only checked if shouldTrackWidth + var shouldTrackWidth = lineWidth !== -1; + var previousLineBreak = -1; // count the first line correctly + var plain = isPlainSafeFirst(codePointAt(string, 0)) + && isPlainSafeLast(codePointAt(string, string.length - 1)); + + if (singleLineOnly || forceQuotes) { + // Case: no block styles. + // Check for disallowed characters to rule out plain and single. + for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + plain = plain && isPlainSafe(char, prevChar, inblock); + prevChar = char; + } + } else { + // Case: block styles permitted. + for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + if (char === CHAR_LINE_FEED) { + hasLineBreak = true; + // Check if any line can be folded. + if (shouldTrackWidth) { + hasFoldableLine = hasFoldableLine || + // Foldable line = too long, and not more-indented. + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' '); + previousLineBreak = i; + } + } else if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + plain = plain && isPlainSafe(char, prevChar, inblock); + prevChar = char; + } + // in case the end is missing a \n + hasFoldableLine = hasFoldableLine || (shouldTrackWidth && + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' ')); + } + // Although every style can represent \n without escaping, prefer block styles + // for multiline, since they're more readable and they don't add empty lines. + // Also prefer folding a super-long line. + if (!hasLineBreak && !hasFoldableLine) { + // Strings interpretable as another type have to be quoted; + // e.g. the string 'true' vs. the boolean true. + if (plain && !forceQuotes && !testAmbiguousType(string)) { + return STYLE_PLAIN; + } + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; + } + // Edge case: block indentation indicator can only have one digit. + if (indentPerLevel > 9 && needIndentIndicator(string)) { + return STYLE_DOUBLE; + } + // At this point we know block styles are valid. + // Prefer literal style unless we want to fold. + if (!forceQuotes) { + return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; + } + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; +} + +// Note: line breaking/folding is implemented for only the folded style. +// NB. We drop the last trailing newline (if any) of a returned block scalar +// since the dumper adds its own newline. This always works: +// • No ending newline => unaffected; already using strip "-" chomping. +// • Ending newline => removed then restored. +// Importantly, this keeps the "+" chomp indicator from gaining an extra line. +function writeScalar(state, string, level, iskey, inblock) { + state.dump = (function () { + if (string.length === 0) { + return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''"; + } + if (!state.noCompatMode) { + if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) { + return state.quotingType === QUOTING_TYPE_DOUBLE ? ('"' + string + '"') : ("'" + string + "'"); + } + } + + var indent = state.indent * Math.max(1, level); // no 0-indent scalars + // As indentation gets deeper, let the width decrease monotonically + // to the lower bound min(state.lineWidth, 40). + // Note that this implies + // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound. + // state.lineWidth > 40 + state.indent: width decreases until the lower bound. + // This behaves better than a constant minimum width which disallows narrower options, + // or an indent threshold which causes the width to suddenly increase. + var lineWidth = state.lineWidth === -1 + ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); + + // Without knowing if keys are implicit/explicit, assume implicit for safety. + var singleLineOnly = iskey + // No block styles in flow mode. + || (state.flowLevel > -1 && level >= state.flowLevel); + function testAmbiguity(string) { + return testImplicitResolving(state, string); + } + + switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, + testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) { + + case STYLE_PLAIN: + return string; + case STYLE_SINGLE: + return "'" + string.replace(/'/g, "''") + "'"; + case STYLE_LITERAL: + return '|' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(string, indent)); + case STYLE_FOLDED: + return '>' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(foldString(string, lineWidth), indent)); + case STYLE_DOUBLE: + return '"' + escapeString(string, lineWidth) + '"'; + default: + throw new YAMLException('impossible error: invalid scalar style'); + } + }()); +} + +// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9. +function blockHeader(string, indentPerLevel) { + var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''; + + // note the special case: the string '\n' counts as a "trailing" empty line. + var clip = string[string.length - 1] === '\n'; + var keep = clip && (string[string.length - 2] === '\n' || string === '\n'); + var chomp = keep ? '+' : (clip ? '' : '-'); + + return indentIndicator + chomp + '\n'; +} + +// (See the note for writeScalar.) +function dropEndingNewline(string) { + return string[string.length - 1] === '\n' ? string.slice(0, -1) : string; +} + +// Note: a long line without a suitable break point will exceed the width limit. +// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0. +function foldString(string, width) { + // In folded style, $k$ consecutive newlines output as $k+1$ newlines— + // unless they're before or after a more-indented line, or at the very + // beginning or end, in which case $k$ maps to $k$. + // Therefore, parse each chunk as newline(s) followed by a content line. + var lineRe = /(\n+)([^\n]*)/g; + + // first line (possibly an empty line) + var result = (function () { + var nextLF = string.indexOf('\n'); + nextLF = nextLF !== -1 ? nextLF : string.length; + lineRe.lastIndex = nextLF; + return foldLine(string.slice(0, nextLF), width); + }()); + // If we haven't reached the first content line yet, don't add an extra \n. + var prevMoreIndented = string[0] === '\n' || string[0] === ' '; + var moreIndented; + + // rest of the lines + var match; + while ((match = lineRe.exec(string))) { + var prefix = match[1], line = match[2]; + moreIndented = (line[0] === ' '); + result += prefix + + (!prevMoreIndented && !moreIndented && line !== '' + ? '\n' : '') + + foldLine(line, width); + prevMoreIndented = moreIndented; + } + + return result; +} + +// Greedy line breaking. +// Picks the longest line under the limit each time, +// otherwise settles for the shortest line over the limit. +// NB. More-indented lines *cannot* be folded, as that would add an extra \n. +function foldLine(line, width) { + if (line === '' || line[0] === ' ') return line; + + // Since a more-indented line adds a \n, breaks can't be followed by a space. + var breakRe = / [^ ]/g; // note: the match index will always be <= length-2. + var match; + // start is an inclusive index. end, curr, and next are exclusive. + var start = 0, end, curr = 0, next = 0; + var result = ''; + + // Invariants: 0 <= start <= length-1. + // 0 <= curr <= next <= max(0, length-2). curr - start <= width. + // Inside the loop: + // A match implies length >= 2, so curr and next are <= length-2. + while ((match = breakRe.exec(line))) { + next = match.index; + // maintain invariant: curr - start <= width + if (next - start > width) { + end = (curr > start) ? curr : next; // derive end <= length-2 + result += '\n' + line.slice(start, end); + // skip the space that was output as \n + start = end + 1; // derive start <= length-1 + } + curr = next; + } + + // By the invariants, start <= length-1, so there is something left over. + // It is either the whole string or a part starting from non-whitespace. + result += '\n'; + // Insert a break if the remainder is too long and there is a break available. + if (line.length - start > width && curr > start) { + result += line.slice(start, curr) + '\n' + line.slice(curr + 1); + } else { + result += line.slice(start); + } + + return result.slice(1); // drop extra \n joiner +} + +// Escapes a double-quoted string. +function escapeString(string) { + var result = ''; + var char = 0; + var escapeSeq; + + for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + escapeSeq = ESCAPE_SEQUENCES[char]; + + if (!escapeSeq && isPrintable(char)) { + result += string[i]; + if (char >= 0x10000) result += string[i + 1]; + } else { + result += escapeSeq || encodeHex(char); + } + } + + return result; +} + +function writeFlowSequence(state, level, object) { + var _result = '', + _tag = state.tag, + index, + length, + value; + + for (index = 0, length = object.length; index < length; index += 1) { + value = object[index]; + + if (state.replacer) { + value = state.replacer.call(object, String(index), value); + } + + // Write only valid elements, put null instead of invalid elements. + if (writeNode(state, level, value, false, false) || + (typeof value === 'undefined' && + writeNode(state, level, null, false, false))) { + + if (_result !== '') _result += ',' + (!state.condenseFlow ? ' ' : ''); + _result += state.dump; + } + } + + state.tag = _tag; + state.dump = '[' + _result + ']'; +} + +function writeBlockSequence(state, level, object, compact) { + var _result = '', + _tag = state.tag, + index, + length, + value; + + for (index = 0, length = object.length; index < length; index += 1) { + value = object[index]; + + if (state.replacer) { + value = state.replacer.call(object, String(index), value); + } + + // Write only valid elements, put null instead of invalid elements. + if (writeNode(state, level + 1, value, true, true, false, true) || + (typeof value === 'undefined' && + writeNode(state, level + 1, null, true, true, false, true))) { + + if (!compact || _result !== '') { + _result += generateNextLine(state, level); + } + + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + _result += '-'; + } else { + _result += '- '; + } + + _result += state.dump; + } + } + + state.tag = _tag; + state.dump = _result || '[]'; // Empty sequence if no valid values. +} + +function writeFlowMapping(state, level, object) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + pairBuffer; + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + + pairBuffer = ''; + if (_result !== '') pairBuffer += ', '; + + if (state.condenseFlow) pairBuffer += '"'; + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (state.replacer) { + objectValue = state.replacer.call(object, objectKey, objectValue); + } + + if (!writeNode(state, level, objectKey, false, false)) { + continue; // Skip this pair because of invalid key; + } + + if (state.dump.length > 1024) pairBuffer += '? '; + + pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' '); + + if (!writeNode(state, level, objectValue, false, false)) { + continue; // Skip this pair because of invalid value. + } + + pairBuffer += state.dump; + + // Both key and value are valid. + _result += pairBuffer; + } + + state.tag = _tag; + state.dump = '{' + _result + '}'; +} + +function writeBlockMapping(state, level, object, compact) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + explicitPair, + pairBuffer; + + // Allow sorting keys so that the output file is deterministic + if (state.sortKeys === true) { + // Default sorting + objectKeyList.sort(); + } else if (typeof state.sortKeys === 'function') { + // Custom sort function + objectKeyList.sort(state.sortKeys); + } else if (state.sortKeys) { + // Something is wrong + throw new YAMLException('sortKeys must be a boolean or a function'); + } + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + pairBuffer = ''; + + if (!compact || _result !== '') { + pairBuffer += generateNextLine(state, level); + } + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (state.replacer) { + objectValue = state.replacer.call(object, objectKey, objectValue); + } + + if (!writeNode(state, level + 1, objectKey, true, true, true)) { + continue; // Skip this pair because of invalid key. + } + + explicitPair = (state.tag !== null && state.tag !== '?') || + (state.dump && state.dump.length > 1024); + + if (explicitPair) { + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += '?'; + } else { + pairBuffer += '? '; + } + } + + pairBuffer += state.dump; + + if (explicitPair) { + pairBuffer += generateNextLine(state, level); + } + + if (!writeNode(state, level + 1, objectValue, true, explicitPair)) { + continue; // Skip this pair because of invalid value. + } + + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += ':'; + } else { + pairBuffer += ': '; + } + + pairBuffer += state.dump; + + // Both key and value are valid. + _result += pairBuffer; + } + + state.tag = _tag; + state.dump = _result || '{}'; // Empty mapping if no valid pairs. +} + +function detectType(state, object, explicit) { + var _result, typeList, index, length, type, style; + + typeList = explicit ? state.explicitTypes : state.implicitTypes; + + for (index = 0, length = typeList.length; index < length; index += 1) { + type = typeList[index]; + + if ((type.instanceOf || type.predicate) && + (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) && + (!type.predicate || type.predicate(object))) { + + if (explicit) { + if (type.multi && type.representName) { + state.tag = type.representName(object); + } else { + state.tag = type.tag; + } + } else { + state.tag = '?'; + } + + if (type.represent) { + style = state.styleMap[type.tag] || type.defaultStyle; + + if (_toString.call(type.represent) === '[object Function]') { + _result = type.represent(object, style); + } else if (_hasOwnProperty.call(type.represent, style)) { + _result = type.represent[style](object, style); + } else { + throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style'); + } + + state.dump = _result; + } + + return true; + } + } + + return false; +} + +// Serializes `object` and writes it to global `result`. +// Returns true on success, or false on invalid object. +// +function writeNode(state, level, object, block, compact, iskey, isblockseq) { + state.tag = null; + state.dump = object; + + if (!detectType(state, object, false)) { + detectType(state, object, true); + } + + var type = _toString.call(state.dump); + var inblock = block; + var tagStr; + + if (block) { + block = (state.flowLevel < 0 || state.flowLevel > level); + } + + var objectOrArray = type === '[object Object]' || type === '[object Array]', + duplicateIndex, + duplicate; + + if (objectOrArray) { + duplicateIndex = state.duplicates.indexOf(object); + duplicate = duplicateIndex !== -1; + } + + if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) { + compact = false; + } + + if (duplicate && state.usedDuplicates[duplicateIndex]) { + state.dump = '*ref_' + duplicateIndex; + } else { + if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { + state.usedDuplicates[duplicateIndex] = true; + } + if (type === '[object Object]') { + if (block && (Object.keys(state.dump).length !== 0)) { + writeBlockMapping(state, level, state.dump, compact); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowMapping(state, level, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object Array]') { + if (block && (state.dump.length !== 0)) { + if (state.noArrayIndent && !isblockseq && level > 0) { + writeBlockSequence(state, level - 1, state.dump, compact); + } else { + writeBlockSequence(state, level, state.dump, compact); + } + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowSequence(state, level, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object String]') { + if (state.tag !== '?') { + writeScalar(state, state.dump, level, iskey, inblock); + } + } else if (type === '[object Undefined]') { + return false; + } else { + if (state.skipInvalid) return false; + throw new YAMLException('unacceptable kind of an object to dump ' + type); + } + + if (state.tag !== null && state.tag !== '?') { + // Need to encode all characters except those allowed by the spec: + // + // [35] ns-dec-digit ::= [#x30-#x39] /* 0-9 */ + // [36] ns-hex-digit ::= ns-dec-digit + // | [#x41-#x46] /* A-F */ | [#x61-#x66] /* a-f */ + // [37] ns-ascii-letter ::= [#x41-#x5A] /* A-Z */ | [#x61-#x7A] /* a-z */ + // [38] ns-word-char ::= ns-dec-digit | ns-ascii-letter | “-” + // [39] ns-uri-char ::= “%” ns-hex-digit ns-hex-digit | ns-word-char | “#” + // | “;” | “/” | “?” | “:” | “@” | “&” | “=” | “+” | “$” | “,” + // | “_” | “.” | “!” | “~” | “*” | “'” | “(” | “)” | “[” | “]” + // + // Also need to encode '!' because it has special meaning (end of tag prefix). + // + tagStr = encodeURI( + state.tag[0] === '!' ? state.tag.slice(1) : state.tag + ).replace(/!/g, '%21'); + + if (state.tag[0] === '!') { + tagStr = '!' + tagStr; + } else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') { + tagStr = '!!' + tagStr.slice(18); + } else { + tagStr = '!<' + tagStr + '>'; + } + + state.dump = tagStr + ' ' + state.dump; + } + } + + return true; +} + +function getDuplicateReferences(object, state) { + var objects = [], + duplicatesIndexes = [], + index, + length; + + inspectNode(object, objects, duplicatesIndexes); + + for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) { + state.duplicates.push(objects[duplicatesIndexes[index]]); + } + state.usedDuplicates = new Array(length); +} + +function inspectNode(object, objects, duplicatesIndexes) { + var objectKeyList, + index, + length; + + if (object !== null && typeof object === 'object') { + index = objects.indexOf(object); + if (index !== -1) { + if (duplicatesIndexes.indexOf(index) === -1) { + duplicatesIndexes.push(index); + } + } else { + objects.push(object); + + if (Array.isArray(object)) { + for (index = 0, length = object.length; index < length; index += 1) { + inspectNode(object[index], objects, duplicatesIndexes); + } + } else { + objectKeyList = Object.keys(object); + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); + } + } + } + } +} + +function dump(input, options) { + options = options || {}; + + var state = new State(options); + + if (!state.noRefs) getDuplicateReferences(input, state); + + var value = input; + + if (state.replacer) { + value = state.replacer.call({ '': value }, '', value); + } + + if (writeNode(state, 0, value, true, true)) return state.dump + '\n'; + + return ''; +} + +module.exports.dump = dump; + + +/***/ }), + +/***/ 7987: +/***/ ((module) => { + +"use strict"; +// YAML error class. http://stackoverflow.com/questions/8458984 +// + + + +function formatError(exception, compact) { + var where = '', message = exception.reason || '(unknown reason)'; + + if (!exception.mark) return message; + + if (exception.mark.name) { + where += 'in "' + exception.mark.name + '" '; + } + + where += '(' + (exception.mark.line + 1) + ':' + (exception.mark.column + 1) + ')'; + + if (!compact && exception.mark.snippet) { + where += '\n\n' + exception.mark.snippet; + } + + return message + ' ' + where; +} + + +function YAMLException(reason, mark) { + // Super constructor + Error.call(this); + + this.name = 'YAMLException'; + this.reason = reason; + this.mark = mark; + this.message = formatError(this, false); + + // Include stack trace in error object + if (Error.captureStackTrace) { + // Chrome and NodeJS + Error.captureStackTrace(this, this.constructor); + } else { + // FF, IE 10+ and Safari 6+. Fallback for others + this.stack = (new Error()).stack || ''; + } +} + + +// Inherit from Error +YAMLException.prototype = Object.create(Error.prototype); +YAMLException.prototype.constructor = YAMLException; + + +YAMLException.prototype.toString = function toString(compact) { + return this.name + ': ' + formatError(this, compact); +}; + + +module.exports = YAMLException; + + +/***/ }), + +/***/ 42432: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +/*eslint-disable max-len,no-use-before-define*/ + +var common = __nccwpck_require__(33198); +var YAMLException = __nccwpck_require__(7987); +var makeSnippet = __nccwpck_require__(99152); +var DEFAULT_SCHEMA = __nccwpck_require__(81448); + + +var _hasOwnProperty = Object.prototype.hasOwnProperty; + + +var CONTEXT_FLOW_IN = 1; +var CONTEXT_FLOW_OUT = 2; +var CONTEXT_BLOCK_IN = 3; +var CONTEXT_BLOCK_OUT = 4; + + +var CHOMPING_CLIP = 1; +var CHOMPING_STRIP = 2; +var CHOMPING_KEEP = 3; + + +var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; +var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; +var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; +var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; +var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; + + +function _class(obj) { return Object.prototype.toString.call(obj); } + +function is_EOL(c) { + return (c === 0x0A/* LF */) || (c === 0x0D/* CR */); +} + +function is_WHITE_SPACE(c) { + return (c === 0x09/* Tab */) || (c === 0x20/* Space */); +} + +function is_WS_OR_EOL(c) { + return (c === 0x09/* Tab */) || + (c === 0x20/* Space */) || + (c === 0x0A/* LF */) || + (c === 0x0D/* CR */); +} + +function is_FLOW_INDICATOR(c) { + return c === 0x2C/* , */ || + c === 0x5B/* [ */ || + c === 0x5D/* ] */ || + c === 0x7B/* { */ || + c === 0x7D/* } */; +} + +function fromHexCode(c) { + var lc; + + if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + return c - 0x30; + } + + /*eslint-disable no-bitwise*/ + lc = c | 0x20; + + if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { + return lc - 0x61 + 10; + } + + return -1; +} + +function escapedHexLen(c) { + if (c === 0x78/* x */) { return 2; } + if (c === 0x75/* u */) { return 4; } + if (c === 0x55/* U */) { return 8; } + return 0; +} + +function fromDecimalCode(c) { + if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + return c - 0x30; + } + + return -1; +} + +function simpleEscapeSequence(c) { + /* eslint-disable indent */ + return (c === 0x30/* 0 */) ? '\x00' : + (c === 0x61/* a */) ? '\x07' : + (c === 0x62/* b */) ? '\x08' : + (c === 0x74/* t */) ? '\x09' : + (c === 0x09/* Tab */) ? '\x09' : + (c === 0x6E/* n */) ? '\x0A' : + (c === 0x76/* v */) ? '\x0B' : + (c === 0x66/* f */) ? '\x0C' : + (c === 0x72/* r */) ? '\x0D' : + (c === 0x65/* e */) ? '\x1B' : + (c === 0x20/* Space */) ? ' ' : + (c === 0x22/* " */) ? '\x22' : + (c === 0x2F/* / */) ? '/' : + (c === 0x5C/* \ */) ? '\x5C' : + (c === 0x4E/* N */) ? '\x85' : + (c === 0x5F/* _ */) ? '\xA0' : + (c === 0x4C/* L */) ? '\u2028' : + (c === 0x50/* P */) ? '\u2029' : ''; +} + +function charFromCodepoint(c) { + if (c <= 0xFFFF) { + return String.fromCharCode(c); + } + // Encode UTF-16 surrogate pair + // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF + return String.fromCharCode( + ((c - 0x010000) >> 10) + 0xD800, + ((c - 0x010000) & 0x03FF) + 0xDC00 + ); +} + +var simpleEscapeCheck = new Array(256); // integer, for fast access +var simpleEscapeMap = new Array(256); +for (var i = 0; i < 256; i++) { + simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; + simpleEscapeMap[i] = simpleEscapeSequence(i); +} + + +function State(input, options) { + this.input = input; + + this.filename = options['filename'] || null; + this.schema = options['schema'] || DEFAULT_SCHEMA; + this.onWarning = options['onWarning'] || null; + // (Hidden) Remove? makes the loader to expect YAML 1.1 documents + // if such documents have no explicit %YAML directive + this.legacy = options['legacy'] || false; + + this.json = options['json'] || false; + this.listener = options['listener'] || null; + + this.implicitTypes = this.schema.compiledImplicit; + this.typeMap = this.schema.compiledTypeMap; + + this.length = input.length; + this.position = 0; + this.line = 0; + this.lineStart = 0; + this.lineIndent = 0; + + // position of first leading tab in the current line, + // used to make sure there are no tabs in the indentation + this.firstTabInLine = -1; + + this.documents = []; + + /* + this.version; + this.checkLineBreaks; + this.tagMap; + this.anchorMap; + this.tag; + this.anchor; + this.kind; + this.result;*/ + +} + + +function generateError(state, message) { + var mark = { + name: state.filename, + buffer: state.input.slice(0, -1), // omit trailing \0 + position: state.position, + line: state.line, + column: state.position - state.lineStart + }; + + mark.snippet = makeSnippet(mark); + + return new YAMLException(message, mark); +} + +function throwError(state, message) { + throw generateError(state, message); +} + +function throwWarning(state, message) { + if (state.onWarning) { + state.onWarning.call(null, generateError(state, message)); + } +} + + +var directiveHandlers = { + + YAML: function handleYamlDirective(state, name, args) { + + var match, major, minor; + + if (state.version !== null) { + throwError(state, 'duplication of %YAML directive'); + } + + if (args.length !== 1) { + throwError(state, 'YAML directive accepts exactly one argument'); + } + + match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); + + if (match === null) { + throwError(state, 'ill-formed argument of the YAML directive'); + } + + major = parseInt(match[1], 10); + minor = parseInt(match[2], 10); + + if (major !== 1) { + throwError(state, 'unacceptable YAML version of the document'); + } + + state.version = args[0]; + state.checkLineBreaks = (minor < 2); + + if (minor !== 1 && minor !== 2) { + throwWarning(state, 'unsupported YAML version of the document'); + } + }, + + TAG: function handleTagDirective(state, name, args) { + + var handle, prefix; + + if (args.length !== 2) { + throwError(state, 'TAG directive accepts exactly two arguments'); + } + + handle = args[0]; + prefix = args[1]; + + if (!PATTERN_TAG_HANDLE.test(handle)) { + throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); + } + + if (_hasOwnProperty.call(state.tagMap, handle)) { + throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); + } + + if (!PATTERN_TAG_URI.test(prefix)) { + throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); + } + + try { + prefix = decodeURIComponent(prefix); + } catch (err) { + throwError(state, 'tag prefix is malformed: ' + prefix); + } + + state.tagMap[handle] = prefix; + } +}; + + +function captureSegment(state, start, end, checkJson) { + var _position, _length, _character, _result; + + if (start < end) { + _result = state.input.slice(start, end); + + if (checkJson) { + for (_position = 0, _length = _result.length; _position < _length; _position += 1) { + _character = _result.charCodeAt(_position); + if (!(_character === 0x09 || + (0x20 <= _character && _character <= 0x10FFFF))) { + throwError(state, 'expected valid JSON character'); + } + } + } else if (PATTERN_NON_PRINTABLE.test(_result)) { + throwError(state, 'the stream contains non-printable characters'); + } + + state.result += _result; + } +} + +function mergeMappings(state, destination, source, overridableKeys) { + var sourceKeys, key, index, quantity; + + if (!common.isObject(source)) { + throwError(state, 'cannot merge mappings; the provided source object is unacceptable'); + } + + sourceKeys = Object.keys(source); + + for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { + key = sourceKeys[index]; + + if (!_hasOwnProperty.call(destination, key)) { + destination[key] = source[key]; + overridableKeys[key] = true; + } + } +} + +function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, + startLine, startLineStart, startPos) { + + var index, quantity; + + // The output is a plain object here, so keys can only be strings. + // We need to convert keyNode to a string, but doing so can hang the process + // (deeply nested arrays that explode exponentially using aliases). + if (Array.isArray(keyNode)) { + keyNode = Array.prototype.slice.call(keyNode); + + for (index = 0, quantity = keyNode.length; index < quantity; index += 1) { + if (Array.isArray(keyNode[index])) { + throwError(state, 'nested arrays are not supported inside keys'); + } + + if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') { + keyNode[index] = '[object Object]'; + } + } + } + + // Avoid code execution in load() via toString property + // (still use its own toString for arrays, timestamps, + // and whatever user schema extensions happen to have @@toStringTag) + if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') { + keyNode = '[object Object]'; + } + + + keyNode = String(keyNode); + + if (_result === null) { + _result = {}; + } + + if (keyTag === 'tag:yaml.org,2002:merge') { + if (Array.isArray(valueNode)) { + for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { + mergeMappings(state, _result, valueNode[index], overridableKeys); + } + } else { + mergeMappings(state, _result, valueNode, overridableKeys); + } + } else { + if (!state.json && + !_hasOwnProperty.call(overridableKeys, keyNode) && + _hasOwnProperty.call(_result, keyNode)) { + state.line = startLine || state.line; + state.lineStart = startLineStart || state.lineStart; + state.position = startPos || state.position; + throwError(state, 'duplicated mapping key'); + } + + // used for this specific key only because Object.defineProperty is slow + if (keyNode === '__proto__') { + Object.defineProperty(_result, keyNode, { + configurable: true, + enumerable: true, + writable: true, + value: valueNode + }); + } else { + _result[keyNode] = valueNode; + } + delete overridableKeys[keyNode]; + } + + return _result; +} + +function readLineBreak(state) { + var ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x0A/* LF */) { + state.position++; + } else if (ch === 0x0D/* CR */) { + state.position++; + if (state.input.charCodeAt(state.position) === 0x0A/* LF */) { + state.position++; + } + } else { + throwError(state, 'a line break is expected'); + } + + state.line += 1; + state.lineStart = state.position; + state.firstTabInLine = -1; +} + +function skipSeparationSpace(state, allowComments, checkIndent) { + var lineBreaks = 0, + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) { + state.firstTabInLine = state.position; + } + ch = state.input.charCodeAt(++state.position); + } + + if (allowComments && ch === 0x23/* # */) { + do { + ch = state.input.charCodeAt(++state.position); + } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0); + } + + if (is_EOL(ch)) { + readLineBreak(state); + + ch = state.input.charCodeAt(state.position); + lineBreaks++; + state.lineIndent = 0; + + while (ch === 0x20/* Space */) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + } else { + break; + } + } + + if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { + throwWarning(state, 'deficient indentation'); + } + + return lineBreaks; +} + +function testDocumentSeparator(state) { + var _position = state.position, + ch; + + ch = state.input.charCodeAt(_position); + + // Condition state.position === state.lineStart is tested + // in parent on each call, for efficiency. No needs to test here again. + if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) && + ch === state.input.charCodeAt(_position + 1) && + ch === state.input.charCodeAt(_position + 2)) { + + _position += 3; + + ch = state.input.charCodeAt(_position); + + if (ch === 0 || is_WS_OR_EOL(ch)) { + return true; + } + } + + return false; +} + +function writeFoldedLines(state, count) { + if (count === 1) { + state.result += ' '; + } else if (count > 1) { + state.result += common.repeat('\n', count - 1); + } +} + + +function readPlainScalar(state, nodeIndent, withinFlowCollection) { + var preceding, + following, + captureStart, + captureEnd, + hasPendingContent, + _line, + _lineStart, + _lineIndent, + _kind = state.kind, + _result = state.result, + ch; + + ch = state.input.charCodeAt(state.position); + + if (is_WS_OR_EOL(ch) || + is_FLOW_INDICATOR(ch) || + ch === 0x23/* # */ || + ch === 0x26/* & */ || + ch === 0x2A/* * */ || + ch === 0x21/* ! */ || + ch === 0x7C/* | */ || + ch === 0x3E/* > */ || + ch === 0x27/* ' */ || + ch === 0x22/* " */ || + ch === 0x25/* % */ || + ch === 0x40/* @ */ || + ch === 0x60/* ` */) { + return false; + } + + if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following) || + withinFlowCollection && is_FLOW_INDICATOR(following)) { + return false; + } + } + + state.kind = 'scalar'; + state.result = ''; + captureStart = captureEnd = state.position; + hasPendingContent = false; + + while (ch !== 0) { + if (ch === 0x3A/* : */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following) || + withinFlowCollection && is_FLOW_INDICATOR(following)) { + break; + } + + } else if (ch === 0x23/* # */) { + preceding = state.input.charCodeAt(state.position - 1); + + if (is_WS_OR_EOL(preceding)) { + break; + } + + } else if ((state.position === state.lineStart && testDocumentSeparator(state)) || + withinFlowCollection && is_FLOW_INDICATOR(ch)) { + break; + + } else if (is_EOL(ch)) { + _line = state.line; + _lineStart = state.lineStart; + _lineIndent = state.lineIndent; + skipSeparationSpace(state, false, -1); + + if (state.lineIndent >= nodeIndent) { + hasPendingContent = true; + ch = state.input.charCodeAt(state.position); + continue; + } else { + state.position = captureEnd; + state.line = _line; + state.lineStart = _lineStart; + state.lineIndent = _lineIndent; + break; + } + } + + if (hasPendingContent) { + captureSegment(state, captureStart, captureEnd, false); + writeFoldedLines(state, state.line - _line); + captureStart = captureEnd = state.position; + hasPendingContent = false; + } + + if (!is_WHITE_SPACE(ch)) { + captureEnd = state.position + 1; + } + + ch = state.input.charCodeAt(++state.position); + } + + captureSegment(state, captureStart, captureEnd, false); + + if (state.result) { + return true; + } + + state.kind = _kind; + state.result = _result; + return false; +} + +function readSingleQuotedScalar(state, nodeIndent) { + var ch, + captureStart, captureEnd; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x27/* ' */) { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x27/* ' */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x27/* ' */) { + captureStart = state.position; + state.position++; + captureEnd = state.position; + } else { + return true; + } + + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, 'unexpected end of the document within a single quoted scalar'); + + } else { + state.position++; + captureEnd = state.position; + } + } + + throwError(state, 'unexpected end of the stream within a single quoted scalar'); +} + +function readDoubleQuotedScalar(state, nodeIndent) { + var captureStart, + captureEnd, + hexLength, + hexResult, + tmp, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x22/* " */) { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x22/* " */) { + captureSegment(state, captureStart, state.position, true); + state.position++; + return true; + + } else if (ch === 0x5C/* \ */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + + if (is_EOL(ch)) { + skipSeparationSpace(state, false, nodeIndent); + + // TODO: rework to inline fn with no type cast? + } else if (ch < 256 && simpleEscapeCheck[ch]) { + state.result += simpleEscapeMap[ch]; + state.position++; + + } else if ((tmp = escapedHexLen(ch)) > 0) { + hexLength = tmp; + hexResult = 0; + + for (; hexLength > 0; hexLength--) { + ch = state.input.charCodeAt(++state.position); + + if ((tmp = fromHexCode(ch)) >= 0) { + hexResult = (hexResult << 4) + tmp; + + } else { + throwError(state, 'expected hexadecimal character'); + } + } + + state.result += charFromCodepoint(hexResult); + + state.position++; + + } else { + throwError(state, 'unknown escape sequence'); + } + + captureStart = captureEnd = state.position; + + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, 'unexpected end of the document within a double quoted scalar'); + + } else { + state.position++; + captureEnd = state.position; + } + } + + throwError(state, 'unexpected end of the stream within a double quoted scalar'); +} + +function readFlowCollection(state, nodeIndent) { + var readNext = true, + _line, + _lineStart, + _pos, + _tag = state.tag, + _result, + _anchor = state.anchor, + following, + terminator, + isPair, + isExplicitPair, + isMapping, + overridableKeys = Object.create(null), + keyNode, + keyTag, + valueNode, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x5B/* [ */) { + terminator = 0x5D;/* ] */ + isMapping = false; + _result = []; + } else if (ch === 0x7B/* { */) { + terminator = 0x7D;/* } */ + isMapping = true; + _result = {}; + } else { + return false; + } + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(++state.position); + + while (ch !== 0) { + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if (ch === terminator) { + state.position++; + state.tag = _tag; + state.anchor = _anchor; + state.kind = isMapping ? 'mapping' : 'sequence'; + state.result = _result; + return true; + } else if (!readNext) { + throwError(state, 'missed comma between flow collection entries'); + } else if (ch === 0x2C/* , */) { + // "flow collection entries can never be completely empty", as per YAML 1.2, section 7.4 + throwError(state, "expected the node content, but found ','"); + } + + keyTag = keyNode = valueNode = null; + isPair = isExplicitPair = false; + + if (ch === 0x3F/* ? */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following)) { + isPair = isExplicitPair = true; + state.position++; + skipSeparationSpace(state, true, nodeIndent); + } + } + + _line = state.line; // Save the current line. + _lineStart = state.lineStart; + _pos = state.position; + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + keyTag = state.tag; + keyNode = state.result; + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) { + isPair = true; + ch = state.input.charCodeAt(++state.position); + skipSeparationSpace(state, true, nodeIndent); + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + valueNode = state.result; + } + + if (isMapping) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos); + } else if (isPair) { + _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos)); + } else { + _result.push(keyNode); + } + + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x2C/* , */) { + readNext = true; + ch = state.input.charCodeAt(++state.position); + } else { + readNext = false; + } + } + + throwError(state, 'unexpected end of the stream within a flow collection'); +} + +function readBlockScalar(state, nodeIndent) { + var captureStart, + folding, + chomping = CHOMPING_CLIP, + didReadContent = false, + detectedIndent = false, + textIndent = nodeIndent, + emptyLines = 0, + atMoreIndented = false, + tmp, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x7C/* | */) { + folding = false; + } else if (ch === 0x3E/* > */) { + folding = true; + } else { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + + while (ch !== 0) { + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x2B/* + */ || ch === 0x2D/* - */) { + if (CHOMPING_CLIP === chomping) { + chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP; + } else { + throwError(state, 'repeat of a chomping mode identifier'); + } + + } else if ((tmp = fromDecimalCode(ch)) >= 0) { + if (tmp === 0) { + throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one'); + } else if (!detectedIndent) { + textIndent = nodeIndent + tmp - 1; + detectedIndent = true; + } else { + throwError(state, 'repeat of an indentation width identifier'); + } + + } else { + break; + } + } + + if (is_WHITE_SPACE(ch)) { + do { ch = state.input.charCodeAt(++state.position); } + while (is_WHITE_SPACE(ch)); + + if (ch === 0x23/* # */) { + do { ch = state.input.charCodeAt(++state.position); } + while (!is_EOL(ch) && (ch !== 0)); + } + } + + while (ch !== 0) { + readLineBreak(state); + state.lineIndent = 0; + + ch = state.input.charCodeAt(state.position); + + while ((!detectedIndent || state.lineIndent < textIndent) && + (ch === 0x20/* Space */)) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + + if (!detectedIndent && state.lineIndent > textIndent) { + textIndent = state.lineIndent; + } + + if (is_EOL(ch)) { + emptyLines++; + continue; + } + + // End of the scalar. + if (state.lineIndent < textIndent) { + + // Perform the chomping. + if (chomping === CHOMPING_KEEP) { + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + } else if (chomping === CHOMPING_CLIP) { + if (didReadContent) { // i.e. only if the scalar is not empty. + state.result += '\n'; + } + } + + // Break this `while` cycle and go to the funciton's epilogue. + break; + } + + // Folded style: use fancy rules to handle line breaks. + if (folding) { + + // Lines starting with white space characters (more-indented lines) are not folded. + if (is_WHITE_SPACE(ch)) { + atMoreIndented = true; + // except for the first content line (cf. Example 8.1) + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + + // End of more-indented block. + } else if (atMoreIndented) { + atMoreIndented = false; + state.result += common.repeat('\n', emptyLines + 1); + + // Just one line break - perceive as the same line. + } else if (emptyLines === 0) { + if (didReadContent) { // i.e. only if we have already read some scalar content. + state.result += ' '; + } + + // Several line breaks - perceive as different lines. + } else { + state.result += common.repeat('\n', emptyLines); + } + + // Literal style: just add exact number of line breaks between content lines. + } else { + // Keep all line breaks except the header line break. + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + } + + didReadContent = true; + detectedIndent = true; + emptyLines = 0; + captureStart = state.position; + + while (!is_EOL(ch) && (ch !== 0)) { + ch = state.input.charCodeAt(++state.position); + } + + captureSegment(state, captureStart, state.position, false); + } + + return true; +} + +function readBlockSequence(state, nodeIndent) { + var _line, + _tag = state.tag, + _anchor = state.anchor, + _result = [], + following, + detected = false, + ch; + + // there is a leading tab before this token, so it can't be a block sequence/mapping; + // it can still be flow sequence/mapping or a scalar + if (state.firstTabInLine !== -1) return false; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + if (state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, 'tab characters must not be used in indentation'); + } + + if (ch !== 0x2D/* - */) { + break; + } + + following = state.input.charCodeAt(state.position + 1); + + if (!is_WS_OR_EOL(following)) { + break; + } + + detected = true; + state.position++; + + if (skipSeparationSpace(state, true, -1)) { + if (state.lineIndent <= nodeIndent) { + _result.push(null); + ch = state.input.charCodeAt(state.position); + continue; + } + } + + _line = state.line; + composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); + _result.push(state.result); + skipSeparationSpace(state, true, -1); + + ch = state.input.charCodeAt(state.position); + + if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { + throwError(state, 'bad indentation of a sequence entry'); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = 'sequence'; + state.result = _result; + return true; + } + return false; +} + +function readBlockMapping(state, nodeIndent, flowIndent) { + var following, + allowCompact, + _line, + _keyLine, + _keyLineStart, + _keyPos, + _tag = state.tag, + _anchor = state.anchor, + _result = {}, + overridableKeys = Object.create(null), + keyTag = null, + keyNode = null, + valueNode = null, + atExplicitKey = false, + detected = false, + ch; + + // there is a leading tab before this token, so it can't be a block sequence/mapping; + // it can still be flow sequence/mapping or a scalar + if (state.firstTabInLine !== -1) return false; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + if (!atExplicitKey && state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, 'tab characters must not be used in indentation'); + } + + following = state.input.charCodeAt(state.position + 1); + _line = state.line; // Save the current line. + + // + // Explicit notation case. There are two separate blocks: + // first for the key (denoted by "?") and second for the value (denoted by ":") + // + if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) { + + if (ch === 0x3F/* ? */) { + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + + detected = true; + atExplicitKey = true; + allowCompact = true; + + } else if (atExplicitKey) { + // i.e. 0x3A/* : */ === character after the explicit key. + atExplicitKey = false; + allowCompact = true; + + } else { + throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line'); + } + + state.position += 1; + ch = following; + + // + // Implicit notation case. Flow-style node as the key first, then ":", and the value. + // + } else { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + + if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { + // Neither implicit nor explicit notation. + // Reading is done. Go to the epilogue. + break; + } + + if (state.line === _line) { + ch = state.input.charCodeAt(state.position); + + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (ch === 0x3A/* : */) { + ch = state.input.charCodeAt(++state.position); + + if (!is_WS_OR_EOL(ch)) { + throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping'); + } + + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + + detected = true; + atExplicitKey = false; + allowCompact = false; + keyTag = state.tag; + keyNode = state.result; + + } else if (detected) { + throwError(state, 'can not read an implicit mapping pair; a colon is missed'); + + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; // Keep the result of `composeNode`. + } + + } else if (detected) { + throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); + + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; // Keep the result of `composeNode`. + } + } + + // + // Common reading code for both explicit and implicit notations. + // + if (state.line === _line || state.lineIndent > nodeIndent) { + if (atExplicitKey) { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + } + + if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { + if (atExplicitKey) { + keyNode = state.result; + } else { + valueNode = state.result; + } + } + + if (!atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + + skipSeparationSpace(state, true, -1); + ch = state.input.charCodeAt(state.position); + } + + if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { + throwError(state, 'bad indentation of a mapping entry'); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + + // + // Epilogue. + // + + // Special case: last mapping's node contains only the key in explicit notation. + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + } + + // Expose the resulting mapping. + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = 'mapping'; + state.result = _result; + } + + return detected; +} + +function readTagProperty(state) { + var _position, + isVerbatim = false, + isNamed = false, + tagHandle, + tagName, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x21/* ! */) return false; + + if (state.tag !== null) { + throwError(state, 'duplication of a tag property'); + } + + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x3C/* < */) { + isVerbatim = true; + ch = state.input.charCodeAt(++state.position); + + } else if (ch === 0x21/* ! */) { + isNamed = true; + tagHandle = '!!'; + ch = state.input.charCodeAt(++state.position); + + } else { + tagHandle = '!'; + } + + _position = state.position; + + if (isVerbatim) { + do { ch = state.input.charCodeAt(++state.position); } + while (ch !== 0 && ch !== 0x3E/* > */); + + if (state.position < state.length) { + tagName = state.input.slice(_position, state.position); + ch = state.input.charCodeAt(++state.position); + } else { + throwError(state, 'unexpected end of the stream within a verbatim tag'); + } + } else { + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + + if (ch === 0x21/* ! */) { + if (!isNamed) { + tagHandle = state.input.slice(_position - 1, state.position + 1); + + if (!PATTERN_TAG_HANDLE.test(tagHandle)) { + throwError(state, 'named tag handle cannot contain such characters'); + } + + isNamed = true; + _position = state.position + 1; + } else { + throwError(state, 'tag suffix cannot contain exclamation marks'); + } + } + + ch = state.input.charCodeAt(++state.position); + } + + tagName = state.input.slice(_position, state.position); + + if (PATTERN_FLOW_INDICATORS.test(tagName)) { + throwError(state, 'tag suffix cannot contain flow indicator characters'); + } + } + + if (tagName && !PATTERN_TAG_URI.test(tagName)) { + throwError(state, 'tag name cannot contain such characters: ' + tagName); + } + + try { + tagName = decodeURIComponent(tagName); + } catch (err) { + throwError(state, 'tag name is malformed: ' + tagName); + } + + if (isVerbatim) { + state.tag = tagName; + + } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) { + state.tag = state.tagMap[tagHandle] + tagName; + + } else if (tagHandle === '!') { + state.tag = '!' + tagName; + + } else if (tagHandle === '!!') { + state.tag = 'tag:yaml.org,2002:' + tagName; + + } else { + throwError(state, 'undeclared tag handle "' + tagHandle + '"'); + } + + return true; +} + +function readAnchorProperty(state) { + var _position, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x26/* & */) return false; + + if (state.anchor !== null) { + throwError(state, 'duplication of an anchor property'); + } + + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (state.position === _position) { + throwError(state, 'name of an anchor node must contain at least one character'); + } + + state.anchor = state.input.slice(_position, state.position); + return true; +} + +function readAlias(state) { + var _position, alias, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x2A/* * */) return false; + + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (state.position === _position) { + throwError(state, 'name of an alias node must contain at least one character'); + } + + alias = state.input.slice(_position, state.position); + + if (!_hasOwnProperty.call(state.anchorMap, alias)) { + throwError(state, 'unidentified alias "' + alias + '"'); + } + + state.result = state.anchorMap[alias]; + skipSeparationSpace(state, true, -1); + return true; +} + +function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { + var allowBlockStyles, + allowBlockScalars, + allowBlockCollections, + indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } + } + + if (indentStatus === 1) { + while (readTagProperty(state) || readAnchorProperty(state)) { + if (skipSeparationSpace(state, true, -1)) { + atNewLine = true; + allowBlockCollections = allowBlockStyles; + + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } else { + allowBlockCollections = false; + } + } + } + + if (allowBlockCollections) { + allowBlockCollections = atNewLine || allowCompact; + } + + if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { + if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { + flowIndent = parentIndent; + } else { + flowIndent = parentIndent + 1; + } + + blockIndent = state.position - state.lineStart; + + if (indentStatus === 1) { + if (allowBlockCollections && + (readBlockSequence(state, blockIndent) || + readBlockMapping(state, blockIndent, flowIndent)) || + readFlowCollection(state, flowIndent)) { + hasContent = true; + } else { + if ((allowBlockScalars && readBlockScalar(state, flowIndent)) || + readSingleQuotedScalar(state, flowIndent) || + readDoubleQuotedScalar(state, flowIndent)) { + hasContent = true; + + } else if (readAlias(state)) { + hasContent = true; + + if (state.tag !== null || state.anchor !== null) { + throwError(state, 'alias node should not have any properties'); + } + + } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { + hasContent = true; + + if (state.tag === null) { + state.tag = '?'; + } + } + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } else if (indentStatus === 0) { + // Special case: block sequences are allowed to have same indentation level as the parent. + // http://www.yaml.org/spec/1.2/spec.html#id2799784 + hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); + } + } + + if (state.tag === null) { + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + + } else if (state.tag === '?') { + // Implicit resolving is not allowed for non-scalar types, and '?' + // non-specific tag is only automatically assigned to plain scalars. + // + // We only need to check kind conformity in case user explicitly assigns '?' + // tag, for example like this: "! [0]" + // + if (state.result !== null && state.kind !== 'scalar') { + throwError(state, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state.kind + '"'); + } + + for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { + type = state.implicitTypes[typeIndex]; + + if (type.resolve(state.result)) { // `state.result` updated in resolver if matched + state.result = type.construct(state.result); + state.tag = type.tag; + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + break; + } + } + } else if (state.tag !== '!') { + if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) { + type = state.typeMap[state.kind || 'fallback'][state.tag]; + } else { + // looking for multi type + type = null; + typeList = state.typeMap.multi[state.kind || 'fallback']; + + for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) { + if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) { + type = typeList[typeIndex]; + break; + } + } + } + + if (!type) { + throwError(state, 'unknown tag !<' + state.tag + '>'); + } + + if (state.result !== null && type.kind !== state.kind) { + throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); + } + + if (!type.resolve(state.result, state.tag)) { // `state.result` updated in resolver if matched + throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); + } else { + state.result = type.construct(state.result, state.tag); + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } + + if (state.listener !== null) { + state.listener('close', state); + } + return state.tag !== null || state.anchor !== null || hasContent; +} + +function readDocument(state) { + var documentStart = state.position, + _position, + directiveName, + directiveArgs, + hasDirectives = false, + ch; + + state.version = null; + state.checkLineBreaks = state.legacy; + state.tagMap = Object.create(null); + state.anchorMap = Object.create(null); + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + skipSeparationSpace(state, true, -1); + + ch = state.input.charCodeAt(state.position); + + if (state.lineIndent > 0 || ch !== 0x25/* % */) { + break; + } + + hasDirectives = true; + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + directiveName = state.input.slice(_position, state.position); + directiveArgs = []; + + if (directiveName.length < 1) { + throwError(state, 'directive name must not be less than one character in length'); + } + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (ch === 0x23/* # */) { + do { ch = state.input.charCodeAt(++state.position); } + while (ch !== 0 && !is_EOL(ch)); + break; + } + + if (is_EOL(ch)) break; + + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + directiveArgs.push(state.input.slice(_position, state.position)); + } + + if (ch !== 0) readLineBreak(state); + + if (_hasOwnProperty.call(directiveHandlers, directiveName)) { + directiveHandlers[directiveName](state, directiveName, directiveArgs); + } else { + throwWarning(state, 'unknown document directive "' + directiveName + '"'); + } + } + + skipSeparationSpace(state, true, -1); + + if (state.lineIndent === 0 && + state.input.charCodeAt(state.position) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 1) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 2) === 0x2D/* - */) { + state.position += 3; + skipSeparationSpace(state, true, -1); + + } else if (hasDirectives) { + throwError(state, 'directives end mark is expected'); + } + + composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); + skipSeparationSpace(state, true, -1); + + if (state.checkLineBreaks && + PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { + throwWarning(state, 'non-ASCII line breaks are interpreted as content'); + } + + state.documents.push(state.result); + + if (state.position === state.lineStart && testDocumentSeparator(state)) { + + if (state.input.charCodeAt(state.position) === 0x2E/* . */) { + state.position += 3; + skipSeparationSpace(state, true, -1); + } + return; + } + + if (state.position < (state.length - 1)) { + throwError(state, 'end of the stream or a document separator is expected'); + } else { + return; + } +} + + +function loadDocuments(input, options) { + input = String(input); + options = options || {}; + + if (input.length !== 0) { + + // Add tailing `\n` if not exists + if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ && + input.charCodeAt(input.length - 1) !== 0x0D/* CR */) { + input += '\n'; + } + + // Strip BOM + if (input.charCodeAt(0) === 0xFEFF) { + input = input.slice(1); + } + } + + var state = new State(input, options); + + var nullpos = input.indexOf('\0'); + + if (nullpos !== -1) { + state.position = nullpos; + throwError(state, 'null byte is not allowed in input'); + } + + // Use 0 as string terminator. That significantly simplifies bounds check. + state.input += '\0'; + + while (state.input.charCodeAt(state.position) === 0x20/* Space */) { + state.lineIndent += 1; + state.position += 1; + } + + while (state.position < (state.length - 1)) { + readDocument(state); + } + + return state.documents; +} + + +function loadAll(input, iterator, options) { + if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') { + options = iterator; + iterator = null; + } + + var documents = loadDocuments(input, options); + + if (typeof iterator !== 'function') { + return documents; + } + + for (var index = 0, length = documents.length; index < length; index += 1) { + iterator(documents[index]); + } +} + + +function load(input, options) { + var documents = loadDocuments(input, options); + + if (documents.length === 0) { + /*eslint-disable no-undefined*/ + return undefined; + } else if (documents.length === 1) { + return documents[0]; + } + throw new YAMLException('expected a single document in the stream, but found more'); +} + + +module.exports.loadAll = loadAll; +module.exports.load = load; + + +/***/ }), + +/***/ 78583: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +/*eslint-disable max-len*/ + +var YAMLException = __nccwpck_require__(7987); +var Type = __nccwpck_require__(63820); + + +function compileList(schema, name) { + var result = []; + + schema[name].forEach(function (currentType) { + var newIndex = result.length; + + result.forEach(function (previousType, previousIndex) { + if (previousType.tag === currentType.tag && + previousType.kind === currentType.kind && + previousType.multi === currentType.multi) { + + newIndex = previousIndex; + } + }); + + result[newIndex] = currentType; + }); + + return result; +} + + +function compileMap(/* lists... */) { + var result = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {}, + multi: { + scalar: [], + sequence: [], + mapping: [], + fallback: [] + } + }, index, length; + + function collectType(type) { + if (type.multi) { + result.multi[type.kind].push(type); + result.multi['fallback'].push(type); + } else { + result[type.kind][type.tag] = result['fallback'][type.tag] = type; + } + } + + for (index = 0, length = arguments.length; index < length; index += 1) { + arguments[index].forEach(collectType); + } + return result; +} + + +function Schema(definition) { + return this.extend(definition); +} + + +Schema.prototype.extend = function extend(definition) { + var implicit = []; + var explicit = []; + + if (definition instanceof Type) { + // Schema.extend(type) + explicit.push(definition); + + } else if (Array.isArray(definition)) { + // Schema.extend([ type1, type2, ... ]) + explicit = explicit.concat(definition); + + } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) { + // Schema.extend({ explicit: [ type1, type2, ... ], implicit: [ type1, type2, ... ] }) + if (definition.implicit) implicit = implicit.concat(definition.implicit); + if (definition.explicit) explicit = explicit.concat(definition.explicit); + + } else { + throw new YAMLException('Schema.extend argument should be a Type, [ Type ], ' + + 'or a schema definition ({ implicit: [...], explicit: [...] })'); + } + + implicit.forEach(function (type) { + if (!(type instanceof Type)) { + throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + + if (type.loadKind && type.loadKind !== 'scalar') { + throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); + } + + if (type.multi) { + throw new YAMLException('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.'); + } + }); + + explicit.forEach(function (type) { + if (!(type instanceof Type)) { + throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + }); + + var result = Object.create(Schema.prototype); + + result.implicit = (this.implicit || []).concat(implicit); + result.explicit = (this.explicit || []).concat(explicit); + + result.compiledImplicit = compileList(result, 'implicit'); + result.compiledExplicit = compileList(result, 'explicit'); + result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit); + + return result; +}; + + +module.exports = Schema; + + +/***/ }), + +/***/ 84030: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// Standard YAML's Core schema. +// http://www.yaml.org/spec/1.2/spec.html#id2804923 +// +// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. +// So, Core schema has no distinctions from JSON schema is JS-YAML. + + + + + +module.exports = __nccwpck_require__(9531); + + +/***/ }), + +/***/ 81448: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// JS-YAML's default schema for `safeLoad` function. +// It is not described in the YAML specification. +// +// This schema is based on standard YAML's Core schema and includes most of +// extra types described at YAML tag repository. (http://yaml.org/type/) + + + + + +module.exports = (__nccwpck_require__(84030).extend)({ + implicit: [ + __nccwpck_require__(65821), + __nccwpck_require__(50718) + ], + explicit: [ + __nccwpck_require__(27731), + __nccwpck_require__(40564), + __nccwpck_require__(61589), + __nccwpck_require__(80986) + ] +}); + + +/***/ }), + +/***/ 59056: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// Standard YAML's Failsafe schema. +// http://www.yaml.org/spec/1.2/spec.html#id2802346 + + + + + +var Schema = __nccwpck_require__(78583); + + +module.exports = new Schema({ + explicit: [ + __nccwpck_require__(98225), + __nccwpck_require__(37331), + __nccwpck_require__(23412) + ] +}); + + +/***/ }), + +/***/ 9531: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// Standard YAML's JSON schema. +// http://www.yaml.org/spec/1.2/spec.html#id2803231 +// +// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. +// So, this schema is not such strict as defined in the YAML specification. +// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc. + + + + + +module.exports = (__nccwpck_require__(59056).extend)({ + implicit: [ + __nccwpck_require__(21471), + __nccwpck_require__(18769), + __nccwpck_require__(58884), + __nccwpck_require__(68155) + ] +}); + + +/***/ }), + +/***/ 99152: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + + +var common = __nccwpck_require__(33198); + + +// get snippet for a single line, respecting maxLength +function getLine(buffer, lineStart, lineEnd, position, maxLineLength) { + var head = ''; + var tail = ''; + var maxHalfLength = Math.floor(maxLineLength / 2) - 1; + + if (position - lineStart > maxHalfLength) { + head = ' ... '; + lineStart = position - maxHalfLength + head.length; + } + + if (lineEnd - position > maxHalfLength) { + tail = ' ...'; + lineEnd = position + maxHalfLength - tail.length; + } + + return { + str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, '→') + tail, + pos: position - lineStart + head.length // relative position + }; +} + + +function padStart(string, max) { + return common.repeat(' ', max - string.length) + string; +} + + +function makeSnippet(mark, options) { + options = Object.create(options || null); + + if (!mark.buffer) return null; + + if (!options.maxLength) options.maxLength = 79; + if (typeof options.indent !== 'number') options.indent = 1; + if (typeof options.linesBefore !== 'number') options.linesBefore = 3; + if (typeof options.linesAfter !== 'number') options.linesAfter = 2; + + var re = /\r?\n|\r|\0/g; + var lineStarts = [ 0 ]; + var lineEnds = []; + var match; + var foundLineNo = -1; + + while ((match = re.exec(mark.buffer))) { + lineEnds.push(match.index); + lineStarts.push(match.index + match[0].length); + + if (mark.position <= match.index && foundLineNo < 0) { + foundLineNo = lineStarts.length - 2; + } + } + + if (foundLineNo < 0) foundLineNo = lineStarts.length - 1; + + var result = '', i, line; + var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length; + var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3); + + for (i = 1; i <= options.linesBefore; i++) { + if (foundLineNo - i < 0) break; + line = getLine( + mark.buffer, + lineStarts[foundLineNo - i], + lineEnds[foundLineNo - i], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), + maxLineLength + ); + result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n' + result; + } + + line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength); + result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n'; + result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + '^' + '\n'; + + for (i = 1; i <= options.linesAfter; i++) { + if (foundLineNo + i >= lineEnds.length) break; + line = getLine( + mark.buffer, + lineStarts[foundLineNo + i], + lineEnds[foundLineNo + i], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), + maxLineLength + ); + result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n'; + } + + return result.replace(/\n$/, ''); +} + + +module.exports = makeSnippet; + + +/***/ }), + +/***/ 63820: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var YAMLException = __nccwpck_require__(7987); + +var TYPE_CONSTRUCTOR_OPTIONS = [ + 'kind', + 'multi', + 'resolve', + 'construct', + 'instanceOf', + 'predicate', + 'represent', + 'representName', + 'defaultStyle', + 'styleAliases' +]; + +var YAML_NODE_KINDS = [ + 'scalar', + 'sequence', + 'mapping' +]; + +function compileStyleAliases(map) { + var result = {}; + + if (map !== null) { + Object.keys(map).forEach(function (style) { + map[style].forEach(function (alias) { + result[String(alias)] = style; + }); + }); + } + + return result; +} + +function Type(tag, options) { + options = options || {}; + + Object.keys(options).forEach(function (name) { + if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { + throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); + } + }); + + // TODO: Add tag format check. + this.options = options; // keep original options in case user wants to extend this type later + this.tag = tag; + this.kind = options['kind'] || null; + this.resolve = options['resolve'] || function () { return true; }; + this.construct = options['construct'] || function (data) { return data; }; + this.instanceOf = options['instanceOf'] || null; + this.predicate = options['predicate'] || null; + this.represent = options['represent'] || null; + this.representName = options['representName'] || null; + this.defaultStyle = options['defaultStyle'] || null; + this.multi = options['multi'] || false; + this.styleAliases = compileStyleAliases(options['styleAliases'] || null); + + if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { + throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); + } +} + +module.exports = Type; + + +/***/ }), + +/***/ 27731: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +/*eslint-disable no-bitwise*/ + + +var Type = __nccwpck_require__(63820); + + +// [ 64, 65, 66 ] -> [ padding, CR, LF ] +var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'; + + +function resolveYamlBinary(data) { + if (data === null) return false; + + var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; + + // Convert one by one. + for (idx = 0; idx < max; idx++) { + code = map.indexOf(data.charAt(idx)); + + // Skip CR/LF + if (code > 64) continue; + + // Fail on illegal characters + if (code < 0) return false; + + bitlen += 6; + } + + // If there are any bits left, source was corrupted + return (bitlen % 8) === 0; +} + +function constructYamlBinary(data) { + var idx, tailbits, + input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan + max = input.length, + map = BASE64_MAP, + bits = 0, + result = []; + + // Collect by 6*4 bits (3 bytes) + + for (idx = 0; idx < max; idx++) { + if ((idx % 4 === 0) && idx) { + result.push((bits >> 16) & 0xFF); + result.push((bits >> 8) & 0xFF); + result.push(bits & 0xFF); + } + + bits = (bits << 6) | map.indexOf(input.charAt(idx)); + } + + // Dump tail + + tailbits = (max % 4) * 6; + + if (tailbits === 0) { + result.push((bits >> 16) & 0xFF); + result.push((bits >> 8) & 0xFF); + result.push(bits & 0xFF); + } else if (tailbits === 18) { + result.push((bits >> 10) & 0xFF); + result.push((bits >> 2) & 0xFF); + } else if (tailbits === 12) { + result.push((bits >> 4) & 0xFF); + } + + return new Uint8Array(result); +} + +function representYamlBinary(object /*, style*/) { + var result = '', bits = 0, idx, tail, + max = object.length, + map = BASE64_MAP; + + // Convert every three bytes to 4 ASCII characters. + + for (idx = 0; idx < max; idx++) { + if ((idx % 3 === 0) && idx) { + result += map[(bits >> 18) & 0x3F]; + result += map[(bits >> 12) & 0x3F]; + result += map[(bits >> 6) & 0x3F]; + result += map[bits & 0x3F]; + } + + bits = (bits << 8) + object[idx]; + } + + // Dump tail + + tail = max % 3; + + if (tail === 0) { + result += map[(bits >> 18) & 0x3F]; + result += map[(bits >> 12) & 0x3F]; + result += map[(bits >> 6) & 0x3F]; + result += map[bits & 0x3F]; + } else if (tail === 2) { + result += map[(bits >> 10) & 0x3F]; + result += map[(bits >> 4) & 0x3F]; + result += map[(bits << 2) & 0x3F]; + result += map[64]; + } else if (tail === 1) { + result += map[(bits >> 2) & 0x3F]; + result += map[(bits << 4) & 0x3F]; + result += map[64]; + result += map[64]; + } + + return result; +} + +function isBinary(obj) { + return Object.prototype.toString.call(obj) === '[object Uint8Array]'; +} + +module.exports = new Type('tag:yaml.org,2002:binary', { + kind: 'scalar', + resolve: resolveYamlBinary, + construct: constructYamlBinary, + predicate: isBinary, + represent: representYamlBinary +}); + + +/***/ }), + +/***/ 18769: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var Type = __nccwpck_require__(63820); + +function resolveYamlBoolean(data) { + if (data === null) return false; + + var max = data.length; + + return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || + (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); +} + +function constructYamlBoolean(data) { + return data === 'true' || + data === 'True' || + data === 'TRUE'; +} + +function isBoolean(object) { + return Object.prototype.toString.call(object) === '[object Boolean]'; +} + +module.exports = new Type('tag:yaml.org,2002:bool', { + kind: 'scalar', + resolve: resolveYamlBoolean, + construct: constructYamlBoolean, + predicate: isBoolean, + represent: { + lowercase: function (object) { return object ? 'true' : 'false'; }, + uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, + camelcase: function (object) { return object ? 'True' : 'False'; } + }, + defaultStyle: 'lowercase' +}); + + +/***/ }), + +/***/ 68155: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var common = __nccwpck_require__(33198); +var Type = __nccwpck_require__(63820); + +var YAML_FLOAT_PATTERN = new RegExp( + // 2.5e4, 2.5 and integers + '^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + + // .2e4, .2 + // special case, seems not from spec + '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' + + // .inf + '|[-+]?\\.(?:inf|Inf|INF)' + + // .nan + '|\\.(?:nan|NaN|NAN))$'); + +function resolveYamlFloat(data) { + if (data === null) return false; + + if (!YAML_FLOAT_PATTERN.test(data) || + // Quick hack to not allow integers end with `_` + // Probably should update regexp & check speed + data[data.length - 1] === '_') { + return false; + } + + return true; +} + +function constructYamlFloat(data) { + var value, sign; + + value = data.replace(/_/g, '').toLowerCase(); + sign = value[0] === '-' ? -1 : 1; + + if ('+-'.indexOf(value[0]) >= 0) { + value = value.slice(1); + } + + if (value === '.inf') { + return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; + + } else if (value === '.nan') { + return NaN; + } + return sign * parseFloat(value, 10); +} + + +var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; + +function representYamlFloat(object, style) { + var res; + + if (isNaN(object)) { + switch (style) { + case 'lowercase': return '.nan'; + case 'uppercase': return '.NAN'; + case 'camelcase': return '.NaN'; + } + } else if (Number.POSITIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '.inf'; + case 'uppercase': return '.INF'; + case 'camelcase': return '.Inf'; + } + } else if (Number.NEGATIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '-.inf'; + case 'uppercase': return '-.INF'; + case 'camelcase': return '-.Inf'; + } + } else if (common.isNegativeZero(object)) { + return '-0.0'; + } + + res = object.toString(10); + + // JS stringifier can build scientific format without dots: 5e-100, + // while YAML requres dot: 5.e-100. Fix it with simple hack + + return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; +} + +function isFloat(object) { + return (Object.prototype.toString.call(object) === '[object Number]') && + (object % 1 !== 0 || common.isNegativeZero(object)); +} + +module.exports = new Type('tag:yaml.org,2002:float', { + kind: 'scalar', + resolve: resolveYamlFloat, + construct: constructYamlFloat, + predicate: isFloat, + represent: representYamlFloat, + defaultStyle: 'lowercase' +}); + + +/***/ }), + +/***/ 58884: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var common = __nccwpck_require__(33198); +var Type = __nccwpck_require__(63820); + +function isHexCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || + ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || + ((0x61/* a */ <= c) && (c <= 0x66/* f */)); +} + +function isOctCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); +} + +function isDecCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); +} + +function resolveYamlInteger(data) { + if (data === null) return false; + + var max = data.length, + index = 0, + hasDigits = false, + ch; + + if (!max) return false; + + ch = data[index]; + + // sign + if (ch === '-' || ch === '+') { + ch = data[++index]; + } + + if (ch === '0') { + // 0 + if (index + 1 === max) return true; + ch = data[++index]; + + // base 2, base 8, base 16 + + if (ch === 'b') { + // base 2 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (ch !== '0' && ch !== '1') return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + + if (ch === 'x') { + // base 16 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isHexCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + + if (ch === 'o') { + // base 8 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isOctCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + } + + // base 10 (except 0) + + // value should not start with `_`; + if (ch === '_') return false; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isDecCode(data.charCodeAt(index))) { + return false; + } + hasDigits = true; + } + + // Should have digits and should not end with `_` + if (!hasDigits || ch === '_') return false; + + return true; +} + +function constructYamlInteger(data) { + var value = data, sign = 1, ch; + + if (value.indexOf('_') !== -1) { + value = value.replace(/_/g, ''); + } + + ch = value[0]; + + if (ch === '-' || ch === '+') { + if (ch === '-') sign = -1; + value = value.slice(1); + ch = value[0]; + } + + if (value === '0') return 0; + + if (ch === '0') { + if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); + if (value[1] === 'x') return sign * parseInt(value.slice(2), 16); + if (value[1] === 'o') return sign * parseInt(value.slice(2), 8); + } + + return sign * parseInt(value, 10); +} + +function isInteger(object) { + return (Object.prototype.toString.call(object)) === '[object Number]' && + (object % 1 === 0 && !common.isNegativeZero(object)); +} + +module.exports = new Type('tag:yaml.org,2002:int', { + kind: 'scalar', + resolve: resolveYamlInteger, + construct: constructYamlInteger, + predicate: isInteger, + represent: { + binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); }, + octal: function (obj) { return obj >= 0 ? '0o' + obj.toString(8) : '-0o' + obj.toString(8).slice(1); }, + decimal: function (obj) { return obj.toString(10); }, + /* eslint-disable max-len */ + hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); } + }, + defaultStyle: 'decimal', + styleAliases: { + binary: [ 2, 'bin' ], + octal: [ 8, 'oct' ], + decimal: [ 10, 'dec' ], + hexadecimal: [ 16, 'hex' ] + } +}); + + +/***/ }), + +/***/ 23412: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var Type = __nccwpck_require__(63820); + +module.exports = new Type('tag:yaml.org,2002:map', { + kind: 'mapping', + construct: function (data) { return data !== null ? data : {}; } +}); + + +/***/ }), + +/***/ 50718: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var Type = __nccwpck_require__(63820); + +function resolveYamlMerge(data) { + return data === '<<' || data === null; +} + +module.exports = new Type('tag:yaml.org,2002:merge', { + kind: 'scalar', + resolve: resolveYamlMerge +}); + + +/***/ }), + +/***/ 21471: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var Type = __nccwpck_require__(63820); + +function resolveYamlNull(data) { + if (data === null) return true; + + var max = data.length; + + return (max === 1 && data === '~') || + (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL')); +} + +function constructYamlNull() { + return null; +} + +function isNull(object) { + return object === null; +} + +module.exports = new Type('tag:yaml.org,2002:null', { + kind: 'scalar', + resolve: resolveYamlNull, + construct: constructYamlNull, + predicate: isNull, + represent: { + canonical: function () { return '~'; }, + lowercase: function () { return 'null'; }, + uppercase: function () { return 'NULL'; }, + camelcase: function () { return 'Null'; }, + empty: function () { return ''; } + }, + defaultStyle: 'lowercase' +}); + + +/***/ }), + +/***/ 40564: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var Type = __nccwpck_require__(63820); + +var _hasOwnProperty = Object.prototype.hasOwnProperty; +var _toString = Object.prototype.toString; + +function resolveYamlOmap(data) { + if (data === null) return true; + + var objectKeys = [], index, length, pair, pairKey, pairHasKey, + object = data; + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + pairHasKey = false; + + if (_toString.call(pair) !== '[object Object]') return false; + + for (pairKey in pair) { + if (_hasOwnProperty.call(pair, pairKey)) { + if (!pairHasKey) pairHasKey = true; + else return false; + } + } + + if (!pairHasKey) return false; + + if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); + else return false; + } + + return true; +} + +function constructYamlOmap(data) { + return data !== null ? data : []; +} + +module.exports = new Type('tag:yaml.org,2002:omap', { + kind: 'sequence', + resolve: resolveYamlOmap, + construct: constructYamlOmap +}); + + +/***/ }), + +/***/ 61589: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var Type = __nccwpck_require__(63820); + +var _toString = Object.prototype.toString; + +function resolveYamlPairs(data) { + if (data === null) return true; + + var index, length, pair, keys, result, + object = data; + + result = new Array(object.length); + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + + if (_toString.call(pair) !== '[object Object]') return false; + + keys = Object.keys(pair); + + if (keys.length !== 1) return false; + + result[index] = [ keys[0], pair[keys[0]] ]; + } + + return true; +} + +function constructYamlPairs(data) { + if (data === null) return []; + + var index, length, pair, keys, result, + object = data; + + result = new Array(object.length); + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + + keys = Object.keys(pair); + + result[index] = [ keys[0], pair[keys[0]] ]; + } + + return result; +} + +module.exports = new Type('tag:yaml.org,2002:pairs', { + kind: 'sequence', + resolve: resolveYamlPairs, + construct: constructYamlPairs +}); + + +/***/ }), + +/***/ 37331: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var Type = __nccwpck_require__(63820); + +module.exports = new Type('tag:yaml.org,2002:seq', { + kind: 'sequence', + construct: function (data) { return data !== null ? data : []; } +}); + + +/***/ }), + +/***/ 80986: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var Type = __nccwpck_require__(63820); + +var _hasOwnProperty = Object.prototype.hasOwnProperty; + +function resolveYamlSet(data) { + if (data === null) return true; + + var key, object = data; + + for (key in object) { + if (_hasOwnProperty.call(object, key)) { + if (object[key] !== null) return false; + } + } + + return true; +} + +function constructYamlSet(data) { + return data !== null ? data : {}; +} + +module.exports = new Type('tag:yaml.org,2002:set', { + kind: 'mapping', + resolve: resolveYamlSet, + construct: constructYamlSet +}); + + +/***/ }), + +/***/ 98225: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var Type = __nccwpck_require__(63820); + +module.exports = new Type('tag:yaml.org,2002:str', { + kind: 'scalar', + construct: function (data) { return data !== null ? data : ''; } +}); + + +/***/ }), + +/***/ 65821: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var Type = __nccwpck_require__(63820); + +var YAML_DATE_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9])' + // [2] month + '-([0-9][0-9])$'); // [3] day + +var YAML_TIMESTAMP_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9]?)' + // [2] month + '-([0-9][0-9]?)' + // [3] day + '(?:[Tt]|[ \\t]+)' + // ... + '([0-9][0-9]?)' + // [4] hour + ':([0-9][0-9])' + // [5] minute + ':([0-9][0-9])' + // [6] second + '(?:\\.([0-9]*))?' + // [7] fraction + '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour + '(?::([0-9][0-9]))?))?$'); // [11] tz_minute + +function resolveYamlTimestamp(data) { + if (data === null) return false; + if (YAML_DATE_REGEXP.exec(data) !== null) return true; + if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; + return false; +} + +function constructYamlTimestamp(data) { + var match, year, month, day, hour, minute, second, fraction = 0, + delta = null, tz_hour, tz_minute, date; + + match = YAML_DATE_REGEXP.exec(data); + if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); + + if (match === null) throw new Error('Date resolve error'); + + // match: [1] year [2] month [3] day + + year = +(match[1]); + month = +(match[2]) - 1; // JS month starts with 0 + day = +(match[3]); + + if (!match[4]) { // no hour + return new Date(Date.UTC(year, month, day)); + } + + // match: [4] hour [5] minute [6] second [7] fraction + + hour = +(match[4]); + minute = +(match[5]); + second = +(match[6]); + + if (match[7]) { + fraction = match[7].slice(0, 3); + while (fraction.length < 3) { // milli-seconds + fraction += '0'; + } + fraction = +fraction; + } + + // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute + + if (match[9]) { + tz_hour = +(match[10]); + tz_minute = +(match[11] || 0); + delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds + if (match[9] === '-') delta = -delta; + } + + date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); + + if (delta) date.setTime(date.getTime() - delta); + + return date; +} + +function representYamlTimestamp(object /*, style*/) { + return object.toISOString(); +} + +module.exports = new Type('tag:yaml.org,2002:timestamp', { + kind: 'scalar', + resolve: resolveYamlTimestamp, + construct: constructYamlTimestamp, + instanceOf: Date, + represent: representYamlTimestamp +}); + + +/***/ }), + +/***/ 49198: +/***/ ((module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.openapi = exports.openapiV31 = exports.openapiV3 = exports.openapiV2 = exports.openapiV1 = void 0; +/** + * JSON Schema for OpenAPI Specification v1.2 + */ +exports.openapiV1 = __nccwpck_require__(88479); +/** + * JSON Schema for OpenAPI Specification v2.0 + */ +exports.openapiV2 = __nccwpck_require__(10499); +/** + * JSON Schema for OpenAPI Specification v3.0 + */ +exports.openapiV3 = __nccwpck_require__(63659); +/** + * JSON Schema for OpenAPI Specification v3.1 + */ +exports.openapiV31 = __nccwpck_require__(51201); +/** + * JSON Schemas for every version of the OpenAPI Specification + */ +exports.openapi = { + v1: exports.openapiV1, + v2: exports.openapiV2, + v3: exports.openapiV3, + v31: exports.openapiV31, +}; +// Export `openapi` as the default export +exports["default"] = exports.openapi; +// CommonJS default export hack +/* eslint-env commonjs */ +if ( true && typeof module.exports === "object") { + module.exports = Object.assign(module.exports.default, module.exports); +} +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 70935: +/***/ ((module) => { + +"use strict"; + + +module.exports = [ + "get", "put", "post", "delete", "options", "head", "patch" +]; + + +/***/ }), + +/***/ 95999: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +/* eslint-disable no-unused-vars */ + + +const validateSchema = __nccwpck_require__(85821); +const validateSpec = __nccwpck_require__(96556); +const normalizeArgs = __nccwpck_require__(64608); +const util = __nccwpck_require__(51569); +const Options = __nccwpck_require__(34011); +const maybe = __nccwpck_require__(63844); +const { ono } = __nccwpck_require__(33436); +const $RefParser = __nccwpck_require__(85862); +const dereference = __nccwpck_require__(82461); + +module.exports = SwaggerParser; + +/** + * This class parses a Swagger 2.0 or 3.0 API, resolves its JSON references and their resolved values, + * and provides methods for traversing, dereferencing, and validating the API. + * + * @class + * @augments $RefParser + */ +function SwaggerParser () { + $RefParser.apply(this, arguments); +} + +util.inherits(SwaggerParser, $RefParser); +SwaggerParser.parse = $RefParser.parse; +SwaggerParser.resolve = $RefParser.resolve; +SwaggerParser.bundle = $RefParser.bundle; +SwaggerParser.dereference = $RefParser.dereference; + +/** + * Alias {@link $RefParser#schema} as {@link SwaggerParser#api} + */ +Object.defineProperty(SwaggerParser.prototype, "api", { + configurable: true, + enumerable: true, + get () { + return this.schema; + } +}); + +/** + * Parses the given Swagger API. + * This method does not resolve any JSON references. + * It just reads a single file in JSON or YAML format, and parse it as a JavaScript object. + * + * @param {string} [path] - The file path or URL of the JSON schema + * @param {object} [api] - The Swagger API object. This object will be used instead of reading from `path`. + * @param {ParserOptions} [options] - Options that determine how the API is parsed + * @param {Function} [callback] - An error-first callback. The second parameter is the parsed API object. + * @returns {Promise} - The returned promise resolves with the parsed API object. + */ +SwaggerParser.prototype.parse = async function (path, api, options, callback) { + let args = normalizeArgs(arguments); + args.options = new Options(args.options); + + try { + let schema = await $RefParser.prototype.parse.call(this, args.path, args.schema, args.options); + + if (schema.swagger) { + // Verify that the parsed object is a Swagger API + if (schema.swagger === undefined || schema.info === undefined || schema.paths === undefined) { + throw ono.syntax(`${args.path || args.schema} is not a valid Swagger API definition`); + } + else if (typeof schema.swagger === "number") { + // This is a very common mistake, so give a helpful error message + throw ono.syntax('Swagger version number must be a string (e.g. "2.0") not a number.'); + } + else if (typeof schema.info.version === "number") { + // This is a very common mistake, so give a helpful error message + throw ono.syntax('API version number must be a string (e.g. "1.0.0") not a number.'); + } + else if (schema.swagger !== "2.0") { + throw ono.syntax(`Unrecognized Swagger version: ${schema.swagger}. Expected 2.0`); + } + } + else { + let supportedVersions = ["3.0.0", "3.0.1", "3.0.2", "3.0.3"]; + + // Verify that the parsed object is a Openapi API + if (schema.openapi === undefined || schema.info === undefined || schema.paths === undefined) { + throw ono.syntax(`${args.path || args.schema} is not a valid Openapi API definition`); + } + else if (typeof schema.openapi === "number") { + // This is a very common mistake, so give a helpful error message + throw ono.syntax('Openapi version number must be a string (e.g. "3.0.0") not a number.'); + } + else if (typeof schema.info.version === "number") { + // This is a very common mistake, so give a helpful error message + throw ono.syntax('API version number must be a string (e.g. "1.0.0") not a number.'); + } + else if (supportedVersions.indexOf(schema.openapi) === -1) { + throw ono.syntax( + `Unsupported OpenAPI version: ${schema.openapi}. ` + + `Swagger Parser only supports versions ${supportedVersions.join(", ")}` + ); + } + } + + // Looks good! + return maybe(args.callback, Promise.resolve(schema)); + } + catch (err) { + return maybe(args.callback, Promise.reject(err)); + } +}; + +/** + * Parses, dereferences, and validates the given Swagger API. + * Depending on the options, validation can include JSON Schema validation and/or Swagger Spec validation. + * + * @param {string} [path] - The file path or URL of the JSON schema + * @param {object} [api] - The Swagger API object. This object will be used instead of reading from `path`. + * @param {ParserOptions} [options] - Options that determine how the API is parsed, dereferenced, and validated + * @param {Function} [callback] - An error-first callback. The second parameter is the parsed API object. + * @returns {Promise} - The returned promise resolves with the parsed API object. + */ +SwaggerParser.validate = function (path, api, options, callback) { + let Class = this; // eslint-disable-line consistent-this + let instance = new Class(); + return instance.validate.apply(instance, arguments); +}; + +/** + * Parses, dereferences, and validates the given Swagger API. + * Depending on the options, validation can include JSON Schema validation and/or Swagger Spec validation. + * + * @param {string} [path] - The file path or URL of the JSON schema + * @param {object} [api] - The Swagger API object. This object will be used instead of reading from `path`. + * @param {ParserOptions} [options] - Options that determine how the API is parsed, dereferenced, and validated + * @param {Function} [callback] - An error-first callback. The second parameter is the parsed API object. + * @returns {Promise} - The returned promise resolves with the parsed API object. + */ +SwaggerParser.prototype.validate = async function (path, api, options, callback) { + let me = this; + let args = normalizeArgs(arguments); + args.options = new Options(args.options); + + // ZSchema doesn't support circular objects, so don't dereference circular $refs yet + // (see https://github.com/zaggino/z-schema/issues/137) + let circular$RefOption = args.options.dereference.circular; + args.options.validate.schema && (args.options.dereference.circular = "ignore"); + + try { + await this.dereference(args.path, args.schema, args.options); + + // Restore the original options, now that we're done dereferencing + args.options.dereference.circular = circular$RefOption; + + if (args.options.validate.schema) { + // Validate the API against the Swagger schema + // NOTE: This is safe to do, because we haven't dereferenced circular $refs yet + validateSchema(me.api); + + if (me.$refs.circular) { + if (circular$RefOption === true) { + // The API has circular references, + // so we need to do a second-pass to fully-dereference it + dereference(me, args.options); + } + else if (circular$RefOption === false) { + // The API has circular references, and they're not allowed, so throw an error + throw ono.reference("The API contains circular references"); + } + } + } + + if (args.options.validate.spec) { + // Validate the API against the Swagger spec + validateSpec(me.api); + } + + return maybe(args.callback, Promise.resolve(me.schema)); + } + catch (err) { + return maybe(args.callback, Promise.reject(err)); + } +}; + +/** + * The Swagger object + * https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#swagger-object + * + * @typedef {{swagger: string, info: {}, paths: {}}} SwaggerObject + */ + + +/***/ }), + +/***/ 34011: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const $RefParserOptions = __nccwpck_require__(36608); +const schemaValidator = __nccwpck_require__(85821); +const specValidator = __nccwpck_require__(96556); +const util = __nccwpck_require__(73837); + +module.exports = ParserOptions; + +/** + * Options that determine how Swagger APIs are parsed, resolved, dereferenced, and validated. + * + * @param {object|ParserOptions} [_options] - Overridden options + * @class + * @augments $RefParserOptions + */ +function ParserOptions (_options) { + $RefParserOptions.call(this, ParserOptions.defaults); + $RefParserOptions.apply(this, arguments); +} + +ParserOptions.defaults = { + /** + * Determines how the API definition will be validated. + * + * You can add additional validators of your own, replace an existing one with + * your own implemenation, or disable any validator by setting it to false. + */ + validate: { + schema: schemaValidator, + spec: specValidator, + }, +}; + +util.inherits(ParserOptions, $RefParserOptions); + + +/***/ }), + +/***/ 51569: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +const util = __nccwpck_require__(73837); + +exports.format = util.format; +exports.inherits = util.inherits; + +/** + * Regular Expression that matches Swagger path params. + */ +exports.swaggerParamRegExp = /\{([^/}]+)}/g; + + +/***/ }), + +/***/ 85821: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const util = __nccwpck_require__(51569); +const { ono } = __nccwpck_require__(33436); +const ZSchema = __nccwpck_require__(42563); +const { openapi } = __nccwpck_require__(49198); + +module.exports = validateSchema; + +let zSchema = initializeZSchema(); + +/** + * Validates the given Swagger API against the Swagger 2.0 or 3.0 schema. + * + * @param {SwaggerObject} api + */ +function validateSchema (api) { + // Choose the appropriate schema (Swagger or OpenAPI) + let schema = api.swagger ? openapi.v2 : openapi.v3; + + // Validate against the schema + let isValid = zSchema.validate(api, schema); + + if (!isValid) { + let err = zSchema.getLastError(); + let message = "Swagger schema validation failed. \n" + formatZSchemaError(err.details); + throw ono.syntax(err, { details: err.details }, message); + } +} + +/** + * Performs one-time initialization logic to prepare for Swagger Schema validation. + */ +function initializeZSchema () { + // HACK: Delete the OpenAPI schema IDs because ZSchema can't resolve them + delete openapi.v2.id; + delete openapi.v3.id; + + // The OpenAPI 3.0 schema uses "uri-reference" formats. + // Assume that any non-whitespace string is valid. + ZSchema.registerFormat("uri-reference", (value) => value.trim().length > 0); + + // Configure ZSchema + return new ZSchema({ + breakOnFirstError: true, + noExtraKeywords: true, + ignoreUnknownFormats: false, + reportPathAsArray: true + }); +} + +/** + * Z-Schema validation errors are a nested tree structure. + * This function crawls that tree and builds an error message string. + * + * @param {object[]} errors - The Z-Schema error details + * @param {string} [indent] - The whitespace used to indent the error message + * @returns {string} + */ +function formatZSchemaError (errors, indent) { + indent = indent || " "; + let message = ""; + for (let error of errors) { + message += util.format(`${indent}${error.message} at #/${error.path.join("/")}\n`); + if (error.inner) { + message += formatZSchemaError(error.inner, indent + " "); + } + } + return message; +} + + +/***/ }), + +/***/ 96556: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const util = __nccwpck_require__(51569); +const { ono } = __nccwpck_require__(33436); +const swaggerMethods = __nccwpck_require__(70935); +const primitiveTypes = ["array", "boolean", "integer", "number", "string"]; +const schemaTypes = ["array", "boolean", "integer", "number", "string", "object", "null", undefined]; + +module.exports = validateSpec; + +/** + * Validates parts of the Swagger 2.0 spec that aren't covered by the Swagger 2.0 JSON Schema. + * + * @param {SwaggerObject} api + */ +function validateSpec (api) { + if (api.openapi) { + // We don't (yet) support validating against the OpenAPI spec + return; + } + + let paths = Object.keys(api.paths || {}); + let operationIds = []; + for (let pathName of paths) { + let path = api.paths[pathName]; + let pathId = "/paths" + pathName; + + if (path && pathName.indexOf("/") === 0) { + validatePath(api, path, pathId, operationIds); + } + } + + let definitions = Object.keys(api.definitions || {}); + for (let definitionName of definitions) { + let definition = api.definitions[definitionName]; + let definitionId = "/definitions/" + definitionName; + validateRequiredPropertiesExist(definition, definitionId); + } +} + +/** + * Validates the given path. + * + * @param {SwaggerObject} api - The entire Swagger API object + * @param {object} path - A Path object, from the Swagger API + * @param {string} pathId - A value that uniquely identifies the path + * @param {string} operationIds - An array of collected operationIds found in other paths + */ +function validatePath (api, path, pathId, operationIds) { + for (let operationName of swaggerMethods) { + let operation = path[operationName]; + let operationId = pathId + "/" + operationName; + + if (operation) { + let declaredOperationId = operation.operationId; + if (declaredOperationId) { + if (operationIds.indexOf(declaredOperationId) === -1) { + operationIds.push(declaredOperationId); + } + else { + throw ono.syntax(`Validation failed. Duplicate operation id '${declaredOperationId}'`); + } + } + validateParameters(api, path, pathId, operation, operationId); + + let responses = Object.keys(operation.responses || {}); + for (let responseName of responses) { + let response = operation.responses[responseName]; + let responseId = operationId + "/responses/" + responseName; + validateResponse(responseName, (response || {}), responseId); + } + } + } +} + +/** + * Validates the parameters for the given operation. + * + * @param {SwaggerObject} api - The entire Swagger API object + * @param {object} path - A Path object, from the Swagger API + * @param {string} pathId - A value that uniquely identifies the path + * @param {object} operation - An Operation object, from the Swagger API + * @param {string} operationId - A value that uniquely identifies the operation + */ +function validateParameters (api, path, pathId, operation, operationId) { + let pathParams = path.parameters || []; + let operationParams = operation.parameters || []; + + // Check for duplicate path parameters + try { + checkForDuplicates(pathParams); + } + catch (e) { + throw ono.syntax(e, `Validation failed. ${pathId} has duplicate parameters`); + } + + // Check for duplicate operation parameters + try { + checkForDuplicates(operationParams); + } + catch (e) { + throw ono.syntax(e, `Validation failed. ${operationId} has duplicate parameters`); + } + + // Combine the path and operation parameters, + // with the operation params taking precedence over the path params + let params = pathParams.reduce((combinedParams, value) => { + let duplicate = combinedParams.some((param) => { + return param.in === value.in && param.name === value.name; + }); + if (!duplicate) { + combinedParams.push(value); + } + return combinedParams; + }, operationParams.slice()); + + validateBodyParameters(params, operationId); + validatePathParameters(params, pathId, operationId); + validateParameterTypes(params, api, operation, operationId); +} + +/** + * Validates body and formData parameters for the given operation. + * + * @param {object[]} params - An array of Parameter objects + * @param {string} operationId - A value that uniquely identifies the operation + */ +function validateBodyParameters (params, operationId) { + let bodyParams = params.filter((param) => { return param.in === "body"; }); + let formParams = params.filter((param) => { return param.in === "formData"; }); + + // There can only be one "body" parameter + if (bodyParams.length > 1) { + throw ono.syntax( + `Validation failed. ${operationId} has ${bodyParams.length} body parameters. Only one is allowed.`, + ); + } + else if (bodyParams.length > 0 && formParams.length > 0) { + // "body" params and "formData" params are mutually exclusive + throw ono.syntax( + `Validation failed. ${operationId} has body parameters and formData parameters. Only one or the other is allowed.`, + ); + } +} + +/** + * Validates path parameters for the given path. + * + * @param {object[]} params - An array of Parameter objects + * @param {string} pathId - A value that uniquely identifies the path + * @param {string} operationId - A value that uniquely identifies the operation + */ +function validatePathParameters (params, pathId, operationId) { + // Find all {placeholders} in the path string + let placeholders = pathId.match(util.swaggerParamRegExp) || []; + + // Check for duplicates + for (let i = 0; i < placeholders.length; i++) { + for (let j = i + 1; j < placeholders.length; j++) { + if (placeholders[i] === placeholders[j]) { + throw ono.syntax( + `Validation failed. ${operationId} has multiple path placeholders named ${placeholders[i]}`); + } + } + } + + params = params.filter((param) => { return param.in === "path"; }); + + for (let param of params) { + if (param.required !== true) { + throw ono.syntax( + "Validation failed. Path parameters cannot be optional. " + + `Set required=true for the "${param.name}" parameter at ${operationId}`, + ); + } + let match = placeholders.indexOf("{" + param.name + "}"); + if (match === -1) { + throw ono.syntax( + `Validation failed. ${operationId} has a path parameter named "${param.name}", ` + + `but there is no corresponding {${param.name}} in the path string` + ); + } + placeholders.splice(match, 1); + } + + if (placeholders.length > 0) { + throw ono.syntax(`Validation failed. ${operationId} is missing path parameter(s) for ${placeholders}`); + } +} + +/** + * Validates data types of parameters for the given operation. + * + * @param {object[]} params - An array of Parameter objects + * @param {object} api - The entire Swagger API object + * @param {object} operation - An Operation object, from the Swagger API + * @param {string} operationId - A value that uniquely identifies the operation + */ +function validateParameterTypes (params, api, operation, operationId) { + for (let param of params) { + let parameterId = operationId + "/parameters/" + param.name; + let schema, validTypes; + + switch (param.in) { + case "body": + schema = param.schema; + validTypes = schemaTypes; + break; + case "formData": + schema = param; + validTypes = primitiveTypes.concat("file"); + break; + default: + schema = param; + validTypes = primitiveTypes; + } + + validateSchema(schema, parameterId, validTypes); + validateRequiredPropertiesExist(schema, parameterId); + + if (schema.type === "file") { + // "file" params must consume at least one of these MIME types + let formData = /multipart\/(.*\+)?form-data/; + let urlEncoded = /application\/(.*\+)?x-www-form-urlencoded/; + + let consumes = operation.consumes || api.consumes || []; + + let hasValidMimeType = consumes.some((consume) => { + return formData.test(consume) || urlEncoded.test(consume); + }); + + if (!hasValidMimeType) { + throw ono.syntax( + `Validation failed. ${operationId} has a file parameter, so it must consume multipart/form-data ` + + "or application/x-www-form-urlencoded", + ); + } + } + } +} + +/** + * Checks the given parameter list for duplicates, and throws an error if found. + * + * @param {object[]} params - An array of Parameter objects + */ +function checkForDuplicates (params) { + for (let i = 0; i < params.length - 1; i++) { + let outer = params[i]; + for (let j = i + 1; j < params.length; j++) { + let inner = params[j]; + if (outer.name === inner.name && outer.in === inner.in) { + throw ono.syntax(`Validation failed. Found multiple ${outer.in} parameters named "${outer.name}"`); + } + } + } +} + +/** + * Validates the given response object. + * + * @param {string} code - The HTTP response code (or "default") + * @param {object} response - A Response object, from the Swagger API + * @param {string} responseId - A value that uniquely identifies the response + */ +function validateResponse (code, response, responseId) { + if (code !== "default" && (code < 100 || code > 599)) { + throw ono.syntax(`Validation failed. ${responseId} has an invalid response code (${code})`); + } + + let headers = Object.keys(response.headers || {}); + for (let headerName of headers) { + let header = response.headers[headerName]; + let headerId = responseId + "/headers/" + headerName; + validateSchema(header, headerId, primitiveTypes); + } + + if (response.schema) { + let validTypes = schemaTypes.concat("file"); + if (validTypes.indexOf(response.schema.type) === -1) { + throw ono.syntax( + `Validation failed. ${responseId} has an invalid response schema type (${response.schema.type})`); + } + else { + validateSchema(response.schema, responseId + "/schema", validTypes); + } + } +} + +/** + * Validates the given Swagger schema object. + * + * @param {object} schema - A Schema object, from the Swagger API + * @param {string} schemaId - A value that uniquely identifies the schema object + * @param {string[]} validTypes - An array of the allowed schema types + */ +function validateSchema (schema, schemaId, validTypes) { + if (validTypes.indexOf(schema.type) === -1) { + throw ono.syntax( + `Validation failed. ${schemaId} has an invalid type (${schema.type})`); + } + + if (schema.type === "array" && !schema.items) { + throw ono.syntax(`Validation failed. ${schemaId} is an array, so it must include an "items" schema`); + } +} + +/** + * Validates that the declared properties of the given Swagger schema object actually exist. + * + * @param {object} schema - A Schema object, from the Swagger API + * @param {string} schemaId - A value that uniquely identifies the schema object + */ +function validateRequiredPropertiesExist (schema, schemaId) { + /** + * Recursively collects all properties of the schema and its ancestors. They are added to the props object. + */ + function collectProperties (schemaObj, props) { + if (schemaObj.properties) { + for (let property in schemaObj.properties) { + if (schemaObj.properties.hasOwnProperty(property)) { + props[property] = schemaObj.properties[property]; + } + } + } + if (schemaObj.allOf) { + for (let parent of schemaObj.allOf) { + collectProperties(parent, props); + } + } + } + + if (schema.required && Array.isArray(schema.required)) { + let props = {}; + collectProperties(schema, props); + for (let requiredProperty of schema.required) { + if (!props[requiredProperty]) { + throw ono.syntax( + `Validation failed. Property '${requiredProperty}' listed as required but does not exist in '${schemaId}'` + ); + } + } + } +} + + +/***/ }), + +/***/ 50326: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Ono = void 0; +const extend_error_1 = __nccwpck_require__(43561); +const normalize_1 = __nccwpck_require__(19322); +const to_json_1 = __nccwpck_require__(24833); +const constructor = Ono; +exports.Ono = constructor; +/** + * Creates an `Ono` instance for a specifc error type. + */ +// eslint-disable-next-line @typescript-eslint/naming-convention +function Ono(ErrorConstructor, options) { + options = normalize_1.normalizeOptions(options); + function ono(...args) { + let { originalError, props, message } = normalize_1.normalizeArgs(args, options); + // Create a new error of the specified type + let newError = new ErrorConstructor(message); + // Extend the error with the properties of the original error and the `props` object + return extend_error_1.extendError(newError, originalError, props); + } + ono[Symbol.species] = ErrorConstructor; + return ono; +} +/** + * Returns an object containing all properties of the given Error object, + * which can be used with `JSON.stringify()`. + */ +Ono.toJSON = function toJSON(error) { + return to_json_1.toJSON.call(error); +}; +/** + * Extends the given Error object with enhanced Ono functionality, such as nested stack traces, + * additional properties, and improved support for `JSON.stringify()`. + */ +Ono.extend = function extend(error, originalError, props) { + if (props || originalError instanceof Error) { + return extend_error_1.extendError(error, originalError, props); + } + else if (originalError) { + return extend_error_1.extendError(error, undefined, originalError); + } + else { + return extend_error_1.extendError(error); + } +}; +//# sourceMappingURL=constructor.js.map + +/***/ }), + +/***/ 43561: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.extendError = void 0; +const isomorphic_node_1 = __nccwpck_require__(26315); +const stack_1 = __nccwpck_require__(55254); +const to_json_1 = __nccwpck_require__(24833); +const protectedProps = ["name", "message", "stack"]; +/** + * Extends the new error with the properties of the original error and the `props` object. + * + * @param newError - The error object to extend + * @param originalError - The original error object, if any + * @param props - Additional properties to add, if any + */ +function extendError(error, originalError, props) { + let onoError = error; + extendStack(onoError, originalError); + // Copy properties from the original error + if (originalError && typeof originalError === "object") { + mergeErrors(onoError, originalError); + } + // The default `toJSON` method doesn't output props like `name`, `message`, `stack`, etc. + // So replace it with one that outputs every property of the error. + onoError.toJSON = to_json_1.toJSON; + // On Node.js, add support for the `util.inspect()` method + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (isomorphic_node_1.addInspectMethod) { + isomorphic_node_1.addInspectMethod(onoError); + } + // Finally, copy custom properties that were specified by the user. + // These props OVERWRITE any previous props + if (props && typeof props === "object") { + Object.assign(onoError, props); + } + return onoError; +} +exports.extendError = extendError; +/** + * Extend the error stack to include its cause + */ +function extendStack(newError, originalError) { + let stackProp = Object.getOwnPropertyDescriptor(newError, "stack"); + if (stack_1.isLazyStack(stackProp)) { + stack_1.lazyJoinStacks(stackProp, newError, originalError); + } + else if (stack_1.isWritableStack(stackProp)) { + newError.stack = stack_1.joinStacks(newError, originalError); + } +} +/** + * Merges properties of the original error with the new error. + * + * @param newError - The error object to extend + * @param originalError - The original error object, if any + */ +function mergeErrors(newError, originalError) { + // Get the original error's keys + // NOTE: We specifically exclude properties that we have already set on the new error. + // This is _especially_ important for the `stack` property, because this property has + // a lazy getter in some environments + let keys = to_json_1.getDeepKeys(originalError, protectedProps); + // HACK: We have to cast the errors to `any` so we can use symbol indexers. + // see https://github.com/Microsoft/TypeScript/issues/1863 + let _newError = newError; + let _originalError = originalError; + for (let key of keys) { + if (_newError[key] === undefined) { + try { + _newError[key] = _originalError[key]; + } + catch (e) { + // This property is read-only, so it can't be copied + } + } + } +} +//# sourceMappingURL=extend-error.js.map + +/***/ }), + +/***/ 33436: +/***/ (function(module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ono = void 0; +/* eslint-env commonjs */ +const singleton_1 = __nccwpck_require__(54760); +Object.defineProperty(exports, "ono", ({ enumerable: true, get: function () { return singleton_1.ono; } })); +var constructor_1 = __nccwpck_require__(50326); +Object.defineProperty(exports, "Ono", ({ enumerable: true, get: function () { return constructor_1.Ono; } })); +__exportStar(__nccwpck_require__(97905), exports); +exports["default"] = singleton_1.ono; +// CommonJS default export hack +if ( true && typeof module.exports === "object") { + module.exports = Object.assign(module.exports.default, module.exports); +} +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 26315: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.addInspectMethod = exports.format = void 0; +const util = __nccwpck_require__(73837); +const to_json_1 = __nccwpck_require__(24833); +// The `inspect()` method is actually a Symbol, not a string key. +// https://nodejs.org/api/util.html#util_util_inspect_custom +const inspectMethod = util.inspect.custom || Symbol.for("nodejs.util.inspect.custom"); +/** + * Ono supports Node's `util.format()` formatting for error messages. + * + * @see https://nodejs.org/api/util.html#util_util_format_format_args + */ +exports.format = util.format; +/** + * Adds an `inspect()` method to support Node's `util.inspect()` function. + * + * @see https://nodejs.org/api/util.html#util_util_inspect_custom + */ +function addInspectMethod(newError) { + // @ts-expect-error - TypeScript doesn't support symbol indexers + newError[inspectMethod] = inspect; +} +exports.addInspectMethod = addInspectMethod; +/** + * Returns a representation of the error for Node's `util.inspect()` method. + * + * @see https://nodejs.org/api/util.html#util_custom_inspection_functions_on_objects + */ +function inspect() { + // HACK: We have to cast the objects to `any` so we can use symbol indexers. + // see https://github.com/Microsoft/TypeScript/issues/1863 + let pojo = {}; + let error = this; + for (let key of to_json_1.getDeepKeys(error)) { + let value = error[key]; + pojo[key] = value; + } + // Don't include the `inspect()` method on the output object, + // otherwise it will cause `util.inspect()` to go into an infinite loop + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + delete pojo[inspectMethod]; + return pojo; +} +//# sourceMappingURL=isomorphic.node.js.map + +/***/ }), + +/***/ 19322: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.normalizeArgs = exports.normalizeOptions = void 0; +const isomorphic_node_1 = __nccwpck_require__(26315); +/** + * Normalizes Ono options, accounting for defaults and optional options. + */ +function normalizeOptions(options) { + options = options || {}; + return { + concatMessages: options.concatMessages === undefined ? true : Boolean(options.concatMessages), + format: options.format === undefined ? isomorphic_node_1.format + : (typeof options.format === "function" ? options.format : false), + }; +} +exports.normalizeOptions = normalizeOptions; +/** + * Normalizes the Ono arguments, accounting for defaults, options, and optional arguments. + */ +function normalizeArgs(args, options) { + let originalError; + let props; + let formatArgs; + let message = ""; + // Determine which arguments were actually specified + if (typeof args[0] === "string") { + formatArgs = args; + } + else if (typeof args[1] === "string") { + if (args[0] instanceof Error) { + originalError = args[0]; + } + else { + props = args[0]; + } + formatArgs = args.slice(1); + } + else { + originalError = args[0]; + props = args[1]; + formatArgs = args.slice(2); + } + // If there are any format arguments, then format the error message + if (formatArgs.length > 0) { + if (options.format) { + message = options.format.apply(undefined, formatArgs); + } + else { + message = formatArgs.join(" "); + } + } + if (options.concatMessages && originalError && originalError.message) { + // The inner-error's message will be added to the new message + message += (message ? " \n" : "") + originalError.message; + } + return { originalError, props, message }; +} +exports.normalizeArgs = normalizeArgs; +//# sourceMappingURL=normalize.js.map + +/***/ }), + +/***/ 54760: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ono = void 0; +const constructor_1 = __nccwpck_require__(50326); +const singleton = ono; +exports.ono = singleton; +ono.error = new constructor_1.Ono(Error); +ono.eval = new constructor_1.Ono(EvalError); +ono.range = new constructor_1.Ono(RangeError); +ono.reference = new constructor_1.Ono(ReferenceError); +ono.syntax = new constructor_1.Ono(SyntaxError); +ono.type = new constructor_1.Ono(TypeError); +ono.uri = new constructor_1.Ono(URIError); +const onoMap = ono; +/** + * Creates a new error with the specified message, properties, and/or inner error. + * If an inner error is provided, then the new error will match its type, if possible. + */ +function ono(...args) { + let originalError = args[0]; + // Is the first argument an Error-like object? + if (typeof originalError === "object" && typeof originalError.name === "string") { + // Try to find an Ono singleton method that matches this error type + for (let typedOno of Object.values(onoMap)) { + if (typeof typedOno === "function" && typedOno.name === "ono") { + let species = typedOno[Symbol.species]; + if (species && species !== Error && (originalError instanceof species || originalError.name === species.name)) { + // Create an error of the same type + return typedOno.apply(undefined, args); + } + } + } + } + // By default, create a base Error object + return ono.error.apply(undefined, args); +} +//# sourceMappingURL=singleton.js.map + +/***/ }), + +/***/ 55254: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.lazyJoinStacks = exports.joinStacks = exports.isWritableStack = exports.isLazyStack = void 0; +const newline = /\r?\n/; +const onoCall = /\bono[ @]/; +/** + * Is the property lazily computed? + */ +function isLazyStack(stackProp) { + return Boolean(stackProp && + stackProp.configurable && + typeof stackProp.get === "function"); +} +exports.isLazyStack = isLazyStack; +/** + * Is the stack property writable? + */ +function isWritableStack(stackProp) { + return Boolean( + // If there is no stack property, then it's writable, since assigning it will create it + !stackProp || + stackProp.writable || + typeof stackProp.set === "function"); +} +exports.isWritableStack = isWritableStack; +/** + * Appends the original `Error.stack` property to the new Error's stack. + */ +function joinStacks(newError, originalError) { + let newStack = popStack(newError.stack); + let originalStack = originalError ? originalError.stack : undefined; + if (newStack && originalStack) { + return newStack + "\n\n" + originalStack; + } + else { + return newStack || originalStack; + } +} +exports.joinStacks = joinStacks; +/** + * Calls `joinStacks` lazily, when the `Error.stack` property is accessed. + */ +function lazyJoinStacks(lazyStack, newError, originalError) { + if (originalError) { + Object.defineProperty(newError, "stack", { + get: () => { + let newStack = lazyStack.get.apply(newError); + return joinStacks({ stack: newStack }, originalError); + }, + enumerable: false, + configurable: true + }); + } + else { + lazyPopStack(newError, lazyStack); + } +} +exports.lazyJoinStacks = lazyJoinStacks; +/** + * Removes Ono from the stack, so that the stack starts at the original error location + */ +function popStack(stack) { + if (stack) { + let lines = stack.split(newline); + // Find the Ono call(s) in the stack, and remove them + let onoStart; + for (let i = 0; i < lines.length; i++) { + let line = lines[i]; + if (onoCall.test(line)) { + if (onoStart === undefined) { + // We found the first Ono call in the stack trace. + // There may be other subsequent Ono calls as well. + onoStart = i; + } + } + else if (onoStart !== undefined) { + // We found the first non-Ono call after one or more Ono calls. + // So remove the Ono call lines from the stack trace + lines.splice(onoStart, i - onoStart); + break; + } + } + if (lines.length > 0) { + return lines.join("\n"); + } + } + // If we get here, then the stack doesn't contain a call to `ono`. + // This may be due to minification or some optimization of the JS engine. + // So just return the stack as-is. + return stack; +} +/** + * Calls `popStack` lazily, when the `Error.stack` property is accessed. + */ +function lazyPopStack(error, lazyStack) { + Object.defineProperty(error, "stack", { + get: () => popStack(lazyStack.get.apply(error)), + enumerable: false, + configurable: true + }); +} +//# sourceMappingURL=stack.js.map + +/***/ }), + +/***/ 24833: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getDeepKeys = exports.toJSON = void 0; +const nonJsonTypes = ["function", "symbol", "undefined"]; +const protectedProps = ["constructor", "prototype", "__proto__"]; +const objectPrototype = Object.getPrototypeOf({}); +/** + * Custom JSON serializer for Error objects. + * Returns all built-in error properties, as well as extended properties. + */ +function toJSON() { + // HACK: We have to cast the objects to `any` so we can use symbol indexers. + // see https://github.com/Microsoft/TypeScript/issues/1863 + let pojo = {}; + let error = this; + for (let key of getDeepKeys(error)) { + if (typeof key === "string") { + let value = error[key]; + let type = typeof value; + if (!nonJsonTypes.includes(type)) { + pojo[key] = value; + } + } + } + return pojo; +} +exports.toJSON = toJSON; +/** + * Returns own, inherited, enumerable, non-enumerable, string, and symbol keys of `obj`. + * Does NOT return members of the base Object prototype, or the specified omitted keys. + */ +function getDeepKeys(obj, omit = []) { + let keys = []; + // Crawl the prototype chain, finding all the string and symbol keys + while (obj && obj !== objectPrototype) { + keys = keys.concat(Object.getOwnPropertyNames(obj), Object.getOwnPropertySymbols(obj)); + obj = Object.getPrototypeOf(obj); + } + // De-duplicate the list of keys + let uniqueKeys = new Set(keys); + // Remove any omitted keys + for (let key of omit.concat(protectedProps)) { + uniqueKeys.delete(key); + } + return uniqueKeys; +} +exports.getDeepKeys = getDeepKeys; +//# sourceMappingURL=to-json.js.map + +/***/ }), + +/***/ 97905: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +const util_1 = __nccwpck_require__(73837); +//# sourceMappingURL=types.js.map + +/***/ }), + +/***/ 83633: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; /*! * accepts * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed - */var v=m(5385);var _=m(3583);i.exports=Accepts;function Accepts(i){if(!(this instanceof Accepts)){return new Accepts(i)}this.headers=i.headers;this.negotiator=new v(i)}Accepts.prototype.type=Accepts.prototype.types=function(i){var u=i;if(u&&!Array.isArray(u)){u=new Array(arguments.length);for(var m=0;m{"use strict";i.exports=arrayFlatten;function flattenWithDepth(i,u,m){for(var v=0;v0&&Array.isArray(_)){flattenWithDepth(_,u,m-1)}else{u.push(_)}}return u}function flattenForever(i,u){for(var m=0;m{i.exports={parallel:m(8210),serial:m(445),serialOrdered:m(3578)}},1700:i=>{i.exports=abort;function abort(i){Object.keys(i.jobs).forEach(clean.bind(i));i.jobs={}}function clean(i){if(typeof this.jobs[i]=="function"){this.jobs[i]()}}},2794:(i,u,m)=>{var v=m(5295);i.exports=async;function async(i){var u=false;v((function(){u=true}));return function async_callback(m,_){if(u){i(m,_)}else{v((function nextTick_callback(){i(m,_)}))}}}},5295:i=>{i.exports=defer;function defer(i){var u=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;if(u){u(i)}else{setTimeout(i,0)}}},9023:(i,u,m)=>{var v=m(2794),_=m(1700);i.exports=iterate;function iterate(i,u,m,v){var M=m["keyedList"]?m["keyedList"][m.index]:m.index;m.jobs[M]=runJob(u,M,i[M],(function(i,u){if(!(M in m.jobs)){return}delete m.jobs[M];if(i){_(m)}else{m.results[M]=u}v(i,m.results)}))}function runJob(i,u,m,_){var M;if(i.length==2){M=i(m,v(_))}else{M=i(m,u,v(_))}return M}},2474:i=>{i.exports=state;function state(i,u){var m=!Array.isArray(i),v={index:0,keyedList:m||u?Object.keys(i):null,jobs:{},results:m?{}:[],size:m?Object.keys(i).length:i.length};if(u){v.keyedList.sort(m?u:function(m,v){return u(i[m],i[v])})}return v}},7942:(i,u,m)=>{var v=m(1700),_=m(2794);i.exports=terminator;function terminator(i){if(!Object.keys(this.jobs).length){return}this.index=this.size;v(this);_(i)(null,this.results)}},8210:(i,u,m)=>{var v=m(9023),_=m(2474),M=m(7942);i.exports=parallel;function parallel(i,u,m){var j=_(i);while(j.index<(j["keyedList"]||i).length){v(i,u,j,(function(i,u){if(i){m(i,u);return}if(Object.keys(j.jobs).length===0){m(null,j.results);return}}));j.index++}return M.bind(j,m)}},445:(i,u,m)=>{var v=m(3578);i.exports=serial;function serial(i,u,m){return v(i,u,null,m)}},3578:(i,u,m)=>{var v=m(9023),_=m(2474),M=m(7942);i.exports=serialOrdered;i.exports.ascending=ascending;i.exports.descending=descending;function serialOrdered(i,u,m,j){var $=_(i,m);v(i,u,$,(function iteratorHandler(m,_){if(m){j(m,_);return}$.index++;if($.index<($["keyedList"]||i).length){v(i,u,$,iteratorHandler);return}j(null,$.results)}));return M.bind($,j)}function ascending(i,u){return iu?1:0}function descending(i,u){return-1*ascending(i,u)}},9417:i=>{"use strict";i.exports=balanced;function balanced(i,u,m){if(i instanceof RegExp)i=maybeMatch(i,m);if(u instanceof RegExp)u=maybeMatch(u,m);var v=range(i,u,m);return v&&{start:v[0],end:v[1],pre:m.slice(0,v[0]),body:m.slice(v[0]+i.length,v[1]),post:m.slice(v[1]+u.length)}}function maybeMatch(i,u){var m=u.match(i);return m?m[0]:null}balanced.range=range;function range(i,u,m){var v,_,M,j,$;var W=m.indexOf(i);var Y=m.indexOf(u,W+1);var Z=W;if(W>=0&&Y>0){if(i===u){return[W,Y]}v=[];M=m.length;while(Z>=0&&!$){if(Z==W){v.push(Z);W=m.indexOf(i,Z+1)}else if(v.length==1){$=[v.pop(),Y]}else{_=v.pop();if(_=0?W:Y}if(v.length){$=[M,j]}}return $}},6330:(i,u,m)=>{"use strict"; + */ + + + +/** + * Module dependencies. + * @private + */ + +var Negotiator = __nccwpck_require__(95385) +var mime = __nccwpck_require__(43583) + +/** + * Module exports. + * @public + */ + +module.exports = Accepts + +/** + * Create a new Accepts object for the given req. + * + * @param {object} req + * @public + */ + +function Accepts (req) { + if (!(this instanceof Accepts)) { + return new Accepts(req) + } + + this.headers = req.headers + this.negotiator = new Negotiator(req) +} + +/** + * Check if the given `type(s)` is acceptable, returning + * the best match when true, otherwise `undefined`, in which + * case you should respond with 406 "Not Acceptable". + * + * The `type` value may be a single mime type string + * such as "application/json", the extension name + * such as "json" or an array `["json", "html", "text/plain"]`. When a list + * or array is given the _best_ match, if any is returned. + * + * Examples: + * + * // Accept: text/html + * this.types('html'); + * // => "html" + * + * // Accept: text/*, application/json + * this.types('html'); + * // => "html" + * this.types('text/html'); + * // => "text/html" + * this.types('json', 'text'); + * // => "json" + * this.types('application/json'); + * // => "application/json" + * + * // Accept: text/*, application/json + * this.types('image/png'); + * this.types('png'); + * // => undefined + * + * // Accept: text/*;q=.5, application/json + * this.types(['html', 'json']); + * this.types('html', 'json'); + * // => "json" + * + * @param {String|Array} types... + * @return {String|Array|Boolean} + * @public + */ + +Accepts.prototype.type = +Accepts.prototype.types = function (types_) { + var types = types_ + + // support flattened arguments + if (types && !Array.isArray(types)) { + types = new Array(arguments.length) + for (var i = 0; i < types.length; i++) { + types[i] = arguments[i] + } + } + + // no types, return all requested types + if (!types || types.length === 0) { + return this.negotiator.mediaTypes() + } + + // no accept header, return first given type + if (!this.headers.accept) { + return types[0] + } + + var mimes = types.map(extToMime) + var accepts = this.negotiator.mediaTypes(mimes.filter(validMime)) + var first = accepts[0] + + return first + ? types[mimes.indexOf(first)] + : false +} + +/** + * Return accepted encodings or best fit based on `encodings`. + * + * Given `Accept-Encoding: gzip, deflate` + * an array sorted by quality is returned: + * + * ['gzip', 'deflate'] + * + * @param {String|Array} encodings... + * @return {String|Array} + * @public + */ + +Accepts.prototype.encoding = +Accepts.prototype.encodings = function (encodings_) { + var encodings = encodings_ + + // support flattened arguments + if (encodings && !Array.isArray(encodings)) { + encodings = new Array(arguments.length) + for (var i = 0; i < encodings.length; i++) { + encodings[i] = arguments[i] + } + } + + // no encodings, return all requested encodings + if (!encodings || encodings.length === 0) { + return this.negotiator.encodings() + } + + return this.negotiator.encodings(encodings)[0] || false +} + +/** + * Return accepted charsets or best fit based on `charsets`. + * + * Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5` + * an array sorted by quality is returned: + * + * ['utf-8', 'utf-7', 'iso-8859-1'] + * + * @param {String|Array} charsets... + * @return {String|Array} + * @public + */ + +Accepts.prototype.charset = +Accepts.prototype.charsets = function (charsets_) { + var charsets = charsets_ + + // support flattened arguments + if (charsets && !Array.isArray(charsets)) { + charsets = new Array(arguments.length) + for (var i = 0; i < charsets.length; i++) { + charsets[i] = arguments[i] + } + } + + // no charsets, return all requested charsets + if (!charsets || charsets.length === 0) { + return this.negotiator.charsets() + } + + return this.negotiator.charsets(charsets)[0] || false +} + +/** + * Return accepted languages or best fit based on `langs`. + * + * Given `Accept-Language: en;q=0.8, es, pt` + * an array sorted by quality is returned: + * + * ['es', 'pt', 'en'] + * + * @param {String|Array} langs... + * @return {Array|String} + * @public + */ + +Accepts.prototype.lang = +Accepts.prototype.langs = +Accepts.prototype.language = +Accepts.prototype.languages = function (languages_) { + var languages = languages_ + + // support flattened arguments + if (languages && !Array.isArray(languages)) { + languages = new Array(arguments.length) + for (var i = 0; i < languages.length; i++) { + languages[i] = arguments[i] + } + } + + // no languages, return all requested languages + if (!languages || languages.length === 0) { + return this.negotiator.languages() + } + + return this.negotiator.languages(languages)[0] || false +} + +/** + * Convert extnames to mime. + * + * @param {String} type + * @return {String} + * @private + */ + +function extToMime (type) { + return type.indexOf('/') === -1 + ? mime.lookup(type) + : type +} + +/** + * Check if mime is valid. + * + * @param {String} type + * @return {String} + * @private + */ + +function validMime (type) { + return typeof type === 'string' +} + + +/***/ }), + +/***/ 73723: +/***/ ((module) => { + +"use strict"; + + +/** + * Expose `arrayFlatten`. + */ +module.exports = arrayFlatten + +/** + * Recursive flatten function with depth. + * + * @param {Array} array + * @param {Array} result + * @param {Number} depth + * @return {Array} + */ +function flattenWithDepth (array, result, depth) { + for (var i = 0; i < array.length; i++) { + var value = array[i] + + if (depth > 0 && Array.isArray(value)) { + flattenWithDepth(value, result, depth - 1) + } else { + result.push(value) + } + } + + return result +} + +/** + * Recursive flatten function. Omitting depth is slightly faster. + * + * @param {Array} array + * @param {Array} result + * @return {Array} + */ +function flattenForever (array, result) { + for (var i = 0; i < array.length; i++) { + var value = array[i] + + if (Array.isArray(value)) { + flattenForever(value, result) + } else { + result.push(value) + } + } + + return result +} + +/** + * Flatten an array, with the ability to define a depth. + * + * @param {Array} array + * @param {Number} depth + * @return {Array} + */ +function arrayFlatten (array, depth) { + if (depth == null) { + return flattenForever(array, []) + } + + return flattenWithDepth(array, [], depth) +} + + +/***/ }), + +/***/ 14812: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +module.exports = +{ + parallel : __nccwpck_require__(8210), + serial : __nccwpck_require__(50445), + serialOrdered : __nccwpck_require__(3578) +}; + + +/***/ }), + +/***/ 1700: +/***/ ((module) => { + +// API +module.exports = abort; + +/** + * Aborts leftover active jobs + * + * @param {object} state - current state object + */ +function abort(state) +{ + Object.keys(state.jobs).forEach(clean.bind(state)); + + // reset leftover jobs + state.jobs = {}; +} + +/** + * Cleans up leftover job by invoking abort function for the provided job id + * + * @this state + * @param {string|number} key - job id to abort + */ +function clean(key) +{ + if (typeof this.jobs[key] == 'function') + { + this.jobs[key](); + } +} + + +/***/ }), + +/***/ 72794: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var defer = __nccwpck_require__(15295); + +// API +module.exports = async; + +/** + * Runs provided callback asynchronously + * even if callback itself is not + * + * @param {function} callback - callback to invoke + * @returns {function} - augmented callback + */ +function async(callback) +{ + var isAsync = false; + + // check if async happened + defer(function() { isAsync = true; }); + + return function async_callback(err, result) + { + if (isAsync) + { + callback(err, result); + } + else + { + defer(function nextTick_callback() + { + callback(err, result); + }); + } + }; +} + + +/***/ }), + +/***/ 15295: +/***/ ((module) => { + +module.exports = defer; + +/** + * Runs provided function on next iteration of the event loop + * + * @param {function} fn - function to run + */ +function defer(fn) +{ + var nextTick = typeof setImmediate == 'function' + ? setImmediate + : ( + typeof process == 'object' && typeof process.nextTick == 'function' + ? process.nextTick + : null + ); + + if (nextTick) + { + nextTick(fn); + } + else + { + setTimeout(fn, 0); + } +} + + +/***/ }), + +/***/ 9023: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var async = __nccwpck_require__(72794) + , abort = __nccwpck_require__(1700) + ; + +// API +module.exports = iterate; + +/** + * Iterates over each job object + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {object} state - current job status + * @param {function} callback - invoked when all elements processed + */ +function iterate(list, iterator, state, callback) +{ + // store current index + var key = state['keyedList'] ? state['keyedList'][state.index] : state.index; + + state.jobs[key] = runJob(iterator, key, list[key], function(error, output) + { + // don't repeat yourself + // skip secondary callbacks + if (!(key in state.jobs)) + { + return; + } + + // clean up jobs + delete state.jobs[key]; + + if (error) + { + // don't process rest of the results + // stop still active jobs + // and reset the list + abort(state); + } + else + { + state.results[key] = output; + } + + // return salvaged results + callback(error, state.results); + }); +} + +/** + * Runs iterator over provided job element + * + * @param {function} iterator - iterator to invoke + * @param {string|number} key - key/index of the element in the list of jobs + * @param {mixed} item - job description + * @param {function} callback - invoked after iterator is done with the job + * @returns {function|mixed} - job abort function or something else + */ +function runJob(iterator, key, item, callback) +{ + var aborter; + + // allow shortcut if iterator expects only two arguments + if (iterator.length == 2) + { + aborter = iterator(item, async(callback)); + } + // otherwise go with full three arguments + else + { + aborter = iterator(item, key, async(callback)); + } + + return aborter; +} + + +/***/ }), + +/***/ 42474: +/***/ ((module) => { + +// API +module.exports = state; + +/** + * Creates initial state object + * for iteration over list + * + * @param {array|object} list - list to iterate over + * @param {function|null} sortMethod - function to use for keys sort, + * or `null` to keep them as is + * @returns {object} - initial state object + */ +function state(list, sortMethod) +{ + var isNamedList = !Array.isArray(list) + , initState = + { + index : 0, + keyedList: isNamedList || sortMethod ? Object.keys(list) : null, + jobs : {}, + results : isNamedList ? {} : [], + size : isNamedList ? Object.keys(list).length : list.length + } + ; + + if (sortMethod) + { + // sort array keys based on it's values + // sort object's keys just on own merit + initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) + { + return sortMethod(list[a], list[b]); + }); + } + + return initState; +} + + +/***/ }), + +/***/ 37942: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var abort = __nccwpck_require__(1700) + , async = __nccwpck_require__(72794) + ; + +// API +module.exports = terminator; + +/** + * Terminates jobs in the attached state context + * + * @this AsyncKitState# + * @param {function} callback - final callback to invoke after termination + */ +function terminator(callback) +{ + if (!Object.keys(this.jobs).length) + { + return; + } + + // fast forward iteration index + this.index = this.size; + + // abort jobs + abort(this); + + // send back results we have so far + async(callback)(null, this.results); +} + + +/***/ }), + +/***/ 8210: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var iterate = __nccwpck_require__(9023) + , initState = __nccwpck_require__(42474) + , terminator = __nccwpck_require__(37942) + ; + +// Public API +module.exports = parallel; + +/** + * Runs iterator over provided array elements in parallel + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function parallel(list, iterator, callback) +{ + var state = initState(list); + + while (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, function(error, result) + { + if (error) + { + callback(error, result); + return; + } + + // looks like it's the last one + if (Object.keys(state.jobs).length === 0) + { + callback(null, state.results); + return; + } + }); + + state.index++; + } + + return terminator.bind(state, callback); +} + + +/***/ }), + +/***/ 50445: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var serialOrdered = __nccwpck_require__(3578); + +// Public API +module.exports = serial; + +/** + * Runs iterator over provided array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serial(list, iterator, callback) +{ + return serialOrdered(list, iterator, null, callback); +} + + +/***/ }), + +/***/ 3578: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var iterate = __nccwpck_require__(9023) + , initState = __nccwpck_require__(42474) + , terminator = __nccwpck_require__(37942) + ; + +// Public API +module.exports = serialOrdered; +// sorting helpers +module.exports.ascending = ascending; +module.exports.descending = descending; + +/** + * Runs iterator over provided sorted array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} sortMethod - custom sort function + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serialOrdered(list, iterator, sortMethod, callback) +{ + var state = initState(list, sortMethod); + + iterate(list, iterator, state, function iteratorHandler(error, result) + { + if (error) + { + callback(error, result); + return; + } + + state.index++; + + // are we there yet? + if (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, iteratorHandler); + return; + } + + // done here + callback(null, state.results); + }); + + return terminator.bind(state, callback); +} + +/* + * -- Sort methods + */ + +/** + * sort helper to sort array elements in ascending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function ascending(a, b) +{ + return a < b ? -1 : a > b ? 1 : 0; +} + +/** + * sort helper to sort array elements in descending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function descending(a, b) +{ + return -1 * ascending(a, b); +} + + +/***/ }), + +/***/ 9417: +/***/ ((module) => { + +"use strict"; + +module.exports = balanced; +function balanced(a, b, str) { + if (a instanceof RegExp) a = maybeMatch(a, str); + if (b instanceof RegExp) b = maybeMatch(b, str); + + var r = range(a, b, str); + + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; +} + +function maybeMatch(reg, str) { + var m = str.match(reg); + return m ? m[0] : null; +} + +balanced.range = range; +function range(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; + + if (ai >= 0 && bi > 0) { + if(a===b) { + return [ai, bi]; + } + begs = []; + left = str.length; + + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [ begs.pop(), bi ]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } + + bi = str.indexOf(b, i + 1); + } + + i = ai < bi && ai >= 0 ? ai : bi; + } + + if (begs.length) { + result = [ left, right ]; + } + } + + return result; +} + + +/***/ }), + +/***/ 66330: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; /*! * basic-auth * Copyright(c) 2013 TJ Holowaychuk * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2015-2016 Douglas Christopher Wilson * MIT Licensed - */var v=m(141).Buffer;i.exports=auth;i.exports.parse=parse;var _=/^ *(?:[Bb][Aa][Ss][Ii][Cc]) +([A-Za-z0-9._~+/-]+=*) *$/;var M=/^([^:]*):(.*)$/;function auth(i){if(!i){throw new TypeError("argument req is required")}if(typeof i!=="object"){throw new TypeError("argument req is required to be an object")}var u=getAuthorization(i);return parse(u)}function decodeBase64(i){return v.from(i,"base64").toString()}function getAuthorization(i){if(!i.headers||typeof i.headers!=="object"){throw new TypeError("argument req is required to have headers property")}return i.headers.authorization}function parse(i){if(typeof i!=="string"){return undefined}var u=_.exec(i);if(!u){return undefined}var m=M.exec(decodeBase64(u[1]));if(!m){return undefined}return new Credentials(m[1],m[2])}function Credentials(i,u){this.name=i;this.pass=u}},141:(i,u,m)=>{var v=m(4300);var _=v.Buffer;function copyProps(i,u){for(var m in i){u[m]=i[m]}}if(_.from&&_.alloc&&_.allocUnsafe&&_.allocUnsafeSlow){i.exports=v}else{copyProps(v,u);u.Buffer=SafeBuffer}function SafeBuffer(i,u,m){return _(i,u,m)}copyProps(_,SafeBuffer);SafeBuffer.from=function(i,u,m){if(typeof i==="number"){throw new TypeError("Argument must not be a number")}return _(i,u,m)};SafeBuffer.alloc=function(i,u,m){if(typeof i!=="number"){throw new TypeError("Argument must be a number")}var v=_(i);if(u!==undefined){if(typeof m==="string"){v.fill(u,m)}else{v.fill(u)}}else{v.fill(0)}return v};SafeBuffer.allocUnsafe=function(i){if(typeof i!=="number"){throw new TypeError("Argument must be a number")}return _(i)};SafeBuffer.allocUnsafeSlow=function(i){if(typeof i!=="number"){throw new TypeError("Argument must be a number")}return v.SlowBuffer(i)}},7076:(i,u,m)=>{"use strict"; + */ + + + +/** + * Module dependencies. + * @private + */ + +var Buffer = (__nccwpck_require__(21867).Buffer) + +/** + * Module exports. + * @public + */ + +module.exports = auth +module.exports.parse = parse + +/** + * RegExp for basic auth credentials + * + * credentials = auth-scheme 1*SP token68 + * auth-scheme = "Basic" ; case insensitive + * token68 = 1*( ALPHA / DIGIT / "-" / "." / "_" / "~" / "+" / "/" ) *"=" + * @private + */ + +var CREDENTIALS_REGEXP = /^ *(?:[Bb][Aa][Ss][Ii][Cc]) +([A-Za-z0-9._~+/-]+=*) *$/ + +/** + * RegExp for basic auth user/pass + * + * user-pass = userid ":" password + * userid = * + * password = *TEXT + * @private + */ + +var USER_PASS_REGEXP = /^([^:]*):(.*)$/ + +/** + * Parse the Authorization header field of a request. + * + * @param {object} req + * @return {object} with .name and .pass + * @public + */ + +function auth (req) { + if (!req) { + throw new TypeError('argument req is required') + } + + if (typeof req !== 'object') { + throw new TypeError('argument req is required to be an object') + } + + // get header + var header = getAuthorization(req) + + // parse header + return parse(header) +} + +/** + * Decode base64 string. + * @private + */ + +function decodeBase64 (str) { + return Buffer.from(str, 'base64').toString() +} + +/** + * Get the Authorization header from request object. + * @private + */ + +function getAuthorization (req) { + if (!req.headers || typeof req.headers !== 'object') { + throw new TypeError('argument req is required to have headers property') + } + + return req.headers.authorization +} + +/** + * Parse basic auth to object. + * + * @param {string} string + * @return {object} + * @public + */ + +function parse (string) { + if (typeof string !== 'string') { + return undefined + } + + // parse header + var match = CREDENTIALS_REGEXP.exec(string) + + if (!match) { + return undefined + } + + // decode user pass + var userPass = USER_PASS_REGEXP.exec(decodeBase64(match[1])) + + if (!userPass) { + return undefined + } + + // return credentials object + return new Credentials(userPass[1], userPass[2]) +} + +/** + * Object to represent user credentials. + * @private + */ + +function Credentials (name, pass) { + this.name = name + this.pass = pass +} + + +/***/ }), + +/***/ 97076: +/***/ ((module, exports, __nccwpck_require__) => { + +"use strict"; /*! * body-parser * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed - */var v=m(8883)("body-parser");var _=Object.create(null);u=i.exports=v.function(bodyParser,"bodyParser: use individual json/urlencoded middlewares");Object.defineProperty(u,"json",{configurable:true,enumerable:true,get:createParserGetter("json")});Object.defineProperty(u,"raw",{configurable:true,enumerable:true,get:createParserGetter("raw")});Object.defineProperty(u,"text",{configurable:true,enumerable:true,get:createParserGetter("text")});Object.defineProperty(u,"urlencoded",{configurable:true,enumerable:true,get:createParserGetter("urlencoded")});function bodyParser(i){var m=Object.create(i||null,{type:{configurable:true,enumerable:true,value:undefined,writable:true}});var v=u.urlencoded(m);var _=u.json(m);return function bodyParser(i,u,m){_(i,u,(function(_){if(_)return m(_);v(i,u,m)}))}}function createParserGetter(i){return function get(){return loadParser(i)}}function loadParser(i){var u=_[i];if(u!==undefined){return u}switch(i){case"json":u=m(859);break;case"raw":u=m(9609);break;case"text":u=m(6382);break;case"urlencoded":u=m(6100);break}return _[i]=u}},8862:(i,u,m)=>{"use strict"; + */ + + + +/** + * Module dependencies. + * @private + */ + +var deprecate = __nccwpck_require__(18883)('body-parser') + +/** + * Cache of loaded parsers. + * @private + */ + +var parsers = Object.create(null) + +/** + * @typedef Parsers + * @type {function} + * @property {function} json + * @property {function} raw + * @property {function} text + * @property {function} urlencoded + */ + +/** + * Module exports. + * @type {Parsers} + */ + +exports = module.exports = deprecate.function(bodyParser, + 'bodyParser: use individual json/urlencoded middlewares') + +/** + * JSON parser. + * @public + */ + +Object.defineProperty(exports, "json", ({ + configurable: true, + enumerable: true, + get: createParserGetter('json') +})) + +/** + * Raw parser. + * @public + */ + +Object.defineProperty(exports, "raw", ({ + configurable: true, + enumerable: true, + get: createParserGetter('raw') +})) + +/** + * Text parser. + * @public + */ + +Object.defineProperty(exports, "text", ({ + configurable: true, + enumerable: true, + get: createParserGetter('text') +})) + +/** + * URL-encoded parser. + * @public + */ + +Object.defineProperty(exports, "urlencoded", ({ + configurable: true, + enumerable: true, + get: createParserGetter('urlencoded') +})) + +/** + * Create a middleware to parse json and urlencoded bodies. + * + * @param {object} [options] + * @return {function} + * @deprecated + * @public + */ + +function bodyParser (options) { + // use default type for parsers + var opts = Object.create(options || null, { + type: { + configurable: true, + enumerable: true, + value: undefined, + writable: true + } + }) + + var _urlencoded = exports.urlencoded(opts) + var _json = exports.json(opts) + + return function bodyParser (req, res, next) { + _json(req, res, function (err) { + if (err) return next(err) + _urlencoded(req, res, next) + }) + } +} + +/** + * Create a getter for loading a parser. + * @private + */ + +function createParserGetter (name) { + return function get () { + return loadParser(name) + } +} + +/** + * Load a parser module. + * @private + */ + +function loadParser (parserName) { + var parser = parsers[parserName] + + if (parser !== undefined) { + return parser + } + + // this uses a switch for static require analysis + switch (parserName) { + case 'json': + parser = __nccwpck_require__(20859) + break + case 'raw': + parser = __nccwpck_require__(49609) + break + case 'text': + parser = __nccwpck_require__(26382) + break + case 'urlencoded': + parser = __nccwpck_require__(76100) + break + } + + // store to prevent invoking require() + return (parsers[parserName] = parser) +} + + +/***/ }), + +/***/ 88862: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; /*! * body-parser * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed - */var v=m(5193);var _=m(3225);var M=m(7742);var j=m(9032);var $=m(4694);var W=m(3124);var Y=m(9796);i.exports=read;function read(i,u,m,$,Y,Z){var X;var ee=Z;var ie;i._body=true;var ae=ee.encoding!==null?ee.encoding:null;var ce=ee.verify;try{ie=contentstream(i,Y,ee.inflate);X=ie.length;ie.length=undefined}catch(i){return m(i)}ee.length=X;ee.encoding=ce?null:ae;if(ee.encoding===null&&ae!==null&&!j.encodingExists(ae)){return m(v(415,'unsupported charset "'+ae.toUpperCase()+'"',{charset:ae.toLowerCase(),type:"charset.unsupported"}))}Y("read body");M(ie,ee,(function(M,Z){if(M){var X;if(M.type==="encoding.unsupported"){X=v(415,'unsupported charset "'+ae.toUpperCase()+'"',{charset:ae.toLowerCase(),type:"charset.unsupported"})}else{X=v(400,M)}if(ie!==i){W(i);_(ie,true)}dump(i,(function onfinished(){m(v(400,X))}));return}if(ce){try{Y("verify body");ce(i,u,Z,ae)}catch(i){m(v(403,i,{body:Z,type:i.type||"entity.verify.failed"}));return}}var ee=Z;try{Y("parse body");ee=typeof Z!=="string"&&ae!==null?j.decode(Z,ae):Z;i.body=$(ee)}catch(i){m(v(400,i,{body:ee,type:i.type||"entity.parse.failed"}));return}m()}))}function contentstream(i,u,m){var _=(i.headers["content-encoding"]||"identity").toLowerCase();var M=i.headers["content-length"];var j;u('content-encoding "%s"',_);if(m===false&&_!=="identity"){throw v(415,"content encoding unsupported",{encoding:_,type:"encoding.unsupported"})}switch(_){case"deflate":j=Y.createInflate();u("inflate body");i.pipe(j);break;case"gzip":j=Y.createGunzip();u("gunzip body");i.pipe(j);break;case"identity":j=i;j.length=M;break;default:throw v(415,'unsupported content encoding "'+_+'"',{encoding:_,type:"encoding.unsupported"})}return j}function dump(i,u){if($.isFinished(i)){u(null)}else{$(i,u);i.resume()}}},859:(i,u,m)=>{"use strict"; + */ + + + +/** + * Module dependencies. + * @private + */ + +var createError = __nccwpck_require__(95193) +var destroy = __nccwpck_require__(43225) +var getBody = __nccwpck_require__(47742) +var iconv = __nccwpck_require__(19032) +var onFinished = __nccwpck_require__(24694) +var unpipe = __nccwpck_require__(3124) +var zlib = __nccwpck_require__(59796) + +/** + * Module exports. + */ + +module.exports = read + +/** + * Read a request into a buffer and parse. + * + * @param {object} req + * @param {object} res + * @param {function} next + * @param {function} parse + * @param {function} debug + * @param {object} options + * @private + */ + +function read (req, res, next, parse, debug, options) { + var length + var opts = options + var stream + + // flag as parsed + req._body = true + + // read options + var encoding = opts.encoding !== null + ? opts.encoding + : null + var verify = opts.verify + + try { + // get the content stream + stream = contentstream(req, debug, opts.inflate) + length = stream.length + stream.length = undefined + } catch (err) { + return next(err) + } + + // set raw-body options + opts.length = length + opts.encoding = verify + ? null + : encoding + + // assert charset is supported + if (opts.encoding === null && encoding !== null && !iconv.encodingExists(encoding)) { + return next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', { + charset: encoding.toLowerCase(), + type: 'charset.unsupported' + })) + } + + // read body + debug('read body') + getBody(stream, opts, function (error, body) { + if (error) { + var _error + + if (error.type === 'encoding.unsupported') { + // echo back charset + _error = createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', { + charset: encoding.toLowerCase(), + type: 'charset.unsupported' + }) + } else { + // set status code on error + _error = createError(400, error) + } + + // unpipe from stream and destroy + if (stream !== req) { + unpipe(req) + destroy(stream, true) + } + + // read off entire request + dump(req, function onfinished () { + next(createError(400, _error)) + }) + return + } + + // verify + if (verify) { + try { + debug('verify body') + verify(req, res, body, encoding) + } catch (err) { + next(createError(403, err, { + body: body, + type: err.type || 'entity.verify.failed' + })) + return + } + } + + // parse + var str = body + try { + debug('parse body') + str = typeof body !== 'string' && encoding !== null + ? iconv.decode(body, encoding) + : body + req.body = parse(str) + } catch (err) { + next(createError(400, err, { + body: str, + type: err.type || 'entity.parse.failed' + })) + return + } + + next() + }) +} + +/** + * Get the content stream of the request. + * + * @param {object} req + * @param {function} debug + * @param {boolean} [inflate=true] + * @return {object} + * @api private + */ + +function contentstream (req, debug, inflate) { + var encoding = (req.headers['content-encoding'] || 'identity').toLowerCase() + var length = req.headers['content-length'] + var stream + + debug('content-encoding "%s"', encoding) + + if (inflate === false && encoding !== 'identity') { + throw createError(415, 'content encoding unsupported', { + encoding: encoding, + type: 'encoding.unsupported' + }) + } + + switch (encoding) { + case 'deflate': + stream = zlib.createInflate() + debug('inflate body') + req.pipe(stream) + break + case 'gzip': + stream = zlib.createGunzip() + debug('gunzip body') + req.pipe(stream) + break + case 'identity': + stream = req + stream.length = length + break + default: + throw createError(415, 'unsupported content encoding "' + encoding + '"', { + encoding: encoding, + type: 'encoding.unsupported' + }) + } + + return stream +} + +/** + * Dump the contents of a request. + * + * @param {object} req + * @param {function} callback + * @api private + */ + +function dump (req, callback) { + if (onFinished.isFinished(req)) { + callback(null) + } else { + onFinished(req, callback) + req.resume() + } +} + + +/***/ }), + +/***/ 20859: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; /*! * body-parser * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed - */var v=m(6966);var _=m(9915);var M=m(5193);var j=m(7471)("body-parser:json");var $=m(8862);var W=m(1159);i.exports=json;var Y=/^[\x20\x09\x0a\x0d]*([^\x20\x09\x0a\x0d])/;function json(i){var u=i||{};var m=typeof u.limit!=="number"?v.parse(u.limit||"100kb"):u.limit;var _=u.inflate!==false;var Y=u.reviver;var Z=u.strict!==false;var X=u.type||"application/json";var ee=u.verify||false;if(ee!==false&&typeof ee!=="function"){throw new TypeError("option verify must be function")}var ie=typeof X!=="function"?typeChecker(X):X;function parse(i){if(i.length===0){return{}}if(Z){var u=firstchar(i);if(u!=="{"&&u!=="["){j("strict violation");throw createStrictSyntaxError(i,u)}}try{j("parse json");return JSON.parse(i,Y)}catch(i){throw normalizeJsonSyntaxError(i,{message:i.message,stack:i.stack})}}return function jsonParser(i,u,v){if(i._body){j("body already parsed");v();return}i.body=i.body||{};if(!W.hasBody(i)){j("skip empty body");v();return}j("content-type %j",i.headers["content-type"]);if(!ie(i)){j("skip parsing");v();return}var Y=getCharset(i)||"utf-8";if(Y.slice(0,4)!=="utf-"){j("invalid charset");v(M(415,'unsupported charset "'+Y.toUpperCase()+'"',{charset:Y,type:"charset.unsupported"}));return}$(i,u,v,parse,j,{encoding:Y,inflate:_,limit:m,verify:ee})}}function createStrictSyntaxError(i,u){var m=i.indexOf(u);var v=m!==-1?i.substring(0,m)+"#":"";try{JSON.parse(v);throw new SyntaxError("strict violation")}catch(i){return normalizeJsonSyntaxError(i,{message:i.message.replace("#",u),stack:i.stack})}}function firstchar(i){var u=Y.exec(i);return u?u[1]:undefined}function getCharset(i){try{return(_.parse(i).parameters.charset||"").toLowerCase()}catch(i){return undefined}}function normalizeJsonSyntaxError(i,u){var m=Object.getOwnPropertyNames(i);for(var v=0;v{"use strict"; + */ + + + +/** + * Module dependencies. + * @private + */ + +var bytes = __nccwpck_require__(86966) +var contentType = __nccwpck_require__(99915) +var createError = __nccwpck_require__(95193) +var debug = __nccwpck_require__(7471)('body-parser:json') +var read = __nccwpck_require__(88862) +var typeis = __nccwpck_require__(71159) + +/** + * Module exports. + */ + +module.exports = json + +/** + * RegExp to match the first non-space in a string. + * + * Allowed whitespace is defined in RFC 7159: + * + * ws = *( + * %x20 / ; Space + * %x09 / ; Horizontal tab + * %x0A / ; Line feed or New line + * %x0D ) ; Carriage return + */ + +var FIRST_CHAR_REGEXP = /^[\x20\x09\x0a\x0d]*([^\x20\x09\x0a\x0d])/ // eslint-disable-line no-control-regex + +var JSON_SYNTAX_CHAR = '#' +var JSON_SYNTAX_REGEXP = /#+/g + +/** + * Create a middleware to parse JSON bodies. + * + * @param {object} [options] + * @return {function} + * @public + */ + +function json (options) { + var opts = options || {} + + var limit = typeof opts.limit !== 'number' + ? bytes.parse(opts.limit || '100kb') + : opts.limit + var inflate = opts.inflate !== false + var reviver = opts.reviver + var strict = opts.strict !== false + var type = opts.type || 'application/json' + var verify = opts.verify || false + + if (verify !== false && typeof verify !== 'function') { + throw new TypeError('option verify must be function') + } + + // create the appropriate type checking function + var shouldParse = typeof type !== 'function' + ? typeChecker(type) + : type + + function parse (body) { + if (body.length === 0) { + // special-case empty json body, as it's a common client-side mistake + // TODO: maybe make this configurable or part of "strict" option + return {} + } + + if (strict) { + var first = firstchar(body) + + if (first !== '{' && first !== '[') { + debug('strict violation') + throw createStrictSyntaxError(body, first) + } + } + + try { + debug('parse json') + return JSON.parse(body, reviver) + } catch (e) { + throw normalizeJsonSyntaxError(e, { + message: e.message, + stack: e.stack + }) + } + } + + return function jsonParser (req, res, next) { + if (req._body) { + debug('body already parsed') + next() + return + } + + req.body = req.body || {} + + // skip requests without bodies + if (!typeis.hasBody(req)) { + debug('skip empty body') + next() + return + } + + debug('content-type %j', req.headers['content-type']) + + // determine if request should be parsed + if (!shouldParse(req)) { + debug('skip parsing') + next() + return + } + + // assert charset per RFC 7159 sec 8.1 + var charset = getCharset(req) || 'utf-8' + if (charset.slice(0, 4) !== 'utf-') { + debug('invalid charset') + next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', { + charset: charset, + type: 'charset.unsupported' + })) + return + } + + // read + read(req, res, next, parse, debug, { + encoding: charset, + inflate: inflate, + limit: limit, + verify: verify + }) + } +} + +/** + * Create strict violation syntax error matching native error. + * + * @param {string} str + * @param {string} char + * @return {Error} + * @private + */ + +function createStrictSyntaxError (str, char) { + var index = str.indexOf(char) + var partial = '' + + if (index !== -1) { + partial = str.substring(0, index) + JSON_SYNTAX_CHAR + + for (var i = index + 1; i < str.length; i++) { + partial += JSON_SYNTAX_CHAR + } + } + + try { + JSON.parse(partial); /* istanbul ignore next */ throw new SyntaxError('strict violation') + } catch (e) { + return normalizeJsonSyntaxError(e, { + message: e.message.replace(JSON_SYNTAX_REGEXP, function (placeholder) { + return str.substring(index, index + placeholder.length) + }), + stack: e.stack + }) + } +} + +/** + * Get the first non-whitespace character in a string. + * + * @param {string} str + * @return {function} + * @private + */ + +function firstchar (str) { + var match = FIRST_CHAR_REGEXP.exec(str) + + return match + ? match[1] + : undefined +} + +/** + * Get the charset of a request. + * + * @param {object} req + * @api private + */ + +function getCharset (req) { + try { + return (contentType.parse(req).parameters.charset || '').toLowerCase() + } catch (e) { + return undefined + } +} + +/** + * Normalize a SyntaxError for JSON.parse. + * + * @param {SyntaxError} error + * @param {object} obj + * @return {SyntaxError} + */ + +function normalizeJsonSyntaxError (error, obj) { + var keys = Object.getOwnPropertyNames(error) + + for (var i = 0; i < keys.length; i++) { + var key = keys[i] + if (key !== 'stack' && key !== 'message') { + delete error[key] + } + } + + // replace stack before message for Node.js 0.10 and below + error.stack = obj.stack.replace(error.message, obj.message) + error.message = obj.message + + return error +} + +/** + * Get the simple type checker. + * + * @param {string} type + * @return {function} + */ + +function typeChecker (type) { + return function checkType (req) { + return Boolean(typeis(req, type)) + } +} + + +/***/ }), + +/***/ 49609: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; /*! * body-parser * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed - */var v=m(6966);var _=m(7471)("body-parser:raw");var M=m(8862);var j=m(1159);i.exports=raw;function raw(i){var u=i||{};var m=u.inflate!==false;var $=typeof u.limit!=="number"?v.parse(u.limit||"100kb"):u.limit;var W=u.type||"application/octet-stream";var Y=u.verify||false;if(Y!==false&&typeof Y!=="function"){throw new TypeError("option verify must be function")}var Z=typeof W!=="function"?typeChecker(W):W;function parse(i){return i}return function rawParser(i,u,v){if(i._body){_("body already parsed");v();return}i.body=i.body||{};if(!j.hasBody(i)){_("skip empty body");v();return}_("content-type %j",i.headers["content-type"]);if(!Z(i)){_("skip parsing");v();return}M(i,u,v,parse,_,{encoding:null,inflate:m,limit:$,verify:Y})}}function typeChecker(i){return function checkType(u){return Boolean(j(u,i))}}},6382:(i,u,m)=>{"use strict"; + */ + + + +/** + * Module dependencies. + */ + +var bytes = __nccwpck_require__(86966) +var debug = __nccwpck_require__(7471)('body-parser:raw') +var read = __nccwpck_require__(88862) +var typeis = __nccwpck_require__(71159) + +/** + * Module exports. + */ + +module.exports = raw + +/** + * Create a middleware to parse raw bodies. + * + * @param {object} [options] + * @return {function} + * @api public + */ + +function raw (options) { + var opts = options || {} + + var inflate = opts.inflate !== false + var limit = typeof opts.limit !== 'number' + ? bytes.parse(opts.limit || '100kb') + : opts.limit + var type = opts.type || 'application/octet-stream' + var verify = opts.verify || false + + if (verify !== false && typeof verify !== 'function') { + throw new TypeError('option verify must be function') + } + + // create the appropriate type checking function + var shouldParse = typeof type !== 'function' + ? typeChecker(type) + : type + + function parse (buf) { + return buf + } + + return function rawParser (req, res, next) { + if (req._body) { + debug('body already parsed') + next() + return + } + + req.body = req.body || {} + + // skip requests without bodies + if (!typeis.hasBody(req)) { + debug('skip empty body') + next() + return + } + + debug('content-type %j', req.headers['content-type']) + + // determine if request should be parsed + if (!shouldParse(req)) { + debug('skip parsing') + next() + return + } + + // read + read(req, res, next, parse, debug, { + encoding: null, + inflate: inflate, + limit: limit, + verify: verify + }) + } +} + +/** + * Get the simple type checker. + * + * @param {string} type + * @return {function} + */ + +function typeChecker (type) { + return function checkType (req) { + return Boolean(typeis(req, type)) + } +} + + +/***/ }), + +/***/ 26382: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; /*! * body-parser * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed - */var v=m(6966);var _=m(9915);var M=m(7471)("body-parser:text");var j=m(8862);var $=m(1159);i.exports=text;function text(i){var u=i||{};var m=u.defaultCharset||"utf-8";var _=u.inflate!==false;var W=typeof u.limit!=="number"?v.parse(u.limit||"100kb"):u.limit;var Y=u.type||"text/plain";var Z=u.verify||false;if(Z!==false&&typeof Z!=="function"){throw new TypeError("option verify must be function")}var X=typeof Y!=="function"?typeChecker(Y):Y;function parse(i){return i}return function textParser(i,u,v){if(i._body){M("body already parsed");v();return}i.body=i.body||{};if(!$.hasBody(i)){M("skip empty body");v();return}M("content-type %j",i.headers["content-type"]);if(!X(i)){M("skip parsing");v();return}var Y=getCharset(i)||m;j(i,u,v,parse,M,{encoding:Y,inflate:_,limit:W,verify:Z})}}function getCharset(i){try{return(_.parse(i).parameters.charset||"").toLowerCase()}catch(i){return undefined}}function typeChecker(i){return function checkType(u){return Boolean($(u,i))}}},6100:(i,u,m)=>{"use strict"; + */ + + + +/** + * Module dependencies. + */ + +var bytes = __nccwpck_require__(86966) +var contentType = __nccwpck_require__(99915) +var debug = __nccwpck_require__(7471)('body-parser:text') +var read = __nccwpck_require__(88862) +var typeis = __nccwpck_require__(71159) + +/** + * Module exports. + */ + +module.exports = text + +/** + * Create a middleware to parse text bodies. + * + * @param {object} [options] + * @return {function} + * @api public + */ + +function text (options) { + var opts = options || {} + + var defaultCharset = opts.defaultCharset || 'utf-8' + var inflate = opts.inflate !== false + var limit = typeof opts.limit !== 'number' + ? bytes.parse(opts.limit || '100kb') + : opts.limit + var type = opts.type || 'text/plain' + var verify = opts.verify || false + + if (verify !== false && typeof verify !== 'function') { + throw new TypeError('option verify must be function') + } + + // create the appropriate type checking function + var shouldParse = typeof type !== 'function' + ? typeChecker(type) + : type + + function parse (buf) { + return buf + } + + return function textParser (req, res, next) { + if (req._body) { + debug('body already parsed') + next() + return + } + + req.body = req.body || {} + + // skip requests without bodies + if (!typeis.hasBody(req)) { + debug('skip empty body') + next() + return + } + + debug('content-type %j', req.headers['content-type']) + + // determine if request should be parsed + if (!shouldParse(req)) { + debug('skip parsing') + next() + return + } + + // get charset + var charset = getCharset(req) || defaultCharset + + // read + read(req, res, next, parse, debug, { + encoding: charset, + inflate: inflate, + limit: limit, + verify: verify + }) + } +} + +/** + * Get the charset of a request. + * + * @param {object} req + * @api private + */ + +function getCharset (req) { + try { + return (contentType.parse(req).parameters.charset || '').toLowerCase() + } catch (e) { + return undefined + } +} + +/** + * Get the simple type checker. + * + * @param {string} type + * @return {function} + */ + +function typeChecker (type) { + return function checkType (req) { + return Boolean(typeis(req, type)) + } +} + + +/***/ }), + +/***/ 76100: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; /*! * body-parser * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed - */var v=m(6966);var _=m(9915);var M=m(5193);var j=m(7471)("body-parser:urlencoded");var $=m(8883)("body-parser");var W=m(8862);var Y=m(1159);i.exports=urlencoded;var Z=Object.create(null);function urlencoded(i){var u=i||{};if(u.extended===undefined){$("undefined extended: provide extended option")}var m=u.extended!==false;var _=u.inflate!==false;var Z=typeof u.limit!=="number"?v.parse(u.limit||"100kb"):u.limit;var X=u.type||"application/x-www-form-urlencoded";var ee=u.verify||false;if(ee!==false&&typeof ee!=="function"){throw new TypeError("option verify must be function")}var ie=m?extendedparser(u):simpleparser(u);var ae=typeof X!=="function"?typeChecker(X):X;function parse(i){return i.length?ie(i):{}}return function urlencodedParser(i,u,m){if(i._body){j("body already parsed");m();return}i.body=i.body||{};if(!Y.hasBody(i)){j("skip empty body");m();return}j("content-type %j",i.headers["content-type"]);if(!ae(i)){j("skip parsing");m();return}var v=getCharset(i)||"utf-8";if(v!=="utf-8"){j("invalid charset");m(M(415,'unsupported charset "'+v.toUpperCase()+'"',{charset:v,type:"charset.unsupported"}));return}W(i,u,m,parse,j,{debug:j,encoding:v,inflate:_,limit:Z,verify:ee})}}function extendedparser(i){var u=i.parameterLimit!==undefined?i.parameterLimit:1e3;var m=parser("qs");if(isNaN(u)||u<1){throw new TypeError("option parameterLimit must be a positive number")}if(isFinite(u)){u=u|0}return function queryparse(i){var v=parameterCount(i,u);if(v===undefined){j("too many parameters");throw M(413,"too many parameters",{type:"parameters.too.many"})}var _=Math.max(100,v);j("parse extended urlencoding");return m(i,{allowPrototypes:true,arrayLimit:_,depth:Infinity,parameterLimit:u})}}function getCharset(i){try{return(_.parse(i).parameters.charset||"").toLowerCase()}catch(i){return undefined}}function parameterCount(i,u){var m=0;var v=0;while((v=i.indexOf("&",v))!==-1){m++;v++;if(m===u){return undefined}}return m}function parser(i){var u=Z[i];if(u!==undefined){return u.parse}switch(i){case"qs":u=m(2760);break;case"querystring":u=m(3477);break}Z[i]=u;return u.parse}function simpleparser(i){var u=i.parameterLimit!==undefined?i.parameterLimit:1e3;var m=parser("querystring");if(isNaN(u)||u<1){throw new TypeError("option parameterLimit must be a positive number")}if(isFinite(u)){u=u|0}return function queryparse(i){var v=parameterCount(i,u);if(v===undefined){j("too many parameters");throw M(413,"too many parameters",{type:"parameters.too.many"})}j("parse urlencoding");return m(i,undefined,undefined,{maxKeys:u})}}function typeChecker(i){return function checkType(u){return Boolean(Y(u,i))}}},5377:(i,u,m)=>{u=i.exports=m(2552);u.log=log;u.formatArgs=formatArgs;u.save=save;u.load=load;u.useColors=useColors;u.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:localstorage();u.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function useColors(){if(typeof window!=="undefined"&&window.process&&window.process.type==="renderer"){return true}return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}u.formatters.j=function(i){try{return JSON.stringify(i)}catch(i){return"[UnexpectedJSONParseError]: "+i.message}};function formatArgs(i){var m=this.useColors;i[0]=(m?"%c":"")+this.namespace+(m?" %c":" ")+i[0]+(m?"%c ":" ")+"+"+u.humanize(this.diff);if(!m)return;var v="color: "+this.color;i.splice(1,0,v,"color: inherit");var _=0;var M=0;i[0].replace(/%[a-zA-Z%]/g,(function(i){if("%%"===i)return;_++;if("%c"===i){M=_}}));i.splice(M,0,v)}function log(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(i){try{if(null==i){u.storage.removeItem("debug")}else{u.storage.debug=i}}catch(i){}}function load(){var i;try{i=u.storage.debug}catch(i){}if(!i&&typeof process!=="undefined"&&"env"in process){i=process.env.DEBUG}return i}u.enable(load());function localstorage(){try{return window.localStorage}catch(i){}}},2552:(i,u,m)=>{u=i.exports=createDebug.debug=createDebug["default"]=createDebug;u.coerce=coerce;u.disable=disable;u.enable=enable;u.enabled=enabled;u.humanize=m(3233);u.names=[];u.skips=[];u.formatters={};var v;function selectColor(i){var m=0,v;for(v in i){m=(m<<5)-m+i.charCodeAt(v);m|=0}return u.colors[Math.abs(m)%u.colors.length]}function createDebug(i){function debug(){if(!debug.enabled)return;var i=debug;var m=+new Date;var _=m-(v||m);i.diff=_;i.prev=v;i.curr=m;v=m;var M=new Array(arguments.length);for(var j=0;j{if(typeof process!=="undefined"&&process.type==="renderer"){i.exports=m(5377)}else{i.exports=m(4117)}},4117:(i,u,m)=>{var v=m(6224);var _=m(3837);u=i.exports=m(2552);u.init=init;u.log=log;u.formatArgs=formatArgs;u.save=save;u.load=load;u.useColors=useColors;u.colors=[6,2,3,4,5,1];u.inspectOpts=Object.keys(process.env).filter((function(i){return/^debug_/i.test(i)})).reduce((function(i,u){var m=u.substring(6).toLowerCase().replace(/_([a-z])/g,(function(i,u){return u.toUpperCase()}));var v=process.env[u];if(/^(yes|on|true|enabled)$/i.test(v))v=true;else if(/^(no|off|false|disabled)$/i.test(v))v=false;else if(v==="null")v=null;else v=Number(v);i[m]=v;return i}),{});var M=parseInt(process.env.DEBUG_FD,10)||2;if(1!==M&&2!==M){_.deprecate((function(){}),"except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)")()}var j=1===M?process.stdout:2===M?process.stderr:createWritableStdioStream(M);function useColors(){return"colors"in u.inspectOpts?Boolean(u.inspectOpts.colors):v.isatty(M)}u.formatters.o=function(i){this.inspectOpts.colors=this.useColors;return _.inspect(i,this.inspectOpts).split("\n").map((function(i){return i.trim()})).join(" ")};u.formatters.O=function(i){this.inspectOpts.colors=this.useColors;return _.inspect(i,this.inspectOpts)};function formatArgs(i){var m=this.namespace;var v=this.useColors;if(v){var _=this.color;var M=" [3"+_+";1m"+m+" "+"";i[0]=M+i[0].split("\n").join("\n"+M);i.push("[3"+_+"m+"+u.humanize(this.diff)+"")}else{i[0]=(new Date).toUTCString()+" "+m+" "+i[0]}}function log(){return j.write(_.format.apply(_,arguments)+"\n")}function save(i){if(null==i){delete process.env.DEBUG}else{process.env.DEBUG=i}}function load(){return process.env.DEBUG}function createWritableStdioStream(i){var u;var _=process.binding("tty_wrap");switch(_.guessHandleType(i)){case"TTY":u=new v.WriteStream(i);u._type="tty";if(u._handle&&u._handle.unref){u._handle.unref()}break;case"FILE":var M=m(7147);u=new M.SyncWriteStream(i,{autoClose:false});u._type="fs";break;case"PIPE":case"TCP":var j=m(1808);u=new j.Socket({fd:i,readable:false,writable:true});u.readable=false;u.read=null;u._type="pipe";if(u._handle&&u._handle.unref){u._handle.unref()}break;default:throw new Error("Implement me. Unknown stream file type!")}u.fd=i;u._isStdio=true;return u}function init(i){i.inspectOpts={};var m=Object.keys(u.inspectOpts);for(var v=0;v{var u=1e3;var m=u*60;var v=m*60;var _=v*24;var M=_*365.25;i.exports=function(i,u){u=u||{};var m=typeof i;if(m==="string"&&i.length>0){return parse(i)}else if(m==="number"&&isNaN(i)===false){return u.long?fmtLong(i):fmtShort(i)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))};function parse(i){i=String(i);if(i.length>100){return}var j=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(i);if(!j){return}var $=parseFloat(j[1]);var W=(j[2]||"ms").toLowerCase();switch(W){case"years":case"year":case"yrs":case"yr":case"y":return $*M;case"days":case"day":case"d":return $*_;case"hours":case"hour":case"hrs":case"hr":case"h":return $*v;case"minutes":case"minute":case"mins":case"min":case"m":return $*m;case"seconds":case"second":case"secs":case"sec":case"s":return $*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return $;default:return undefined}}function fmtShort(i){if(i>=_){return Math.round(i/_)+"d"}if(i>=v){return Math.round(i/v)+"h"}if(i>=m){return Math.round(i/m)+"m"}if(i>=u){return Math.round(i/u)+"s"}return i+"ms"}function fmtLong(i){return plural(i,_,"day")||plural(i,v,"hour")||plural(i,m,"minute")||plural(i,u,"second")||i+" ms"}function plural(i,u,m){if(i{i.exports={trueFunc:function trueFunc(){return true},falseFunc:function falseFunc(){return false}}},3717:(i,u,m)=>{var v=m(6891);var _=m(9417);i.exports=expandTop;var M="\0SLASH"+Math.random()+"\0";var j="\0OPEN"+Math.random()+"\0";var $="\0CLOSE"+Math.random()+"\0";var W="\0COMMA"+Math.random()+"\0";var Y="\0PERIOD"+Math.random()+"\0";function numeric(i){return parseInt(i,10)==i?parseInt(i,10):i.charCodeAt(0)}function escapeBraces(i){return i.split("\\\\").join(M).split("\\{").join(j).split("\\}").join($).split("\\,").join(W).split("\\.").join(Y)}function unescapeBraces(i){return i.split(M).join("\\").split(j).join("{").split($).join("}").split(W).join(",").split(Y).join(".")}function parseCommaParts(i){if(!i)return[""];var u=[];var m=_("{","}",i);if(!m)return i.split(",");var v=m.pre;var M=m.body;var j=m.post;var $=v.split(",");$[$.length-1]+="{"+M+"}";var W=parseCommaParts(j);if(j.length){$[$.length-1]+=W.shift();$.push.apply($,W)}u.push.apply(u,$);return u}function expandTop(i){if(!i)return[];if(i.substr(0,2)==="{}"){i="\\{\\}"+i.substr(2)}return expand(escapeBraces(i),true).map(unescapeBraces)}function identity(i){return i}function embrace(i){return"{"+i+"}"}function isPadded(i){return/^-?0\d/.test(i)}function lte(i,u){return i<=u}function gte(i,u){return i>=u}function expand(i,u){var m=[];var M=_("{","}",i);if(!M||/\$$/.test(M.pre))return[i];var j=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(M.body);var W=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(M.body);var Y=j||W;var Z=M.body.indexOf(",")>=0;if(!Y&&!Z){if(M.post.match(/,.*\}/)){i=M.pre+"{"+M.body+$+M.post;return expand(i)}return[i]}var X;if(Y){X=M.body.split(/\.\./)}else{X=parseCommaParts(M.body);if(X.length===1){X=expand(X[0],false).map(embrace);if(X.length===1){var ee=M.post.length?expand(M.post,false):[""];return ee.map((function(i){return M.pre+X[0]+i}))}}}var ie=M.pre;var ee=M.post.length?expand(M.post,false):[""];var ae;if(Y){var ce=numeric(X[0]);var le=numeric(X[1]);var pe=Math.max(X[0].length,X[1].length);var fe=X.length==3?Math.abs(numeric(X[2])):1;var de=lte;var ye=le0){var we=new Array(xe+1).join("0");if(_e<0)Se="-"+we+Se.slice(1);else Se=we+Se}}}ae.push(Se)}}else{ae=v(X,(function(i){return expand(i,false)}))}for(var Te=0;Te{"use strict"; + */ + + + +/** + * Module dependencies. + * @private + */ + +var bytes = __nccwpck_require__(86966) +var contentType = __nccwpck_require__(99915) +var createError = __nccwpck_require__(95193) +var debug = __nccwpck_require__(7471)('body-parser:urlencoded') +var deprecate = __nccwpck_require__(18883)('body-parser') +var read = __nccwpck_require__(88862) +var typeis = __nccwpck_require__(71159) + +/** + * Module exports. + */ + +module.exports = urlencoded + +/** + * Cache of parser modules. + */ + +var parsers = Object.create(null) + +/** + * Create a middleware to parse urlencoded bodies. + * + * @param {object} [options] + * @return {function} + * @public + */ + +function urlencoded (options) { + var opts = options || {} + + // notice because option default will flip in next major + if (opts.extended === undefined) { + deprecate('undefined extended: provide extended option') + } + + var extended = opts.extended !== false + var inflate = opts.inflate !== false + var limit = typeof opts.limit !== 'number' + ? bytes.parse(opts.limit || '100kb') + : opts.limit + var type = opts.type || 'application/x-www-form-urlencoded' + var verify = opts.verify || false + var depth = typeof opts.depth !== 'number' + ? Number(opts.depth || 32) + : opts.depth + + if (verify !== false && typeof verify !== 'function') { + throw new TypeError('option verify must be function') + } + + // create the appropriate query parser + var queryparse = extended + ? extendedparser(opts) + : simpleparser(opts) + + // create the appropriate type checking function + var shouldParse = typeof type !== 'function' + ? typeChecker(type) + : type + + function parse (body) { + return body.length + ? queryparse(body) + : {} + } + + return function urlencodedParser (req, res, next) { + if (req._body) { + debug('body already parsed') + next() + return + } + + req.body = req.body || {} + + // skip requests without bodies + if (!typeis.hasBody(req)) { + debug('skip empty body') + next() + return + } + + debug('content-type %j', req.headers['content-type']) + + // determine if request should be parsed + if (!shouldParse(req)) { + debug('skip parsing') + next() + return + } + + // assert charset + var charset = getCharset(req) || 'utf-8' + if (charset !== 'utf-8') { + debug('invalid charset') + next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', { + charset: charset, + type: 'charset.unsupported' + })) + return + } + + // read + read(req, res, next, parse, debug, { + debug: debug, + encoding: charset, + inflate: inflate, + limit: limit, + verify: verify, + depth: depth + }) + } +} + +/** + * Get the extended query parser. + * + * @param {object} options + */ + +function extendedparser (options) { + var parameterLimit = options.parameterLimit !== undefined + ? options.parameterLimit + : 1000 + + var depth = typeof options.depth !== 'number' + ? Number(options.depth || 32) + : options.depth + var parse = parser('qs') + + if (isNaN(parameterLimit) || parameterLimit < 1) { + throw new TypeError('option parameterLimit must be a positive number') + } + + if (isNaN(depth) || depth < 0) { + throw new TypeError('option depth must be a zero or a positive number') + } + + if (isFinite(parameterLimit)) { + parameterLimit = parameterLimit | 0 + } + + return function queryparse (body) { + var paramCount = parameterCount(body, parameterLimit) + + if (paramCount === undefined) { + debug('too many parameters') + throw createError(413, 'too many parameters', { + type: 'parameters.too.many' + }) + } + + var arrayLimit = Math.max(100, paramCount) + + debug('parse extended urlencoding') + try { + return parse(body, { + allowPrototypes: true, + arrayLimit: arrayLimit, + depth: depth, + strictDepth: true, + parameterLimit: parameterLimit + }) + } catch (err) { + if (err instanceof RangeError) { + throw createError(400, 'The input exceeded the depth', { + type: 'querystring.parse.rangeError' + }) + } else { + throw err + } + } + } +} + +/** + * Get the charset of a request. + * + * @param {object} req + * @api private + */ + +function getCharset (req) { + try { + return (contentType.parse(req).parameters.charset || '').toLowerCase() + } catch (e) { + return undefined + } +} + +/** + * Count the number of parameters, stopping once limit reached + * + * @param {string} body + * @param {number} limit + * @api private + */ + +function parameterCount (body, limit) { + var count = 0 + var index = 0 + + while ((index = body.indexOf('&', index)) !== -1) { + count++ + index++ + + if (count === limit) { + return undefined + } + } + + return count +} + +/** + * Get parser for module name dynamically. + * + * @param {string} name + * @return {function} + * @api private + */ + +function parser (name) { + var mod = parsers[name] + + if (mod !== undefined) { + return mod.parse + } + + // this uses a switch for static require analysis + switch (name) { + case 'qs': + mod = __nccwpck_require__(22760) + break + case 'querystring': + mod = __nccwpck_require__(63477) + break + } + + // store to prevent invoking require() + parsers[name] = mod + + return mod.parse +} + +/** + * Get the simple query parser. + * + * @param {object} options + */ + +function simpleparser (options) { + var parameterLimit = options.parameterLimit !== undefined + ? options.parameterLimit + : 1000 + var parse = parser('querystring') + + if (isNaN(parameterLimit) || parameterLimit < 1) { + throw new TypeError('option parameterLimit must be a positive number') + } + + if (isFinite(parameterLimit)) { + parameterLimit = parameterLimit | 0 + } + + return function queryparse (body) { + var paramCount = parameterCount(body, parameterLimit) + + if (paramCount === undefined) { + debug('too many parameters') + throw createError(413, 'too many parameters', { + type: 'parameters.too.many' + }) + } + + debug('parse urlencoding') + return parse(body, undefined, undefined, { maxKeys: parameterLimit }) + } +} + +/** + * Get the simple type checker. + * + * @param {string} type + * @return {function} + */ + +function typeChecker (type) { + return function checkType (req) { + return Boolean(typeis(req, type)) + } +} + + +/***/ }), + +/***/ 15377: +/***/ ((module, exports, __nccwpck_require__) => { + +/** + * This is the web browser implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = __nccwpck_require__(22552); +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = 'undefined' != typeof chrome + && 'undefined' != typeof chrome.storage + ? chrome.storage.local + : localstorage(); + +/** + * Colors. + */ + +exports.colors = [ + 'lightseagreen', + 'forestgreen', + 'goldenrod', + 'dodgerblue', + 'darkorchid', + 'crimson' +]; + +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') { + return true; + } + + // is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); +} + +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +exports.formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (err) { + return '[UnexpectedJSONParseError]: ' + err.message; + } +}; + + +/** + * Colorize log arguments if enabled. + * + * @api public + */ + +function formatArgs(args) { + var useColors = this.useColors; + + args[0] = (useColors ? '%c' : '') + + this.namespace + + (useColors ? ' %c' : ' ') + + args[0] + + (useColors ? '%c ' : ' ') + + '+' + exports.humanize(this.diff); + + if (!useColors) return; + + var c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit') + + // the final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + var index = 0; + var lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, function(match) { + if ('%%' === match) return; + index++; + if ('%c' === match) { + // we only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); +} + +/** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ + +function log() { + // this hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return 'object' === typeof console + && console.log + && Function.prototype.apply.call(console.log, console, arguments); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + try { + if (null == namespaces) { + exports.storage.removeItem('debug'); + } else { + exports.storage.debug = namespaces; + } + } catch(e) {} +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + var r; + try { + r = exports.storage.debug; + } catch(e) {} + + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + + return r; +} + +/** + * Enable namespaces listed in `localStorage.debug` initially. + */ + +exports.enable(load()); + +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + +function localstorage() { + try { + return window.localStorage; + } catch (e) {} +} + + +/***/ }), + +/***/ 22552: +/***/ ((module, exports, __nccwpck_require__) => { + + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = createDebug.debug = createDebug['default'] = createDebug; +exports.coerce = coerce; +exports.disable = disable; +exports.enable = enable; +exports.enabled = enabled; +exports.humanize = __nccwpck_require__(73233); + +/** + * The currently active debug mode names, and names to skip. + */ + +exports.names = []; +exports.skips = []; + +/** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + +exports.formatters = {}; + +/** + * Previous log timestamp. + */ + +var prevTime; + +/** + * Select a color. + * @param {String} namespace + * @return {Number} + * @api private + */ + +function selectColor(namespace) { + var hash = 0, i; + + for (i in namespace) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return exports.colors[Math.abs(hash) % exports.colors.length]; +} + +/** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + +function createDebug(namespace) { + + function debug() { + // disabled? + if (!debug.enabled) return; + + var self = debug; + + // set `diff` timestamp + var curr = +new Date(); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + // turn the `arguments` into a proper Array + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + + args[0] = exports.coerce(args[0]); + + if ('string' !== typeof args[0]) { + // anything else let's inspect with %O + args.unshift('%O'); + } + + // apply any `formatters` transformations + var index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) { + // if we encounter an escaped % then don't increase the array index + if (match === '%%') return match; + index++; + var formatter = exports.formatters[format]; + if ('function' === typeof formatter) { + var val = args[index]; + match = formatter.call(self, val); + + // now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + // apply env-specific formatting (colors, etc.) + exports.formatArgs.call(self, args); + + var logFn = debug.log || exports.log || console.log.bind(console); + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.enabled = exports.enabled(namespace); + debug.useColors = exports.useColors(); + debug.color = selectColor(namespace); + + // env-specific initialization logic for debug instances + if ('function' === typeof exports.init) { + exports.init(debug); + } + + return debug; +} + +/** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + +function enable(namespaces) { + exports.save(namespaces); + + exports.names = []; + exports.skips = []; + + var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + var len = split.length; + + for (var i = 0; i < len; i++) { + if (!split[i]) continue; // ignore empty strings + namespaces = split[i].replace(/\*/g, '.*?'); + if (namespaces[0] === '-') { + exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + exports.names.push(new RegExp('^' + namespaces + '$')); + } + } +} + +/** + * Disable debug output. + * + * @api public + */ + +function disable() { + exports.enable(''); +} + +/** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + +function enabled(name) { + var i, len; + for (i = 0, len = exports.skips.length; i < len; i++) { + if (exports.skips[i].test(name)) { + return false; + } + } + for (i = 0, len = exports.names.length; i < len; i++) { + if (exports.names[i].test(name)) { + return true; + } + } + return false; +} + +/** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + +function coerce(val) { + if (val instanceof Error) return val.stack || val.message; + return val; +} + + +/***/ }), + +/***/ 7471: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +/** + * Detect Electron renderer process, which is node, but we should + * treat as a browser. + */ + +if (typeof process !== 'undefined' && process.type === 'renderer') { + module.exports = __nccwpck_require__(15377); +} else { + module.exports = __nccwpck_require__(74117); +} + + +/***/ }), + +/***/ 74117: +/***/ ((module, exports, __nccwpck_require__) => { + +/** + * Module dependencies. + */ + +var tty = __nccwpck_require__(76224); +var util = __nccwpck_require__(73837); + +/** + * This is the Node.js implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = __nccwpck_require__(22552); +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; + +/** + * Colors. + */ + +exports.colors = [6, 2, 3, 4, 5, 1]; + +/** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ + +exports.inspectOpts = Object.keys(process.env).filter(function (key) { + return /^debug_/i.test(key); +}).reduce(function (obj, key) { + // camel-case + var prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() }); + + // coerce string value into JS value + var val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) val = true; + else if (/^(no|off|false|disabled)$/i.test(val)) val = false; + else if (val === 'null') val = null; + else val = Number(val); + + obj[prop] = val; + return obj; +}, {}); + +/** + * The file descriptor to write the `debug()` calls to. + * Set the `DEBUG_FD` env variable to override with another value. i.e.: + * + * $ DEBUG_FD=3 node script.js 3>debug.log + */ + +var fd = parseInt(process.env.DEBUG_FD, 10) || 2; + +if (1 !== fd && 2 !== fd) { + util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')() +} + +var stream = 1 === fd ? process.stdout : + 2 === fd ? process.stderr : + createWritableStdioStream(fd); + +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + +function useColors() { + return 'colors' in exports.inspectOpts + ? Boolean(exports.inspectOpts.colors) + : tty.isatty(fd); +} + +/** + * Map %o to `util.inspect()`, all on a single line. + */ + +exports.formatters.o = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n').map(function(str) { + return str.trim() + }).join(' '); +}; + +/** + * Map %o to `util.inspect()`, allowing multiple lines if needed. + */ + +exports.formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; + +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + +function formatArgs(args) { + var name = this.namespace; + var useColors = this.useColors; + + if (useColors) { + var c = this.color; + var prefix = ' \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m'; + + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m'); + } else { + args[0] = new Date().toUTCString() + + ' ' + name + ' ' + args[0]; + } +} + +/** + * Invokes `util.format()` with the specified arguments and writes to `stream`. + */ + +function log() { + return stream.write(util.format.apply(util, arguments) + '\n'); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + if (null == namespaces) { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } else { + process.env.DEBUG = namespaces; + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + return process.env.DEBUG; +} + +/** + * Copied from `node/src/node.js`. + * + * XXX: It's lame that node doesn't expose this API out-of-the-box. It also + * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. + */ + +function createWritableStdioStream (fd) { + var stream; + var tty_wrap = process.binding('tty_wrap'); + + // Note stream._type is used for test-module-load-list.js + + switch (tty_wrap.guessHandleType(fd)) { + case 'TTY': + stream = new tty.WriteStream(fd); + stream._type = 'tty'; + + // Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + case 'FILE': + var fs = __nccwpck_require__(57147); + stream = new fs.SyncWriteStream(fd, { autoClose: false }); + stream._type = 'fs'; + break; + + case 'PIPE': + case 'TCP': + var net = __nccwpck_require__(41808); + stream = new net.Socket({ + fd: fd, + readable: false, + writable: true + }); + + // FIXME Should probably have an option in net.Socket to create a + // stream from an existing fd which is writable only. But for now + // we'll just add this hack and set the `readable` member to false. + // Test: ./node test/fixtures/echo.js < /etc/passwd + stream.readable = false; + stream.read = null; + stream._type = 'pipe'; + + // FIXME Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + default: + // Probably an error on in uv_guess_handle() + throw new Error('Implement me. Unknown stream file type!'); + } + + // For supporting legacy API we put the FD here. + stream.fd = fd; + + stream._isStdio = true; + + return stream; +} + +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ + +function init (debug) { + debug.inspectOpts = {}; + + var keys = Object.keys(exports.inspectOpts); + for (var i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } +} + +/** + * Enable namespaces listed in `process.env.DEBUG` initially. + */ + +exports.enable(load()); + + +/***/ }), + +/***/ 73233: +/***/ ((module) => { + +/** + * Helpers. + */ + +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var y = d * 365.25; + +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + +module.exports = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isNaN(val) === false) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); +}; + +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; + } +} + +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtShort(ms) { + if (ms >= d) { + return Math.round(ms / d) + 'd'; + } + if (ms >= h) { + return Math.round(ms / h) + 'h'; + } + if (ms >= m) { + return Math.round(ms / m) + 'm'; + } + if (ms >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; +} + +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtLong(ms) { + return plural(ms, d, 'day') || + plural(ms, h, 'hour') || + plural(ms, m, 'minute') || + plural(ms, s, 'second') || + ms + ' ms'; +} + +/** + * Pluralization helper. + */ + +function plural(ms, n, name) { + if (ms < n) { + return; + } + if (ms < n * 1.5) { + return Math.floor(ms / n) + ' ' + name; + } + return Math.ceil(ms / n) + ' ' + name + 's'; +} + + +/***/ }), + +/***/ 44159: +/***/ ((module) => { + +module.exports = { + trueFunc: function trueFunc(){ + return true; + }, + falseFunc: function falseFunc(){ + return false; + } +}; + +/***/ }), + +/***/ 86966: +/***/ ((module) => { + +"use strict"; /*! * bytes * Copyright(c) 2012-2014 TJ Holowaychuk * Copyright(c) 2015 Jed Watson * MIT Licensed - */i.exports=bytes;i.exports.format=format;i.exports.parse=parse;var u=/\B(?=(\d{3})+(?!\d))/g;var m=/(?:\.0*|(\.[^0]+)0+)$/;var v={b:1,kb:1<<10,mb:1<<20,gb:1<<30,tb:Math.pow(1024,4),pb:Math.pow(1024,5)};var _=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function bytes(i,u){if(typeof i==="string"){return parse(i)}if(typeof i==="number"){return format(i,u)}return null}function format(i,_){if(!Number.isFinite(i)){return null}var M=Math.abs(i);var j=_&&_.thousandsSeparator||"";var $=_&&_.unitSeparator||"";var W=_&&_.decimalPlaces!==undefined?_.decimalPlaces:2;var Y=Boolean(_&&_.fixedDecimals);var Z=_&&_.unit||"";if(!Z||!v[Z.toLowerCase()]){if(M>=v.pb){Z="PB"}else if(M>=v.tb){Z="TB"}else if(M>=v.gb){Z="GB"}else if(M>=v.mb){Z="MB"}else if(M>=v.kb){Z="KB"}else{Z="B"}}var X=i/v[Z.toLowerCase()];var ee=X.toFixed(W);if(!Y){ee=ee.replace(m,"$1")}if(j){ee=ee.split(".").map((function(i,m){return m===0?i.replace(u,j):i})).join(".")}return ee+$+Z}function parse(i){if(typeof i==="number"&&!isNaN(i)){return i}if(typeof i!=="string"){return null}var u=_.exec(i);var m;var M="b";if(!u){m=parseInt(i,10);M="b"}else{m=parseFloat(u[1]);M=u[4].toLowerCase()}if(isNaN(m)){return null}return Math.floor(v[M]*m)}},8803:(i,u,m)=>{"use strict";var v=m(4538);var _=m(2977);var M=_(v("String.prototype.indexOf"));i.exports=function callBoundIntrinsic(i,u){var m=v(i,!!u);if(typeof m==="function"&&M(i,".prototype.")>-1){return _(m)}return m}},2977:(i,u,m)=>{"use strict";var v=m(8334);var _=m(4538);var M=_("%Function.prototype.apply%");var j=_("%Function.prototype.call%");var $=_("%Reflect.apply%",true)||v.call(j,M);var W=_("%Object.getOwnPropertyDescriptor%",true);var Y=_("%Object.defineProperty%",true);var Z=_("%Math.max%");if(Y){try{Y({},"a",{value:1})}catch(i){Y=null}}i.exports=function callBind(i){var u=$(v,j,arguments);if(W&&Y){var m=W(u,"length");if(m.configurable){Y(u,"length",{value:1+Z(0,i.length-(arguments.length-1))})}}return u};var X=function applyBind(){return $(v,M,arguments)};if(Y){Y(i.exports,"apply",{value:X})}else{i.exports.apply=X}},3844:(i,u,m)=>{"use strict";var v=m(7224);i.exports=function maybe(i,u){if(i){u.then((function(u){v((function(){i(null,u)}))}),(function(u){v((function(){i(u)}))}));return undefined}else{return u}}},7224:i=>{"use strict";function makeNext(){if(typeof process==="object"&&typeof process.nextTick==="function"){return process.nextTick}else if(typeof setImmediate==="function"){return setImmediate}else{return function next(i){setTimeout(i,0)}}}i.exports=makeNext()},8513:(i,u,m)=>{"use strict";Object.defineProperty(u,"__esModule",{value:true});u.groupSelectors=u.getDocumentRoot=void 0;var v=m(9159);function getDocumentRoot(i){while(i.parent)i=i.parent;return i}u.getDocumentRoot=getDocumentRoot;function groupSelectors(i){var u=[];var m=[];for(var _=0,M=i;_0&&i.some((0,Y._compileToken)(_,m))||M.some((function(u){return filterBySelector(u,i,m).length>0}))}u.some=some;function filterByPosition(i,u,m,v){var _=typeof m==="string"?parseInt(m,10):NaN;switch(i){case"first":case"lt":return u;case"last":return u.length>0?[u[u.length-1]]:u;case"nth":case"eq":return isFinite(_)&&Math.abs(_){"use strict";Object.defineProperty(u,"__esModule",{value:true});u.getLimit=u.isFilter=u.filterNames=void 0;u.filterNames=new Set(["first","last","eq","gt","nth","lt","even","odd"]);function isFilter(i){if(i.type!=="pseudo")return false;if(u.filterNames.has(i.name))return true;if(i.name==="not"&&Array.isArray(i.data)){return i.data.some((function(i){return i.some(isFilter)}))}return false}u.isFilter=isFilter;function getLimit(i,u,m){var v=u!=null?parseInt(u,10):NaN;switch(i){case"first":return 1;case"nth":case"eq":return isFinite(v)?v>=0?v+1:Infinity:0;case"lt":return isFinite(v)?v>=0?Math.min(v,m):Infinity:0;case"gt":return isFinite(v)?Infinity:0;case"odd":return 2*m;case"even":return 2*m-1;case"last":case"not":return Infinity}}u.getLimit=getLimit},8596:(i,u,m)=>{"use strict";Object.defineProperty(u,"__esModule",{value:true});u.toggleClass=u.removeClass=u.addClass=u.hasClass=u.removeAttr=u.val=u.data=u.prop=u.attr=void 0;var v=m(2);var _=m(1183);var M=m(1754);var j=Object.prototype.hasOwnProperty;var $=/\s+/;var W="data-";var Y={null:null,true:true,false:false};var Z=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i;var X=/^{[^]*}$|^\[[^]*]$/;function getAttr(i,u,m){var M;if(!i||!(0,_.isTag)(i))return undefined;(M=i.attribs)!==null&&M!==void 0?M:i.attribs={};if(!u){return i.attribs}if(j.call(i.attribs,u)){return!m&&Z.test(u)?u:i.attribs[u]}if(i.name==="option"&&u==="value"){return(0,v.text)(i.children)}if(i.name==="input"&&(i.attribs["type"]==="radio"||i.attribs["type"]==="checkbox")&&u==="value"){return"on"}return undefined}function setAttr(i,u,m){if(m===null){removeAttribute(i,u)}else{i.attribs[u]="".concat(m)}}function attr(i,u){if(typeof i==="object"||u!==undefined){if(typeof u==="function"){if(typeof i!=="string"){{throw new Error("Bad combination of arguments.")}}return(0,_.domEach)(this,(function(m,v){if((0,_.isTag)(m))setAttr(m,i,u.call(m,v,m.attribs[i]))}))}return(0,_.domEach)(this,(function(m){if(!(0,_.isTag)(m))return;if(typeof i==="object"){Object.keys(i).forEach((function(u){var v=i[u];setAttr(m,u,v)}))}else{setAttr(m,i,u)}}))}return arguments.length>1?this:getAttr(this[0],i,this.options.xmlMode)}u.attr=attr;function getProp(i,u,m){return u in i?i[u]:!m&&Z.test(u)?getAttr(i,u,false)!==undefined:getAttr(i,u,m)}function setProp(i,u,m,v){if(u in i){i[u]=m}else{setAttr(i,u,!v&&Z.test(u)?m?"":null:"".concat(m))}}function prop(i,u){var m=this;var v;if(typeof i==="string"&&u===undefined){var j=this[0];if(!j||!(0,_.isTag)(j))return undefined;switch(i){case"style":{var $=this.css();var W=Object.keys($);W.forEach((function(i,u){$[u]=i}));$.length=W.length;return $}case"tagName":case"nodeName":{return j.name.toUpperCase()}case"href":case"src":{var Y=(v=j.attribs)===null||v===void 0?void 0:v[i];if(typeof URL!=="undefined"&&(i==="href"&&(j.tagName==="a"||j.name==="link")||i==="src"&&(j.tagName==="img"||j.tagName==="iframe"||j.tagName==="audio"||j.tagName==="video"||j.tagName==="source"))&&Y!==undefined&&this.options.baseURI){return new URL(Y,this.options.baseURI).href}return Y}case"innerText":{return(0,M.innerText)(j)}case"textContent":{return(0,M.textContent)(j)}case"outerHTML":return this.clone().wrap("").parent().html();case"innerHTML":return this.html();default:return getProp(j,i,this.options.xmlMode)}}if(typeof i==="object"||u!==undefined){if(typeof u==="function"){if(typeof i==="object"){throw new Error("Bad combination of arguments.")}return(0,_.domEach)(this,(function(v,M){if((0,_.isTag)(v)){setProp(v,i,u.call(v,M,getProp(v,i,m.options.xmlMode)),m.options.xmlMode)}}))}return(0,_.domEach)(this,(function(v){if(!(0,_.isTag)(v))return;if(typeof i==="object"){Object.keys(i).forEach((function(u){var _=i[u];setProp(v,u,_,m.options.xmlMode)}))}else{setProp(v,i,u,m.options.xmlMode)}}))}return undefined}u.prop=prop;function setData(i,u,m){var v;var _=i;(v=_.data)!==null&&v!==void 0?v:_.data={};if(typeof u==="object")Object.assign(_.data,u);else if(typeof u==="string"&&m!==undefined){_.data[u]=m}}function readData(i,u){var m;var v;var M;if(u==null){m=Object.keys(i.attribs).filter((function(i){return i.startsWith(W)}));v=m.map((function(i){return(0,_.camelCase)(i.slice(W.length))}))}else{m=[W+(0,_.cssCase)(u)];v=[u]}for(var $=0;$-1){var M=v+i.length;if((v===0||$.test(m[v-1]))&&(M===m.length||$.test(m[M]))){return true}}}return false}))}u.hasClass=hasClass;function addClass(i){if(typeof i==="function"){return(0,_.domEach)(this,(function(u,m){if((0,_.isTag)(u)){var v=u.attribs["class"]||"";addClass.call([u],i.call(u,m,v))}}))}if(!i||typeof i!=="string")return this;var u=i.split($);var m=this.length;for(var v=0;v=0){M.splice(W,1);j=true;$--}}if(j){i.attribs["class"]=M.join(" ")}}}))}u.removeClass=removeClass;function toggleClass(i,u){if(typeof i==="function"){return(0,_.domEach)(this,(function(m,v){if((0,_.isTag)(m)){toggleClass.call([m],i.call(m,v,m.attribs["class"]||"",u),u)}}))}if(!i||typeof i!=="string")return this;var m=i.split($);var v=m.length;var M=typeof u==="boolean"?u?1:-1:0;var j=this.length;for(var W=0;W=0&&ee<0){Z.push(m[X])}else if(M<=0&&ee>=0){Z.splice(ee,1)}}Y.attribs["class"]=Z.join(" ")}return this}u.toggleClass=toggleClass},7084:(i,u,m)=>{"use strict";Object.defineProperty(u,"__esModule",{value:true});u.css=void 0;var v=m(1183);function css(i,u){if(i!=null&&u!=null||typeof i==="object"&&!Array.isArray(i)){return(0,v.domEach)(this,(function(m,_){if((0,v.isTag)(m)){setCss(m,i,u,_)}}))}if(this.length===0){return undefined}return getCss(this[0],i)}u.css=css;function setCss(i,u,m,v){if(typeof u==="string"){var _=getCss(i);var M=typeof m==="function"?m.call(i,v,_[u]):m;if(M===""){delete _[u]}else if(M!=null){_[u]=M}i.attribs["style"]=stringify(_)}else if(typeof u==="object"){Object.keys(u).forEach((function(m,v){setCss(i,m,u[m],v)}))}}function getCss(i,u){if(!i||!(0,v.isTag)(i))return;var m=parse(i.attribs["style"]);if(typeof u==="string"){return m[u]}if(Array.isArray(u)){var _={};u.forEach((function(i){if(m[i]!=null){_[i]=m[i]}}));return _}return m}function stringify(i){return Object.keys(i).reduce((function(u,m){return"".concat(u).concat(u?" ":"").concat(m,": ").concat(i[m],";")}),"")}function parse(i){i=(i||"").trim();if(!i)return{};var u={};var m;for(var v=0,_=i.split(";");v<_.length;v++){var M=_[v];var j=M.indexOf(":");if(j<1||j===M.length-1){var $=M.trimEnd();if($.length>0&&m!==undefined){u[m]+=";".concat($)}}else{m=M.slice(0,j).trim();u[m]=M.slice(j+1).trim()}}return u}},5954:(i,u,m)=>{"use strict";Object.defineProperty(u,"__esModule",{value:true});u.serializeArray=u.serialize=void 0;var v=m(1183);var _="input,select,textarea,keygen";var M=/%20/g;var j=/\r?\n/g;function serialize(){var i=this.serializeArray();var u=i.map((function(i){return"".concat(encodeURIComponent(i.name),"=").concat(encodeURIComponent(i.value))}));return u.join("&").replace(M,"+")}u.serialize=serialize;function serializeArray(){var i=this;return this.map((function(u,m){var M=i._make(m);if((0,v.isTag)(m)&&m.name==="form"){return M.find(_).toArray()}return M.filter(_).toArray()})).filter('[name!=""]:enabled'+":not(:submit, :button, :image, :reset, :file)"+":matches([checked], :not(:checkbox, :radio))").map((function(u,m){var v;var _=i._make(m);var M=_.attr("name");var $=(v=_.val())!==null&&v!==void 0?v:"";if(Array.isArray($)){return $.map((function(i){return{name:M,value:i.replace(j,"\r\n")}}))}return{name:M,value:$.replace(j,"\r\n")}})).toArray()}u.serializeArray=serializeArray},8196:function(i,u,m){"use strict";var v=this&&this.__spreadArray||function(i,u,m){if(m||arguments.length===2)for(var v=0,_=u.length,M;v<_;v++){if(M||!(v in u)){if(!M)M=Array.prototype.slice.call(u,0,v);M[v]=u[v]}}return i.concat(M||Array.prototype.slice.call(u))};Object.defineProperty(u,"__esModule",{value:true});u.clone=u.text=u.toString=u.html=u.empty=u.replaceWith=u.remove=u.insertBefore=u.before=u.insertAfter=u.after=u.wrapAll=u.unwrap=u.wrapInner=u.wrap=u.prepend=u.append=u.prependTo=u.appendTo=u._makeDomArray=void 0;var _=m(4038);var M=m(9024);var j=m(2);var $=m(1183);var W=m(1754);function _makeDomArray(i,u){var m=this;if(i==null){return[]}if((0,$.isCheerio)(i)){return u?(0,$.cloneDom)(i.get()):i.get()}if(Array.isArray(i)){return i.reduce((function(i,v){return i.concat(m._makeDomArray(v,u))}),[])}if(typeof i==="string"){return this._parse(i,this.options,false,null).children}return u?(0,$.cloneDom)([i]):[i]}u._makeDomArray=_makeDomArray;function _insert(i){return function(){var u=this;var m=[];for(var v=0;v=i.length?null:i[u+m];for(var X=0;X<_.length;++X){var ee=_[X];var ie=ee.parent;if(ie){var ae=ie.children;var ce=ae.indexOf(ee);if(ce>-1){ie.children.splice(ce,1);if(M===ie&&u>ce){W[0]--}}}ee.parent=M;if(ee.prev){ee.prev.next=(j=ee.next)!==null&&j!==void 0?j:null}if(ee.next){ee.next.prev=($=ee.prev)!==null&&$!==void 0?$:null}ee.prev=X===0?Y:_[X-1];ee.next=X===_.length-1?Z:_[X+1]}if(Y){Y.next=_[0]}if(Z){Z.prev=_[_.length-1]}return i.splice.apply(i,W)}function appendTo(i){var u=(0,$.isCheerio)(i)?i:this._make(i);u.append(this);return this}u.appendTo=appendTo;function prependTo(i){var u=(0,$.isCheerio)(i)?i:this._make(i);u.prepend(this);return this}u.prependTo=prependTo;u.append=_insert((function(i,u,m){uniqueSplice(u,u.length,0,i,m)}));u.prepend=_insert((function(i,u,m){uniqueSplice(u,0,0,i,m)}));function _wrap(i){return function(u){var m=this.length-1;var v=this.parents().last();for(var M=0;M1&&M.length>1?m.reduce((function(i,u){return u(i)}),M):M)}}}var ie=_getMatcher((function(i,u){var m;var v=[];for(var _=0;_0})}u.has=has;function first(){return this.length>1?this._make(this[0]):this}u.first=first;function last(){return this.length>0?this._make(this[this.length-1]):this}u.last=last;function eq(i){var u;i=+i;if(i===0&&this.length<=1)return this;if(i<0)i=this.length+i;return this._make((u=this[i])!==null&&u!==void 0?u:[])}u.eq=eq;function get(i){if(i==null){return this.toArray()}return this[i<0?this.length+i:i]}u.get=get;function toArray(){return Array.prototype.slice.call(this)}u.toArray=toArray;function index(i){var u;var m;if(i==null){u=this.parent().children();m=this[0]}else if(typeof i==="string"){u=this._make(i);m=this[0]}else{u=this;m=(0,Y.isCheerio)(i)?i[0]:i}return Array.prototype.indexOf.call(u,m)}u.index=index;function slice(i,u){return this._make(Array.prototype.slice.call(this,i,u))}u.slice=slice;function end(){var i;return(i=this.prevObject)!==null&&i!==void 0?i:this._make([])}u.end=end;function add(i,u){var m=this._make(i,u);var v=(0,X.uniqueSort)(j(j([],this.get(),true),m.get(),true));return this._make(v)}u.add=add;function addBack(i){return this.prevObject?this.add(i?this.prevObject.filter(i):this.prevObject):this}u.addBack=addBack},641:function(i,u,m){"use strict";var v=this&&this.__createBinding||(Object.create?function(i,u,m,v){if(v===undefined)v=m;var _=Object.getOwnPropertyDescriptor(u,m);if(!_||("get"in _?!u.__esModule:_.writable||_.configurable)){_={enumerable:true,get:function(){return u[m]}}}Object.defineProperty(i,v,_)}:function(i,u,m,v){if(v===undefined)v=m;i[v]=u[m]});var _=this&&this.__setModuleDefault||(Object.create?function(i,u){Object.defineProperty(i,"default",{enumerable:true,value:u})}:function(i,u){i["default"]=u});var M=this&&this.__importStar||function(i){if(i&&i.__esModule)return i;var u={};if(i!=null)for(var m in i)if(m!=="default"&&Object.prototype.hasOwnProperty.call(i,m))v(u,i,m);_(u,i);return u};Object.defineProperty(u,"__esModule",{value:true});u.Cheerio=void 0;var j=M(m(8596));var $=M(m(6563));var W=M(m(8196));var Y=M(m(7084));var Z=M(m(5954));var X=function(){function Cheerio(i,u,m){this.length=0;this.options=m;this._root=u;if(i){for(var v=0;v{"use strict";Object.defineProperty(u,"__esModule",{value:true});u.update=u.getParse=void 0;var v=m(1754);var _=m(4038);function getParse(i){return function parse(u,m,v,M){if(typeof Buffer!=="undefined"&&Buffer.isBuffer(u)){u=u.toString()}if(typeof u==="string"){return i(u,m,v,M)}var j=u;if(!Array.isArray(j)&&(0,_.isDocument)(j)){return j}var $=new _.Document([]);update(j,$);return $}}u.getParse=getParse;function update(i,u){var m=Array.isArray(i)?i:[i];if(u){u.children=m}else{u=null}for(var _=0;_{"use strict";Object.defineProperty(u,"__esModule",{value:true})},1183:(i,u,m)=>{"use strict";Object.defineProperty(u,"__esModule",{value:true});u.isHtml=u.cloneDom=u.domEach=u.cssCase=u.camelCase=u.isCheerio=u.isTag=void 0;var v=m(4038);var _=m(4038);Object.defineProperty(u,"isTag",{enumerable:true,get:function(){return _.isTag}});function isCheerio(i){return i.cheerio!=null}u.isCheerio=isCheerio;function camelCase(i){return i.replace(/[_.-](\w|$)/g,(function(i,u){return u.toUpperCase()}))}u.camelCase=camelCase;function cssCase(i){return i.replace(/[A-Z]/g,"-$&").toLowerCase()}u.cssCase=cssCase;function domEach(i,u){var m=i.length;for(var v=0;vi.length-3)return false;var m=i.charCodeAt(u+1);return(m>=M.LowerA&&m<=M.LowerZ||m>=M.UpperA&&m<=M.UpperZ||m===M.Exclamation)&&i.includes(">",u+2)}u.isHtml=isHtml},5443:(i,u,m)=>{var v=m(3837);var _=m(2781).Stream;var M=m(8611);i.exports=CombinedStream;function CombinedStream(){this.writable=false;this.readable=true;this.dataSize=0;this.maxDataSize=2*1024*1024;this.pauseStreams=true;this._released=false;this._streams=[];this._currentStream=null;this._insideLoop=false;this._pendingNext=false}v.inherits(CombinedStream,_);CombinedStream.create=function(i){var u=new this;i=i||{};for(var m in i){u[m]=i[m]}return u};CombinedStream.isStreamLike=function(i){return typeof i!=="function"&&typeof i!=="string"&&typeof i!=="boolean"&&typeof i!=="number"&&!Buffer.isBuffer(i)};CombinedStream.prototype.append=function(i){var u=CombinedStream.isStreamLike(i);if(u){if(!(i instanceof M)){var m=M.create(i,{maxDataSize:Infinity,pauseStream:this.pauseStreams});i.on("data",this._checkDataSize.bind(this));i=m}this._handleErrors(i);if(this.pauseStreams){i.pause()}}this._streams.push(i);return this};CombinedStream.prototype.pipe=function(i,u){_.prototype.pipe.call(this,i,u);this.resume();return i};CombinedStream.prototype._getNext=function(){this._currentStream=null;if(this._insideLoop){this._pendingNext=true;return}this._insideLoop=true;try{do{this._pendingNext=false;this._realGetNext()}while(this._pendingNext)}finally{this._insideLoop=false}};CombinedStream.prototype._realGetNext=function(){var i=this._streams.shift();if(typeof i=="undefined"){this.end();return}if(typeof i!=="function"){this._pipeNext(i);return}var u=i;u(function(i){var u=CombinedStream.isStreamLike(i);if(u){i.on("data",this._checkDataSize.bind(this));this._handleErrors(i)}this._pipeNext(i)}.bind(this))};CombinedStream.prototype._pipeNext=function(i){this._currentStream=i;var u=CombinedStream.isStreamLike(i);if(u){i.on("end",this._getNext.bind(this));i.pipe(this,{end:false});return}var m=i;this.write(m);this._getNext()};CombinedStream.prototype._handleErrors=function(i){var u=this;i.on("error",(function(i){u._emitError(i)}))};CombinedStream.prototype.write=function(i){this.emit("data",i)};CombinedStream.prototype.pause=function(){if(!this.pauseStreams){return}if(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function")this._currentStream.pause();this.emit("pause")};CombinedStream.prototype.resume=function(){if(!this._released){this._released=true;this.writable=true;this._getNext()}if(this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function")this._currentStream.resume();this.emit("resume")};CombinedStream.prototype.end=function(){this._reset();this.emit("end")};CombinedStream.prototype.destroy=function(){this._reset();this.emit("close")};CombinedStream.prototype._reset=function(){this.writable=false;this._streams=[];this._currentStream=null};CombinedStream.prototype._checkDataSize=function(){this._updateDataSize();if(this.dataSize<=this.maxDataSize){return}var i="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(i))};CombinedStream.prototype._updateDataSize=function(){this.dataSize=0;var i=this;this._streams.forEach((function(u){if(!u.dataSize){return}i.dataSize+=u.dataSize}));if(this._currentStream&&this._currentStream.dataSize){this.dataSize+=this._currentStream.dataSize}};CombinedStream.prototype._emitError=function(i){this._reset();this.emit("error",i)}},6891:i=>{i.exports=function(i,m){var v=[];for(var _=0;_{"use strict"; -/*! - * content-disposition - * Copyright(c) 2014-2017 Douglas Christopher Wilson + */ + + + +/** + * Module exports. + * @public + */ + +module.exports = bytes; +module.exports.format = format; +module.exports.parse = parse; + +/** + * Module variables. + * @private + */ + +var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g; + +var formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/; + +var map = { + b: 1, + kb: 1 << 10, + mb: 1 << 20, + gb: 1 << 30, + tb: Math.pow(1024, 4), + pb: Math.pow(1024, 5), +}; + +var parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i; + +/** + * Convert the given value in bytes into a string or parse to string to an integer in bytes. + * + * @param {string|number} value + * @param {{ + * case: [string], + * decimalPlaces: [number] + * fixedDecimals: [boolean] + * thousandsSeparator: [string] + * unitSeparator: [string] + * }} [options] bytes options. + * + * @returns {string|number|null} + */ + +function bytes(value, options) { + if (typeof value === 'string') { + return parse(value); + } + + if (typeof value === 'number') { + return format(value, options); + } + + return null; +} + +/** + * Format the given value in bytes into a string. + * + * If the value is negative, it is kept as such. If it is a float, + * it is rounded. + * + * @param {number} value + * @param {object} [options] + * @param {number} [options.decimalPlaces=2] + * @param {number} [options.fixedDecimals=false] + * @param {string} [options.thousandsSeparator=] + * @param {string} [options.unit=] + * @param {string} [options.unitSeparator=] + * + * @returns {string|null} + * @public + */ + +function format(value, options) { + if (!Number.isFinite(value)) { + return null; + } + + var mag = Math.abs(value); + var thousandsSeparator = (options && options.thousandsSeparator) || ''; + var unitSeparator = (options && options.unitSeparator) || ''; + var decimalPlaces = (options && options.decimalPlaces !== undefined) ? options.decimalPlaces : 2; + var fixedDecimals = Boolean(options && options.fixedDecimals); + var unit = (options && options.unit) || ''; + + if (!unit || !map[unit.toLowerCase()]) { + if (mag >= map.pb) { + unit = 'PB'; + } else if (mag >= map.tb) { + unit = 'TB'; + } else if (mag >= map.gb) { + unit = 'GB'; + } else if (mag >= map.mb) { + unit = 'MB'; + } else if (mag >= map.kb) { + unit = 'KB'; + } else { + unit = 'B'; + } + } + + var val = value / map[unit.toLowerCase()]; + var str = val.toFixed(decimalPlaces); + + if (!fixedDecimals) { + str = str.replace(formatDecimalsRegExp, '$1'); + } + + if (thousandsSeparator) { + str = str.split('.').map(function (s, i) { + return i === 0 + ? s.replace(formatThousandsRegExp, thousandsSeparator) + : s + }).join('.'); + } + + return str + unitSeparator + unit; +} + +/** + * Parse the string value into an integer in bytes. + * + * If no unit is given, it is assumed the value is in bytes. + * + * @param {number|string} val + * + * @returns {number|null} + * @public + */ + +function parse(val) { + if (typeof val === 'number' && !isNaN(val)) { + return val; + } + + if (typeof val !== 'string') { + return null; + } + + // Test if the string passed is valid + var results = parseRegExp.exec(val); + var floatValue; + var unit = 'b'; + + if (!results) { + // Nothing could be extracted from the given string + floatValue = parseInt(val, 10); + unit = 'b' + } else { + // Retrieve the value and the unit + floatValue = parseFloat(results[1]); + unit = results[4].toLowerCase(); + } + + if (isNaN(floatValue)) { + return null; + } + + return Math.floor(map[unit] * floatValue); +} + + +/***/ }), + +/***/ 28803: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var GetIntrinsic = __nccwpck_require__(74538); + +var callBind = __nccwpck_require__(62977); + +var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); + +module.exports = function callBoundIntrinsic(name, allowMissing) { + var intrinsic = GetIntrinsic(name, !!allowMissing); + if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { + return callBind(intrinsic); + } + return intrinsic; +}; + + +/***/ }), + +/***/ 62977: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var bind = __nccwpck_require__(88334); +var GetIntrinsic = __nccwpck_require__(74538); +var setFunctionLength = __nccwpck_require__(64056); + +var $TypeError = __nccwpck_require__(6361); +var $apply = GetIntrinsic('%Function.prototype.apply%'); +var $call = GetIntrinsic('%Function.prototype.call%'); +var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); + +var $defineProperty = __nccwpck_require__(6123); +var $max = GetIntrinsic('%Math.max%'); + +module.exports = function callBind(originalFunction) { + if (typeof originalFunction !== 'function') { + throw new $TypeError('a function is required'); + } + var func = $reflectApply(bind, $call, arguments); + return setFunctionLength( + func, + 1 + $max(0, originalFunction.length - (arguments.length - 1)), + true + ); +}; + +var applyBind = function applyBind() { + return $reflectApply(bind, $apply, arguments); +}; + +if ($defineProperty) { + $defineProperty(module.exports, 'apply', { value: applyBind }); +} else { + module.exports.apply = applyBind; +} + + +/***/ }), + +/***/ 63844: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var next = __nccwpck_require__(57224) + +module.exports = function maybe (cb, promise) { + if (cb) { + promise + .then(function (result) { + next(function () { cb(null, result) }) + }, function (err) { + next(function () { cb(err) }) + }) + return undefined + } + else { + return promise + } +} + + +/***/ }), + +/***/ 57224: +/***/ ((module) => { + +"use strict"; + + +function makeNext () { + if (typeof process === 'object' && typeof process.nextTick === 'function') { + return process.nextTick + } else if (typeof setImmediate === 'function') { + return setImmediate + } else { + return function next (f) { + setTimeout(f, 0) + } + } +} + +module.exports = makeNext() + + +/***/ }), + +/***/ 28513: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.groupSelectors = exports.getDocumentRoot = void 0; +var positionals_js_1 = __nccwpck_require__(59159); +function getDocumentRoot(node) { + while (node.parent) + node = node.parent; + return node; +} +exports.getDocumentRoot = getDocumentRoot; +function groupSelectors(selectors) { + var filteredSelectors = []; + var plainSelectors = []; + for (var _i = 0, selectors_1 = selectors; _i < selectors_1.length; _i++) { + var selector = selectors_1[_i]; + if (selector.some(positionals_js_1.isFilter)) { + filteredSelectors.push(selector); + } + else { + plainSelectors.push(selector); + } + } + return [plainSelectors, filteredSelectors]; +} +exports.groupSelectors = groupSelectors; +//# sourceMappingURL=helpers.js.map + +/***/ }), + +/***/ 95409: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.select = exports.filter = exports.some = exports.is = exports.aliases = exports.pseudos = exports.filters = void 0; +var css_what_1 = __nccwpck_require__(80284); +var css_select_1 = __nccwpck_require__(4508); +var DomUtils = __importStar(__nccwpck_require__(11754)); +var boolbase = __importStar(__nccwpck_require__(44159)); +var helpers_js_1 = __nccwpck_require__(28513); +var positionals_js_1 = __nccwpck_require__(59159); +// Re-export pseudo extension points +var css_select_2 = __nccwpck_require__(4508); +Object.defineProperty(exports, "filters", ({ enumerable: true, get: function () { return css_select_2.filters; } })); +Object.defineProperty(exports, "pseudos", ({ enumerable: true, get: function () { return css_select_2.pseudos; } })); +Object.defineProperty(exports, "aliases", ({ enumerable: true, get: function () { return css_select_2.aliases; } })); +var UNIVERSAL_SELECTOR = { + type: css_what_1.SelectorType.Universal, + namespace: null, +}; +var SCOPE_PSEUDO = { + type: css_what_1.SelectorType.Pseudo, + name: "scope", + data: null, +}; +function is(element, selector, options) { + if (options === void 0) { options = {}; } + return some([element], selector, options); +} +exports.is = is; +function some(elements, selector, options) { + if (options === void 0) { options = {}; } + if (typeof selector === "function") + return elements.some(selector); + var _a = (0, helpers_js_1.groupSelectors)((0, css_what_1.parse)(selector)), plain = _a[0], filtered = _a[1]; + return ((plain.length > 0 && elements.some((0, css_select_1._compileToken)(plain, options))) || + filtered.some(function (sel) { return filterBySelector(sel, elements, options).length > 0; })); +} +exports.some = some; +function filterByPosition(filter, elems, data, options) { + var num = typeof data === "string" ? parseInt(data, 10) : NaN; + switch (filter) { + case "first": + case "lt": + // Already done in `getLimit` + return elems; + case "last": + return elems.length > 0 ? [elems[elems.length - 1]] : elems; + case "nth": + case "eq": + return isFinite(num) && Math.abs(num) < elems.length + ? [num < 0 ? elems[elems.length + num] : elems[num]] + : []; + case "gt": + return isFinite(num) ? elems.slice(num + 1) : []; + case "even": + return elems.filter(function (_, i) { return i % 2 === 0; }); + case "odd": + return elems.filter(function (_, i) { return i % 2 === 1; }); + case "not": { + var filtered_1 = new Set(filterParsed(data, elems, options)); + return elems.filter(function (e) { return !filtered_1.has(e); }); + } + } +} +function filter(selector, elements, options) { + if (options === void 0) { options = {}; } + return filterParsed((0, css_what_1.parse)(selector), elements, options); +} +exports.filter = filter; +/** + * Filter a set of elements by a selector. + * + * Will return elements in the original order. + * + * @param selector Selector to filter by. + * @param elements Elements to filter. + * @param options Options for selector. + */ +function filterParsed(selector, elements, options) { + if (elements.length === 0) + return []; + var _a = (0, helpers_js_1.groupSelectors)(selector), plainSelectors = _a[0], filteredSelectors = _a[1]; + var found; + if (plainSelectors.length) { + var filtered = filterElements(elements, plainSelectors, options); + // If there are no filters, just return + if (filteredSelectors.length === 0) { + return filtered; + } + // Otherwise, we have to do some filtering + if (filtered.length) { + found = new Set(filtered); + } + } + for (var i = 0; i < filteredSelectors.length && (found === null || found === void 0 ? void 0 : found.size) !== elements.length; i++) { + var filteredSelector = filteredSelectors[i]; + var missing = found + ? elements.filter(function (e) { return DomUtils.isTag(e) && !found.has(e); }) + : elements; + if (missing.length === 0) + break; + var filtered = filterBySelector(filteredSelector, elements, options); + if (filtered.length) { + if (!found) { + /* + * If we haven't found anything before the last selector, + * just return what we found now. + */ + if (i === filteredSelectors.length - 1) { + return filtered; + } + found = new Set(filtered); + } + else { + filtered.forEach(function (el) { return found.add(el); }); + } + } + } + return typeof found !== "undefined" + ? (found.size === elements.length + ? elements + : // Filter elements to preserve order + elements.filter(function (el) { + return found.has(el); + })) + : []; +} +function filterBySelector(selector, elements, options) { + var _a; + if (selector.some(css_what_1.isTraversal)) { + /* + * Get root node, run selector with the scope + * set to all of our nodes. + */ + var root = (_a = options.root) !== null && _a !== void 0 ? _a : (0, helpers_js_1.getDocumentRoot)(elements[0]); + var opts = __assign(__assign({}, options), { context: elements, relativeSelector: false }); + selector.push(SCOPE_PSEUDO); + return findFilterElements(root, selector, opts, true, elements.length); + } + // Performance optimization: If we don't have to traverse, just filter set. + return findFilterElements(elements, selector, options, false, elements.length); +} +function select(selector, root, options, limit) { + if (options === void 0) { options = {}; } + if (limit === void 0) { limit = Infinity; } + if (typeof selector === "function") { + return find(root, selector); + } + var _a = (0, helpers_js_1.groupSelectors)((0, css_what_1.parse)(selector)), plain = _a[0], filtered = _a[1]; + var results = filtered.map(function (sel) { + return findFilterElements(root, sel, options, true, limit); + }); + // Plain selectors can be queried in a single go + if (plain.length) { + results.push(findElements(root, plain, options, limit)); + } + if (results.length === 0) { + return []; + } + // If there was only a single selector, just return the result + if (results.length === 1) { + return results[0]; + } + // Sort results, filtering for duplicates + return DomUtils.uniqueSort(results.reduce(function (a, b) { return __spreadArray(__spreadArray([], a, true), b, true); })); +} +exports.select = select; +/** + * + * @param root Element(s) to search from. + * @param selector Selector to look for. + * @param options Options for querying. + * @param queryForSelector Query multiple levels deep for the initial selector, even if it doesn't contain a traversal. + */ +function findFilterElements(root, selector, options, queryForSelector, totalLimit) { + var filterIndex = selector.findIndex(positionals_js_1.isFilter); + var sub = selector.slice(0, filterIndex); + var filter = selector[filterIndex]; + // If we are at the end of the selector, we can limit the number of elements to retrieve. + var partLimit = selector.length - 1 === filterIndex ? totalLimit : Infinity; + /* + * Set the number of elements to retrieve. + * Eg. for :first, we only have to get a single element. + */ + var limit = (0, positionals_js_1.getLimit)(filter.name, filter.data, partLimit); + if (limit === 0) + return []; + /* + * Skip `findElements` call if our selector starts with a positional + * pseudo. + */ + var elemsNoLimit = sub.length === 0 && !Array.isArray(root) + ? DomUtils.getChildren(root).filter(DomUtils.isTag) + : sub.length === 0 + ? (Array.isArray(root) ? root : [root]).filter(DomUtils.isTag) + : queryForSelector || sub.some(css_what_1.isTraversal) + ? findElements(root, [sub], options, limit) + : filterElements(root, [sub], options); + var elems = elemsNoLimit.slice(0, limit); + var result = filterByPosition(filter.name, elems, filter.data, options); + if (result.length === 0 || selector.length === filterIndex + 1) { + return result; + } + var remainingSelector = selector.slice(filterIndex + 1); + var remainingHasTraversal = remainingSelector.some(css_what_1.isTraversal); + if (remainingHasTraversal) { + if ((0, css_what_1.isTraversal)(remainingSelector[0])) { + var type = remainingSelector[0].type; + if (type === css_what_1.SelectorType.Sibling || + type === css_what_1.SelectorType.Adjacent) { + // If we have a sibling traversal, we need to also look at the siblings. + result = (0, css_select_1.prepareContext)(result, DomUtils, true); + } + // Avoid a traversal-first selector error. + remainingSelector.unshift(UNIVERSAL_SELECTOR); + } + options = __assign(__assign({}, options), { + // Avoid absolutizing the selector + relativeSelector: false, + /* + * Add a custom root func, to make sure traversals don't match elements + * that aren't a part of the considered tree. + */ + rootFunc: function (el) { return result.includes(el); } }); + } + else if (options.rootFunc && options.rootFunc !== boolbase.trueFunc) { + options = __assign(__assign({}, options), { rootFunc: boolbase.trueFunc }); + } + /* + * If we have another filter, recursively call `findFilterElements`, + * with the `recursive` flag disabled. We only have to look for more + * elements when we see a traversal. + * + * Otherwise, + */ + return remainingSelector.some(positionals_js_1.isFilter) + ? findFilterElements(result, remainingSelector, options, false, totalLimit) + : remainingHasTraversal + ? // Query existing elements to resolve traversal. + findElements(result, [remainingSelector], options, totalLimit) + : // If we don't have any more traversals, simply filter elements. + filterElements(result, [remainingSelector], options); +} +function findElements(root, sel, options, limit) { + var query = (0, css_select_1._compileToken)(sel, options, root); + return find(root, query, limit); +} +function find(root, query, limit) { + if (limit === void 0) { limit = Infinity; } + var elems = (0, css_select_1.prepareContext)(root, DomUtils, query.shouldTestNextSiblings); + return DomUtils.find(function (node) { return DomUtils.isTag(node) && query(node); }, elems, true, limit); +} +function filterElements(elements, sel, options) { + var els = (Array.isArray(elements) ? elements : [elements]).filter(DomUtils.isTag); + if (els.length === 0) + return els; + var query = (0, css_select_1._compileToken)(sel, options); + return query === boolbase.trueFunc ? els : els.filter(query); +} +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 59159: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getLimit = exports.isFilter = exports.filterNames = void 0; +exports.filterNames = new Set([ + "first", + "last", + "eq", + "gt", + "nth", + "lt", + "even", + "odd", +]); +function isFilter(s) { + if (s.type !== "pseudo") + return false; + if (exports.filterNames.has(s.name)) + return true; + if (s.name === "not" && Array.isArray(s.data)) { + // Only consider `:not` with embedded filters + return s.data.some(function (s) { return s.some(isFilter); }); + } + return false; +} +exports.isFilter = isFilter; +function getLimit(filter, data, partLimit) { + var num = data != null ? parseInt(data, 10) : NaN; + switch (filter) { + case "first": + return 1; + case "nth": + case "eq": + return isFinite(num) ? (num >= 0 ? num + 1 : Infinity) : 0; + case "lt": + return isFinite(num) + ? num >= 0 + ? Math.min(num, partLimit) + : Infinity + : 0; + case "gt": + return isFinite(num) ? Infinity : 0; + case "odd": + return 2 * partLimit; + case "even": + return 2 * partLimit - 1; + case "last": + case "not": + return Infinity; + } +} +exports.getLimit = getLimit; +//# sourceMappingURL=positionals.js.map + +/***/ }), + +/***/ 85443: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var util = __nccwpck_require__(73837); +var Stream = (__nccwpck_require__(12781).Stream); +var DelayedStream = __nccwpck_require__(18611); + +module.exports = CombinedStream; +function CombinedStream() { + this.writable = false; + this.readable = true; + this.dataSize = 0; + this.maxDataSize = 2 * 1024 * 1024; + this.pauseStreams = true; + + this._released = false; + this._streams = []; + this._currentStream = null; + this._insideLoop = false; + this._pendingNext = false; +} +util.inherits(CombinedStream, Stream); + +CombinedStream.create = function(options) { + var combinedStream = new this(); + + options = options || {}; + for (var option in options) { + combinedStream[option] = options[option]; + } + + return combinedStream; +}; + +CombinedStream.isStreamLike = function(stream) { + return (typeof stream !== 'function') + && (typeof stream !== 'string') + && (typeof stream !== 'boolean') + && (typeof stream !== 'number') + && (!Buffer.isBuffer(stream)); +}; + +CombinedStream.prototype.append = function(stream) { + var isStreamLike = CombinedStream.isStreamLike(stream); + + if (isStreamLike) { + if (!(stream instanceof DelayedStream)) { + var newStream = DelayedStream.create(stream, { + maxDataSize: Infinity, + pauseStream: this.pauseStreams, + }); + stream.on('data', this._checkDataSize.bind(this)); + stream = newStream; + } + + this._handleErrors(stream); + + if (this.pauseStreams) { + stream.pause(); + } + } + + this._streams.push(stream); + return this; +}; + +CombinedStream.prototype.pipe = function(dest, options) { + Stream.prototype.pipe.call(this, dest, options); + this.resume(); + return dest; +}; + +CombinedStream.prototype._getNext = function() { + this._currentStream = null; + + if (this._insideLoop) { + this._pendingNext = true; + return; // defer call + } + + this._insideLoop = true; + try { + do { + this._pendingNext = false; + this._realGetNext(); + } while (this._pendingNext); + } finally { + this._insideLoop = false; + } +}; + +CombinedStream.prototype._realGetNext = function() { + var stream = this._streams.shift(); + + + if (typeof stream == 'undefined') { + this.end(); + return; + } + + if (typeof stream !== 'function') { + this._pipeNext(stream); + return; + } + + var getStream = stream; + getStream(function(stream) { + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + stream.on('data', this._checkDataSize.bind(this)); + this._handleErrors(stream); + } + + this._pipeNext(stream); + }.bind(this)); +}; + +CombinedStream.prototype._pipeNext = function(stream) { + this._currentStream = stream; + + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + stream.on('end', this._getNext.bind(this)); + stream.pipe(this, {end: false}); + return; + } + + var value = stream; + this.write(value); + this._getNext(); +}; + +CombinedStream.prototype._handleErrors = function(stream) { + var self = this; + stream.on('error', function(err) { + self._emitError(err); + }); +}; + +CombinedStream.prototype.write = function(data) { + this.emit('data', data); +}; + +CombinedStream.prototype.pause = function() { + if (!this.pauseStreams) { + return; + } + + if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause(); + this.emit('pause'); +}; + +CombinedStream.prototype.resume = function() { + if (!this._released) { + this._released = true; + this.writable = true; + this._getNext(); + } + + if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume(); + this.emit('resume'); +}; + +CombinedStream.prototype.end = function() { + this._reset(); + this.emit('end'); +}; + +CombinedStream.prototype.destroy = function() { + this._reset(); + this.emit('close'); +}; + +CombinedStream.prototype._reset = function() { + this.writable = false; + this._streams = []; + this._currentStream = null; +}; + +CombinedStream.prototype._checkDataSize = function() { + this._updateDataSize(); + if (this.dataSize <= this.maxDataSize) { + return; + } + + var message = + 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'; + this._emitError(new Error(message)); +}; + +CombinedStream.prototype._updateDataSize = function() { + this.dataSize = 0; + + var self = this; + this._streams.forEach(function(stream) { + if (!stream.dataSize) { + return; + } + + self.dataSize += stream.dataSize; + }); + + if (this._currentStream && this._currentStream.dataSize) { + this.dataSize += this._currentStream.dataSize; + } +}; + +CombinedStream.prototype._emitError = function(err) { + this._reset(); + this.emit('error', err); +}; + + +/***/ }), + +/***/ 86891: +/***/ ((module) => { + +module.exports = function (xs, fn) { + var res = []; + for (var i = 0; i < xs.length; i++) { + var x = fn(xs[i], i); + if (isArray(x)) res.push.apply(res, x); + else res.push(x); + } + return res; +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; + + +/***/ }), + +/***/ 53921: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +/*! + * content-disposition + * Copyright(c) 2014-2017 Douglas Christopher Wilson * MIT Licensed - */i.exports=contentDisposition;i.exports.parse=parse;var v=m(1017).basename;var _=m(1867).Buffer;var M=/[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g;var j=/%[0-9A-Fa-f]{2}/;var $=/%([0-9A-Fa-f]{2})/g;var W=/[^\x20-\x7e\xa0-\xff]/g;var Y=/\\([\u0000-\u007f])/g;var Z=/([\\"])/g;var X=/;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g;var ee=/^[\x20-\x7e\x80-\xff]+$/;var ie=/^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/;var ae=/^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/;var ce=/^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/;function contentDisposition(i,u){var m=u||{};var v=m.type||"attachment";var _=createparams(i,m.fallback);return format(new ContentDisposition(v,_))}function createparams(i,u){if(i===undefined){return}var m={};if(typeof i!=="string"){throw new TypeError("filename must be a string")}if(u===undefined){u=true}if(typeof u!=="string"&&typeof u!=="boolean"){throw new TypeError("fallback must be a string or boolean")}if(typeof u==="string"&&W.test(u)){throw new TypeError("fallback must be ISO-8859-1 string")}var _=v(i);var M=ee.test(_);var $=typeof u!=="string"?u&&getlatin1(_):v(u);var Y=typeof $==="string"&&$!==_;if(Y||!M||j.test(_)){m["filename*"]=_}if(M||Y){m.filename=Y?$:_}return m}function format(i){var u=i.parameters;var m=i.type;if(!m||typeof m!=="string"||!ie.test(m)){throw new TypeError("invalid type")}var v=String(m).toLowerCase();if(u&&typeof u==="object"){var _;var M=Object.keys(u).sort();for(var j=0;j{"use strict"; + */ + + + +/** + * Module exports. + * @public + */ + +module.exports = contentDisposition +module.exports.parse = parse + +/** + * Module dependencies. + * @private + */ + +var basename = (__nccwpck_require__(71017).basename) +var Buffer = (__nccwpck_require__(38558).Buffer) + +/** + * RegExp to match non attr-char, *after* encodeURIComponent (i.e. not including "%") + * @private + */ + +var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g // eslint-disable-line no-control-regex + +/** + * RegExp to match percent encoding escape. + * @private + */ + +var HEX_ESCAPE_REGEXP = /%[0-9A-Fa-f]{2}/ +var HEX_ESCAPE_REPLACE_REGEXP = /%([0-9A-Fa-f]{2})/g + +/** + * RegExp to match non-latin1 characters. + * @private + */ + +var NON_LATIN1_REGEXP = /[^\x20-\x7e\xa0-\xff]/g + +/** + * RegExp to match quoted-pair in RFC 2616 + * + * quoted-pair = "\" CHAR + * CHAR = + * @private + */ + +var QESC_REGEXP = /\\([\u0000-\u007f])/g // eslint-disable-line no-control-regex + +/** + * RegExp to match chars that must be quoted-pair in RFC 2616 + * @private + */ + +var QUOTE_REGEXP = /([\\"])/g + +/** + * RegExp for various RFC 2616 grammar + * + * parameter = token "=" ( token | quoted-string ) + * token = 1* + * separators = "(" | ")" | "<" | ">" | "@" + * | "," | ";" | ":" | "\" | <"> + * | "/" | "[" | "]" | "?" | "=" + * | "{" | "}" | SP | HT + * quoted-string = ( <"> *(qdtext | quoted-pair ) <"> ) + * qdtext = > + * quoted-pair = "\" CHAR + * CHAR = + * TEXT = + * LWS = [CRLF] 1*( SP | HT ) + * CRLF = CR LF + * CR = + * LF = + * SP = + * HT = + * CTL = + * OCTET = + * @private + */ + +var PARAM_REGEXP = /;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g // eslint-disable-line no-control-regex +var TEXT_REGEXP = /^[\x20-\x7e\x80-\xff]+$/ +var TOKEN_REGEXP = /^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/ + +/** + * RegExp for various RFC 5987 grammar + * + * ext-value = charset "'" [ language ] "'" value-chars + * charset = "UTF-8" / "ISO-8859-1" / mime-charset + * mime-charset = 1*mime-charsetc + * mime-charsetc = ALPHA / DIGIT + * / "!" / "#" / "$" / "%" / "&" + * / "+" / "-" / "^" / "_" / "`" + * / "{" / "}" / "~" + * language = ( 2*3ALPHA [ extlang ] ) + * / 4ALPHA + * / 5*8ALPHA + * extlang = *3( "-" 3ALPHA ) + * value-chars = *( pct-encoded / attr-char ) + * pct-encoded = "%" HEXDIG HEXDIG + * attr-char = ALPHA / DIGIT + * / "!" / "#" / "$" / "&" / "+" / "-" / "." + * / "^" / "_" / "`" / "|" / "~" + * @private + */ + +var EXT_VALUE_REGEXP = /^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/ + +/** + * RegExp for various RFC 6266 grammar + * + * disposition-type = "inline" | "attachment" | disp-ext-type + * disp-ext-type = token + * disposition-parm = filename-parm | disp-ext-parm + * filename-parm = "filename" "=" value + * | "filename*" "=" ext-value + * disp-ext-parm = token "=" value + * | ext-token "=" ext-value + * ext-token = + * @private + */ + +var DISPOSITION_TYPE_REGEXP = /^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/ // eslint-disable-line no-control-regex + +/** + * Create an attachment Content-Disposition header. + * + * @param {string} [filename] + * @param {object} [options] + * @param {string} [options.type=attachment] + * @param {string|boolean} [options.fallback=true] + * @return {string} + * @public + */ + +function contentDisposition (filename, options) { + var opts = options || {} + + // get type + var type = opts.type || 'attachment' + + // get parameters + var params = createparams(filename, opts.fallback) + + // format into string + return format(new ContentDisposition(type, params)) +} + +/** + * Create parameters object from filename and fallback. + * + * @param {string} [filename] + * @param {string|boolean} [fallback=true] + * @return {object} + * @private + */ + +function createparams (filename, fallback) { + if (filename === undefined) { + return + } + + var params = {} + + if (typeof filename !== 'string') { + throw new TypeError('filename must be a string') + } + + // fallback defaults to true + if (fallback === undefined) { + fallback = true + } + + if (typeof fallback !== 'string' && typeof fallback !== 'boolean') { + throw new TypeError('fallback must be a string or boolean') + } + + if (typeof fallback === 'string' && NON_LATIN1_REGEXP.test(fallback)) { + throw new TypeError('fallback must be ISO-8859-1 string') + } + + // restrict to file base name + var name = basename(filename) + + // determine if name is suitable for quoted string + var isQuotedString = TEXT_REGEXP.test(name) + + // generate fallback name + var fallbackName = typeof fallback !== 'string' + ? fallback && getlatin1(name) + : basename(fallback) + var hasFallback = typeof fallbackName === 'string' && fallbackName !== name + + // set extended filename parameter + if (hasFallback || !isQuotedString || HEX_ESCAPE_REGEXP.test(name)) { + params['filename*'] = name + } + + // set filename parameter + if (isQuotedString || hasFallback) { + params.filename = hasFallback + ? fallbackName + : name + } + + return params +} + +/** + * Format object to Content-Disposition header. + * + * @param {object} obj + * @param {string} obj.type + * @param {object} [obj.parameters] + * @return {string} + * @private + */ + +function format (obj) { + var parameters = obj.parameters + var type = obj.type + + if (!type || typeof type !== 'string' || !TOKEN_REGEXP.test(type)) { + throw new TypeError('invalid type') + } + + // start with normalized type + var string = String(type).toLowerCase() + + // append parameters + if (parameters && typeof parameters === 'object') { + var param + var params = Object.keys(parameters).sort() + + for (var i = 0; i < params.length; i++) { + param = params[i] + + var val = param.substr(-1) === '*' + ? ustring(parameters[param]) + : qstring(parameters[param]) + + string += '; ' + param + '=' + val + } + } + + return string +} + +/** + * Decode a RFC 5987 field value (gracefully). + * + * @param {string} str + * @return {string} + * @private + */ + +function decodefield (str) { + var match = EXT_VALUE_REGEXP.exec(str) + + if (!match) { + throw new TypeError('invalid extended field value') + } + + var charset = match[1].toLowerCase() + var encoded = match[2] + var value + + // to binary string + var binary = encoded.replace(HEX_ESCAPE_REPLACE_REGEXP, pdecode) + + switch (charset) { + case 'iso-8859-1': + value = getlatin1(binary) + break + case 'utf-8': + value = Buffer.from(binary, 'binary').toString('utf8') + break + default: + throw new TypeError('unsupported charset in extended field') + } + + return value +} + +/** + * Get ISO-8859-1 version of string. + * + * @param {string} val + * @return {string} + * @private + */ + +function getlatin1 (val) { + // simple Unicode -> ISO-8859-1 transformation + return String(val).replace(NON_LATIN1_REGEXP, '?') +} + +/** + * Parse Content-Disposition header string. + * + * @param {string} string + * @return {object} + * @public + */ + +function parse (string) { + if (!string || typeof string !== 'string') { + throw new TypeError('argument string is required') + } + + var match = DISPOSITION_TYPE_REGEXP.exec(string) + + if (!match) { + throw new TypeError('invalid type format') + } + + // normalize type + var index = match[0].length + var type = match[1].toLowerCase() + + var key + var names = [] + var params = {} + var value + + // calculate index to start at + index = PARAM_REGEXP.lastIndex = match[0].substr(-1) === ';' + ? index - 1 + : index + + // match parameters + while ((match = PARAM_REGEXP.exec(string))) { + if (match.index !== index) { + throw new TypeError('invalid parameter format') + } + + index += match[0].length + key = match[1].toLowerCase() + value = match[2] + + if (names.indexOf(key) !== -1) { + throw new TypeError('invalid duplicate parameter') + } + + names.push(key) + + if (key.indexOf('*') + 1 === key.length) { + // decode extended value + key = key.slice(0, -1) + value = decodefield(value) + + // overwrite existing value + params[key] = value + continue + } + + if (typeof params[key] === 'string') { + continue + } + + if (value[0] === '"') { + // remove quotes and escapes + value = value + .substr(1, value.length - 2) + .replace(QESC_REGEXP, '$1') + } + + params[key] = value + } + + if (index !== -1 && index !== string.length) { + throw new TypeError('invalid parameter format') + } + + return new ContentDisposition(type, params) +} + +/** + * Percent decode a single character. + * + * @param {string} str + * @param {string} hex + * @return {string} + * @private + */ + +function pdecode (str, hex) { + return String.fromCharCode(parseInt(hex, 16)) +} + +/** + * Percent encode a single character. + * + * @param {string} char + * @return {string} + * @private + */ + +function pencode (char) { + return '%' + String(char) + .charCodeAt(0) + .toString(16) + .toUpperCase() +} + +/** + * Quote a string for HTTP. + * + * @param {string} val + * @return {string} + * @private + */ + +function qstring (val) { + var str = String(val) + + return '"' + str.replace(QUOTE_REGEXP, '\\$1') + '"' +} + +/** + * Encode a Unicode string for HTTP (RFC 5987). + * + * @param {string} val + * @return {string} + * @private + */ + +function ustring (val) { + var str = String(val) + + // percent encode as UTF-8 + var encoded = encodeURIComponent(str) + .replace(ENCODE_URL_ATTR_CHAR_REGEXP, pencode) + + return 'UTF-8\'\'' + encoded +} + +/** + * Class for parsed Content-Disposition header for v8 optimization + * + * @public + * @param {string} type + * @param {object} parameters + * @constructor + */ + +function ContentDisposition (type, parameters) { + this.type = type + this.parameters = parameters +} + + +/***/ }), + +/***/ 38558: +/***/ ((module, exports, __nccwpck_require__) => { + +/*! safe-buffer. MIT License. Feross Aboukhadijeh */ +/* eslint-disable node/no-deprecated-api */ +var buffer = __nccwpck_require__(14300) +var Buffer = buffer.Buffer + +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] + } +} +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} + +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.prototype = Object.create(Buffer.prototype) + +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) + +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + } else { + buf.fill(0) + } + return buf +} + +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) +} + +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) +} + + +/***/ }), + +/***/ 99915: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; /*! * content-type * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed - */var m=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g;var v=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/;var _=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;var M=/\\([\u000b\u0020-\u00ff])/g;var j=/([\\"])/g;var $=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;u.format=format;u.parse=parse;function format(i){if(!i||typeof i!=="object"){throw new TypeError("argument obj is required")}var u=i.parameters;var m=i.type;if(!m||!$.test(m)){throw new TypeError("invalid type")}var v=m;if(u&&typeof u==="object"){var M;var j=Object.keys(u).sort();for(var W=0;W0&&!v.test(u)){throw new TypeError("invalid parameter value")}return'"'+u.replace(j,"\\$1")+'"'}function ContentType(i){this.parameters=Object.create(null);this.type=i}},1579:(i,u,m)=>{var v=m(6113);u.sign=function(i,u){if("string"!=typeof i)throw new TypeError("Cookie value must be provided as a string.");if("string"!=typeof u)throw new TypeError("Secret string must be provided.");return i+"."+v.createHmac("sha256",u).update(i).digest("base64").replace(/\=+$/,"")};u.unsign=function(i,m){if("string"!=typeof i)throw new TypeError("Signed cookie string must be provided.");if("string"!=typeof m)throw new TypeError("Secret string must be provided.");var v=i.slice(0,i.lastIndexOf(".")),_=u.sign(v,m);return sha1(_)==sha1(i)?v:false};function sha1(i){return v.createHash("sha1").update(i).digest("hex")}},3658:(i,u)=>{"use strict"; + */ + + + +/** + * RegExp to match *( ";" parameter ) in RFC 7231 sec 3.1.1.1 + * + * parameter = token "=" ( token / quoted-string ) + * token = 1*tchar + * tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" + * / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~" + * / DIGIT / ALPHA + * ; any VCHAR, except delimiters + * quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE + * qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text + * obs-text = %x80-FF + * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text ) + */ +var PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g // eslint-disable-line no-control-regex +var TEXT_REGEXP = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/ // eslint-disable-line no-control-regex +var TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/ + +/** + * RegExp to match quoted-pair in RFC 7230 sec 3.2.6 + * + * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text ) + * obs-text = %x80-FF + */ +var QESC_REGEXP = /\\([\u000b\u0020-\u00ff])/g // eslint-disable-line no-control-regex + +/** + * RegExp to match chars that must be quoted-pair in RFC 7230 sec 3.2.6 + */ +var QUOTE_REGEXP = /([\\"])/g + +/** + * RegExp to match type in RFC 7231 sec 3.1.1.1 + * + * media-type = type "/" subtype + * type = token + * subtype = token + */ +var TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/ + +/** + * Module exports. + * @public + */ + +exports.format = format +exports.parse = parse + +/** + * Format object to media type. + * + * @param {object} obj + * @return {string} + * @public + */ + +function format (obj) { + if (!obj || typeof obj !== 'object') { + throw new TypeError('argument obj is required') + } + + var parameters = obj.parameters + var type = obj.type + + if (!type || !TYPE_REGEXP.test(type)) { + throw new TypeError('invalid type') + } + + var string = type + + // append parameters + if (parameters && typeof parameters === 'object') { + var param + var params = Object.keys(parameters).sort() + + for (var i = 0; i < params.length; i++) { + param = params[i] + + if (!TOKEN_REGEXP.test(param)) { + throw new TypeError('invalid parameter name') + } + + string += '; ' + param + '=' + qstring(parameters[param]) + } + } + + return string +} + +/** + * Parse media type to object. + * + * @param {string|object} string + * @return {Object} + * @public + */ + +function parse (string) { + if (!string) { + throw new TypeError('argument string is required') + } + + // support req/res-like objects as argument + var header = typeof string === 'object' + ? getcontenttype(string) + : string + + if (typeof header !== 'string') { + throw new TypeError('argument string is required to be a string') + } + + var index = header.indexOf(';') + var type = index !== -1 + ? header.slice(0, index).trim() + : header.trim() + + if (!TYPE_REGEXP.test(type)) { + throw new TypeError('invalid media type') + } + + var obj = new ContentType(type.toLowerCase()) + + // parse parameters + if (index !== -1) { + var key + var match + var value + + PARAM_REGEXP.lastIndex = index + + while ((match = PARAM_REGEXP.exec(header))) { + if (match.index !== index) { + throw new TypeError('invalid parameter format') + } + + index += match[0].length + key = match[1].toLowerCase() + value = match[2] + + if (value.charCodeAt(0) === 0x22 /* " */) { + // remove quotes + value = value.slice(1, -1) + + // remove escapes + if (value.indexOf('\\') !== -1) { + value = value.replace(QESC_REGEXP, '$1') + } + } + + obj.parameters[key] = value + } + + if (index !== header.length) { + throw new TypeError('invalid parameter format') + } + } + + return obj +} + +/** + * Get content-type from req/res objects. + * + * @param {object} + * @return {Object} + * @private + */ + +function getcontenttype (obj) { + var header + + if (typeof obj.getHeader === 'function') { + // res-like + header = obj.getHeader('content-type') + } else if (typeof obj.headers === 'object') { + // req-like + header = obj.headers && obj.headers['content-type'] + } + + if (typeof header !== 'string') { + throw new TypeError('content-type header is missing from object') + } + + return header +} + +/** + * Quote a string if necessary. + * + * @param {string} val + * @return {string} + * @private + */ + +function qstring (val) { + var str = String(val) + + // no need to quote tokens + if (TOKEN_REGEXP.test(str)) { + return str + } + + if (str.length > 0 && !TEXT_REGEXP.test(str)) { + throw new TypeError('invalid parameter value') + } + + return '"' + str.replace(QUOTE_REGEXP, '\\$1') + '"' +} + +/** + * Class to represent a content type. + * @private + */ +function ContentType (type) { + this.parameters = Object.create(null) + this.type = type +} + + +/***/ }), + +/***/ 61579: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +/** + * Module dependencies. + */ + +var crypto = __nccwpck_require__(6113); + +/** + * Sign the given `val` with `secret`. + * + * @param {String} val + * @param {String} secret + * @return {String} + * @api private + */ + +exports.sign = function(val, secret){ + if ('string' != typeof val) throw new TypeError("Cookie value must be provided as a string."); + if ('string' != typeof secret) throw new TypeError("Secret string must be provided."); + return val + '.' + crypto + .createHmac('sha256', secret) + .update(val) + .digest('base64') + .replace(/\=+$/, ''); +}; + +/** + * Unsign and decode the given `val` with `secret`, + * returning `false` if the signature is invalid. + * + * @param {String} val + * @param {String} secret + * @return {String|Boolean} + * @api private + */ + +exports.unsign = function(val, secret){ + if ('string' != typeof val) throw new TypeError("Signed cookie string must be provided."); + if ('string' != typeof secret) throw new TypeError("Secret string must be provided."); + var str = val.slice(0, val.lastIndexOf('.')) + , mac = exports.sign(str, secret); + + return sha1(mac) == sha1(val) ? str : false; +}; + +/** + * Private + */ + +function sha1(str){ + return crypto.createHash('sha1').update(str).digest('hex'); +} + + +/***/ }), + +/***/ 93658: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; /*! * cookie * Copyright(c) 2012-2014 Roman Shtylman * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed - */u.parse=parse;u.serialize=serialize;var m=Object.prototype.toString;var v=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function parse(i,u){if(typeof i!=="string"){throw new TypeError("argument str must be a string")}var m={};var v=u||{};var _=v.decode||decode;var M=0;while(M{(function(){"use strict";var u=m(1763);var v=m(5931);var _={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:false,optionsSuccessStatus:204};function isString(i){return typeof i==="string"||i instanceof String}function isOriginAllowed(i,u){if(Array.isArray(u)){for(var m=0;m=j.length&&$.test(m)&&i(u)}},exists:function(i,u,m){var v=u.name;var _=m.adapter;return function(u){return _.hasAttrib(u,v)&&i(u)}},start:function(i,u,m){var v=m.adapter;var M=u.name;var j=u.value;var $=j.length;if($===0){return _.default.falseFunc}if(shouldIgnoreCase(u,m)){j=j.toLowerCase();return function(u){var m=v.getAttributeValue(u,M);return m!=null&&m.length>=$&&m.substr(0,$).toLowerCase()===j&&i(u)}}return function(u){var m;return!!((m=v.getAttributeValue(u,M))===null||m===void 0?void 0:m.startsWith(j))&&i(u)}},end:function(i,u,m){var v=m.adapter;var M=u.name;var j=u.value;var $=-j.length;if($===0){return _.default.falseFunc}if(shouldIgnoreCase(u,m)){j=j.toLowerCase();return function(u){var m;return((m=v.getAttributeValue(u,M))===null||m===void 0?void 0:m.substr($).toLowerCase())===j&&i(u)}}return function(u){var m;return!!((m=v.getAttributeValue(u,M))===null||m===void 0?void 0:m.endsWith(j))&&i(u)}},any:function(i,u,m){var v=m.adapter;var M=u.name,j=u.value;if(j===""){return _.default.falseFunc}if(shouldIgnoreCase(u,m)){var $=new RegExp(escapeRegex(j),"i");return function anyIC(u){var m=v.getAttributeValue(u,M);return m!=null&&m.length>=j.length&&$.test(m)&&i(u)}}return function(u){var m;return!!((m=v.getAttributeValue(u,M))===null||m===void 0?void 0:m.includes(j))&&i(u)}},not:function(i,u,m){var v=m.adapter;var _=u.name;var M=u.value;if(M===""){return function(u){return!!v.getAttributeValue(u,_)&&i(u)}}else if(shouldIgnoreCase(u,m)){M=M.toLowerCase();return function(u){var m=v.getAttributeValue(u,_);return(m==null||m.length!==M.length||m.toLowerCase()!==M)&&i(u)}}return function(u){return v.getAttributeValue(u,_)!==M&&i(u)}}}},5030:function(i,u,m){"use strict";var v=this&&this.__createBinding||(Object.create?function(i,u,m,v){if(v===undefined)v=m;var _=Object.getOwnPropertyDescriptor(u,m);if(!_||("get"in _?!u.__esModule:_.writable||_.configurable)){_={enumerable:true,get:function(){return u[m]}}}Object.defineProperty(i,v,_)}:function(i,u,m,v){if(v===undefined)v=m;i[v]=u[m]});var _=this&&this.__setModuleDefault||(Object.create?function(i,u){Object.defineProperty(i,"default",{enumerable:true,value:u})}:function(i,u){i["default"]=u});var M=this&&this.__importStar||function(i){if(i&&i.__esModule)return i;var u={};if(i!=null)for(var m in i)if(m!=="default"&&Object.prototype.hasOwnProperty.call(i,m))v(u,i,m);_(u,i);return u};var j=this&&this.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(u,"__esModule",{value:true});u.compileToken=u.compileUnsafe=u.compile=void 0;var $=m(284);var W=j(m(4159));var Y=M(m(7320));var Z=m(5374);var X=m(5813);function compile(i,u,m){var v=compileUnsafe(i,u,m);return(0,X.ensureIsTag)(v,u.adapter)}u.compile=compile;function compileUnsafe(i,u,m){var v=typeof i==="string"?(0,$.parse)(i):i;return compileToken(v,u,m)}u.compileUnsafe=compileUnsafe;function includesScopePseudo(i){return i.type===$.SelectorType.Pseudo&&(i.name==="scope"||Array.isArray(i.data)&&i.data.some((function(i){return i.some(includesScopePseudo)})))}var ee={type:$.SelectorType.Descendant};var ie={type:"_flexibleDescendant"};var ae={type:$.SelectorType.Pseudo,name:"scope",data:null};function absolutize(i,u,m){var v=u.adapter;var _=!!(m===null||m===void 0?void 0:m.every((function(i){var u=v.isTag(i)&&v.getParent(i);return i===X.PLACEHOLDER_ELEMENT||u&&v.isTag(u)})));for(var M=0,j=i;M0&&(0,Y.isTraversal)(W[0])&&W[0].type!==$.SelectorType.Descendant){}else if(_&&!W.some(includesScopePseudo)){W.unshift(ee)}else{continue}W.unshift(ae)}}function compileToken(i,u,m){var v;i.forEach(Y.default);m=(v=u.context)!==null&&v!==void 0?v:m;var _=Array.isArray(m);var M=m&&(Array.isArray(m)?m:[m]);if(u.relativeSelector!==false){absolutize(i,u,M)}else if(i.some((function(i){return i.length>0&&(0,Y.isTraversal)(i[0])}))){throw new Error("Relative selectors are not allowed when the `relativeSelector` option is disabled")}var j=false;var Z=i.map((function(i){if(i.length>=2){var m=i[0],v=i[1];if(m.type!==$.SelectorType.Pseudo||m.name!=="scope"){}else if(_&&v.type===$.SelectorType.Descendant){i[1]=ie}else if(v.type===$.SelectorType.Adjacent||v.type===$.SelectorType.Sibling){j=true}}return compileRules(i,u,M)})).reduce(reduceRules,W.default.falseFunc);Z.shouldTestNextSiblings=j;return Z}u.compileToken=compileToken;function compileRules(i,u,m){var v;return i.reduce((function(i,v){return i===W.default.falseFunc?W.default.falseFunc:(0,Z.compileGeneralSelector)(i,v,u,m,compileToken)}),(v=u.rootFunc)!==null&&v!==void 0?v:W.default.trueFunc)}function reduceRules(i,u){if(u===W.default.falseFunc||i===W.default.trueFunc){return i}if(i===W.default.falseFunc||u===W.default.trueFunc){return u}return function combine(m){return i(m)||u(m)}}},5374:(i,u,m)=>{"use strict";Object.defineProperty(u,"__esModule",{value:true});u.compileGeneralSelector=void 0;var v=m(6863);var _=m(9312);var M=m(284);function getElementParent(i,u){var m=u.getParent(i);if(m&&u.isTag(m)){return m}return null}function compileGeneralSelector(i,u,m,j,$){var W=m.adapter,Y=m.equals;switch(u.type){case M.SelectorType.PseudoElement:{throw new Error("Pseudo-elements are not supported by css-select")}case M.SelectorType.ColumnCombinator:{throw new Error("Column combinators are not yet supported by css-select")}case M.SelectorType.Attribute:{if(u.namespace!=null){throw new Error("Namespaced attributes are not yet supported by css-select")}if(!m.xmlMode||m.lowerCaseAttributeNames){u.name=u.name.toLowerCase()}return v.attributeRules[u.action](i,u,m)}case M.SelectorType.Pseudo:{return(0,_.compilePseudoSelector)(i,u,m,j,$)}case M.SelectorType.Tag:{if(u.namespace!=null){throw new Error("Namespaced tag names are not yet supported by css-select")}var Z=u.name;if(!m.xmlMode||m.lowerCaseTags){Z=Z.toLowerCase()}return function tag(u){return W.getName(u)===Z&&i(u)}}case M.SelectorType.Descendant:{if(m.cacheResults===false||typeof WeakSet==="undefined"){return function descendant(u){var m=u;while(m=getElementParent(m,W)){if(i(m)){return true}}return false}}var X=new WeakSet;return function cachedDescendant(u){var m=u;while(m=getElementParent(m,W)){if(!X.has(m)){if(W.isTag(m)&&i(m)){return true}X.add(m)}}return false}}case"_flexibleDescendant":{return function flexibleDescendant(u){var m=u;do{if(i(m))return true}while(m=getElementParent(m,W));return false}}case M.SelectorType.Parent:{return function parent(u){return W.getChildren(u).some((function(u){return W.isTag(u)&&i(u)}))}}case M.SelectorType.Child:{return function child(u){var m=W.getParent(u);return m!=null&&W.isTag(m)&&i(m)}}case M.SelectorType.Sibling:{return function sibling(u){var m=W.getSiblings(u);for(var v=0;v{"use strict";Object.defineProperty(u,"__esModule",{value:true});u.aliases=void 0;u.aliases={"any-link":":is(a, area, link)[href]",link:":any-link:not(:visited)",disabled:":is(\n :is(button, input, select, textarea, optgroup, option)[disabled],\n optgroup[disabled] > option,\n fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)\n )",enabled:":not(:disabled)",checked:":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",required:":is(input, select, textarea)[required]",optional:":is(input, select, textarea):not([required])",selected:"option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",checkbox:"[type=checkbox]",file:"[type=file]",password:"[type=password]",radio:"[type=radio]",reset:"[type=reset]",image:"[type=image]",submit:"[type=submit]",parent:":not(:empty)",header:":is(h1, h2, h3, h4, h5, h6)",button:":is(button, input[type=button])",input:":is(input, textarea, select, button)",text:"input:is(:not([type!='']), [type=text])"}},1686:function(i,u,m){"use strict";var v=this&&this.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(u,"__esModule",{value:true});u.filters=void 0;var _=v(m(1260));var M=v(m(4159));function getChildFunc(i,u){return function(m){var v=u.getParent(m);return v!=null&&u.isTag(v)&&i(m)}}u.filters={contains:function(i,u,m){var v=m.adapter;return function contains(m){return i(m)&&v.getText(m).includes(u)}},icontains:function(i,u,m){var v=m.adapter;var _=u.toLowerCase();return function icontains(u){return i(u)&&v.getText(u).toLowerCase().includes(_)}},"nth-child":function(i,u,m){var v=m.adapter,j=m.equals;var $=(0,_.default)(u);if($===M.default.falseFunc)return M.default.falseFunc;if($===M.default.trueFunc)return getChildFunc(i,v);return function nthChild(u){var m=v.getSiblings(u);var _=0;for(var M=0;M=0;M--){if(j(u,m[M]))break;if(v.isTag(m[M])){_++}}return $(_)&&i(u)}},"nth-of-type":function(i,u,m){var v=m.adapter,j=m.equals;var $=(0,_.default)(u);if($===M.default.falseFunc)return M.default.falseFunc;if($===M.default.trueFunc)return getChildFunc(i,v);return function nthOfType(u){var m=v.getSiblings(u);var _=0;for(var M=0;M=0;M--){var W=m[M];if(j(u,W))break;if(v.isTag(W)&&v.getName(W)===v.getName(u)){_++}}return $(_)&&i(u)}},root:function(i,u,m){var v=m.adapter;return function(u){var m=v.getParent(u);return(m==null||!v.isTag(m))&&i(u)}},scope:function(i,m,v,_){var M=v.equals;if(!_||_.length===0){return u.filters["root"](i,m,v)}if(_.length===1){return function(u){return M(_[0],u)&&i(u)}}return function(u){return _.includes(u)&&i(u)}},hover:dynamicStatePseudo("isHovered"),visited:dynamicStatePseudo("isVisited"),active:dynamicStatePseudo("isActive")};function dynamicStatePseudo(i){return function dynamicPseudo(u,m,v){var _=v.adapter;var j=_[i];if(typeof j!=="function"){return M.default.falseFunc}return function active(i){return j(i)&&u(i)}}}},9312:(i,u,m)=>{"use strict";Object.defineProperty(u,"__esModule",{value:true});u.compilePseudoSelector=u.aliases=u.pseudos=u.filters=void 0;var v=m(284);var _=m(1686);Object.defineProperty(u,"filters",{enumerable:true,get:function(){return _.filters}});var M=m(8952);Object.defineProperty(u,"pseudos",{enumerable:true,get:function(){return M.pseudos}});var j=m(4176);Object.defineProperty(u,"aliases",{enumerable:true,get:function(){return j.aliases}});var $=m(5813);function compilePseudoSelector(i,u,m,W,Y){var Z;var X=u.name,ee=u.data;if(Array.isArray(ee)){if(!(X in $.subselects)){throw new Error("Unknown pseudo-class :".concat(X,"(").concat(ee,")"))}return $.subselects[X](i,ee,m,W,Y)}var ie=(Z=m.pseudos)===null||Z===void 0?void 0:Z[X];var ae=typeof ie==="string"?ie:j.aliases[X];if(typeof ae==="string"){if(ee!=null){throw new Error("Pseudo ".concat(X," doesn't have any arguments"))}var ce=(0,v.parse)(ae);return $.subselects["is"](i,ce,m,W,Y)}if(typeof ie==="function"){(0,M.verifyPseudoArgs)(ie,X,ee,1);return function(u){return ie(u,ee)&&i(u)}}if(X in _.filters){return _.filters[X](i,ee,m,W)}if(X in M.pseudos){var le=M.pseudos[X];(0,M.verifyPseudoArgs)(le,X,ee,2);return function(u){return le(u,m,ee)&&i(u)}}throw new Error("Unknown pseudo-class :".concat(X))}u.compilePseudoSelector=compilePseudoSelector},8952:(i,u)=>{"use strict";Object.defineProperty(u,"__esModule",{value:true});u.verifyPseudoArgs=u.pseudos=void 0;u.pseudos={empty:function(i,u){var m=u.adapter;return!m.getChildren(i).some((function(i){return m.isTag(i)||m.getText(i)!==""}))},"first-child":function(i,u){var m=u.adapter,v=u.equals;if(m.prevElementSibling){return m.prevElementSibling(i)==null}var _=m.getSiblings(i).find((function(i){return m.isTag(i)}));return _!=null&&v(i,_)},"last-child":function(i,u){var m=u.adapter,v=u.equals;var _=m.getSiblings(i);for(var M=_.length-1;M>=0;M--){if(v(i,_[M]))return true;if(m.isTag(_[M]))break}return false},"first-of-type":function(i,u){var m=u.adapter,v=u.equals;var _=m.getSiblings(i);var M=m.getName(i);for(var j=0;j<_.length;j++){var $=_[j];if(v(i,$))return true;if(m.isTag($)&&m.getName($)===M){break}}return false},"last-of-type":function(i,u){var m=u.adapter,v=u.equals;var _=m.getSiblings(i);var M=m.getName(i);for(var j=_.length-1;j>=0;j--){var $=_[j];if(v(i,$))return true;if(m.isTag($)&&m.getName($)===M){break}}return false},"only-of-type":function(i,u){var m=u.adapter,v=u.equals;var _=m.getName(i);return m.getSiblings(i).every((function(u){return v(i,u)||!m.isTag(u)||m.getName(u)!==_}))},"only-child":function(i,u){var m=u.adapter,v=u.equals;return m.getSiblings(i).every((function(u){return v(i,u)||!m.isTag(u)}))}};function verifyPseudoArgs(i,u,m,v){if(m===null){if(i.length>v){throw new Error("Pseudo-class :".concat(u," requires an argument"))}}else if(i.length===v){throw new Error("Pseudo-class :".concat(u," doesn't have any arguments"))}}u.verifyPseudoArgs=verifyPseudoArgs},5813:function(i,u,m){"use strict";var v=this&&this.__spreadArray||function(i,u,m){if(m||arguments.length===2)for(var v=0,_=u.length,M;v<_;v++){if(M||!(v in u)){if(!M)M=Array.prototype.slice.call(u,0,v);M[v]=u[v]}}return i.concat(M||Array.prototype.slice.call(u))};var _=this&&this.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(u,"__esModule",{value:true});u.subselects=u.getNextSiblings=u.ensureIsTag=u.PLACEHOLDER_ELEMENT=void 0;var M=_(m(4159));var j=m(7320);u.PLACEHOLDER_ELEMENT={};function ensureIsTag(i,u){if(i===M.default.falseFunc)return M.default.falseFunc;return function(m){return u.isTag(m)&&i(m)}}u.ensureIsTag=ensureIsTag;function getNextSiblings(i,u){var m=u.getSiblings(i);if(m.length<=1)return[];var v=m.indexOf(i);if(v<0||v===m.length-1)return[];return m.slice(v+1).filter(u.isTag)}u.getNextSiblings=getNextSiblings;function copyOptions(i){return{xmlMode:!!i.xmlMode,lowerCaseAttributeNames:!!i.lowerCaseAttributeNames,lowerCaseTags:!!i.lowerCaseTags,quirksMode:!!i.quirksMode,cacheResults:!!i.cacheResults,pseudos:i.pseudos,adapter:i.adapter,equals:i.equals}}var is=function(i,u,m,v,_){var j=_(u,copyOptions(m),v);return j===M.default.trueFunc?i:j===M.default.falseFunc?M.default.falseFunc:function(u){return j(u)&&i(u)}};u.subselects={is:is,matches:is,where:is,not:function(i,u,m,v,_){var j=_(u,copyOptions(m),v);return j===M.default.falseFunc?i:j===M.default.trueFunc?M.default.falseFunc:function(u){return!j(u)&&i(u)}},has:function(i,m,_,$,W){var Y=_.adapter;var Z=copyOptions(_);Z.relativeSelector=true;var X=m.some((function(i){return i.some(j.isTraversal)}))?[u.PLACEHOLDER_ELEMENT]:undefined;var ee=W(m,Z,X);if(ee===M.default.falseFunc)return M.default.falseFunc;var ie=ensureIsTag(ee,Y);if(X&&ee!==M.default.trueFunc){var ae=ee.shouldTestNextSiblings,ce=ae===void 0?false:ae;return function(u){if(!i(u))return false;X[0]=u;var m=Y.getChildren(u);var _=ce?v(v([],m,true),getNextSiblings(u,Y),true):m;return Y.existsOne(ie,_)}}return function(u){return i(u)&&Y.existsOne(ie,Y.getChildren(u))}}}},7320:(i,u,m)=>{"use strict";Object.defineProperty(u,"__esModule",{value:true});u.isTraversal=void 0;var v=m(284);var _=new Map([[v.SelectorType.Universal,50],[v.SelectorType.Tag,30],[v.SelectorType.Attribute,1],[v.SelectorType.Pseudo,0]]);function isTraversal(i){return!_.has(i.type)}u.isTraversal=isTraversal;var M=new Map([[v.AttributeAction.Exists,10],[v.AttributeAction.Equals,8],[v.AttributeAction.Not,7],[v.AttributeAction.Start,6],[v.AttributeAction.End,6],[v.AttributeAction.Any,5]]);function sortByProcedure(i){var u=i.map(getProcedure);for(var m=1;m=0&&v>=1}}else if(i.type===v.SelectorType.Pseudo){if(!i.data){j=3}else if(i.name==="has"||i.name==="contains"){j=0}else if(Array.isArray(i.data)){j=Math.min.apply(Math,i.data.map((function(i){return Math.min.apply(Math,i.map(getProcedure))})));if(j<0){j=0}}else{j=2}}return j}},284:function(i,u,m){"use strict";var v=this&&this.__createBinding||(Object.create?function(i,u,m,v){if(v===undefined)v=m;var _=Object.getOwnPropertyDescriptor(u,m);if(!_||("get"in _?!u.__esModule:_.writable||_.configurable)){_={enumerable:true,get:function(){return u[m]}}}Object.defineProperty(i,v,_)}:function(i,u,m,v){if(v===undefined)v=m;i[v]=u[m]});var _=this&&this.__exportStar||function(i,u){for(var m in i)if(m!=="default"&&!Object.prototype.hasOwnProperty.call(u,m))v(u,i,m)};Object.defineProperty(u,"__esModule",{value:true});u.stringify=u.parse=u.isTraversal=void 0;_(m(3172),u);var M=m(7255);Object.defineProperty(u,"isTraversal",{enumerable:true,get:function(){return M.isTraversal}});Object.defineProperty(u,"parse",{enumerable:true,get:function(){return M.parse}});var j=m(9265);Object.defineProperty(u,"stringify",{enumerable:true,get:function(){return j.stringify}})},7255:(i,u,m)=>{"use strict";Object.defineProperty(u,"__esModule",{value:true});u.parse=u.isTraversal=void 0;var v=m(3172);var _=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/;var M=/\\([\da-f]{1,6}\s?|(\s)|.)/gi;var j=new Map([[126,v.AttributeAction.Element],[94,v.AttributeAction.Start],[36,v.AttributeAction.End],[42,v.AttributeAction.Any],[33,v.AttributeAction.Not],[124,v.AttributeAction.Hyphen]]);var $=new Set(["has","not","matches","is","where","host","host-context"]);function isTraversal(i){switch(i.type){case v.SelectorType.Adjacent:case v.SelectorType.Child:case v.SelectorType.Descendant:case v.SelectorType.Parent:case v.SelectorType.Sibling:case v.SelectorType.ColumnCombinator:return true;default:return false}}u.isTraversal=isTraversal;var W=new Set(["contains","icontains"]);function funescape(i,u,m){var v=parseInt(u,16)-65536;return v!==v||m?u:v<0?String.fromCharCode(v+65536):String.fromCharCode(v>>10|55296,v&1023|56320)}function unescapeCSS(i){return i.replace(M,funescape)}function isQuote(i){return i===39||i===34}function isWhitespace(i){return i===32||i===9||i===10||i===12||i===13}function parse(i){var u=[];var m=parseSelector(u,"".concat(i),0);if(m0&&m0&&isTraversal(M[M.length-1])){throw new Error("Did not expect successive traversals.")}}function addTraversal(i){if(M.length>0&&M[M.length-1].type===v.SelectorType.Descendant){M[M.length-1].type=i;return}ensureNotTraversal();M.push({type:i})}function addSpecialAttribute(i,u){M.push({type:v.SelectorType.Attribute,name:i,action:u,value:getName(1),namespace:null,ignoreCase:"quirks"})}function finalizeSubselector(){if(M.length&&M[M.length-1].type===v.SelectorType.Descendant){M.pop()}if(M.length===0){throw new Error("Empty sub-selector")}i.push(M)}stripWhitespace(0);if(u.length===m){return m}e:while(m ":" > ";case _.SelectorType.Parent:return u===0?"< ":" < ";case _.SelectorType.Sibling:return u===0?"~ ":" ~ ";case _.SelectorType.Adjacent:return u===0?"+ ":" + ";case _.SelectorType.Descendant:return" ";case _.SelectorType.ColumnCombinator:return u===0?"|| ":" || ";case _.SelectorType.Universal:return i.namespace==="*"&&u+10?v+i.slice(m):i}},3172:(i,u)=>{"use strict";Object.defineProperty(u,"__esModule",{value:true});u.AttributeAction=u.IgnoreCaseMode=u.SelectorType=void 0;var m;(function(i){i["Attribute"]="attribute";i["Pseudo"]="pseudo";i["PseudoElement"]="pseudo-element";i["Tag"]="tag";i["Universal"]="universal";i["Adjacent"]="adjacent";i["Child"]="child";i["Descendant"]="descendant";i["Parent"]="parent";i["Sibling"]="sibling";i["ColumnCombinator"]="column-combinator"})(m=u.SelectorType||(u.SelectorType={}));u.IgnoreCaseMode={Unknown:null,QuirksMode:"quirks",IgnoreCase:true,CaseSensitive:false};var v;(function(i){i["Any"]="any";i["Element"]="element";i["End"]="end";i["Equals"]="equals";i["Exists"]="exists";i["Hyphen"]="hyphen";i["Not"]="not";i["Start"]="start"})(v=u.AttributeAction||(u.AttributeAction={}))},8222:(i,u,m)=>{u.formatArgs=formatArgs;u.save=save;u.load=load;u.useColors=useColors;u.storage=localstorage();u.destroy=(()=>{let i=false;return()=>{if(!i){i=true;console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}}})();u.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function useColors(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)){return true}if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)){return false}return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function formatArgs(u){u[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+u[0]+(this.useColors?"%c ":" ")+"+"+i.exports.humanize(this.diff);if(!this.useColors){return}const m="color: "+this.color;u.splice(1,0,m,"color: inherit");let v=0;let _=0;u[0].replace(/%[a-zA-Z%]/g,(i=>{if(i==="%%"){return}v++;if(i==="%c"){_=v}}));u.splice(_,0,m)}u.log=console.debug||console.log||(()=>{});function save(i){try{if(i){u.storage.setItem("debug",i)}else{u.storage.removeItem("debug")}}catch(i){}}function load(){let i;try{i=u.storage.getItem("debug")}catch(i){}if(!i&&typeof process!=="undefined"&&"env"in process){i=process.env.DEBUG}return i}function localstorage(){try{return localStorage}catch(i){}}i.exports=m(6243)(u);const{formatters:v}=i.exports;v.j=function(i){try{return JSON.stringify(i)}catch(i){return"[UnexpectedJSONParseError]: "+i.message}}},6243:(i,u,m)=>{function setup(i){createDebug.debug=createDebug;createDebug.default=createDebug;createDebug.coerce=coerce;createDebug.disable=disable;createDebug.enable=enable;createDebug.enabled=enabled;createDebug.humanize=m(900);createDebug.destroy=destroy;Object.keys(i).forEach((u=>{createDebug[u]=i[u]}));createDebug.names=[];createDebug.skips=[];createDebug.formatters={};function selectColor(i){let u=0;for(let m=0;m{if(u==="%%"){return"%"}M++;const _=createDebug.formatters[v];if(typeof _==="function"){const v=i[M];u=_.call(m,v);i.splice(M,1);M--}return u}));createDebug.formatArgs.call(m,i);const j=m.log||createDebug.log;j.apply(m,i)}debug.namespace=i;debug.useColors=createDebug.useColors();debug.color=createDebug.selectColor(i);debug.extend=extend;debug.destroy=createDebug.destroy;Object.defineProperty(debug,"enabled",{enumerable:true,configurable:false,get:()=>{if(m!==null){return m}if(v!==createDebug.namespaces){v=createDebug.namespaces;_=createDebug.enabled(i)}return _},set:i=>{m=i}});if(typeof createDebug.init==="function"){createDebug.init(debug)}return debug}function extend(i,u){const m=createDebug(this.namespace+(typeof u==="undefined"?":":u)+i);m.log=this.log;return m}function enable(i){createDebug.save(i);createDebug.namespaces=i;createDebug.names=[];createDebug.skips=[];let u;const m=(typeof i==="string"?i:"").split(/[\s,]+/);const v=m.length;for(u=0;u"-"+i))].join(",");createDebug.enable("");return i}function enabled(i){if(i[i.length-1]==="*"){return true}let u;let m;for(u=0,m=createDebug.skips.length;u{if(typeof process==="undefined"||process.type==="renderer"||process.browser===true||process.__nwjs){i.exports=m(8222)}else{i.exports=m(5332)}},5332:(i,u,m)=>{const v=m(6224);const _=m(3837);u.init=init;u.log=log;u.formatArgs=formatArgs;u.save=save;u.load=load;u.useColors=useColors;u.destroy=_.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");u.colors=[6,2,3,4,5,1];try{const i=m(9318);if(i&&(i.stderr||i).level>=2){u.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}}catch(i){}u.inspectOpts=Object.keys(process.env).filter((i=>/^debug_/i.test(i))).reduce(((i,u)=>{const m=u.substring(6).toLowerCase().replace(/_([a-z])/g,((i,u)=>u.toUpperCase()));let v=process.env[u];if(/^(yes|on|true|enabled)$/i.test(v)){v=true}else if(/^(no|off|false|disabled)$/i.test(v)){v=false}else if(v==="null"){v=null}else{v=Number(v)}i[m]=v;return i}),{});function useColors(){return"colors"in u.inspectOpts?Boolean(u.inspectOpts.colors):v.isatty(process.stderr.fd)}function formatArgs(u){const{namespace:m,useColors:v}=this;if(v){const v=this.color;const _="[3"+(v<8?v:"8;5;"+v);const M=` ${_};1m${m} `;u[0]=M+u[0].split("\n").join("\n"+M);u.push(_+"m+"+i.exports.humanize(this.diff)+"")}else{u[0]=getDate()+m+" "+u[0]}}function getDate(){if(u.inspectOpts.hideDate){return""}return(new Date).toISOString()+" "}function log(...i){return process.stderr.write(_.format(...i)+"\n")}function save(i){if(i){process.env.DEBUG=i}else{delete process.env.DEBUG}}function load(){return process.env.DEBUG}function init(i){i.inspectOpts={};const m=Object.keys(u.inspectOpts);for(let v=0;vi.trim())).join(" ")};M.O=function(i){this.inspectOpts.colors=this.useColors;return _.inspect(i,this.inspectOpts)}},8611:(i,u,m)=>{var v=m(2781).Stream;var _=m(3837);i.exports=DelayedStream;function DelayedStream(){this.source=null;this.dataSize=0;this.maxDataSize=1024*1024;this.pauseStream=true;this._maxDataSizeExceeded=false;this._released=false;this._bufferedEvents=[]}_.inherits(DelayedStream,v);DelayedStream.create=function(i,u){var m=new this;u=u||{};for(var v in u){m[v]=u[v]}m.source=i;var _=i.emit;i.emit=function(){m._handleEmit(arguments);return _.apply(i,arguments)};i.on("error",(function(){}));if(m.pauseStream){i.pause()}return m};Object.defineProperty(DelayedStream.prototype,"readable",{configurable:true,enumerable:true,get:function(){return this.source.readable}});DelayedStream.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};DelayedStream.prototype.resume=function(){if(!this._released){this.release()}this.source.resume()};DelayedStream.prototype.pause=function(){this.source.pause()};DelayedStream.prototype.release=function(){this._released=true;this._bufferedEvents.forEach(function(i){this.emit.apply(this,i)}.bind(this));this._bufferedEvents=[]};DelayedStream.prototype.pipe=function(){var i=v.prototype.pipe.apply(this,arguments);this.resume();return i};DelayedStream.prototype._handleEmit=function(i){if(this._released){this.emit.apply(this,i);return}if(i[0]==="data"){this.dataSize+=i[1].length;this._checkIfMaxDataSizeExceeded()}this._bufferedEvents.push(i)};DelayedStream.prototype._checkIfMaxDataSizeExceeded=function(){if(this._maxDataSizeExceeded){return}if(this.dataSize<=this.maxDataSize){return}this._maxDataSizeExceeded=true;var i="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(i))}},8883:(i,u,m)=>{ + */ + + + +/** + * Module exports. + * @public + */ + +exports.parse = parse; +exports.serialize = serialize; + +/** + * Module variables. + * @private + */ + +var __toString = Object.prototype.toString + +/** + * RegExp to match cookie-name in RFC 6265 sec 4.1.1 + * This refers out to the obsoleted definition of token in RFC 2616 sec 2.2 + * which has been replaced by the token definition in RFC 7230 appendix B. + * + * cookie-name = token + * token = 1*tchar + * tchar = "!" / "#" / "$" / "%" / "&" / "'" / + * "*" / "+" / "-" / "." / "^" / "_" / + * "`" / "|" / "~" / DIGIT / ALPHA + */ + +var cookieNameRegExp = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/; + +/** + * RegExp to match cookie-value in RFC 6265 sec 4.1.1 + * + * cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE ) + * cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E + * ; US-ASCII characters excluding CTLs, + * ; whitespace DQUOTE, comma, semicolon, + * ; and backslash + */ + +var cookieValueRegExp = /^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/; + +/** + * RegExp to match domain-value in RFC 6265 sec 4.1.1 + * + * domain-value = + * ; defined in [RFC1034], Section 3.5, as + * ; enhanced by [RFC1123], Section 2.1 + * =