From f5f7526f53a79cd8804e6dc95129b11b166a52fd Mon Sep 17 00:00:00 2001 From: gaoyuan Date: Mon, 6 Nov 2023 10:56:24 +0800 Subject: [PATCH 1/8] chore(builder): update rspack to 0.3.10 and fix deprecate warning (#4908) --- .changeset/late-cows-judge.md | 7 + .../builder-rspack-provider/package.json | 6 +- .../src/core/rspackConfig.ts | 5 +- .../src/plugins/react.ts | 23 +- .../__snapshots__/default.test.ts.snap | 36 ++-- .../builder/builder-shared/src/apply/hmr.ts | 2 +- .../builder/builder-shared/src/types/hooks.ts | 1 + .../src/core/webpackConfig.ts | 3 +- .../builder/plugin-node-polyfill/src/index.ts | 32 +-- pnpm-lock.yaml | 204 +++--------------- 10 files changed, 83 insertions(+), 236 deletions(-) create mode 100644 .changeset/late-cows-judge.md diff --git a/.changeset/late-cows-judge.md b/.changeset/late-cows-judge.md new file mode 100644 index 000000000000..5072fff36fe1 --- /dev/null +++ b/.changeset/late-cows-judge.md @@ -0,0 +1,7 @@ +--- +'@modern-js/builder-rspack-provider': patch +--- + +chore(builder): update rspack to 0.3.10 and fix deprecate warning + +chore(builder): 升级 rspack 到 0.3.10 并修复 deprecate warning diff --git a/packages/builder/builder-rspack-provider/package.json b/packages/builder/builder-rspack-provider/package.json index 0c3e9fc6dbd5..cb8f4da2c283 100644 --- a/packages/builder/builder-rspack-provider/package.json +++ b/packages/builder/builder-rspack-provider/package.json @@ -56,9 +56,9 @@ "@modern-js/types": "workspace:*", "@modern-js/utils": "workspace:*", "@babel/preset-typescript": "^7.22.15", - "@rspack/core": "0.3.8", - "@rspack/dev-client": "0.3.8", - "@rspack/plugin-html": "0.3.8", + "@rspack/core": "0.3.10", + "@rspack/dev-client": "0.3.10", + "@rspack/plugin-html": "0.3.10", "@swc/helpers": "0.5.1", "rspack-manifest-plugin": "5.0.0-alpha0", "caniuse-lite": "^1.0.30001520", diff --git a/packages/builder/builder-rspack-provider/src/core/rspackConfig.ts b/packages/builder/builder-rspack-provider/src/core/rspackConfig.ts index a2b4f0e32f4b..db8f74da4f64 100644 --- a/packages/builder/builder-rspack-provider/src/core/rspackConfig.ts +++ b/packages/builder/builder-rspack-provider/src/core/rspackConfig.ts @@ -124,13 +124,16 @@ export async function generateRspackConfig({ context: Context; }) { const chainUtils = await getChainUtils(target); - const { BannerPlugin, DefinePlugin } = await import('@rspack/core'); + const { BannerPlugin, DefinePlugin, ProvidePlugin } = await import( + '@rspack/core' + ); const chain = await modifyBundlerChain(context, { ...chainUtils, bundler: { BannerPlugin, DefinePlugin, + ProvidePlugin, }, }); diff --git a/packages/builder/builder-rspack-provider/src/plugins/react.ts b/packages/builder/builder-rspack-provider/src/plugins/react.ts index cd724e493786..d9fd74458c78 100644 --- a/packages/builder/builder-rspack-provider/src/plugins/react.ts +++ b/packages/builder/builder-rspack-provider/src/plugins/react.ts @@ -16,13 +16,24 @@ export const builderPluginReact = (): BuilderPlugin => ({ // https://swc.rs/docs/configuration/compilation#jsctransformreactruntime runtime: 'automatic', }); + }); - setConfig(rspackConfig, 'builtins.provide', { - ...(rspackConfig.builtins?.provide || {}), - $ReactRefreshRuntime$: [ - require.resolve('@rspack/dev-client/react-refresh'), - ], - }); + api.modifyBundlerChain(async (chain, utils) => { + const config = api.getNormalizedConfig(); + + const usingHMR = isUsingHMR(config, utils); + + const { bundler } = utils; + + if (usingHMR) { + chain.plugin('ReactRefreshRuntime').use(bundler.ProvidePlugin, [ + { + $ReactRefreshRuntime$: [ + require.resolve('@rspack/dev-client/react-refresh'), + ], + }, + ]); + } }); }, }); diff --git a/packages/builder/builder-rspack-provider/tests/plugins/__snapshots__/default.test.ts.snap b/packages/builder/builder-rspack-provider/tests/plugins/__snapshots__/default.test.ts.snap index 9d9aa3a450db..8fe3a762c770 100644 --- a/packages/builder/builder-rspack-provider/tests/plugins/__snapshots__/default.test.ts.snap +++ b/packages/builder/builder-rspack-provider/tests/plugins/__snapshots__/default.test.ts.snap @@ -41,11 +41,6 @@ exports[`applyDefaultPlugins > should apply default plugins correctly 1`] = ` "not op_mini all", ], }, - "provide": { - "$ReactRefreshRuntime$": [ - "/node_modules//@rspack/dev-client/src/reactRefresh.js", - ], - }, "react": { "development": true, "refresh": true, @@ -702,6 +697,14 @@ exports[`applyDefaultPlugins > should apply default plugins correctly 1`] = ` }, "name": "ProgressPlugin", }, + Plugin { + "_options": { + "$ReactRefreshRuntime$": [ + "/node_modules//@rspack/dev-client/src/reactRefresh.js", + ], + }, + "name": "ProvidePlugin", + }, ], "resolve": { "alias": { @@ -765,11 +768,6 @@ exports[`applyDefaultPlugins > should apply default plugins correctly when prod "not op_mini all", ], }, - "provide": { - "$ReactRefreshRuntime$": [ - "/node_modules//@rspack/dev-client/src/reactRefresh.js", - ], - }, "react": { "development": false, "refresh": false, @@ -1541,11 +1539,6 @@ exports[`applyDefaultPlugins > should apply default plugins correctyly when targ "node >= 14", ], }, - "provide": { - "$ReactRefreshRuntime$": [ - "/node_modules//@rspack/dev-client/src/reactRefresh.js", - ], - }, "react": { "development": true, "refresh": false, @@ -2011,11 +2004,6 @@ exports[`tools.rspack > should match snapshot 1`] = ` "not op_mini all", ], }, - "provide": { - "$ReactRefreshRuntime$": [ - "/node_modules//@rspack/dev-client/src/reactRefresh.js", - ], - }, "react": { "development": true, "refresh": true, @@ -2683,6 +2671,14 @@ exports[`tools.rspack > should match snapshot 1`] = ` }, "name": "ProgressPlugin", }, + Plugin { + "_options": { + "$ReactRefreshRuntime$": [ + "/node_modules//@rspack/dev-client/src/reactRefresh.js", + ], + }, + "name": "ProvidePlugin", + }, ], "resolve": { "alias": { diff --git a/packages/builder/builder-shared/src/apply/hmr.ts b/packages/builder/builder-shared/src/apply/hmr.ts index 421181fa03af..ff8123b05b85 100644 --- a/packages/builder/builder-shared/src/apply/hmr.ts +++ b/packages/builder/builder-shared/src/apply/hmr.ts @@ -2,7 +2,7 @@ import { ModifyChainUtils, SharedNormalizedConfig } from '../types'; export function isUsingHMR( config: SharedNormalizedConfig, - { isProd, target }: ModifyChainUtils, + { isProd, target }: Pick, ) { return ( !isProd && diff --git a/packages/builder/builder-shared/src/types/hooks.ts b/packages/builder/builder-shared/src/types/hooks.ts index 80e349cb58fa..d86f68baf09d 100644 --- a/packages/builder/builder-shared/src/types/hooks.ts +++ b/packages/builder/builder-shared/src/types/hooks.ts @@ -65,6 +65,7 @@ export type ModifyBundlerChainUtils = ModifyChainUtils & { bundler: { BannerPlugin: WebpackPluginInstance; DefinePlugin: WebpackPluginInstance; + ProvidePlugin: WebpackPluginInstance; }; }; diff --git a/packages/builder/builder-webpack-provider/src/core/webpackConfig.ts b/packages/builder/builder-webpack-provider/src/core/webpackConfig.ts index a363184a9481..6bbcf6672693 100644 --- a/packages/builder/builder-webpack-provider/src/core/webpackConfig.ts +++ b/packages/builder/builder-webpack-provider/src/core/webpackConfig.ts @@ -155,13 +155,14 @@ export async function generateWebpackConfig({ context: Context; }) { const chainUtils = await getChainUtils(target); - const { BannerPlugin, DefinePlugin } = await import('webpack'); + const { BannerPlugin, DefinePlugin, ProvidePlugin } = await import('webpack'); const bundlerChain = await modifyBundlerChain(context, { ...chainUtils, bundler: { BannerPlugin, DefinePlugin, + ProvidePlugin, }, }); diff --git a/packages/builder/plugin-node-polyfill/src/index.ts b/packages/builder/plugin-node-polyfill/src/index.ts index ddbd82741031..0be18059b99e 100644 --- a/packages/builder/plugin-node-polyfill/src/index.ts +++ b/packages/builder/plugin-node-polyfill/src/index.ts @@ -1,4 +1,3 @@ -import { setConfig } from '@modern-js/builder-shared'; import type { BuilderPlugin } from '@modern-js/builder'; import type { BuilderPluginAPI as WebpackBuilderPluginAPI } from '@modern-js/builder-webpack-provider'; import type { BuilderPluginAPI as RspackBuilderPluginAPI } from '@modern-js/builder-rspack-provider'; @@ -41,7 +40,7 @@ export function builderPluginNodePolyfill(): BuilderPlugin< name: 'builder-plugin-node-polyfill', async setup(api) { - api.modifyBundlerChain(async (chain, { isServer }) => { + api.modifyBundlerChain(async (chain, { CHAIN_ID, isServer, bundler }) => { // it had not need `node polyfill`, if the target is 'node'(server runtime). if (isServer) { return; @@ -54,32 +53,11 @@ export function builderPluginNodePolyfill(): BuilderPlugin< // module polyfill chain.resolve.fallback.merge(getResolveFallback(nodeLibs)); - }); - if (api.context.bundlerType === 'rspack') { - (api as RspackBuilderPluginAPI).modifyRspackConfig( - async (config, { isServer }) => { - if (isServer) { - return; - } - setConfig(config, 'builtins.provide', { - ...(config.builtins?.provide ?? {}), - ...(await getProvideLibs()), - }); - }, - ); - } else { - (api as WebpackBuilderPluginAPI).modifyWebpackChain( - async (chain, { CHAIN_ID, isServer, webpack }) => { - if (isServer) { - return; - } - chain - .plugin(CHAIN_ID.PLUGIN.NODE_POLYFILL_PROVIDE) - .use(webpack.ProvidePlugin, [await getProvideLibs()]); - }, - ); - } + chain + .plugin(CHAIN_ID.PLUGIN.NODE_POLYFILL_PROVIDE) + .use(bundler.ProvidePlugin, [await getProvideLibs()]); + }); }, }; } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2c34370bf8f5..6d4e70dcf5a3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -171,14 +171,14 @@ importers: specifier: workspace:* version: link:../../toolkit/utils '@rspack/core': - specifier: 0.3.8 - version: 0.3.8 + specifier: 0.3.10 + version: 0.3.10 '@rspack/dev-client': - specifier: 0.3.8 - version: 0.3.8(react-refresh@0.14.0)(webpack@5.88.1) + specifier: 0.3.10 + version: 0.3.10(react-refresh@0.14.0)(webpack@5.88.1) '@rspack/plugin-html': - specifier: 0.3.8 - version: 0.3.8(@rspack/core@0.3.8) + specifier: 0.3.10 + version: 0.3.10(@rspack/core@0.3.10) '@swc/helpers': specifier: 0.5.1 version: 0.5.1 @@ -8908,7 +8908,7 @@ packages: '@babel/core': 7.23.2 '@babel/helper-annotate-as-pure': 7.22.5 '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-wrap-function': 7.22.20 + '@babel/helper-wrap-function': 7.22.10 /@babel/helper-replace-supers@7.22.20(@babel/core@7.23.2): resolution: {integrity: sha512-qsW0In3dbwQUbK8kejJ4R7IHVGwHJlV6lpG6UA7a9hSa2YEiAib+N1T2kr6PEeUT+Fl7najmSOS6SmAwCHK6Tw==} @@ -8951,8 +8951,8 @@ packages: resolution: {integrity: sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==} engines: {node: '>=6.9.0'} - /@babel/helper-wrap-function@7.22.20: - resolution: {integrity: sha512-pms/UwkOpnQe/PDAEdV/d7dVCoBbB+R4FvYoHGZz+4VPcg7RtYy2KP7S2lbuWM6FCSgob5wshfGESbC/hzNXZw==} + /@babel/helper-wrap-function@7.22.10: + resolution: {integrity: sha512-OnMhjWjuGYtdoO3FmsEFWvBStBAe2QOgwOLsLNDjN+aaiMD8InJk1/O3HSD8lkqTjCgg5YI34Tz15KNNA3p+nQ==} engines: {node: '>=6.9.0'} dependencies: '@babel/helper-function-name': 7.23.0 @@ -12457,7 +12457,7 @@ packages: dependencies: '@babel/runtime': 7.23.2 '@modern-js/codesmith': 2.2.5 - '@modern-js/utils': 2.39.0 + '@modern-js/utils': 2.37.2 dev: true /@modern-js/codesmith-api-git@2.3.0(@modern-js/codesmith@2.3.0): @@ -12517,7 +12517,7 @@ packages: dependencies: '@babel/runtime': 7.23.2 '@modern-js/codesmith': 2.2.5 - '@modern-js/utils': 2.39.0 + '@modern-js/utils': 2.37.2 transitivePeerDependencies: - debug dev: true @@ -12540,7 +12540,7 @@ packages: '@formily/json-schema': 2.2.24(typescript@5.2.2) '@formily/validator': 2.2.24 '@modern-js/codesmith': 2.2.5 - '@modern-js/utils': 2.39.0 + '@modern-js/utils': 2.37.2 inquirer: 8.2.5 transitivePeerDependencies: - typescript @@ -12554,7 +12554,7 @@ packages: '@formily/json-schema': 2.2.24(typescript@5.0.4) '@formily/validator': 2.2.24 '@modern-js/codesmith': 2.3.0 - '@modern-js/utils': 2.39.0 + '@modern-js/utils': 2.37.2 '@swc/helpers': 0.5.1 inquirer: 8.2.5 transitivePeerDependencies: @@ -12861,15 +12861,7 @@ packages: resolution: {integrity: sha512-w9qsxogSrvUBHmBPKjr7vqV9b6HkzcSd7Ps0KhBaB+iAfv2fNumVELA/zWqtRyJdlXvMB0Y3ilYB9+XM17NmNw==} dependencies: '@swc/helpers': 0.5.1 - caniuse-lite: 1.0.30001559 - lodash: 4.17.21 - rslog: 1.1.0 - - /@modern-js/utils@2.39.0: - resolution: {integrity: sha512-k8J4eYgguKRHbJd4gON9DDzxX8Cmb7BS2lOGf6Uqsd4T8/KkfTl1C0qTO9Jso63K7RJJpw6dKGUQEp46qWelBA==} - dependencies: - '@swc/helpers': 0.5.1 - caniuse-lite: 1.0.30001559 + caniuse-lite: 1.0.30001520 lodash: 4.17.21 rslog: 1.1.0 @@ -14991,15 +14983,6 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true - dev: true - optional: true - - /@rspack/binding-darwin-arm64@0.3.8: - resolution: {integrity: sha512-qvxzkUaqAbVmwJuVW3p7o1XVT5z2MbwpC9VZQr1fAd7/vEdDfiMm8Vz1AcY/WKxrUjX6rwNs3Ix1SdSBveThKQ==} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: false optional: true /@rspack/binding-darwin-x64@0.3.10: @@ -15007,15 +14990,6 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true - dev: true - optional: true - - /@rspack/binding-darwin-x64@0.3.8: - resolution: {integrity: sha512-Ae3cJiTcXuBTZdLv+vDtbjGcx5D0rizg7nuRmtFmDvtPjYgFE9y0F+VzajQVySqvtAO8kowryC8BYjqnJ7A2Rg==} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: false optional: true /@rspack/binding-linux-arm64-gnu@0.3.10: @@ -15023,15 +14997,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: true - optional: true - - /@rspack/binding-linux-arm64-gnu@0.3.8: - resolution: {integrity: sha512-aZ/cbLq8j85t4TLA94Oj+urPMDlBb+FHce4YGatX6+0juzxNUY23rSRB6pvtQz6DkFxFHDayiOcLkk8loiNiUQ==} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: false optional: true /@rspack/binding-linux-arm64-musl@0.3.10: @@ -15039,15 +15004,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: true - optional: true - - /@rspack/binding-linux-arm64-musl@0.3.8: - resolution: {integrity: sha512-fcwnXl6BqnZ21LizWdcuFz1CNHHuMRoll1z5nfnWn5yzNo5eprXNqFgw0aC5R15Gri/GaiT7bZA7FXAU7eGR8g==} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: false optional: true /@rspack/binding-linux-x64-gnu@0.3.10: @@ -15055,15 +15011,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: true - optional: true - - /@rspack/binding-linux-x64-gnu@0.3.8: - resolution: {integrity: sha512-W7Kqf13GE/mT/HiQfnLMCkrNxekaJuk53sOYVehxBJ6J5NKvL/uzBvPa3m2EtbhUUkBnR0t87Yp04YS9JrnkeA==} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: false optional: true /@rspack/binding-linux-x64-musl@0.3.10: @@ -15071,15 +15018,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: true - optional: true - - /@rspack/binding-linux-x64-musl@0.3.8: - resolution: {integrity: sha512-KIRAj7WQ3JLaCENctA1aiREw9PPuLAFMxkXPGm2YeszfLhv+o3Suehc0OvsPcGeXg/laGKQzl0RV6dHyKfocQg==} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: false optional: true /@rspack/binding-win32-arm64-msvc@0.3.10: @@ -15087,15 +15025,6 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true - dev: true - optional: true - - /@rspack/binding-win32-arm64-msvc@0.3.8: - resolution: {integrity: sha512-PHlMQu0uiUBiJCpxR1ql6HJBeFpsombiPRquoN2d/a5WfkETDX04BnfN7XW8Fe9j164iCe5yU0Xwk0gaaJp3Uw==} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: false optional: true /@rspack/binding-win32-ia32-msvc@0.3.10: @@ -15103,15 +15032,6 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true - dev: true - optional: true - - /@rspack/binding-win32-ia32-msvc@0.3.8: - resolution: {integrity: sha512-ln3js9wOQLJi9E1MVNtLui56a3pXmSnEags9YJhZs5ZMT5SJGsofoa0zXNxeTMuRQ0Gx5w0tVSXZXgyVUm1OdA==} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: false optional: true /@rspack/binding-win32-x64-msvc@0.3.10: @@ -15119,15 +15039,6 @@ packages: cpu: [x64] os: [win32] requiresBuild: true - dev: true - optional: true - - /@rspack/binding-win32-x64-msvc@0.3.8: - resolution: {integrity: sha512-UK70L1vsp5St0qPATB1UdrFh9Ax/G1VpWx3Fp4W5iNzfcLBDKbCpEyCetxZhjHCcFVfbSE74X34NzgDiLDFrHA==} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: false optional: true /@rspack/binding@0.3.10: @@ -15142,21 +15053,6 @@ packages: '@rspack/binding-win32-arm64-msvc': 0.3.10 '@rspack/binding-win32-ia32-msvc': 0.3.10 '@rspack/binding-win32-x64-msvc': 0.3.10 - dev: true - - /@rspack/binding@0.3.8: - resolution: {integrity: sha512-urM1+I6BL1jv6hUZ44Nv2kYYWVIQxRIJoZFrlubo1XhTJqTFUPNF/7E/ritNC9J6gxxZMQLc0NLJz4jdUTaUbg==} - optionalDependencies: - '@rspack/binding-darwin-arm64': 0.3.8 - '@rspack/binding-darwin-x64': 0.3.8 - '@rspack/binding-linux-arm64-gnu': 0.3.8 - '@rspack/binding-linux-arm64-musl': 0.3.8 - '@rspack/binding-linux-x64-gnu': 0.3.8 - '@rspack/binding-linux-x64-musl': 0.3.8 - '@rspack/binding-win32-arm64-msvc': 0.3.8 - '@rspack/binding-win32-ia32-msvc': 0.3.8 - '@rspack/binding-win32-x64-msvc': 0.3.8 - dev: false /@rspack/core@0.3.10: resolution: {integrity: sha512-1mwLC9zyF15kpOQzxsrG5zjPxOSQHnKW/MUXvx4ak0JuZCK3uJgLsK8Jn8tSqvEeh2rWvm7k0S6GJIFl2F2jvA==} @@ -15179,38 +15075,16 @@ packages: webpack-sources: 3.2.3 zod: 3.22.3 zod-validation-error: 1.2.0(zod@3.22.3) - dev: true - - /@rspack/core@0.3.8: - resolution: {integrity: sha512-KUYYqm+PKVJBnnLuB+t0RCu0LhWm8mM3K3/VIGSATUi66Xgn7mxbSoab0IrCXWGekPUpUrmoA7hLg06wMtVJlQ==} - dependencies: - '@rspack/binding': 0.3.8 - '@swc/helpers': 0.5.1 - browserslist: 4.21.10 - compare-versions: 6.0.0-rc.1 - enhanced-resolve: 5.12.0 - graceful-fs: 4.2.10 - neo-async: 2.6.2 - react-refresh: 0.14.0 - schema-utils: 4.2.0 - tapable: 2.2.1 - terminal-link: 2.1.1 - util: 0.12.5 - watchpack: 2.4.0 - webpack-sources: 3.2.3 - zod: 3.22.3 - zod-validation-error: 1.2.0(zod@3.22.3) - dev: false - /@rspack/dev-client@0.3.2(react-refresh@0.14.0)(webpack-hot-middleware@2.25.4)(webpack@5.88.1): - resolution: {integrity: sha512-t/4b6rzMh13pi0JARj85xaU02FNihUmGGpsHsG3UdqM1pVzS3z6Kl6h0FrmMG8NNJAvoTT0p6drltdijIxb6Qw==} + /@rspack/dev-client@0.3.10(react-refresh@0.14.0)(webpack@5.88.1): + resolution: {integrity: sha512-7jD5IsQkUL8S54LmyIKMlPmBAW2eQ+KBMDzK9JG9I2rgAAPb4tGHgHMj4GF+/dQyAOzmx521cFmDkz+bJymU7Q==} peerDependencies: react-refresh: '>=0.10.0 <1.0.0' peerDependenciesMeta: react-refresh: optional: true dependencies: - '@pmmmwh/react-refresh-webpack-plugin': 0.5.10(react-refresh@0.14.0)(webpack-hot-middleware@2.25.4)(webpack@5.88.1) + '@rspack/plugin-react-refresh': 0.3.10(react-refresh@0.14.0)(webpack@5.88.1) react-refresh: 0.14.0 transitivePeerDependencies: - '@types/webpack' @@ -15222,15 +15096,15 @@ packages: - webpack-plugin-serve dev: false - /@rspack/dev-client@0.3.8(react-refresh@0.14.0)(webpack@5.88.1): - resolution: {integrity: sha512-L+5ZdHj6DXKg9yaIjoDhnqPAXEXxuyvUJBNb8NVzshKqLhKYsAPQCSOtGLb984b0kVdh53lckZb3vwRbfei3lw==} + /@rspack/dev-client@0.3.2(react-refresh@0.14.0)(webpack-hot-middleware@2.25.4)(webpack@5.88.1): + resolution: {integrity: sha512-t/4b6rzMh13pi0JARj85xaU02FNihUmGGpsHsG3UdqM1pVzS3z6Kl6h0FrmMG8NNJAvoTT0p6drltdijIxb6Qw==} peerDependencies: react-refresh: '>=0.10.0 <1.0.0' peerDependenciesMeta: react-refresh: optional: true dependencies: - '@rspack/plugin-react-refresh': 0.3.8(react-refresh@0.14.0)(webpack@5.88.1) + '@pmmmwh/react-refresh-webpack-plugin': 0.5.10(react-refresh@0.14.0)(webpack-hot-middleware@2.25.4)(webpack@5.88.1) react-refresh: 0.14.0 transitivePeerDependencies: - '@types/webpack' @@ -15242,15 +15116,15 @@ packages: - webpack-plugin-serve dev: false - /@rspack/plugin-html@0.3.8(@rspack/core@0.3.8): - resolution: {integrity: sha512-eHZo+Ah2vrsS9pxT5Xue7SjSMN8joSNHDLui95Pnni1oj1ESuCojhxPCRxUhbort7xwsGYpnhfhsJZoHL8qN4w==} + /@rspack/plugin-html@0.3.10(@rspack/core@0.3.10): + resolution: {integrity: sha512-zTbcoigqKG8UChq4nBcr47dUZiIBiWwKhqXX++6k7AocyUbBwcVL6tGOtBeSXTMH8IHDazgCACLfbzX+FyKMaw==} peerDependencies: - '@rspack/core': 0.3.8 + '@rspack/core': 0.3.10 peerDependenciesMeta: '@rspack/core': optional: true dependencies: - '@rspack/core': 0.3.8 + '@rspack/core': 0.3.10 '@types/html-minifier-terser': 7.0.0 html-minifier-terser: 7.0.0 lodash.template: 4.5.0 @@ -15277,28 +15151,6 @@ packages: - webpack-dev-server - webpack-hot-middleware - webpack-plugin-serve - dev: true - - /@rspack/plugin-react-refresh@0.3.8(react-refresh@0.14.0)(webpack@5.88.1): - resolution: {integrity: sha512-HF6liXhYJqXRYlQNRNTu1YpR4QykOAjh9/8bt6kYKsWZPj5D1zcPH+evpvF7QxcRpfSRXRujyHOXMIKBLTBqIQ==} - peerDependencies: - react-refresh: '>=0.10.0 <1.0.0' - peerDependenciesMeta: - react-refresh: - optional: true - dependencies: - '@pmmmwh/react-refresh-webpack-plugin': 0.5.10(react-refresh@0.14.0)(webpack@5.88.1) - react-refresh: 0.14.0 - schema-utils: 4.2.0 - transitivePeerDependencies: - - '@types/webpack' - - sockjs-client - - type-fest - - webpack - - webpack-dev-server - - webpack-hot-middleware - - webpack-plugin-serve - dev: false /@rspress/core@1.5.0(esbuild@0.17.19)(ts-node@10.9.1)(webpack@5.88.1): resolution: {integrity: sha512-HiH0T6Zrm0csvUifpuwNJZj64T6LRMKD9aSge6GK2So/GAAiB/Itq4o3tTMDT6i7mejxvyh13A/9w8jjEboUcw==} @@ -18873,8 +18725,8 @@ packages: peerDependencies: postcss: ^8.1.0 dependencies: - browserslist: 4.22.1 - caniuse-lite: 1.0.30001559 + browserslist: 4.21.10 + caniuse-lite: 1.0.30001520 fraction.js: 4.2.0 normalize-range: 0.1.2 picocolors: 1.0.0 @@ -25210,7 +25062,7 @@ packages: chalk: 4.1.2 ci-info: 3.3.2 graceful-fs: 4.2.10 - picomatch: 2.3.1 + picomatch: 2.3.0 /jest-validate@29.5.0: resolution: {integrity: sha512-pC26etNIi+y3HV8A+tUGr/lph9B18GnzSRAkPaaZJIE1eFdiYm6/CewuiJQ8/RlfHd1u/8Ioi8/sJ+CmbA+zAQ==} @@ -25443,7 +25295,6 @@ packages: /json-parse-even-better-errors@3.0.0: resolution: {integrity: sha512-iZbGHafX/59r39gPwVPRBGw0QQKnA7tte5pSMrhWOW7swGsVvVTjmfyAV9pNqk8YGT7tRCdxRu8uzcgZwoDooA==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - dev: true /json-schema-traverse@0.4.1: resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} @@ -29038,7 +28889,6 @@ packages: resolution: {integrity: sha512-wkvS7mL/JMugcup3/rMitHmd9ecIGd2lhFhK9N3UUQ450h66d1r3Y9nvXzQAW1Lq+wyx61k/1pfKS5KuKiyEbg==} engines: {node: '>=0.4.x'} deprecated: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. - dev: true /querystringify@2.2.0: resolution: {integrity: sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==} From ac89fb88d3ee020708d042a126b7aff873e411c8 Mon Sep 17 00:00:00 2001 From: qixuan <58852732+GiveMe-A-Name@users.noreply.github.com> Date: Mon, 6 Nov 2023 11:24:16 +0800 Subject: [PATCH 2/8] fix: skip ssr inline test (#4914) --- tests/integration/ssr/tests/inline.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/ssr/tests/inline.test.ts b/tests/integration/ssr/tests/inline.test.ts index 930c545b0288..8719cce13064 100644 --- a/tests/integration/ssr/tests/inline.test.ts +++ b/tests/integration/ssr/tests/inline.test.ts @@ -13,7 +13,7 @@ const fixtureDir = path.resolve(__dirname, '../fixtures'); dns.setDefaultResultOrder('ipv4first'); -describe('Inline SSR', () => { +describe.skip('Inline SSR', () => { let app: any; let appPort: number; let page: Page; From 477f18de17d53df451ad30b9da61ab3c30974f02 Mon Sep 17 00:00:00 2001 From: targeral Date: Mon, 6 Nov 2023 13:19:33 +0800 Subject: [PATCH 3/8] docs(builder-doc): add version tip for sourceBuild api (#4917) Co-authored-by: neverland --- .changeset/tough-shoes-kneel.md | 6 ++++++ .../builder-doc/docs/en/config/experiments/sourceBuild.md | 1 + .../builder-doc/docs/zh/config/experiments/sourceBuild.md | 1 + 3 files changed, 8 insertions(+) create mode 100644 .changeset/tough-shoes-kneel.md diff --git a/.changeset/tough-shoes-kneel.md b/.changeset/tough-shoes-kneel.md new file mode 100644 index 000000000000..e756543fbdaf --- /dev/null +++ b/.changeset/tough-shoes-kneel.md @@ -0,0 +1,6 @@ +--- +'@modern-js/builder-doc': patch +--- + +doc(builder-doc): add version tip for sourceBuild api +doc(builder-doc): 为 sourceBuild API 添加版本提示信息 diff --git a/packages/document/builder-doc/docs/en/config/experiments/sourceBuild.md b/packages/document/builder-doc/docs/en/config/experiments/sourceBuild.md index 6e8dc5f484ab..7c5b9d191d92 100644 --- a/packages/document/builder-doc/docs/en/config/experiments/sourceBuild.md +++ b/packages/document/builder-doc/docs/en/config/experiments/sourceBuild.md @@ -1,6 +1,7 @@ - **Type:** `boolean` - **Default:** `false` - **Bundler:** `only support webpack` +- **Version:** `MAJOR_VERSION.26.0` Used to enable the ability for source code building. When this configuration option is enabled, Builder will read the source code files corresponding to the `source` field in the sub-project's package.json and compile them. diff --git a/packages/document/builder-doc/docs/zh/config/experiments/sourceBuild.md b/packages/document/builder-doc/docs/zh/config/experiments/sourceBuild.md index 4a474a95a53a..cfb62c41171a 100644 --- a/packages/document/builder-doc/docs/zh/config/experiments/sourceBuild.md +++ b/packages/document/builder-doc/docs/zh/config/experiments/sourceBuild.md @@ -1,6 +1,7 @@ - **类型:** `boolean` - **默认值:** `false` - **打包工具:** `仅支持 webpack` +- **版本:** `MAJOR_VERSION.26.0` 用于开启源码构建的能力。当开启此配置项时,Builder 会读取子项目 package.json 的 `source` 字段对应的源码文件,并进行编译。 From 95f15d26d962d4ce641e1b1b727d2f433fc03e78 Mon Sep 17 00:00:00 2001 From: zero <68810266+zllkjc@users.noreply.github.com> Date: Mon, 6 Nov 2023 14:23:48 +0800 Subject: [PATCH 4/8] chore: remove ajv schema verification of modern configuration (#4911) --- .changeset/eighty-scissors-drop.md | 22 ++ .../core/src/config/createResolvedConfig.ts | 69 +---- packages/cli/core/src/createCli.ts | 9 +- packages/cli/core/src/manager.ts | 1 - packages/cli/core/src/schema/patchSchema.ts | 65 ----- .../cli/core/src/schema/traverseSchema.ts | 23 -- packages/cli/core/src/types/coreOptions.ts | 2 - packages/cli/core/src/types/hooks.ts | 1 - packages/cli/core/src/types/index.ts | 7 - packages/cli/core/src/utils/index.ts | 1 - .../cli/core/src/utils/repeatKeyWarning.ts | 29 --- .../cli/core/tests/repeatKeyWarning.test.ts | 68 ----- packages/cli/core/tests/schema.test.ts | 132 ---------- packages/cli/plugin-bff/src/cli.ts | 18 -- .../tests/__snapshots__/cli.test.ts.snap | 30 --- packages/cli/plugin-bff/tests/cli.test.ts | 8 - packages/cli/plugin-proxy/src/index.ts | 9 - .../tests/__snapshots__/cli.test.ts.snap | 16 -- packages/cli/plugin-proxy/tests/cli.test.ts | 8 - packages/cli/plugin-ssg/src/index.ts | 14 -- packages/cli/plugin-swc/src/index.ts | 8 - packages/cli/plugin-tailwind/src/cli.ts | 10 - .../src/design-token/cli/index.ts | 19 -- .../tests/design-token/cli.test.ts | 8 - packages/devtools/plugin/src/cli.ts | 8 - .../framework-plugin/hook-list.mdx | 66 ----- .../framework-plugin/hook-list.mdx | 66 ----- .../runtime/plugin-garfish/src/cli/index.ts | 16 -- .../runtime/plugin-router-v5/src/cli/index.ts | 8 - .../plugin-router-v5/tests/index.test.ts | 9 - .../runtime/plugin-runtime/src/cli/index.ts | 25 +- .../plugin-runtime/src/router/cli/index.ts | 8 - .../plugin-runtime/src/state/cli/index.ts | 8 - .../runtime/plugin-runtime/tests/cli.test.ts | 9 - .../plugin-runtime/tests/router/index.test.ts | 9 - .../runtime/plugin-testing/src/cli/index.ts | 24 -- packages/server/plugin-worker/src/index.ts | 8 - .../solutions/app-tools/src/analyze/index.ts | 10 - .../app-tools/src/initialize/index.ts | 8 - .../solutions/app-tools/src/schema/Schema.ts | 51 ---- .../solutions/app-tools/src/schema/index.ts | 99 -------- .../solutions/app-tools/src/schema/legacy.ts | 162 ------------ packages/solutions/module-tools/src/cli.ts | 11 - .../utils/compiled/ajv-keywords/index.d.ts | 1 - .../utils/compiled/ajv-keywords/index.js | 1 - .../utils/compiled/ajv-keywords/license | 21 -- .../utils/compiled/ajv-keywords/package.json | 1 - .../toolkit/utils/compiled/ajv/codegen.js | 1 - packages/toolkit/utils/compiled/ajv/index.js | 9 - packages/toolkit/utils/compiled/ajv/license | 22 -- .../toolkit/utils/compiled/ajv/package.json | 1 - .../toolkit/utils/compiled/ajv/types/ajv.d.ts | 16 -- .../ajv/types/compile/codegen/code.d.ts | 40 --- .../ajv/types/compile/codegen/index.d.ts | 79 ------ .../ajv/types/compile/codegen/scope.d.ts | 79 ------ .../compiled/ajv/types/compile/errors.d.ts | 13 - .../compiled/ajv/types/compile/index.d.ts | 80 ------ .../compiled/ajv/types/compile/ref_error.d.ts | 6 - .../compiled/ajv/types/compile/resolve.d.ts | 12 - .../compiled/ajv/types/compile/rules.d.ts | 28 --- .../compiled/ajv/types/compile/util.d.ts | 40 --- .../ajv/types/compile/validate/index.d.ts | 42 ---- .../ajv/types/compile/validate/subschema.d.ts | 47 ---- .../utils/compiled/ajv/types/core.d.ts | 173 ------------- .../ajv/types/runtime/validation_error.d.ts | 7 - .../utils/compiled/ajv/types/types/index.d.ts | 183 -------------- .../compiled/ajv/types/types/json-schema.d.ts | 124 --------- .../compiled/ajv/types/types/jtd-schema.d.ts | 169 ------------- .../ajv/types/vocabularies/errors.d.ts | 1 - .../toolkit/utils/compiled/ajv/uri-js.d.ts | 59 ----- .../compiled/better-ajv-errors/index.d.ts | 1 - .../utils/compiled/better-ajv-errors/index.js | 1 - .../utils/compiled/better-ajv-errors/license | 13 - .../compiled/better-ajv-errors/package.json | 1 - packages/toolkit/utils/package.json | 22 +- pnpm-lock.yaml | 236 +++++++++++++----- scripts/prebundle/package.json | 3 - scripts/prebundle/src/constant.ts | 46 +--- 78 files changed, 204 insertions(+), 2556 deletions(-) create mode 100644 .changeset/eighty-scissors-drop.md delete mode 100644 packages/cli/core/src/schema/patchSchema.ts delete mode 100644 packages/cli/core/src/schema/traverseSchema.ts delete mode 100644 packages/cli/core/src/utils/repeatKeyWarning.ts delete mode 100644 packages/cli/core/tests/repeatKeyWarning.test.ts delete mode 100644 packages/cli/core/tests/schema.test.ts delete mode 100644 packages/solutions/app-tools/src/schema/Schema.ts delete mode 100644 packages/solutions/app-tools/src/schema/index.ts delete mode 100644 packages/solutions/app-tools/src/schema/legacy.ts delete mode 100644 packages/toolkit/utils/compiled/ajv-keywords/index.d.ts delete mode 100644 packages/toolkit/utils/compiled/ajv-keywords/index.js delete mode 100644 packages/toolkit/utils/compiled/ajv-keywords/license delete mode 100644 packages/toolkit/utils/compiled/ajv-keywords/package.json delete mode 100644 packages/toolkit/utils/compiled/ajv/codegen.js delete mode 100644 packages/toolkit/utils/compiled/ajv/index.js delete mode 100644 packages/toolkit/utils/compiled/ajv/license delete mode 100644 packages/toolkit/utils/compiled/ajv/package.json delete mode 100644 packages/toolkit/utils/compiled/ajv/types/ajv.d.ts delete mode 100644 packages/toolkit/utils/compiled/ajv/types/compile/codegen/code.d.ts delete mode 100644 packages/toolkit/utils/compiled/ajv/types/compile/codegen/index.d.ts delete mode 100644 packages/toolkit/utils/compiled/ajv/types/compile/codegen/scope.d.ts delete mode 100644 packages/toolkit/utils/compiled/ajv/types/compile/errors.d.ts delete mode 100644 packages/toolkit/utils/compiled/ajv/types/compile/index.d.ts delete mode 100644 packages/toolkit/utils/compiled/ajv/types/compile/ref_error.d.ts delete mode 100644 packages/toolkit/utils/compiled/ajv/types/compile/resolve.d.ts delete mode 100644 packages/toolkit/utils/compiled/ajv/types/compile/rules.d.ts delete mode 100644 packages/toolkit/utils/compiled/ajv/types/compile/util.d.ts delete mode 100644 packages/toolkit/utils/compiled/ajv/types/compile/validate/index.d.ts delete mode 100644 packages/toolkit/utils/compiled/ajv/types/compile/validate/subschema.d.ts delete mode 100644 packages/toolkit/utils/compiled/ajv/types/core.d.ts delete mode 100644 packages/toolkit/utils/compiled/ajv/types/runtime/validation_error.d.ts delete mode 100644 packages/toolkit/utils/compiled/ajv/types/types/index.d.ts delete mode 100644 packages/toolkit/utils/compiled/ajv/types/types/json-schema.d.ts delete mode 100644 packages/toolkit/utils/compiled/ajv/types/types/jtd-schema.d.ts delete mode 100644 packages/toolkit/utils/compiled/ajv/types/vocabularies/errors.d.ts delete mode 100644 packages/toolkit/utils/compiled/ajv/uri-js.d.ts delete mode 100644 packages/toolkit/utils/compiled/better-ajv-errors/index.d.ts delete mode 100644 packages/toolkit/utils/compiled/better-ajv-errors/index.js delete mode 100644 packages/toolkit/utils/compiled/better-ajv-errors/license delete mode 100644 packages/toolkit/utils/compiled/better-ajv-errors/package.json diff --git a/.changeset/eighty-scissors-drop.md b/.changeset/eighty-scissors-drop.md new file mode 100644 index 000000000000..b7915635a55a --- /dev/null +++ b/.changeset/eighty-scissors-drop.md @@ -0,0 +1,22 @@ +--- +'@modern-js/plugin-router-v5': minor +'@modern-js/plugin-garfish': minor +'@modern-js/runtime': minor +'@modern-js/plugin-testing': minor +'@modern-js/module-tools': minor +'@modern-js/plugin-worker': minor +'@modern-js/plugin-tailwindcss': minor +'@modern-js/app-tools': minor +'@modern-js/main-doc': minor +'@modern-js/plugin-proxy': minor +'@modern-js/plugin-devtools': minor +'@modern-js/plugin-bff': minor +'@modern-js/plugin-ssg': minor +'@modern-js/plugin-swc': minor +'@modern-js/utils': minor +'@modern-js/core': minor +'@scripts/prebundle': minor +--- + +chore: remove ajv schema verification of configuration +chore: 移除 ajv 对项目配置的校验 diff --git a/packages/cli/core/src/config/createResolvedConfig.ts b/packages/cli/core/src/config/createResolvedConfig.ts index 85583dcf918f..0e69c77c31d6 100644 --- a/packages/cli/core/src/config/createResolvedConfig.ts +++ b/packages/cli/core/src/config/createResolvedConfig.ts @@ -1,13 +1,5 @@ -import { createDebugger, logger } from '@modern-js/utils'; -import type { ErrorObject } from '@modern-js/utils/ajv'; -import { patchSchema } from '../schema/patchSchema'; -import type { - UserConfig, - NormalizedConfig, - LoadedConfig, - PluginValidateSchema, -} from '../types'; -import { repeatKeyWarning } from '../utils/repeatKeyWarning'; +import { createDebugger } from '@modern-js/utils'; +import type { UserConfig, NormalizedConfig, LoadedConfig } from '../types'; import { mergeConfig } from '../utils/mergeConfig'; import { createDefaultConfig } from './createDefaultConfig'; @@ -17,64 +9,9 @@ export const createResolveConfig = async ( // eslint-disable-next-line @typescript-eslint/ban-types loaded: LoadedConfig<{}>, configs: UserConfig[], - schemas: PluginValidateSchema[], - onSchemaError?: (error: ErrorObject) => void | Promise, ): Promise => { - const { default: Ajv } = await import('@modern-js/utils/ajv'); - const { default: ajvKeywords } = await import( - '@modern-js/utils/ajv-keywords' - ); - const { default: betterAjvErrors } = await import( - '@modern-js/utils/better-ajv-errors' - ); - - const { config: userConfig, jsConfig, pkgConfig } = loaded; - - const ajv = new Ajv({ $data: true, strict: false }); - - ajvKeywords(ajv); - - const validateSchema = patchSchema(schemas); - const validate = ajv.compile(validateSchema); - - repeatKeyWarning(validateSchema, jsConfig, pkgConfig); - - // validate user config. - const valid = validate(userConfig); - - const formatValidateError = (config: UserConfig) => - betterAjvErrors( - validateSchema, - config, - validate.errors?.map(e => ({ - ...e, - dataPath: e.instancePath, - })), - { - indent: 2, - }, - ); - - if (!valid && validate.errors?.length) { - if (onSchemaError) { - await onSchemaError(validate?.errors[0]); - } - const errors = formatValidateError(userConfig); - logger.log(errors); - throw new Error(`Validate configuration error`); - } - - // validate config from plugins. - for (const config of configs) { - if (!validate(config)) { - const errors = formatValidateError(config); - logger.error(errors); - throw new Error(`Validate configuration error.`); - } - } - + const { config: userConfig } = loaded; const resolved = mergeConfig([createDefaultConfig(), ...configs, userConfig]); - debug('resolved %o', resolved); return resolved; diff --git a/packages/cli/core/src/createCli.ts b/packages/cli/core/src/createCli.ts index ebb419989d88..34a1e242bcd5 100644 --- a/packages/cli/core/src/createCli.ts +++ b/packages/cli/core/src/createCli.ts @@ -119,14 +119,7 @@ export const createCli = () => { const extraConfigs = await hooksRunner.config(); - const extraSchemas = await hooksRunner.validateSchema(); - - const normalizedConfig = await createResolveConfig( - loaded, - extraConfigs, - extraSchemas, - options?.onSchemaError, - ); + const normalizedConfig = await createResolveConfig(loaded, extraConfigs); const { resolved } = await hooksRunner.resolvedConfig({ resolved: normalizedConfig, diff --git a/packages/cli/core/src/manager.ts b/packages/cli/core/src/manager.ts index c08bb8164051..752c526c726d 100644 --- a/packages/cli/core/src/manager.ts +++ b/packages/cli/core/src/manager.ts @@ -19,7 +19,6 @@ const baseHooks: BaseHooks<{}> = { beforeConfig: createAsyncWorkflow(), config: createParallelWorkflow(), resolvedConfig: createAsyncWaterfall(), - validateSchema: createParallelWorkflow(), prepare: createAsyncWorkflow(), afterPrepare: createAsyncWorkflow(), commands: createAsyncWorkflow(), diff --git a/packages/cli/core/src/schema/patchSchema.ts b/packages/cli/core/src/schema/patchSchema.ts deleted file mode 100644 index f82627669e97..000000000000 --- a/packages/cli/core/src/schema/patchSchema.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { createDebugger, isObject } from '@modern-js/utils'; -import { cloneDeep } from '@modern-js/utils/lodash'; -import { PluginValidateSchema } from '../types'; - -const debug = createDebugger('validate-schema'); - -export const patchSchema = ( - pluginSchemas: Array, -) => { - const finalSchema = { - type: 'object', - properties: {}, - }; - - const findTargetNode = (props: string[]) => { - let node: any = finalSchema.properties; - - for (const prop of props) { - if (!node[prop]) { - node[prop] = { - type: 'object', - }; - } - node = node[prop as keyof typeof node]; - - if (!node || !isObject(node)) { - throw new Error(`add schema ${props.join('.')} error`); - } - (node as any).properties = (node as any).hasOwnProperty('properties') - ? (node as any).properties - : {}; - - node = (node as any).properties; - } - return node; - }; - - const finalPluginSchemas: PluginValidateSchema[] = []; - pluginSchemas.forEach(item => { - if (Array.isArray(item)) { - finalPluginSchemas.push(...item); - } else { - finalPluginSchemas.push(item); - } - }); - - for (const { target, schema } of finalPluginSchemas) { - if (!target) { - throw new Error(`should return target property in plugin schema.`); - } - const props = target.split('.'); - - const mountProperty = props.pop(); - - const targetNode = findTargetNode(props); - - if (!targetNode.hasOwnProperty(mountProperty)) { - targetNode[mountProperty as string] = cloneDeep(schema); - } - } - - debug(`final validate schema: %o`, finalSchema); - - return finalSchema; -}; diff --git a/packages/cli/core/src/schema/traverseSchema.ts b/packages/cli/core/src/schema/traverseSchema.ts deleted file mode 100644 index b323060c1daa..000000000000 --- a/packages/cli/core/src/schema/traverseSchema.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { patchSchema } from './patchSchema'; - -export const traverseSchema = (schema: ReturnType) => { - const keys: string[] = []; - - const traverse = ( - { properties }: { properties: any }, - old: string[] = [], - ) => { - for (const key of Object.keys(properties)) { - const current = [...old, key]; - if (properties[key].type === 'object' && properties[key].properties) { - traverse(properties[key], current); - } else { - keys.push(current.join('.')); - } - } - }; - - traverse(schema); - - return keys; -}; diff --git a/packages/cli/core/src/types/coreOptions.ts b/packages/cli/core/src/types/coreOptions.ts index 6a33a96da787..e22ee01eba1c 100644 --- a/packages/cli/core/src/types/coreOptions.ts +++ b/packages/cli/core/src/types/coreOptions.ts @@ -1,4 +1,3 @@ -import type { ErrorObject } from '@modern-js/utils/compiled/ajv'; import type { InternalPlugins } from './plugin'; import type { UserConfig } from './config'; @@ -17,7 +16,6 @@ export interface CoreOptions { server?: InternalPlugins; autoLoad?: InternalPlugins; }; - onSchemaError?: (error: ErrorObject) => void; options?: { metaName?: string; srcDir?: string; diff --git a/packages/cli/core/src/types/hooks.ts b/packages/cli/core/src/types/hooks.ts index 5b488892ba08..936507a5d8f2 100644 --- a/packages/cli/core/src/types/hooks.ts +++ b/packages/cli/core/src/types/hooks.ts @@ -27,7 +27,6 @@ export type BaseHooks< resolvedConfig: AsyncWaterfall<{ resolved: NormalizedConfig; }>; - validateSchema: ParallelWorkflow; prepare: AsyncWorkflow; afterPrepare: AsyncWorkflow; watchFiles: ParallelWorkflow< diff --git a/packages/cli/core/src/types/index.ts b/packages/cli/core/src/types/index.ts index 7b658b73d318..3b0298ef2a74 100644 --- a/packages/cli/core/src/types/index.ts +++ b/packages/cli/core/src/types/index.ts @@ -1,13 +1,6 @@ -import type { JSONSchemaType } from '@modern-js/utils/ajv/json-schema'; - export * from './plugin'; export * from './config'; export * from './pluginAPI'; export * from './hooks'; export * from './context'; export * from './coreOptions'; - -export interface PluginValidateSchema { - target: string; - schema: JSONSchemaType; -} diff --git a/packages/cli/core/src/utils/index.ts b/packages/cli/core/src/utils/index.ts index 14e57bba633b..9d872ecee50b 100644 --- a/packages/cli/core/src/utils/index.ts +++ b/packages/cli/core/src/utils/index.ts @@ -2,5 +2,4 @@ export * from './commander'; export * from './createFileWatcher'; export * from './initAppDir'; export * from './mergeConfig'; -export * from './repeatKeyWarning'; export * from './checkIsDuplicationPlugin'; diff --git a/packages/cli/core/src/utils/repeatKeyWarning.ts b/packages/cli/core/src/utils/repeatKeyWarning.ts deleted file mode 100644 index d7cc62ae9176..000000000000 --- a/packages/cli/core/src/utils/repeatKeyWarning.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { traverseSchema } from '../schema/traverseSchema'; -import { UserConfig } from '../types'; - -export const deepGet = (obj: any, key: string) => { - for (const p of key.split('.')) { - // eslint-disable-next-line no-param-reassign - obj = obj ? obj[p] : undefined; - } - return obj; -}; - -export const repeatKeyWarning = >( - schema: any, - jsConfig: UserConfig, - pkgConfig: UserConfig, -) => { - const keys = traverseSchema(schema); - - for (const key of keys) { - if ( - deepGet(jsConfig, key) !== undefined && - deepGet(pkgConfig, key) !== undefined - ) { - throw new Error( - `The same configuration ${key} exists in modern.config.js and package.json.\n Please remove it from package.json.`, - ); - } - } -}; diff --git a/packages/cli/core/tests/repeatKeyWarning.test.ts b/packages/cli/core/tests/repeatKeyWarning.test.ts deleted file mode 100644 index 65b43f599967..000000000000 --- a/packages/cli/core/tests/repeatKeyWarning.test.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { repeatKeyWarning } from '../src/utils/repeatKeyWarning'; -import { UserConfig } from '../src/types'; - -jest.spyOn(process, 'exit').mockImplementation(); - -describe('check repeated keys in user config', () => { - test(`should exit with error`, () => { - expect(() => { - repeatKeyWarning( - { - type: 'object', - properties: { - a: { - type: 'object', - properties: { - b: { - type: 'object', - properties: { c: { type: ['boolean', 'object'] } }, - }, - }, - }, - }, - }, - { a: { b: { c: true } } } as UserConfig, - { a: { b: { c: false } } } as UserConfig, - ); - }).toThrowError( - 'The same configuration a.b.c exists in modern.config.js and package.json.', - ); - }); - - test(`should exit successfully`, () => { - expect( - repeatKeyWarning( - { - type: 'object', - properties: { - a: { - type: 'object', - properties: { b: { type: 'string' } }, - }, - }, - c: { - type: 'object', - properties: { - d: { - type: 'object', - properties: { e: { type: 'string' } }, - }, - f: { type: 'string' }, - }, - }, - }, - { - a: { b: 'name' }, - c: { d: { e: 's' } }, - } as UserConfig, - { - a: {}, - c: { - d: {}, - f: 'ss', - }, - } as UserConfig, - ), - ).toBeUndefined(); - }); -}); diff --git a/packages/cli/core/tests/schema.test.ts b/packages/cli/core/tests/schema.test.ts deleted file mode 100644 index ecac9bdcf988..000000000000 --- a/packages/cli/core/tests/schema.test.ts +++ /dev/null @@ -1,132 +0,0 @@ -import { patchSchema } from '../src/schema/patchSchema'; -import { traverseSchema } from '../src/schema/traverseSchema'; - -describe('patch schemas', () => { - test('should add schema successfully', () => { - const schema = patchSchema([ - { - target: 'foo', - schema: { type: 'string' }, - }, - { - target: 'deploy.foo', - schema: { type: 'number' }, - }, - ]); - - expect(schema.properties).toHaveProperty('foo'); - - expect( - ( - schema.properties as unknown as { - deploy: { - properties: Record; - }; - } - ).deploy.properties, - ).toHaveProperty('foo'); - }); - - test('should create a node when node is undefined', () => { - const schema = patchSchema([ - { - target: 'deploy.a.foo', - schema: { type: 'string' }, - }, - ]); - - expect( - ( - schema.properties as unknown as { - deploy: { - properties: Record; - }; - } - ).deploy.properties.a.properties, - ).toHaveProperty('foo'); - }); - - test(`should throw error on empty target property`, () => { - expect(() => { - patchSchema([ - { - target: '', - schema: { type: 'object' }, - }, - ]); - }).toThrowError('should return target property in plugin schema.'); - }); - - test(`support schema array in one schema`, () => { - const schema = patchSchema([ - [ - { - target: 'foo', - schema: { type: 'string' }, - }, - { - target: 'tools.foo', - schema: { type: 'number' }, - }, - ], - { - target: 'bar', - schema: { type: 'string' }, - }, - ]); - - expect(schema.properties).toHaveProperty('foo'); - expect(schema.properties).toHaveProperty('bar'); - expect( - ( - schema.properties as unknown as { - tools: { - properties: Record; - }; - } - ).tools.properties, - ).toHaveProperty('foo'); - }); -}); - -describe(`traverse schema`, () => { - test(`should return all available keys of current schema`, () => { - const schema = { - type: 'object', - properties: { - source: { - type: 'object', - properties: { alias: { type: ['object', 'function'] } }, - }, - a: { - type: 'object', - properties: { - b: { - type: 'object', - properties: { c: { type: 'object' } }, - }, - d: { type: 'string' }, - }, - }, - runtime: { - type: 'object', - properties: { - router: { type: ['object', 'boolean'] }, - state: { type: ['object', 'boolean'] }, - }, - }, - runtimeByEntries: { patternProperties: { '^$': { type: 'string' } } }, - dev: { type: ['function', 'string'] }, - }, - }; - expect(traverseSchema(schema as any)).toEqual([ - 'source.alias', - 'a.b.c', - 'a.d', - 'runtime.router', - 'runtime.state', - 'runtimeByEntries', - 'dev', - ]); - }); -}); diff --git a/packages/cli/plugin-bff/src/cli.ts b/packages/cli/plugin-bff/src/cli.ts index 5407ed5497e3..e271274eeac7 100644 --- a/packages/cli/plugin-bff/src/cli.ts +++ b/packages/cli/plugin-bff/src/cli.ts @@ -20,24 +20,6 @@ export const bffPlugin = (): CliPlugin => ({ setup: api => { let unRegisterResolveRuntimePath: (() => void) | null = null; return { - validateSchema() { - return [ - { - target: 'bff', - schema: { - type: 'object', - properties: { - prefix: { - type: ['string', 'array'], - items: { type: 'string' }, - }, - fetcher: { type: 'string' }, - proxy: { type: 'object' }, - }, - }, - }, - ]; - }, config() { return { tools: { diff --git a/packages/cli/plugin-bff/tests/__snapshots__/cli.test.ts.snap b/packages/cli/plugin-bff/tests/__snapshots__/cli.test.ts.snap index b4bcb6fc8357..2ba98ece0ea7 100644 --- a/packages/cli/plugin-bff/tests/__snapshots__/cli.test.ts.snap +++ b/packages/cli/plugin-bff/tests/__snapshots__/cli.test.ts.snap @@ -34,33 +34,3 @@ exports[`bff cli plugin routes 1`] = ` ], } `; - -exports[`bff cli plugin schema 1`] = ` -[ - [ - { - "schema": { - "properties": { - "fetcher": { - "type": "string", - }, - "prefix": { - "items": { - "type": "string", - }, - "type": [ - "string", - "array", - ], - }, - "proxy": { - "type": "object", - }, - }, - "type": "object", - }, - "target": "bff", - }, - ], -] -`; diff --git a/packages/cli/plugin-bff/tests/cli.test.ts b/packages/cli/plugin-bff/tests/cli.test.ts index 405e63a20c0e..93548965967c 100644 --- a/packages/cli/plugin-bff/tests/cli.test.ts +++ b/packages/cli/plugin-bff/tests/cli.test.ts @@ -14,14 +14,6 @@ import plugin from '../src/cli'; import './helper'; describe('bff cli plugin', () => { - it('schema', async () => { - const main = manager.clone().usePlugin(plugin as CliPlugin); - const runner = await main.init(); - const result = await runner.validateSchema(); - - expect(result).toMatchSnapshot(); - }); - it('routes', async () => { const main = manager.clone().usePlugin(plugin as CliPlugin); main.registerHook({ diff --git a/packages/cli/plugin-proxy/src/index.ts b/packages/cli/plugin-proxy/src/index.ts index fae4d1c8c842..a4e92ea49df1 100644 --- a/packages/cli/plugin-proxy/src/index.ts +++ b/packages/cli/plugin-proxy/src/index.ts @@ -9,15 +9,6 @@ export const proxyPlugin = (): CliPlugin => { name: '@modern-js/plugin-proxy', setup: api => ({ - validateSchema() { - return [ - { - target: 'dev.proxy', - schema: { typeof: ['string', 'object'] }, - }, - ]; - }, - async afterDev() { const { dev } = api.useResolvedConfigContext() as any; const { internalDirectory } = api.useAppContext(); diff --git a/packages/cli/plugin-proxy/tests/__snapshots__/cli.test.ts.snap b/packages/cli/plugin-proxy/tests/__snapshots__/cli.test.ts.snap index cb56a780bf1c..bc0883b6c12c 100644 --- a/packages/cli/plugin-proxy/tests/__snapshots__/cli.test.ts.snap +++ b/packages/cli/plugin-proxy/tests/__snapshots__/cli.test.ts.snap @@ -1,19 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`plugin proxy test config 1`] = `[]`; - -exports[`plugin proxy test schema 1`] = ` -[ - [ - { - "schema": { - "typeof": [ - "string", - "object", - ], - }, - "target": "dev.proxy", - }, - ], -] -`; diff --git a/packages/cli/plugin-proxy/tests/cli.test.ts b/packages/cli/plugin-proxy/tests/cli.test.ts index 454cf79e5238..61b5ecd542e4 100644 --- a/packages/cli/plugin-proxy/tests/cli.test.ts +++ b/packages/cli/plugin-proxy/tests/cli.test.ts @@ -2,14 +2,6 @@ import { manager } from '@modern-js/core'; import plugin from '../src'; describe('plugin proxy test', () => { - it('schema', async () => { - const main = manager.clone().usePlugin(plugin); - const runner = await main.init(); - const result = await runner.validateSchema(); - - expect(result).toMatchSnapshot(); - }); - it('config', async () => { const main = manager.clone().usePlugin(plugin); const runner = await main.init(); diff --git a/packages/cli/plugin-ssg/src/index.ts b/packages/cli/plugin-ssg/src/index.ts index 91d40fac4829..ff9dc36d973d 100644 --- a/packages/cli/plugin-ssg/src/index.ts +++ b/packages/cli/plugin-ssg/src/index.ts @@ -25,20 +25,6 @@ export const ssgPlugin = (): CliPlugin => ({ const agreedRouteMap: AgreedRouteMap = {}; return { - validateSchema() { - return [ - { - target: 'output.ssg', - schema: { - oneOf: [ - { type: 'boolean' }, - { type: 'object' }, - { instanceof: 'Function' }, - ], - }, - }, - ]; - }, modifyFileSystemRoutes({ entrypoint, routes }) { const { entryName } = entrypoint; const flattedRoutes = flattenRoutes(routes); diff --git a/packages/cli/plugin-swc/src/index.ts b/packages/cli/plugin-swc/src/index.ts index ec13ed63f2cf..b8463892349e 100644 --- a/packages/cli/plugin-swc/src/index.ts +++ b/packages/cli/plugin-swc/src/index.ts @@ -15,14 +15,6 @@ export function factory( return () => ({ name, setup: api => ({ - validateSchema() { - return [ - { - target: 'tools.swc', - schema: { typeof: ['object', 'function'] }, - }, - ]; - }, prepare() { const context = api.useAppContext(); if (!context.builder || context.bundlerType === 'rspack') { diff --git a/packages/cli/plugin-tailwind/src/cli.ts b/packages/cli/plugin-tailwind/src/cli.ts index 5909b5884ec2..1b26291a9e89 100644 --- a/packages/cli/plugin-tailwind/src/cli.ts +++ b/packages/cli/plugin-tailwind/src/cli.ts @@ -62,16 +62,6 @@ export const tailwindcssPlugin = ( } } }, - - validateSchema() { - return [ - { - target: 'tools.tailwindcss', - schema: { typeof: ['object', 'function'] }, - }, - ]; - }, - config() { let tailwindConfig: Record; diff --git a/packages/cli/plugin-tailwind/src/design-token/cli/index.ts b/packages/cli/plugin-tailwind/src/design-token/cli/index.ts index 10fb3fbf43c9..9ee115ffbb41 100644 --- a/packages/cli/plugin-tailwind/src/design-token/cli/index.ts +++ b/packages/cli/plugin-tailwind/src/design-token/cli/index.ts @@ -102,25 +102,6 @@ export const designTokenPlugin = ( }; }, - validateSchema() { - // add source.designSystem.supportStyledComponents config - return [ - // Legacy Features - { - target: 'source.designSystem', - schema: { typeof: ['object'] }, - }, - { - target: 'source.designSystem.supportStyledComponents', - schema: { type: ['boolean'] }, - }, - { - target: 'designSystem', - schema: { typeof: ['object'] }, - }, - ]; - }, - addRuntimeExports() { pluginsExportsUtils.addExport( `export { default as designToken } from '${pluginName}/runtime-design-token'`, diff --git a/packages/cli/plugin-tailwind/tests/design-token/cli.test.ts b/packages/cli/plugin-tailwind/tests/design-token/cli.test.ts index d2c5ede21de1..b695e4614e85 100644 --- a/packages/cli/plugin-tailwind/tests/design-token/cli.test.ts +++ b/packages/cli/plugin-tailwind/tests/design-token/cli.test.ts @@ -2,14 +2,6 @@ import { manager } from '@modern-js/core'; import plugin from '../../src/design-token/cli'; describe('plugin design token test', () => { - it('schema', async () => { - const main = manager.clone().usePlugin(plugin); - const runner = await main.init(); - const result = await runner.validateSchema(); - - expect(result).not.toBeNull(); - }); - it('config', async () => { const main = manager.clone().usePlugin(plugin); const runner = await main.init(); diff --git a/packages/devtools/plugin/src/cli.ts b/packages/devtools/plugin/src/cli.ts index ca4a9aac3430..be515cb030bc 100644 --- a/packages/devtools/plugin/src/cli.ts +++ b/packages/devtools/plugin/src/cli.ts @@ -59,14 +59,6 @@ export const devtoolsPlugin = ( return { prepare: rpc.hooks.prepare, modifyFileSystemRoutes: rpc.hooks.modifyFileSystemRoutes, - validateSchema() { - return [ - { - target: 'devtools', - schema: { typeof: ['boolean', 'object'] }, - }, - ]; - }, beforeRestart() { return new Promise((resolve, reject) => httpServer.close(err => (err ? reject(err) : resolve())), diff --git a/packages/document/main-doc/docs/en/guides/topic-detail/framework-plugin/hook-list.mdx b/packages/document/main-doc/docs/en/guides/topic-detail/framework-plugin/hook-list.mdx index 74c75c537e7f..8ad1f6a6dcd1 100644 --- a/packages/document/main-doc/docs/en/guides/topic-detail/framework-plugin/hook-list.mdx +++ b/packages/document/main-doc/docs/en/guides/topic-detail/framework-plugin/hook-list.mdx @@ -84,72 +84,6 @@ The configuration returned by the `config` hook will be collected and merged by 2. Configuration defined by the plugin through the `config` hook. 3. Default configuration of Modern.js. -### `validateSchema` - -- Functionality: Collect the JSON schema used to validate user configurations in various plugins. -- Execution phase: After the `config` Hook has run. -- Hook model: `ParallelWorkflow` -- Type: `ParallelWorkflow` -- Example: - -```ts -import type { CliPlugin } from '@modern-js/core'; - -export const myPlugin = (): CliPlugin => ({ - setup(api) { - return { - validateSchema: () => { - return { - // target is field - target: 'foo', - schema: { - type: 'string', - }, - }; - }, - }; - }, -}); -``` - -The returned JSON Schema here is used to validate the configuration information in `modern.config.js`. - -For example, the following JSON Schema is returned: - -```json -{ - "target": "foo", - "schema": { - "type": "string" - } -} -``` - -You can configure it in `modern.config.ts` like this: - -```ts title="modern.config.ts" -export const myPlugin = defineConfig({ - foo: 'test', -}); -``` - -If it is another type, validation will fail and an error will be reported. For example: - -```ts title="modern.config.ts" -export const myPlugin = defineConfig({ - foo: {}, -}); -``` - -then throw error: - -``` -$ modern dev - 1 | { -> 2 | "foo": {}, - | ^^^^^ Property foo is not expected to be here -``` - ### `prepare` - Functionality: Preparatory process for running the main process. diff --git a/packages/document/main-doc/docs/zh/guides/topic-detail/framework-plugin/hook-list.mdx b/packages/document/main-doc/docs/zh/guides/topic-detail/framework-plugin/hook-list.mdx index 52bcc0e449ae..57638cd34f00 100644 --- a/packages/document/main-doc/docs/zh/guides/topic-detail/framework-plugin/hook-list.mdx +++ b/packages/document/main-doc/docs/zh/guides/topic-detail/framework-plugin/hook-list.mdx @@ -84,72 +84,6 @@ export const myPlugin = (): CliPlugin => ({ 2. 插件通过 `config` hook 定义的配置 3. Modern.js 默认配置。 -### `validateSchema` - -- 功能:收集各个插件中配置的用来校验用户配置的 [JSON Schema](https://json-schema.org/) -- 执行阶段:`config` Hook 运行完成之后。 -- Hook 模型:`ParallelWorkflow` -- 类型:`ParallelWorkflow` -- 使用示例: - -```ts -import type { CliPlugin } from '@modern-js/core'; - -export const myPlugin = (): CliPlugin => ({ - setup(api) { - return { - validateSchema: () => { - return { - // target is field - target: 'foo', - schema: { - type: 'string', - }, - }; - }, - }; - }, -}); -``` - -这里返回的 JSON Schema 会用来校验 `modern.config.js` 中的配置信息。 - -比如这里返回: - -```json -{ - "target": "foo", - "schema": { - "type": "string" - } -} -``` - -就可以在 `modern.config.ts` 中这样配置: - -```ts title="modern.config.ts" -export const myPlugin = defineConfig({ - foo: 'test', -}); -``` - -如果是别的类型,校验就不通过会报错,比如这样: - -```ts title="modern.config.ts" -export const myPlugin = defineConfig({ - foo: {}, -}); -``` - -就会报错: - -``` -$ modern dev - 1 | { -> 2 | "foo": {}, - | ^^^^^ Property foo is not expected to be here -``` - ### `prepare` - 功能:运行主流程的前置准备流程 diff --git a/packages/runtime/plugin-garfish/src/cli/index.ts b/packages/runtime/plugin-garfish/src/cli/index.ts index 49aa8185fb28..f13e0472af99 100644 --- a/packages/runtime/plugin-garfish/src/cli/index.ts +++ b/packages/runtime/plugin-garfish/src/cli/index.ts @@ -46,22 +46,6 @@ export const garfishPlugin = ({ setup: ({ useAppContext, useResolvedConfigContext, useConfigContext }) => { let pluginsExportsUtils: ReturnType; return { - validateSchema() { - return [ - { - target: 'runtime.masterApp', - schema: { type: ['boolean', 'object'] }, - }, - { - target: 'dev.withMasterApp', - schema: { type: ['object'] }, - }, - { - target: 'deploy.microFrontend', - schema: { type: ['boolean', 'object'] }, - }, - ]; - }, resolvedConfig: async config => { const { resolved } = config; const { masterApp, router } = getRuntimeConfig(resolved); diff --git a/packages/runtime/plugin-router-v5/src/cli/index.ts b/packages/runtime/plugin-router-v5/src/cli/index.ts index eac32861801f..22c47e661c9a 100644 --- a/packages/runtime/plugin-router-v5/src/cli/index.ts +++ b/packages/runtime/plugin-router-v5/src/cli/index.ts @@ -43,14 +43,6 @@ export const routerPlugin = (): CliPlugin => ({ }, }; }, - validateSchema() { - return [ - { - target: 'runtime.router', - schema: { type: ['boolean', 'object'] }, - }, - ]; - }, modifyEntryImports({ entrypoint, imports }) { const { entryName, isMainEntry } = entrypoint; const userConfig = api.useResolvedConfigContext(); diff --git a/packages/runtime/plugin-router-v5/tests/index.test.ts b/packages/runtime/plugin-router-v5/tests/index.test.ts index 22a0ac5bb14e..e7b17f0afd84 100644 --- a/packages/runtime/plugin-router-v5/tests/index.test.ts +++ b/packages/runtime/plugin-router-v5/tests/index.test.ts @@ -31,13 +31,4 @@ describe('cli-router-legacy', () => { ), ).toBeTruthy(); }); - - it('plugin-router-legacy cli schema is defined', async () => { - const result = await runner.validateSchema(); - expect( - result.find((item: any) => - item.find(({ target }: any) => target === 'runtime.router'), - ), - ).toBeTruthy(); - }); }); diff --git a/packages/runtime/plugin-runtime/src/cli/index.ts b/packages/runtime/plugin-runtime/src/cli/index.ts index dfc733022bd2..537368813c4f 100644 --- a/packages/runtime/plugin-runtime/src/cli/index.ts +++ b/packages/runtime/plugin-runtime/src/cli/index.ts @@ -1,9 +1,5 @@ import path from 'path'; -import { - isReact18, - cleanRequireCache, - ENTRY_NAME_PATTERN, -} from '@modern-js/utils'; +import { isReact18, cleanRequireCache } from '@modern-js/utils'; import type { CliPlugin, AppTools } from '@modern-js/app-tools'; import { statePlugin } from '../state/cli'; import { ssrPlugin } from '../ssr/cli'; @@ -50,25 +46,6 @@ export const runtimePlugin = (): CliPlugin => ({ }, }; }, - validateSchema() { - return [ - { - target: 'runtime', - schema: { - type: 'object', - additionalProperties: false, - }, - }, - { - target: 'runtimeByEntries', - schema: { - type: 'object', - patternProperties: { [ENTRY_NAME_PATTERN]: { type: 'object' } }, - additionalProperties: false, - }, - }, - ]; - }, async beforeRestart() { cleanRequireCache([ require.resolve('../state/cli'), diff --git a/packages/runtime/plugin-runtime/src/router/cli/index.ts b/packages/runtime/plugin-runtime/src/router/cli/index.ts index 8c9e7b6b2be7..1e352f6ea653 100644 --- a/packages/runtime/plugin-runtime/src/router/cli/index.ts +++ b/packages/runtime/plugin-runtime/src/router/cli/index.ts @@ -43,14 +43,6 @@ export const routerPlugin = (): CliPlugin => ({ }, }; }, - validateSchema() { - return [ - { - target: 'runtime.router', - schema: { type: ['boolean', 'object'] }, - }, - ]; - }, modifyEntryImports({ entrypoint, imports }: any) { const { entryName, isMainEntry, fileSystemRoutes } = entrypoint; const userConfig = api.useResolvedConfigContext(); diff --git a/packages/runtime/plugin-runtime/src/state/cli/index.ts b/packages/runtime/plugin-runtime/src/state/cli/index.ts index 1ebacfd8f314..2b7bf1110978 100644 --- a/packages/runtime/plugin-runtime/src/state/cli/index.ts +++ b/packages/runtime/plugin-runtime/src/state/cli/index.ts @@ -78,14 +78,6 @@ export const statePlugin = (): CliPlugin => ({ plugins, }; }, - validateSchema() { - return [ - { - target: 'runtime.state', - schema: { type: ['boolean', 'object'] }, - }, - ]; - }, addRuntimeExports() { pluginsExportsUtils.addExport( `export { default as state } from '@modern-js/runtime/model'`, diff --git a/packages/runtime/plugin-runtime/tests/cli.test.ts b/packages/runtime/plugin-runtime/tests/cli.test.ts index 40612de3e665..992a19a1c67d 100644 --- a/packages/runtime/plugin-runtime/tests/cli.test.ts +++ b/packages/runtime/plugin-runtime/tests/cli.test.ts @@ -18,13 +18,4 @@ describe('plugin runtime cli', () => { expect(config.find((item: any) => item.runtime)).toBeTruthy(); expect(config.find((item: any) => item.runtimeByEntries)).toBeTruthy(); }); - - it('plugin-runtime cli schema is defined', async () => { - const result = await runner.validateSchema(); - expect( - result.find((item: any) => - item.find(({ target }: any) => target === 'runtime'), - ), - ).toBeTruthy(); - }); }); diff --git a/packages/runtime/plugin-runtime/tests/router/index.test.ts b/packages/runtime/plugin-runtime/tests/router/index.test.ts index 37236c44c51c..9738b8ecc5aa 100644 --- a/packages/runtime/plugin-runtime/tests/router/index.test.ts +++ b/packages/runtime/plugin-runtime/tests/router/index.test.ts @@ -33,13 +33,4 @@ describe('cli-router', () => { ), ).toBeTruthy(); }); - - it('plugin-router cli schema is defined', async () => { - const result = await runner.validateSchema(); - expect( - result.find((item: any) => - item.find(({ target }: any) => target === 'runtime.router'), - ), - ).toBeTruthy(); - }); }); diff --git a/packages/runtime/plugin-testing/src/cli/index.ts b/packages/runtime/plugin-testing/src/cli/index.ts index 07292a146fc2..debf9986b3e1 100644 --- a/packages/runtime/plugin-testing/src/cli/index.ts +++ b/packages/runtime/plugin-testing/src/cli/index.ts @@ -75,30 +75,6 @@ export const testingPlugin = (): CliPlugin<{ await test(api); }); }, - - validateSchema() { - return [ - { - target: 'testing', - schema: { - type: 'object', - additionalProperties: false, - properties: { - transformer: { - type: 'string', - enum: ['babel-jest', 'ts-jest'], - }, - jest: { typeof: ['object', 'function'] }, - }, - }, - }, - { - target: 'tools.jest', - schema: { typeof: ['object', 'function'] }, - }, - ]; - }, - config() { const appContext = api.useAppContext(); diff --git a/packages/server/plugin-worker/src/index.ts b/packages/server/plugin-worker/src/index.ts index eae8bd8061e2..145561f0cf87 100644 --- a/packages/server/plugin-worker/src/index.ts +++ b/packages/server/plugin-worker/src/index.ts @@ -39,14 +39,6 @@ export const workerPlugin = (): CliPlugin => ({ // }, }; }, - validateSchema() { - return [ - { - target: 'deploy.worker.ssr', - schema: { type: ['boolean'] }, - }, - ]; - }, async afterDev() { const { appDirectory, distDirectory } = ctx.useAppContext(); diff --git a/packages/solutions/app-tools/src/analyze/index.ts b/packages/solutions/app-tools/src/analyze/index.ts index fcb47e3c1335..d7ed03808f7e 100644 --- a/packages/solutions/app-tools/src/analyze/index.ts +++ b/packages/solutions/app-tools/src/analyze/index.ts @@ -300,16 +300,6 @@ export default ({ imports, }; }, - - validateSchema() { - return { - target: 'output.splitRouteChunks', - schema: { - type: 'boolean', - }, - }; - }, - async fileChange(e) { const appContext = api.useAppContext(); const { appDirectory } = appContext; diff --git a/packages/solutions/app-tools/src/initialize/index.ts b/packages/solutions/app-tools/src/initialize/index.ts index b2e21de5728d..168d82658d7e 100644 --- a/packages/solutions/app-tools/src/initialize/index.ts +++ b/packages/solutions/app-tools/src/initialize/index.ts @@ -4,7 +4,6 @@ import { isDev, isDevCommand, } from '@modern-js/utils'; -import { legacySchema, schema } from '../schema'; import { checkIsLegacyConfig, createDefaultConfig, @@ -51,15 +50,8 @@ export default ({ : createDefaultConfig(appContext, bundler); }; - const validateSchema = () => { - const userConfig = api.useConfigContext(); - const schemas = checkIsLegacyConfig(userConfig) ? legacySchema : schema; - return schemas.generate(); - }; - return { config, - validateSchema, async resolvedConfig({ resolved }) { let appContext = api.useAppContext(); const userConfig = api.useConfigContext(); diff --git a/packages/solutions/app-tools/src/schema/Schema.ts b/packages/solutions/app-tools/src/schema/Schema.ts deleted file mode 100644 index 2fa1689453b1..000000000000 --- a/packages/solutions/app-tools/src/schema/Schema.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { merge } from '@modern-js/utils/lodash'; - -export type ValidateSchema = { - target: string; - schema: any; -}; - -export class Schema extends Map { - private schema: Record; - - constructor(baseSchema: Record = {}) { - super(); - this.schema = baseSchema; - } - - setSchema(key: string, object: Record): this { - Object.entries(object).forEach(([k, v]) => { - const target = `${key}.${k}`; - this.set(target, v); - }); - return this; - } - - set(key: string, value: any): this { - if (this.has(key)) { - merge(this.schema[key], value); - } else { - this.schema[key] = value; - } - return this; - } - - has(key: string): boolean { - return key in this.schema; - } - - get(key: string) { - return this.schema[key]; - } - - delete(key: string): boolean { - return delete this.schema[key]; - } - - generate(): ValidateSchema[] { - return Object.entries(this.schema).map(([target, schema]) => ({ - target, - schema, - })); - } -} diff --git a/packages/solutions/app-tools/src/schema/index.ts b/packages/solutions/app-tools/src/schema/index.ts deleted file mode 100644 index d53d74628c27..000000000000 --- a/packages/solutions/app-tools/src/schema/index.ts +++ /dev/null @@ -1,99 +0,0 @@ -import { ENTRY_NAME_PATTERN } from '@modern-js/utils'; -import { Schema } from './Schema'; - -const source = { - entries: { - type: 'object', - patternProperties: { - [ENTRY_NAME_PATTERN]: { - if: { type: 'object' }, - then: { - required: ['entry'], - properties: { - entry: { type: ['string', 'array'] }, - disableMount: { type: 'boolean' }, - customBootstrap: { type: 'string' }, - }, - additionalProperties: false, - }, - else: { type: ['string', 'array'] }, - }, - }, - }, - mainEntryName: { type: 'string' }, - enableAsyncEntry: { type: 'boolean' }, - disableDefaultEntries: { type: 'boolean' }, - entriesDir: { type: 'string' }, - disableEntryDirs: { type: 'array' }, - configDir: { type: 'string' }, - designSystem: { type: 'object' }, -}; -const bff = { - prefix: { - type: 'string', - }, - httpMethodDecider: { - type: 'string', - enum: ['functionName', 'inputParams'], - }, - proxy: { - type: 'object', - additionalProperties: { - type: 'string', - }, - }, -}; -const output = { - ssg: { typeof: ['boolean', 'object', 'function'] }, - disableNodePolyfill: { type: 'boolean' }, - enableInlineRouteManifests: { type: 'boolean' }, -}; -const dev = {}; -const server = { - routes: { type: 'object' }, - publicRoutes: { type: 'object' }, - ssr: { - type: ['boolean', 'object'], - }, - ssrByEntries: { type: 'object' }, - baseUrl: { - anyOf: [ - { - type: 'string', - }, - { - type: 'array', - items: { - type: 'string', - }, - }, - ], - }, - port: { type: 'number' }, - logger: { type: ['boolean', 'object'] }, - metrics: { type: ['boolean', 'object'] }, - enableMicroFrontendDebug: { type: 'boolean' }, - watchOptions: { type: 'object' }, - compiler: { type: 'string' }, - enableFrameworkExt: { type: 'boolean' }, -}; -const tools = { - esbuild: { typeof: ['object'] }, -}; -const deploy = {}; -const builderPlugins = { type: 'array' }; - -const schema = new Schema(); - -schema - .setSchema('bff', bff) - .setSchema('dev', dev) - .setSchema('server', server) - .setSchema('source', source) - .setSchema('output', output) - .setSchema('tools', tools) - .setSchema('deploy', deploy) - .set('builderPlugin', builderPlugins); - -export { default as legacySchema } from './legacy'; -export { schema }; diff --git a/packages/solutions/app-tools/src/schema/legacy.ts b/packages/solutions/app-tools/src/schema/legacy.ts deleted file mode 100644 index ce5c002143b2..000000000000 --- a/packages/solutions/app-tools/src/schema/legacy.ts +++ /dev/null @@ -1,162 +0,0 @@ -import { ENTRY_NAME_PATTERN } from '@modern-js/utils'; -import { Schema } from './Schema'; - -const source = { - entries: { - type: 'object', - patternProperties: { - [ENTRY_NAME_PATTERN]: { - if: { type: 'object' }, - then: { - required: ['entry'], - properties: { - entry: { type: ['string', 'array'] }, - disableMount: { type: 'boolean' }, - }, - additionalProperties: false, - }, - else: { type: ['string', 'array'] }, - }, - }, - }, - mainEntryName: { type: 'string' }, - preEntry: { type: ['string', 'array'] }, - alias: { typeof: ['object', 'function'] }, - enableAsyncEntry: { type: 'boolean' }, - disableDefaultEntries: { type: 'boolean' }, - envVars: { type: 'array' }, - globalVars: { typeof: ['object', 'function'] }, - moduleScopes: { instanceof: ['Array', 'Function'] }, - entriesDir: { type: 'string' }, - configDir: { type: 'string' }, - include: { type: ['array'] }, -}; - -const output = { - assetPrefix: { type: 'string' }, - path: { type: 'string' }, - jsPath: { type: 'string' }, - cssPath: { type: 'string' }, - htmlPath: { type: 'string' }, - mediaPath: { type: 'string' }, - mountId: { type: 'string' }, - favicon: { type: 'string' }, - faviconByEntries: { - type: 'object', - patternProperties: { [ENTRY_NAME_PATTERN]: { type: 'string' } }, - }, - title: { type: 'string' }, - titleByEntries: { - type: 'object', - patternProperties: { [ENTRY_NAME_PATTERN]: { type: 'string' } }, - }, - meta: { type: 'object' }, - metaByEntries: { - type: 'object', - patternProperties: { [ENTRY_NAME_PATTERN]: { type: 'object' } }, - }, - inject: { enum: [true, 'head', 'body', false] }, - injectByEntries: { - type: 'object', - patternProperties: { - [ENTRY_NAME_PATTERN]: { enum: [true, 'head', 'body', false] }, - }, - }, - copy: { type: 'array' }, - scriptExt: { type: 'object' }, - disableTsChecker: { type: 'boolean' }, - disableHtmlFolder: { type: 'boolean' }, - disableCssModuleExtension: { type: 'boolean' }, - disableCssExtract: { type: 'boolean' }, - enableCssModuleTSDeclaration: { type: 'boolean' }, - disableMinimize: { type: 'boolean' }, - enableInlineStyles: { type: 'boolean' }, - enableInlineScripts: { type: 'boolean' }, - disableSourceMap: { type: 'boolean' }, - disableInlineRuntimeChunk: { type: 'boolean' }, - disableAssetsCache: { type: 'boolean' }, - enableLatestDecorators: { type: 'boolean' }, - enableTsLoader: { type: 'boolean' }, - dataUriLimit: { type: 'number' }, - templateParameters: { type: 'object' }, - templateParametersByEntries: { - type: 'object', - patternProperties: { [ENTRY_NAME_PATTERN]: { type: 'object' } }, - }, - polyfill: { - type: 'string', - enum: ['usage', 'entry', 'off', 'ua'], - }, - cssModuleLocalIdentName: { type: 'string' }, - federation: { type: 'object' }, - disableNodePolyfill: { type: 'boolean' }, -}; - -const server = { - routes: { type: 'object' }, - publicRoutes: { type: 'object' }, - ssr: { - type: ['boolean', 'object'], - }, - ssrByEntries: { type: 'object' }, - baseUrl: { - anyOf: [ - { - type: 'string', - }, - { - type: 'array', - items: { - type: 'string', - }, - }, - ], - }, - port: { type: 'number' }, - logger: { type: ['boolean', 'object'] }, - metrics: { type: ['boolean', 'object'] }, - enableMicroFrontendDebug: { type: 'boolean' }, - watchOptions: { type: 'object' }, - compiler: { type: 'string' }, - enableFrameworkExt: { type: 'boolean' }, -}; - -const dev = { - proxy: { - type: ['boolean', 'object'], - }, -}; - -const deploy = { - microFrontend: { type: ['boolean', 'object'] }, -}; - -const tools = { - tailwindcss: { type: 'object' }, - jest: { typeof: ['object', 'function'] }, - esbuild: { typeof: ['object'] }, -}; - -const bff = { - prefix: { - type: 'string', - }, - proxy: { - type: 'object', - additionalProperties: { - type: 'string', - }, - }, -}; - -const schema = new Schema(); -schema - .setSchema('bff', bff) - .setSchema('dev', dev) - .setSchema('server', server) - .setSchema('source', source) - .setSchema('output', output) - .setSchema('tools', tools) - .setSchema('deploy', deploy); - -export default schema; diff --git a/packages/solutions/module-tools/src/cli.ts b/packages/solutions/module-tools/src/cli.ts index 98c42d2b69b0..a3ecfc59bb3f 100644 --- a/packages/solutions/module-tools/src/cli.ts +++ b/packages/solutions/module-tools/src/cli.ts @@ -9,10 +9,7 @@ import { newCommand, upgradeCommand, } from './command'; -import { isLegacyUserConfig } from './config/merge'; import { addExitListener } from './utils/onExit'; -import { legacySchema } from './config/legacySchema'; -import { schema } from './config/schema'; export const moduleTools = (): CliPlugin => ({ name: '@modern-js/module-tools', @@ -49,16 +46,8 @@ const setup: CliPlugin['setup'] = async api => { }); }; - const validateSchema = async () => { - const userConfig = api.useConfigContext(); - return isLegacyUserConfig(userConfig as { legacy?: boolean }) - ? legacySchema - : schema; - }; - return { prepare, - validateSchema, async commands({ program }) { await buildCommand(program, api); await devCommand(program, api); diff --git a/packages/toolkit/utils/compiled/ajv-keywords/index.d.ts b/packages/toolkit/utils/compiled/ajv-keywords/index.d.ts deleted file mode 100644 index a2ac5f9bc2ef..000000000000 --- a/packages/toolkit/utils/compiled/ajv-keywords/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export = any; diff --git a/packages/toolkit/utils/compiled/ajv-keywords/index.js b/packages/toolkit/utils/compiled/ajv-keywords/index.js deleted file mode 100644 index ceb6aa281e38..000000000000 --- a/packages/toolkit/utils/compiled/ajv-keywords/index.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e={408:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});function getRangeDef(e){return()=>({keyword:e,type:"number",schemaType:"array",macro:function([t,r]){validateRangeSchema(t,r);return e==="range"?{minimum:t,maximum:r}:{exclusiveMinimum:t,exclusiveMaximum:r}},metaSchema:{type:"array",minItems:2,maxItems:2,items:{type:"number"}}});function validateRangeSchema(t,r){if(t>r||e==="exclusiveRange"&&t===r){throw new Error("There are no numbers in range")}}}t["default"]=getRangeDef},85:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});function getRequiredDef(e){return()=>({keyword:e,type:"object",schemaType:"array",macro(t){if(t.length===0)return true;if(t.length===1)return{required:t};const r=e==="anyRequired"?"anyOf":"oneOf";return{[r]:t.map((e=>({required:[e]})))}},metaSchema:{type:"array",items:{type:"string"}}})}t["default"]=getRequiredDef},503:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.usePattern=t.metaSchemaRef=void 0;const n=r(759);const o="http://json-schema.org/schema";function metaSchemaRef({defaultMeta:e}={}){return e===false?{}:{$ref:e||o}}t.metaSchemaRef=metaSchemaRef;function usePattern({gen:e,it:{opts:t}},r,o=(t.unicodeRegExp?"u":"")){const a=new RegExp(r,o);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:(0,n._)`new RegExp(${r}, ${o})`})}t.usePattern=usePattern},160:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});function getDef(){return{keyword:"allRequired",type:"object",schemaType:"boolean",macro(e,t){if(!e)return true;const r=Object.keys(t.properties);if(r.length===0)return true;return{required:r}},dependencies:["properties"]}}t["default"]=getDef;e.exports=getDef},817:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(85));const a=(0,o.default)("anyRequired");t["default"]=a;e.exports=a},165:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});const n=r(503);function getDef(e){return{keyword:"deepProperties",type:"object",schemaType:"object",macro:function(e){const t=[];for(const r in e)t.push(getSchema(r,e[r]));return{allOf:t}},metaSchema:{type:"object",propertyNames:{type:"string",format:"json-pointer"},additionalProperties:(0,n.metaSchemaRef)(e)}}}t["default"]=getDef;function getSchema(e,t){const r=e.split("/");const n={};let o=n;for(let e=1;e{Object.defineProperty(t,"__esModule",{value:true});const n=r(759);function getDef(){return{keyword:"deepRequired",type:"object",schemaType:"array",code(e){const{schema:t,data:r}=e;const o=t.map((e=>(0,n._)`(${getData(e)}) === undefined`));e.fail((0,n.or)(...o));function getData(e){if(e==="")throw new Error("empty JSON pointer not allowed");const t=e.split("/");let o=r;const a=t.map(((e,t)=>t?o=(0,n._)`${o}${(0,n.getProperty)(unescapeJPSegment(e))}`:o));return(0,n.and)(...a)}},metaSchema:{type:"array",items:{type:"string",format:"json-pointer"}}}}t["default"]=getDef;function unescapeJPSegment(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}e.exports=getDef},220:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});const r={};const n={timestamp:()=>()=>Date.now(),datetime:()=>()=>(new Date).toISOString(),date:()=>()=>(new Date).toISOString().slice(0,10),time:()=>()=>(new Date).toISOString().slice(11),random:()=>()=>Math.random(),randomint:e=>{var t;const r=(t=e===null||e===void 0?void 0:e.max)!==null&&t!==void 0?t:2;return()=>Math.floor(Math.random()*r)},seq:e=>{var t;const n=(t=e===null||e===void 0?void 0:e.name)!==null&&t!==void 0?t:"";r[n]||(r[n]=0);return()=>r[n]++}};const o=Object.assign(_getDef,{DEFAULTS:n});function _getDef(){return{keyword:"dynamicDefaults",type:"object",schemaType:["string","object"],modifying:true,valid:true,compile(e,t,r){if(!r.opts.useDefaults||r.compositeRule)return()=>true;const n={};for(const t in e)n[t]=getDefault(e[t]);const o=r.opts.useDefaults==="empty";return t=>{for(const r in e){if(t[r]===undefined||o&&(t[r]===null||t[r]==="")){t[r]=n[r]()}}return true}},metaSchema:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"object",additionalProperties:false,required:["func","args"],properties:{func:{type:"string"},args:{type:"object"}}}]}}}}function getDefault(e){return typeof e=="object"?getObjDefault(e):getStrDefault(e)}function getObjDefault({func:e,args:t}){const r=n[e];assertDefined(e,r);return r(t)}function getStrDefault(e=""){const t=n[e];assertDefined(e,t);return t()}function assertDefined(e,t){if(!t)throw new Error(`invalid "dynamicDefaults" keyword property value: ${e}`)}t["default"]=o;e.exports=o},541:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(408));const a=(0,o.default)("exclusiveRange");t["default"]=a;e.exports=a},785:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});const r={Object:Object,Array:Array,Function:Function,Number:Number,String:String,Date:Date,RegExp:RegExp};if(typeof Buffer!="undefined")r.Buffer=Buffer;if(typeof Promise!="undefined")r.Promise=Promise;const n=Object.assign(_getDef,{CONSTRUCTORS:r});function _getDef(){return{keyword:"instanceof",schemaType:["string","array"],compile(e){if(typeof e=="string"){const t=getConstructor(e);return e=>e instanceof t}if(Array.isArray(e)){const t=e.map(getConstructor);return e=>{for(const r of t){if(e instanceof r)return true}return false}}throw new Error("ajv implementation error")},metaSchema:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}}function getConstructor(e){const t=r[e];if(t)return t;throw new Error(`invalid "instanceof" keyword value ${e}`)}t["default"]=n;e.exports=n},656:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(85));const a=(0,o.default)("oneRequired");t["default"]=a;e.exports=a},818:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});const n=r(759);const o=r(503);const a={message:({params:{missingPattern:e}})=>(0,n.str)`should have property matching pattern '${e}'`,params:({params:{missingPattern:e}})=>(0,n._)`{missingPattern: ${e}}`};function getDef(){return{keyword:"patternRequired",type:"object",schemaType:"array",error:a,code(e){const{gen:t,schema:r,data:a}=e;if(r.length===0)return;const u=t.let("valid",true);for(const e of r)validateProperties(e);function validateProperties(r){const s=t.let("matched",false);t.forIn("key",a,(a=>{t.assign(s,(0,n._)`${(0,o.usePattern)(e,r)}.test(${a})`);t.if(s,(()=>t.break()))}));e.setParams({missingPattern:r});t.assign(u,(0,n.and)(u,s));e.pass(u)}},metaSchema:{type:"array",items:{type:"string",format:"regex"},uniqueItems:true}}}t["default"]=getDef;e.exports=getDef},506:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});function getDef(){return{keyword:"prohibited",type:"object",schemaType:"array",macro:function(e){if(e.length===0)return true;if(e.length===1)return{not:{required:e}};return{not:{anyOf:e.map((e=>({required:[e]})))}}},metaSchema:{type:"array",items:{type:"string"}}}}t["default"]=getDef;e.exports=getDef},669:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(408));const a=(0,o.default)("range");t["default"]=a;e.exports=a},163:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});const n=r(759);const o=r(503);const a={type:"object",properties:{pattern:{type:"string"},flags:{type:"string",nullable:true}},required:["pattern"],additionalProperties:false};const u=/^\/(.*)\/([gimuy]*)$/;function getDef(){return{keyword:"regexp",type:"string",schemaType:["string","object"],code(e){const{data:t,schema:r}=e;const a=getRegExp(r);e.pass((0,n._)`${a}.test(${t})`);function getRegExp(t){if(typeof t=="object")return(0,o.usePattern)(e,t.pattern,t.flags);const r=u.exec(t);if(r)return(0,o.usePattern)(e,r[1],r[2]);throw new Error("cannot parse string into RegExp")}},metaSchema:{anyOf:[{type:"string"},a]}}}t["default"]=getDef;e.exports=getDef},730:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});const n=r(759);const o=r(503);const a={message:({params:{schemaProp:e}})=>e?(0,n.str)`should match case "${e}" schema`:(0,n.str)`should match default case schema`,params:({params:{schemaProp:e}})=>e?(0,n._)`{failingCase: ${e}}`:(0,n._)`{failingDefault: true}`};function getDef(e){const t=(0,o.metaSchemaRef)(e);return[{keyword:"select",schemaType:["string","number","boolean","null"],$data:true,error:a,dependencies:["selectCases"],code(e){const{gen:t,schemaCode:r,parentSchema:o}=e;e.block$data(n.nil,(()=>{const a=t.let("valid",true);const u=t.name("_valid");const s=t.const("value",(0,n._)`${r} === null ? "null" : ${r}`);t.if(false);for(const r in o.selectCases){e.setParams({schemaProp:r});t.elseIf((0,n._)`"" + ${s} == ${r}`);const o=e.subschema({keyword:"selectCases",schemaProp:r},u);e.mergeEvaluated(o,n.Name);t.assign(a,u)}t.else();if(o.selectDefault!==undefined){e.setParams({schemaProp:undefined});const r=e.subschema({keyword:"selectDefault"},u);e.mergeEvaluated(r,n.Name);t.assign(a,u)}t.endIf();e.pass(a)}))}},{keyword:"selectCases",dependencies:["select"],metaSchema:{type:"object",additionalProperties:t}},{keyword:"selectDefault",dependencies:["select","selectCases"],metaSchema:t}]}t["default"]=getDef;e.exports=getDef},678:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});const n=r(759);const o={trimStart:e=>e.trimStart(),trimEnd:e=>e.trimEnd(),trimLeft:e=>e.trimStart(),trimRight:e=>e.trimEnd(),trim:e=>e.trim(),toLowerCase:e=>e.toLowerCase(),toUpperCase:e=>e.toUpperCase(),toEnumCase:(e,t)=>(t===null||t===void 0?void 0:t.hash[configKey(e)])||e};const a=Object.assign(_getDef,{transform:o});function _getDef(){return{keyword:"transform",schemaType:"array",before:"enum",code(e){const{gen:t,data:r,schema:a,parentSchema:u,it:s}=e;const{parentData:i,parentDataProperty:f}=s;const c=a;if(!c.length)return;let l;if(c.includes("toEnumCase")){const e=getEnumCaseCfg(u);l=t.scopeValue("obj",{ref:e,code:(0,n.stringify)(e)})}t.if((0,n._)`typeof ${r} == "string" && ${i} !== undefined`,(()=>{t.assign(r,transformExpr(c.slice()));t.assign((0,n._)`${i}[${f}]`,r)}));function transformExpr(e){if(!e.length)return r;const a=e.pop();if(!(a in o))throw new Error(`transform: unknown transformation ${a}`);const u=t.scopeValue("func",{ref:o[a],code:(0,n._)`require("ajv-keywords/dist/definitions/transform").transform${(0,n.getProperty)(a)}`});const s=transformExpr(e);return l&&a==="toEnumCase"?(0,n._)`${u}(${s}, ${l})`:(0,n._)`${u}(${s})`}},metaSchema:{type:"array",items:{type:"string",enum:Object.keys(o)}}}}function getEnumCaseCfg(e){const t={hash:{}};if(!e.enum)throw new Error('transform: "toEnumCase" requires "enum"');for(const r of e.enum){if(typeof r!=="string")continue;const e=configKey(r);if(t.hash[e]){throw new Error('transform: "toEnumCase" requires all lowercased "enum" values to be unique')}t.hash[e]=r}return t}function configKey(e){return e.toLowerCase()}t["default"]=a;e.exports=a},518:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});const n=r(759);const o=["undefined","string","number","object","function","boolean","symbol"];function getDef(){return{keyword:"typeof",schemaType:["string","array"],code(e){const{data:t,schema:r,schemaValue:o}=e;e.fail(typeof r=="string"?(0,n._)`typeof ${t} != ${r}`:(0,n._)`${o}.indexOf(typeof ${t}) < 0`)},metaSchema:{anyOf:[{type:"string",enum:o},{type:"array",items:{type:"string",enum:o}}]}}}t["default"]=getDef;e.exports=getDef},530:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});const n=r(447);const o=["number","integer","string","boolean","null"];function getDef(){return{keyword:"uniqueItemProperties",type:"array",schemaType:"array",compile(e,t){const r=getScalarKeys(e,t);return t=>{if(t.length<=1)return true;for(let o=0;o{var r,n,a;const u=(a=(n=(r=t.items)===null||r===void 0?void 0:r.properties)===null||n===void 0?void 0:n[e])===null||a===void 0?void 0:a.type;return Array.isArray(u)?!u.includes("object")&&!u.includes("array"):o.includes(u)}))}e.exports=getDef},563:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(959));const ajvKeywords=(e,t)=>{if(Array.isArray(t)){for(const r of t)get(r)(e);return e}if(t){get(t)(e);return e}for(t in o.default)get(t)(e);return e};ajvKeywords.get=get;function get(e){const t=o.default[e];if(!t)throw new Error("Unknown keyword "+e);return t}t["default"]=ajvKeywords;e.exports=ajvKeywords;e.exports["default"]=ajvKeywords},237:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(160));const allRequired=e=>e.addKeyword((0,o.default)());t["default"]=allRequired;e.exports=allRequired},484:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(817));const anyRequired=e=>e.addKeyword((0,o.default)());t["default"]=anyRequired;e.exports=anyRequired},739:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(165));const deepProperties=(e,t)=>e.addKeyword((0,o.default)(t));t["default"]=deepProperties;e.exports=deepProperties},360:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(592));const deepRequired=e=>e.addKeyword((0,o.default)());t["default"]=deepRequired;e.exports=deepRequired},515:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(220));const dynamicDefaults=e=>e.addKeyword((0,o.default)());t["default"]=dynamicDefaults;e.exports=dynamicDefaults},304:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(541));const exclusiveRange=e=>e.addKeyword((0,o.default)());t["default"]=exclusiveRange;e.exports=exclusiveRange},959:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(401));const a=n(r(499));const u=n(r(119));const s=n(r(304));const i=n(r(33));const f=n(r(573));const c=n(r(857));const l=n(r(237));const d=n(r(484));const p=n(r(207));const m=n(r(417));const y=n(r(832));const _=n(r(739));const g=n(r(360));const h=n(r(515));const v=n(r(520));const b={typeof:o.default,instanceof:a.default,range:u.default,exclusiveRange:s.default,regexp:i.default,transform:f.default,uniqueItemProperties:c.default,allRequired:l.default,anyRequired:d.default,oneRequired:p.default,patternRequired:m.default,prohibited:y.default,deepProperties:_.default,deepRequired:g.default,dynamicDefaults:h.default,select:v.default};t["default"]=b;e.exports=b},499:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(785));const instanceofPlugin=e=>e.addKeyword((0,o.default)());t["default"]=instanceofPlugin;e.exports=instanceofPlugin},207:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(656));const oneRequired=e=>e.addKeyword((0,o.default)());t["default"]=oneRequired;e.exports=oneRequired},417:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(818));const patternRequired=e=>e.addKeyword((0,o.default)());t["default"]=patternRequired;e.exports=patternRequired},832:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(506));const prohibited=e=>e.addKeyword((0,o.default)());t["default"]=prohibited;e.exports=prohibited},119:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(669));const range=e=>e.addKeyword((0,o.default)());t["default"]=range;e.exports=range},33:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(163));const regexp=e=>e.addKeyword((0,o.default)());t["default"]=regexp;e.exports=regexp},520:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(730));const select=(e,t)=>{(0,o.default)(t).forEach((t=>e.addKeyword(t)));return e};t["default"]=select;e.exports=select},573:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(678));const transform=e=>e.addKeyword((0,o.default)());t["default"]=transform;e.exports=transform},401:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(518));const typeofPlugin=e=>e.addKeyword((0,o.default)());t["default"]=typeofPlugin;e.exports=typeofPlugin},857:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(530));const uniqueItemProperties=e=>e.addKeyword((0,o.default)());t["default"]=uniqueItemProperties;e.exports=uniqueItemProperties},447:e=>{e.exports=function equal(e,t){if(e===t)return true;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return false;var r,n,o;if(Array.isArray(e)){r=e.length;if(r!=t.length)return false;for(n=r;n--!==0;)if(!equal(e[n],t[n]))return false;return true}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();o=Object.keys(e);r=o.length;if(r!==Object.keys(t).length)return false;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[n]))return false;for(n=r;n--!==0;){var a=o[n];if(!equal(e[a],t[a]))return false}return true}return e!==e&&t!==t}},759:e=>{e.exports=require("../ajv/codegen")}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var o=t[r]={exports:{}};var a=true;try{e[r].call(o.exports,o,o.exports,__nccwpck_require__);a=false}finally{if(a)delete t[r]}return o.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(563);module.exports=r})(); \ No newline at end of file diff --git a/packages/toolkit/utils/compiled/ajv-keywords/license b/packages/toolkit/utils/compiled/ajv-keywords/license deleted file mode 100644 index 90139aa74cef..000000000000 --- a/packages/toolkit/utils/compiled/ajv-keywords/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Evgeny Poberezkin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/packages/toolkit/utils/compiled/ajv-keywords/package.json b/packages/toolkit/utils/compiled/ajv-keywords/package.json deleted file mode 100644 index 6cd01ad251c8..000000000000 --- a/packages/toolkit/utils/compiled/ajv-keywords/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"ajv-keywords","author":"Evgeny Poberezkin","version":"5.1.0","license":"MIT","types":"index.d.ts"} diff --git a/packages/toolkit/utils/compiled/ajv/codegen.js b/packages/toolkit/utils/compiled/ajv/codegen.js deleted file mode 100644 index cf5cb7cf84e4..000000000000 --- a/packages/toolkit/utils/compiled/ajv/codegen.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./').codegen; \ No newline at end of file diff --git a/packages/toolkit/utils/compiled/ajv/index.js b/packages/toolkit/utils/compiled/ajv/index.js deleted file mode 100644 index 21574c37bbc4..000000000000 --- a/packages/toolkit/utils/compiled/ajv/index.js +++ /dev/null @@ -1,9 +0,0 @@ -(()=>{var e={4711:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const s=r(3834);const a=r(8056);const n=r(8222);const o=r(9520);const i=["/properties"];const c="http://json-schema.org/draft-07/schema";class Ajv extends s.default{_addVocabularies(){super._addVocabularies();a.default.forEach((e=>this.addVocabulary(e)));if(this.opts.discriminator)this.addKeyword(n.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();if(!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(o,i):o;this.addMetaSchema(e,c,false);this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:undefined)}}e.exports=t=Ajv;Object.defineProperty(t,"__esModule",{value:true});t["default"]=Ajv;var u=r(7357);Object.defineProperty(t,"KeywordCxt",{enumerable:true,get:function(){return u.KeywordCxt}});var d=r(4109);Object.defineProperty(t,"_",{enumerable:true,get:function(){return d._}});Object.defineProperty(t,"str",{enumerable:true,get:function(){return d.str}});Object.defineProperty(t,"stringify",{enumerable:true,get:function(){return d.stringify}});Object.defineProperty(t,"nil",{enumerable:true,get:function(){return d.nil}});Object.defineProperty(t,"Name",{enumerable:true,get:function(){return d.Name}});Object.defineProperty(t,"CodeGen",{enumerable:true,get:function(){return d.CodeGen}});t.codegen=r(4109)},3456:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class _CodeOrName{}t._CodeOrName=_CodeOrName;t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Name extends _CodeOrName{constructor(e){super();if(!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return false}get names(){return{[this.str]:1}}}t.Name=Name;class _Code extends _CodeOrName{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return false;const e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce(((e,t)=>{if(t instanceof Name)e[t.str]=(e[t.str]||0)+1;return e}),{})}}t._Code=_Code;t.nil=new _Code("");function _(e,...t){const r=[e[0]];let s=0;while(s{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const s=r(3456);const a=r(3078);var n=r(3456);Object.defineProperty(t,"_",{enumerable:true,get:function(){return n._}});Object.defineProperty(t,"str",{enumerable:true,get:function(){return n.str}});Object.defineProperty(t,"strConcat",{enumerable:true,get:function(){return n.strConcat}});Object.defineProperty(t,"nil",{enumerable:true,get:function(){return n.nil}});Object.defineProperty(t,"getProperty",{enumerable:true,get:function(){return n.getProperty}});Object.defineProperty(t,"stringify",{enumerable:true,get:function(){return n.stringify}});Object.defineProperty(t,"regexpCode",{enumerable:true,get:function(){return n.regexpCode}});Object.defineProperty(t,"Name",{enumerable:true,get:function(){return n.Name}});var o=r(3078);Object.defineProperty(t,"Scope",{enumerable:true,get:function(){return o.Scope}});Object.defineProperty(t,"ValueScope",{enumerable:true,get:function(){return o.ValueScope}});Object.defineProperty(t,"ValueScopeName",{enumerable:true,get:function(){return o.ValueScopeName}});Object.defineProperty(t,"varKinds",{enumerable:true,get:function(){return o.varKinds}});t.operators={GT:new s._Code(">"),GTE:new s._Code(">="),LT:new s._Code("<"),LTE:new s._Code("<="),EQ:new s._Code("==="),NEQ:new s._Code("!=="),NOT:new s._Code("!"),OR:new s._Code("||"),AND:new s._Code("&&"),ADD:new s._Code("+")};class Node{optimizeNodes(){return this}optimizeNames(e,t){return this}}class Def extends Node{constructor(e,t,r){super();this.varKind=e;this.name=t;this.rhs=r}render({es5:e,_n:t}){const r=e?a.varKinds.var:this.varKind;const s=this.rhs===undefined?"":` = ${this.rhs}`;return`${r} ${this.name}${s};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=optimizeExpr(this.rhs,e,t);return this}get names(){return this.rhs instanceof s._CodeOrName?this.rhs.names:{}}}class Assign extends Node{constructor(e,t,r){super();this.lhs=e;this.rhs=t;this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof s.Name&&!e[this.lhs.str]&&!this.sideEffects)return;this.rhs=optimizeExpr(this.rhs,e,t);return this}get names(){const e=this.lhs instanceof s.Name?{}:{...this.lhs.names};return addExprNames(e,this.rhs)}}class AssignOp extends Assign{constructor(e,t,r,s){super(e,r,s);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class Label extends Node{constructor(e){super();this.label=e;this.names={}}render({_n:e}){return`${this.label}:`+e}}class Break extends Node{constructor(e){super();this.label=e;this.names={}}render({_n:e}){const t=this.label?` ${this.label}`:"";return`break${t};`+e}}class Throw extends Node{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class AnyCode extends Node{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:undefined}optimizeNames(e,t){this.code=optimizeExpr(this.code,e,t);return this}get names(){return this.code instanceof s._CodeOrName?this.code.names:{}}}class ParentNode extends Node{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce(((t,r)=>t+r.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;while(t--){const r=e[t].optimizeNodes();if(Array.isArray(r))e.splice(t,1,...r);else if(r)e[t]=r;else e.splice(t,1)}return e.length>0?this:undefined}optimizeNames(e,t){const{nodes:r}=this;let s=r.length;while(s--){const a=r[s];if(a.optimizeNames(e,t))continue;subtractNames(e,a.names);r.splice(s,1)}return r.length>0?this:undefined}get names(){return this.nodes.reduce(((e,t)=>addNames(e,t.names)),{})}}class BlockNode extends ParentNode{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class Root extends ParentNode{}class Else extends BlockNode{}Else.kind="else";class If extends BlockNode{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+="else "+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(e===true)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new Else(e):e}if(t){if(e===false)return t instanceof If?t:t.nodes;if(this.nodes.length)return this;return new If(not(e),t instanceof If?[t]:t.nodes)}if(e===false||!this.nodes.length)return undefined;return this}optimizeNames(e,t){var r;this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,t);if(!(super.optimizeNames(e,t)||this.else))return;this.condition=optimizeExpr(this.condition,e,t);return this}get names(){const e=super.names;addExprNames(e,this.condition);if(this.else)addNames(e,this.else.names);return e}}If.kind="if";class For extends BlockNode{}For.kind="for";class ForLoop extends For{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;this.iteration=optimizeExpr(this.iteration,e,t);return this}get names(){return addNames(super.names,this.iteration.names)}}class ForRange extends For{constructor(e,t,r,s){super();this.varKind=e;this.name=t;this.from=r;this.to=s}render(e){const t=e.es5?a.varKinds.var:this.varKind;const{name:r,from:s,to:n}=this;return`for(${t} ${r}=${s}; ${r}<${n}; ${r}++)`+super.render(e)}get names(){const e=addExprNames(super.names,this.from);return addExprNames(e,this.to)}}class ForIter extends For{constructor(e,t,r,s){super();this.loop=e;this.varKind=t;this.name=r;this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;this.iterable=optimizeExpr(this.iterable,e,t);return this}get names(){return addNames(super.names,this.iterable.names)}}class Func extends BlockNode{constructor(e,t,r){super();this.name=e;this.args=t;this.async=r}render(e){const t=this.async?"async ":"";return`${t}function ${this.name}(${this.args})`+super.render(e)}}Func.kind="func";class Return extends ParentNode{render(e){return"return "+super.render(e)}}Return.kind="return";class Try extends BlockNode{render(e){let t="try"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;super.optimizeNodes();(e=this.catch)===null||e===void 0?void 0:e.optimizeNodes();(t=this.finally)===null||t===void 0?void 0:t.optimizeNodes();return this}optimizeNames(e,t){var r,s;super.optimizeNames(e,t);(r=this.catch)===null||r===void 0?void 0:r.optimizeNames(e,t);(s=this.finally)===null||s===void 0?void 0:s.optimizeNames(e,t);return this}get names(){const e=super.names;if(this.catch)addNames(e,this.catch.names);if(this.finally)addNames(e,this.finally.names);return e}}class Catch extends BlockNode{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Catch.kind="catch";class Finally extends BlockNode{render(e){return"finally"+super.render(e)}}Finally.kind="finally";class CodeGen{constructor(e,t={}){this._values={};this._blockStarts=[];this._constants={};this.opts={...t,_n:t.lines?"\n":""};this._extScope=e;this._scope=new a.Scope({parent:e});this._nodes=[new Root]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const r=this._extScope.value(e,t);const s=this._values[r.prefix]||(this._values[r.prefix]=new Set);s.add(r);return r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,s){const a=this._scope.toName(t);if(r!==undefined&&s)this._constants[a.str]=r;this._leafNode(new Def(e,a,r));return a}const(e,t,r){return this._def(a.varKinds.const,e,t,r)}let(e,t,r){return this._def(a.varKinds.let,e,t,r)}var(e,t,r){return this._def(a.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new Assign(e,t,r))}add(e,r){return this._leafNode(new AssignOp(e,t.operators.ADD,r))}code(e){if(typeof e=="function")e();else if(e!==s.nil)this._leafNode(new AnyCode(e));return this}object(...e){const t=["{"];for(const[r,a]of e){if(t.length>1)t.push(",");t.push(r);if(r!==a||this.opts.es5){t.push(":");(0,s.addCodeArg)(t,a)}}t.push("}");return new s._Code(t)}if(e,t,r){this._blockNode(new If(e));if(t&&r){this.code(t).else().code(r).endIf()}else if(t){this.code(t).endIf()}else if(r){throw new Error('CodeGen: "else" body without "then" body')}return this}elseIf(e){return this._elseNode(new If(e))}else(){return this._elseNode(new Else)}endIf(){return this._endBlockNode(If,Else)}_for(e,t){this._blockNode(e);if(t)this.code(t).endFor();return this}for(e,t){return this._for(new ForLoop(e),t)}forRange(e,t,r,s,n=(this.opts.es5?a.varKinds.var:a.varKinds.let)){const o=this._scope.toName(e);return this._for(new ForRange(n,o,t,r),(()=>s(o)))}forOf(e,t,r,n=a.varKinds.const){const o=this._scope.toName(e);if(this.opts.es5){const e=t instanceof s.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,s._)`${e}.length`,(t=>{this.var(o,(0,s._)`${e}[${t}]`);r(o)}))}return this._for(new ForIter("of",n,o,t),(()=>r(o)))}forIn(e,t,r,n=(this.opts.es5?a.varKinds.var:a.varKinds.const)){if(this.opts.ownProperties){return this.forOf(e,(0,s._)`Object.keys(${t})`,r)}const o=this._scope.toName(e);return this._for(new ForIter("in",n,o,t),(()=>r(o)))}endFor(){return this._endBlockNode(For)}label(e){return this._leafNode(new Label(e))}break(e){return this._leafNode(new Break(e))}return(e){const t=new Return;this._blockNode(t);this.code(e);if(t.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Return)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const s=new Try;this._blockNode(s);this.code(e);if(t){const e=this.name("e");this._currNode=s.catch=new Catch(e);t(e)}if(r){this._currNode=s.finally=new Finally;this.code(r)}return this._endBlockNode(Catch,Finally)}throw(e){return this._leafNode(new Throw(e))}block(e,t){this._blockStarts.push(this._nodes.length);if(e)this.code(e).endBlock(t);return this}endBlock(e){const t=this._blockStarts.pop();if(t===undefined)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||e!==undefined&&r!==e){throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`)}this._nodes.length=t;return this}func(e,t=s.nil,r,a){this._blockNode(new Func(e,t,r));if(a)this.code(a).endFunc();return this}endFunc(){return this._endBlockNode(Func)}optimize(e=1){while(e-- >0){this._root.optimizeNodes();this._root.optimizeNames(this._root.names,this._constants)}}_leafNode(e){this._currNode.nodes.push(e);return this}_blockNode(e){this._currNode.nodes.push(e);this._nodes.push(e)}_endBlockNode(e,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t){this._nodes.pop();return this}throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof If)){throw new Error('CodeGen: "else" without "if"')}this._currNode=t.else=e;return this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}}t.CodeGen=CodeGen;function addNames(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function addExprNames(e,t){return t instanceof s._CodeOrName?addNames(e,t.names):e}function optimizeExpr(e,t,r){if(e instanceof s.Name)return replaceName(e);if(!canOptimize(e))return e;return new s._Code(e._items.reduce(((e,t)=>{if(t instanceof s.Name)t=replaceName(t);if(t instanceof s._Code)e.push(...t._items);else e.push(t);return e}),[]));function replaceName(e){const s=r[e.str];if(s===undefined||t[e.str]!==1)return e;delete t[e.str];return s}function canOptimize(e){return e instanceof s._Code&&e._items.some((e=>e instanceof s.Name&&t[e.str]===1&&r[e.str]!==undefined))}}function subtractNames(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function not(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,s._)`!${par(e)}`}t.not=not;const i=mappend(t.operators.AND);function and(...e){return e.reduce(i)}t.and=and;const c=mappend(t.operators.OR);function or(...e){return e.reduce(c)}t.or=or;function mappend(e){return(t,r)=>t===s.nil?r:r===s.nil?t:(0,s._)`${par(t)} ${e} ${par(r)}`}function par(e){return e instanceof s.Name?e:(0,s._)`(${e})`}},3078:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const s=r(3456);class ValueError extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var a;(function(e){e[e["Started"]=0]="Started";e[e["Completed"]=1]="Completed"})(a=t.UsedValueState||(t.UsedValueState={}));t.varKinds={const:new s.Name("const"),let:new s.Name("let"),var:new s.Name("var")};class Scope{constructor({prefixes:e,parent:t}={}){this._names={};this._prefixes=e;this._parent=t}toName(e){return e instanceof s.Name?e:this.name(e)}name(e){return new s.Name(this._newName(e))}_newName(e){const t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if(((r=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||r===void 0?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e)){throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`)}return this._names[e]={prefix:e,index:0}}}t.Scope=Scope;class ValueScopeName extends s.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e;this.scopePath=(0,s._)`.${new s.Name(t)}[${r}]`}}t.ValueScopeName=ValueScopeName;const n=(0,s._)`\n`;class ValueScope extends Scope{constructor(e){super(e);this._values={};this._scope=e.scope;this.opts={...e,_n:e.lines?n:s.nil}}get(){return this._scope}name(e){return new ValueScopeName(e,this._newName(e))}value(e,t){var r;if(t.ref===undefined)throw new Error("CodeGen: ref must be passed in value");const s=this.toName(e);const{prefix:a}=s;const n=(r=t.key)!==null&&r!==void 0?r:t.ref;let o=this._values[a];if(o){const e=o.get(n);if(e)return e}else{o=this._values[a]=new Map}o.set(n,s);const i=this._scope[a]||(this._scope[a]=[]);const c=i.length;i[c]=t.ref;s.setValue(t,{property:a,itemIndex:c});return s}getValue(e,t){const r=this._values[e];if(!r)return;return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(t=>{if(t.scopePath===undefined)throw new Error(`CodeGen: name "${t}" has no value`);return(0,s._)`${e}${t.scopePath}`}))}scopeCode(e=this._values,t,r){return this._reduceValues(e,(e=>{if(e.value===undefined)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,r)}_reduceValues(e,r,n={},o){let i=s.nil;for(const c in e){const u=e[c];if(!u)continue;const d=n[c]=n[c]||new Map;u.forEach((e=>{if(d.has(e))return;d.set(e,a.Started);let n=r(e);if(n){const r=this.opts.es5?t.varKinds.var:t.varKinds.const;i=(0,s._)`${i}${r} ${e} = ${n};${this.opts._n}`}else if(n=o===null||o===void 0?void 0:o(e)){i=(0,s._)`${i}${n}${this.opts._n}`}else{throw new ValueError(e)}d.set(e,a.Completed)}))}return i}}t.ValueScope=ValueScope},1069:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const s=r(4109);const a=r(7545);const n=r(4492);t.keywordError={message:({keyword:e})=>(0,s.str)`must pass "${e}" keyword validation`};t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,s.str)`"${e}" keyword must be ${t} ($data)`:(0,s.str)`"${e}" keyword is invalid ($data)`};function reportError(e,r=t.keywordError,a,n){const{it:o}=e;const{gen:i,compositeRule:c,allErrors:u}=o;const d=errorObjectCode(e,r,a);if(n!==null&&n!==void 0?n:c||u){addError(i,d)}else{returnErrors(o,(0,s._)`[${d}]`)}}t.reportError=reportError;function reportExtraError(e,r=t.keywordError,s){const{it:a}=e;const{gen:o,compositeRule:i,allErrors:c}=a;const u=errorObjectCode(e,r,s);addError(o,u);if(!(i||c)){returnErrors(a,n.default.vErrors)}}t.reportExtraError=reportExtraError;function resetErrorsCount(e,t){e.assign(n.default.errors,t);e.if((0,s._)`${n.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign((0,s._)`${n.default.vErrors}.length`,t)),(()=>e.assign(n.default.vErrors,null)))))}t.resetErrorsCount=resetErrorsCount;function extendErrors({gen:e,keyword:t,schemaValue:r,data:a,errsCount:o,it:i}){if(o===undefined)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",o,n.default.errors,(o=>{e.const(c,(0,s._)`${n.default.vErrors}[${o}]`);e.if((0,s._)`${c}.instancePath === undefined`,(()=>e.assign((0,s._)`${c}.instancePath`,(0,s.strConcat)(n.default.instancePath,i.errorPath))));e.assign((0,s._)`${c}.schemaPath`,(0,s.str)`${i.errSchemaPath}/${t}`);if(i.opts.verbose){e.assign((0,s._)`${c}.schema`,r);e.assign((0,s._)`${c}.data`,a)}}))}t.extendErrors=extendErrors;function addError(e,t){const r=e.const("err",t);e.if((0,s._)`${n.default.vErrors} === null`,(()=>e.assign(n.default.vErrors,(0,s._)`[${r}]`)),(0,s._)`${n.default.vErrors}.push(${r})`);e.code((0,s._)`${n.default.errors}++`)}function returnErrors(e,t){const{gen:r,validateName:a,schemaEnv:n}=e;if(n.$async){r.throw((0,s._)`new ${e.ValidationError}(${t})`)}else{r.assign((0,s._)`${a}.errors`,t);r.return(false)}}const o={keyword:new s.Name("keyword"),schemaPath:new s.Name("schemaPath"),params:new s.Name("params"),propertyName:new s.Name("propertyName"),message:new s.Name("message"),schema:new s.Name("schema"),parentSchema:new s.Name("parentSchema")};function errorObjectCode(e,t,r){const{createErrors:a}=e.it;if(a===false)return(0,s._)`{}`;return errorObject(e,t,r)}function errorObject(e,t,r={}){const{gen:s,it:a}=e;const n=[errorInstancePath(a,r),errorSchemaPath(e,r)];extraErrorProps(e,t,n);return s.object(...n)}function errorInstancePath({errorPath:e},{instancePath:t}){const r=t?(0,s.str)`${e}${(0,a.getErrorPath)(t,a.Type.Str)}`:e;return[n.default.instancePath,(0,s.strConcat)(n.default.instancePath,r)]}function errorSchemaPath({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let i=n?t:(0,s.str)`${t}/${e}`;if(r){i=(0,s.str)`${i}${(0,a.getErrorPath)(r,a.Type.Str)}`}return[o.schemaPath,i]}function extraErrorProps(e,{params:t,message:r},a){const{keyword:i,data:c,schemaValue:u,it:d}=e;const{opts:l,propertyName:f,topSchemaRef:p,schemaPath:h}=d;a.push([o.keyword,i],[o.params,typeof t=="function"?t(e):t||(0,s._)`{}`]);if(l.messages){a.push([o.message,typeof r=="function"?r(e):r])}if(l.verbose){a.push([o.schema,u],[o.parentSchema,(0,s._)`${p}${h}`],[n.default.data,c])}if(f)a.push([o.propertyName,f])}},960:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const s=r(4109);const a=r(5919);const n=r(4492);const o=r(3877);const i=r(7545);const c=r(7357);class SchemaEnv{constructor(e){var t;this.refs={};this.dynamicAnchors={};let r;if(typeof e.schema=="object")r=e.schema;this.schema=e.schema;this.schemaId=e.schemaId;this.root=e.root||this;this.baseId=(t=e.baseId)!==null&&t!==void 0?t:(0,o.normalizeId)(r===null||r===void 0?void 0:r[e.schemaId||"$id"]);this.schemaPath=e.schemaPath;this.localRefs=e.localRefs;this.meta=e.meta;this.$async=r===null||r===void 0?void 0:r.$async;this.refs={}}}t.SchemaEnv=SchemaEnv;function compileSchema(e){const t=getCompilingSchema.call(this,e);if(t)return t;const r=(0,o.getFullPath)(this.opts.uriResolver,e.root.baseId);const{es5:i,lines:u}=this.opts.code;const{ownProperties:d}=this.opts;const l=new s.CodeGen(this.scope,{es5:i,lines:u,ownProperties:d});let f;if(e.$async){f=l.scopeValue("Error",{ref:a.default,code:(0,s._)`require("ajv/dist/runtime/validation_error").default`})}const p=l.scopeName("validate");e.validateName=p;const h={gen:l,allErrors:this.opts.allErrors,data:n.default.data,parentData:n.default.parentData,parentDataProperty:n.default.parentDataProperty,dataNames:[n.default.data],dataPathArr:[s.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:l.scopeValue("schema",this.opts.code.source===true?{ref:e.schema,code:(0,s.stringify)(e.schema)}:{ref:e.schema}),validateName:p,ValidationError:f,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:s.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,s._)`""`,opts:this.opts,self:this};let m;try{this._compilations.add(e);(0,c.validateFunctionCode)(h);l.optimize(this.opts.code.optimize);const t=l.toString();m=`${l.scopeRefs(n.default.scope)}return ${t}`;if(this.opts.code.process)m=this.opts.code.process(m,e);const r=new Function(`${n.default.self}`,`${n.default.scope}`,m);const a=r(this,this.scope.get());this.scope.value(p,{ref:a});a.errors=null;a.schema=e.schema;a.schemaEnv=e;if(e.$async)a.$async=true;if(this.opts.code.source===true){a.source={validateName:p,validateCode:t,scopeValues:l._values}}if(this.opts.unevaluated){const{props:e,items:t}=h;a.evaluated={props:e instanceof s.Name?undefined:e,items:t instanceof s.Name?undefined:t,dynamicProps:e instanceof s.Name,dynamicItems:t instanceof s.Name};if(a.source)a.source.evaluated=(0,s.stringify)(a.evaluated)}e.validate=a;return e}catch(t){delete e.validate;delete e.validateName;if(m)this.logger.error("Error compiling schema, function code:",m);throw t}finally{this._compilations.delete(e)}}t.compileSchema=compileSchema;function resolveRef(e,t,r){var s;r=(0,o.resolveUrl)(this.opts.uriResolver,t,r);const a=e.refs[r];if(a)return a;let n=resolve.call(this,e,r);if(n===undefined){const a=(s=e.localRefs)===null||s===void 0?void 0:s[r];const{schemaId:o}=this.opts;if(a)n=new SchemaEnv({schema:a,schemaId:o,root:e,baseId:t})}if(n===undefined)return;return e.refs[r]=inlineOrCompile.call(this,n)}t.resolveRef=resolveRef;function inlineOrCompile(e){if((0,o.inlineRef)(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:compileSchema.call(this,e)}function getCompilingSchema(e){for(const t of this._compilations){if(sameSchemaEnv(t,e))return t}}t.getCompilingSchema=getCompilingSchema;function sameSchemaEnv(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function resolve(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||resolveSchema.call(this,e,t)}function resolveSchema(e,t){const r=this.opts.uriResolver.parse(t);const s=(0,o._getFullPath)(this.opts.uriResolver,r);let a=(0,o.getFullPath)(this.opts.uriResolver,e.baseId,undefined);if(Object.keys(e.schema).length>0&&s===a){return getJsonPointer.call(this,r,e)}const n=(0,o.normalizeId)(s);const i=this.refs[n]||this.schemas[n];if(typeof i=="string"){const t=resolveSchema.call(this,e,i);if(typeof(t===null||t===void 0?void 0:t.schema)!=="object")return;return getJsonPointer.call(this,r,t)}if(typeof(i===null||i===void 0?void 0:i.schema)!=="object")return;if(!i.validate)compileSchema.call(this,i);if(n===(0,o.normalizeId)(t)){const{schema:t}=i;const{schemaId:r}=this.opts;const s=t[r];if(s)a=(0,o.resolveUrl)(this.opts.uriResolver,a,s);return new SchemaEnv({schema:t,schemaId:r,root:e,baseId:a})}return getJsonPointer.call(this,r,i)}t.resolveSchema=resolveSchema;const u=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function getJsonPointer(e,{baseId:t,schema:r,root:s}){var a;if(((a=e.fragment)===null||a===void 0?void 0:a[0])!=="/")return;for(const s of e.fragment.slice(1).split("/")){if(typeof r==="boolean")return;const e=r[(0,i.unescapeFragment)(s)];if(e===undefined)return;r=e;const a=typeof r==="object"&&r[this.opts.schemaId];if(!u.has(s)&&a){t=(0,o.resolveUrl)(this.opts.uriResolver,t,a)}}let n;if(typeof r!="boolean"&&r.$ref&&!(0,i.schemaHasRulesButRef)(r,this.RULES)){const e=(0,o.resolveUrl)(this.opts.uriResolver,t,r.$ref);n=resolveSchema.call(this,s,e)}const{schemaId:c}=this.opts;n=n||new SchemaEnv({schema:r,schemaId:c,root:s,baseId:t});if(n.schema!==n.root.schema)return n;return undefined}},4492:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(4109);const a={data:new s.Name("data"),valCxt:new s.Name("valCxt"),instancePath:new s.Name("instancePath"),parentData:new s.Name("parentData"),parentDataProperty:new s.Name("parentDataProperty"),rootData:new s.Name("rootData"),dynamicAnchors:new s.Name("dynamicAnchors"),vErrors:new s.Name("vErrors"),errors:new s.Name("errors"),this:new s.Name("this"),self:new s.Name("self"),scope:new s.Name("scope"),json:new s.Name("json"),jsonPos:new s.Name("jsonPos"),jsonLen:new s.Name("jsonLen"),jsonPart:new s.Name("jsonPart")};t["default"]=a},9984:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(3877);class MissingRefError extends Error{constructor(e,t,r,a){super(a||`can't resolve reference ${r} from id ${t}`);this.missingRef=(0,s.resolveUrl)(e,t,r);this.missingSchema=(0,s.normalizeId)((0,s.getFullPath)(e,this.missingRef))}}t["default"]=MissingRefError},3877:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const s=r(7545);const a=r(7447);const n=r(7243);const o=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function inlineRef(e,t=true){if(typeof e=="boolean")return true;if(t===true)return!hasRef(e);if(!t)return false;return countKeys(e)<=t}t.inlineRef=inlineRef;const i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function hasRef(e){for(const t in e){if(i.has(t))return true;const r=e[t];if(Array.isArray(r)&&r.some(hasRef))return true;if(typeof r=="object"&&hasRef(r))return true}return false}function countKeys(e){let t=0;for(const r in e){if(r==="$ref")return Infinity;t++;if(o.has(r))continue;if(typeof e[r]=="object"){(0,s.eachItem)(e[r],(e=>t+=countKeys(e)))}if(t===Infinity)return Infinity}return t}function getFullPath(e,t="",r){if(r!==false)t=normalizeId(t);const s=e.parse(t);return _getFullPath(e,s)}t.getFullPath=getFullPath;function _getFullPath(e,t){const r=e.serialize(t);return r.split("#")[0]+"#"}t._getFullPath=_getFullPath;const c=/#\/?$/;function normalizeId(e){return e?e.replace(c,""):""}t.normalizeId=normalizeId;function resolveUrl(e,t,r){r=normalizeId(r);return e.resolve(t,r)}t.resolveUrl=resolveUrl;const u=/^[a-z_][-a-z0-9._]*$/i;function getSchemaRefs(e,t){if(typeof e=="boolean")return{};const{schemaId:r,uriResolver:s}=this.opts;const o=normalizeId(e[r]||t);const i={"":o};const c=getFullPath(s,o,false);const d={};const l=new Set;n(e,{allKeys:true},((e,t,s,a)=>{if(a===undefined)return;const n=c+t;let o=i[a];if(typeof e[r]=="string")o=addRef.call(this,e[r]);addAnchor.call(this,e.$anchor);addAnchor.call(this,e.$dynamicAnchor);i[t]=o;function addRef(t){const r=this.opts.uriResolver.resolve;t=normalizeId(o?r(o,t):t);if(l.has(t))throw ambiguos(t);l.add(t);let s=this.refs[t];if(typeof s=="string")s=this.refs[s];if(typeof s=="object"){checkAmbiguosRef(e,s.schema,t)}else if(t!==normalizeId(n)){if(t[0]==="#"){checkAmbiguosRef(e,d[t],t);d[t]=e}else{this.refs[t]=n}}return t}function addAnchor(e){if(typeof e=="string"){if(!u.test(e))throw new Error(`invalid anchor "${e}"`);addRef.call(this,`#${e}`)}}}));return d;function checkAmbiguosRef(e,t,r){if(t!==undefined&&!a(e,t))throw ambiguos(r)}function ambiguos(e){return new Error(`reference "${e}" resolves to more than one schema`)}}t.getSchemaRefs=getSchemaRefs},521:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getRules=t.isJSONType=void 0;const r=["string","number","integer","boolean","null","object","array"];const s=new Set(r);function isJSONType(e){return typeof e=="string"&&s.has(e)}t.isJSONType=isJSONType;function getRules(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:true,boolean:true,null:true},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}t.getRules=getRules},7545:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const s=r(4109);const a=r(3456);function toHash(e){const t={};for(const r of e)t[r]=true;return t}t.toHash=toHash;function alwaysValidSchema(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return true;checkUnknownRules(e,t);return!schemaHasRules(t,e.self.RULES.all)}t.alwaysValidSchema=alwaysValidSchema;function checkUnknownRules(e,t=e.schema){const{opts:r,self:s}=e;if(!r.strictSchema)return;if(typeof t==="boolean")return;const a=s.RULES.keywords;for(const r in t){if(!a[r])checkStrictMode(e,`unknown keyword: "${r}"`)}}t.checkUnknownRules=checkUnknownRules;function schemaHasRules(e,t){if(typeof e=="boolean")return!e;for(const r in e)if(t[r])return true;return false}t.schemaHasRules=schemaHasRules;function schemaHasRulesButRef(e,t){if(typeof e=="boolean")return!e;for(const r in e)if(r!=="$ref"&&t.all[r])return true;return false}t.schemaHasRulesButRef=schemaHasRulesButRef;function schemaRefOrVal({topSchemaRef:e,schemaPath:t},r,a,n){if(!n){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,s._)`${r}`}return(0,s._)`${e}${t}${(0,s.getProperty)(a)}`}t.schemaRefOrVal=schemaRefOrVal;function unescapeFragment(e){return unescapeJsonPointer(decodeURIComponent(e))}t.unescapeFragment=unescapeFragment;function escapeFragment(e){return encodeURIComponent(escapeJsonPointer(e))}t.escapeFragment=escapeFragment;function escapeJsonPointer(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}t.escapeJsonPointer=escapeJsonPointer;function unescapeJsonPointer(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}t.unescapeJsonPointer=unescapeJsonPointer;function eachItem(e,t){if(Array.isArray(e)){for(const r of e)t(r)}else{t(e)}}t.eachItem=eachItem;function makeMergeEvaluated({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:a}){return(n,o,i,c)=>{const u=i===undefined?o:i instanceof s.Name?(o instanceof s.Name?e(n,o,i):t(n,o,i),i):o instanceof s.Name?(t(n,i,o),o):r(o,i);return c===s.Name&&!(u instanceof s.Name)?a(n,u):u}}t.mergeEvaluated={props:makeMergeEvaluated({mergeNames:(e,t,r)=>e.if((0,s._)`${r} !== true && ${t} !== undefined`,(()=>{e.if((0,s._)`${t} === true`,(()=>e.assign(r,true)),(()=>e.assign(r,(0,s._)`${r} || {}`).code((0,s._)`Object.assign(${r}, ${t})`)))})),mergeToName:(e,t,r)=>e.if((0,s._)`${r} !== true`,(()=>{if(t===true){e.assign(r,true)}else{e.assign(r,(0,s._)`${r} || {}`);setEvaluated(e,r,t)}})),mergeValues:(e,t)=>e===true?true:{...e,...t},resultToName:evaluatedPropsToName}),items:makeMergeEvaluated({mergeNames:(e,t,r)=>e.if((0,s._)`${r} !== true && ${t} !== undefined`,(()=>e.assign(r,(0,s._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`))),mergeToName:(e,t,r)=>e.if((0,s._)`${r} !== true`,(()=>e.assign(r,t===true?true:(0,s._)`${r} > ${t} ? ${r} : ${t}`))),mergeValues:(e,t)=>e===true?true:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function evaluatedPropsToName(e,t){if(t===true)return e.var("props",true);const r=e.var("props",(0,s._)`{}`);if(t!==undefined)setEvaluated(e,r,t);return r}t.evaluatedPropsToName=evaluatedPropsToName;function setEvaluated(e,t,r){Object.keys(r).forEach((r=>e.assign((0,s._)`${t}${(0,s.getProperty)(r)}`,true)))}t.setEvaluated=setEvaluated;const n={};function useFunc(e,t){return e.scopeValue("func",{ref:t,code:n[t.code]||(n[t.code]=new a._Code(t.code))})}t.useFunc=useFunc;var o;(function(e){e[e["Num"]=0]="Num";e[e["Str"]=1]="Str"})(o=t.Type||(t.Type={}));function getErrorPath(e,t,r){if(e instanceof s.Name){const a=t===o.Num;return r?a?(0,s._)`"[" + ${e} + "]"`:(0,s._)`"['" + ${e} + "']"`:a?(0,s._)`"/" + ${e}`:(0,s._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,s.getProperty)(e).toString():"/"+escapeJsonPointer(e)}t.getErrorPath=getErrorPath;function checkStrictMode(e,t,r=e.opts.strictSchema){if(!r)return;t=`strict mode: ${t}`;if(r===true)throw new Error(t);e.self.logger.warn(t)}t.checkStrictMode=checkStrictMode},2175:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0;function schemaHasRulesForType({schema:e,self:t},r){const s=t.RULES.types[r];return s&&s!==true&&shouldUseGroup(e,s)}t.schemaHasRulesForType=schemaHasRulesForType;function shouldUseGroup(e,t){return t.rules.some((t=>shouldUseRule(e,t)))}t.shouldUseGroup=shouldUseGroup;function shouldUseRule(e,t){var r;return e[t.keyword]!==undefined||((r=t.definition.implements)===null||r===void 0?void 0:r.some((t=>e[t]!==undefined)))}t.shouldUseRule=shouldUseRule},4152:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const s=r(1069);const a=r(4109);const n=r(4492);const o={message:"boolean schema is false"};function topBoolOrEmptySchema(e){const{gen:t,schema:r,validateName:s}=e;if(r===false){falseSchemaError(e,false)}else if(typeof r=="object"&&r.$async===true){t.return(n.default.data)}else{t.assign((0,a._)`${s}.errors`,null);t.return(true)}}t.topBoolOrEmptySchema=topBoolOrEmptySchema;function boolOrEmptySchema(e,t){const{gen:r,schema:s}=e;if(s===false){r.var(t,false);falseSchemaError(e)}else{r.var(t,true)}}t.boolOrEmptySchema=boolOrEmptySchema;function falseSchemaError(e,t){const{gen:r,data:a}=e;const n={gen:r,keyword:"false schema",data:a,schema:false,schemaCode:false,schemaValue:false,params:{},it:e};(0,s.reportError)(n,o,undefined,t)}},3967:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const s=r(521);const a=r(2175);const n=r(1069);const o=r(4109);const i=r(7545);var c;(function(e){e[e["Correct"]=0]="Correct";e[e["Wrong"]=1]="Wrong"})(c=t.DataType||(t.DataType={}));function getSchemaTypes(e){const t=getJSONTypes(e.type);const r=t.includes("null");if(r){if(e.nullable===false)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==undefined){throw new Error('"nullable" cannot be used without "type"')}if(e.nullable===true)t.push("null")}return t}t.getSchemaTypes=getSchemaTypes;function getJSONTypes(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(s.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}t.getJSONTypes=getJSONTypes;function coerceAndCheckDataType(e,t){const{gen:r,data:s,opts:n}=e;const o=coerceToTypes(t,n.coerceTypes);const i=t.length>0&&!(o.length===0&&t.length===1&&(0,a.schemaHasRulesForType)(e,t[0]));if(i){const a=checkDataTypes(t,s,n.strictNumbers,c.Wrong);r.if(a,(()=>{if(o.length)coerceData(e,t,o);else reportTypeError(e)}))}return i}t.coerceAndCheckDataType=coerceAndCheckDataType;const u=new Set(["string","number","integer","boolean","null"]);function coerceToTypes(e,t){return t?e.filter((e=>u.has(e)||t==="array"&&e==="array")):[]}function coerceData(e,t,r){const{gen:s,data:a,opts:n}=e;const i=s.let("dataType",(0,o._)`typeof ${a}`);const c=s.let("coerced",(0,o._)`undefined`);if(n.coerceTypes==="array"){s.if((0,o._)`${i} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,(()=>s.assign(a,(0,o._)`${a}[0]`).assign(i,(0,o._)`typeof ${a}`).if(checkDataTypes(t,a,n.strictNumbers),(()=>s.assign(c,a)))))}s.if((0,o._)`${c} !== undefined`);for(const e of r){if(u.has(e)||e==="array"&&n.coerceTypes==="array"){coerceSpecificType(e)}}s.else();reportTypeError(e);s.endIf();s.if((0,o._)`${c} !== undefined`,(()=>{s.assign(a,c);assignParentData(e,c)}));function coerceSpecificType(e){switch(e){case"string":s.elseIf((0,o._)`${i} == "number" || ${i} == "boolean"`).assign(c,(0,o._)`"" + ${a}`).elseIf((0,o._)`${a} === null`).assign(c,(0,o._)`""`);return;case"number":s.elseIf((0,o._)`${i} == "boolean" || ${a} === null - || (${i} == "string" && ${a} && ${a} == +${a})`).assign(c,(0,o._)`+${a}`);return;case"integer":s.elseIf((0,o._)`${i} === "boolean" || ${a} === null - || (${i} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(c,(0,o._)`+${a}`);return;case"boolean":s.elseIf((0,o._)`${a} === "false" || ${a} === 0 || ${a} === null`).assign(c,false).elseIf((0,o._)`${a} === "true" || ${a} === 1`).assign(c,true);return;case"null":s.elseIf((0,o._)`${a} === "" || ${a} === 0 || ${a} === false`);s.assign(c,null);return;case"array":s.elseIf((0,o._)`${i} === "string" || ${i} === "number" - || ${i} === "boolean" || ${a} === null`).assign(c,(0,o._)`[${a}]`)}}}function assignParentData({gen:e,parentData:t,parentDataProperty:r},s){e.if((0,o._)`${t} !== undefined`,(()=>e.assign((0,o._)`${t}[${r}]`,s)))}function checkDataType(e,t,r,s=c.Correct){const a=s===c.Correct?o.operators.EQ:o.operators.NEQ;let n;switch(e){case"null":return(0,o._)`${t} ${a} null`;case"array":n=(0,o._)`Array.isArray(${t})`;break;case"object":n=(0,o._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":n=numCond((0,o._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":n=numCond();break;default:return(0,o._)`typeof ${t} ${a} ${e}`}return s===c.Correct?n:(0,o.not)(n);function numCond(e=o.nil){return(0,o.and)((0,o._)`typeof ${t} == "number"`,e,r?(0,o._)`isFinite(${t})`:o.nil)}}t.checkDataType=checkDataType;function checkDataTypes(e,t,r,s){if(e.length===1){return checkDataType(e[0],t,r,s)}let a;const n=(0,i.toHash)(e);if(n.array&&n.object){const e=(0,o._)`typeof ${t} != "object"`;a=n.null?e:(0,o._)`!${t} || ${e}`;delete n.null;delete n.array;delete n.object}else{a=o.nil}if(n.number)delete n.integer;for(const e in n)a=(0,o.and)(a,checkDataType(e,t,r,s));return a}t.checkDataTypes=checkDataTypes;const d={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,o._)`{type: ${e}}`:(0,o._)`{type: ${t}}`};function reportTypeError(e){const t=getTypeErrorContext(e);(0,n.reportError)(t,d)}t.reportTypeError=reportTypeError;function getTypeErrorContext(e){const{gen:t,data:r,schema:s}=e;const a=(0,i.schemaRefOrVal)(e,s,"type");return{gen:t,keyword:"type",data:r,schema:s.type,schemaCode:a,schemaValue:a,parentSchema:s,params:{},it:e}}},4017:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.assignDefaults=void 0;const s=r(4109);const a=r(7545);function assignDefaults(e,t){const{properties:r,items:s}=e.schema;if(t==="object"&&r){for(const t in r){assignDefault(e,t,r[t].default)}}else if(t==="array"&&Array.isArray(s)){s.forEach(((t,r)=>assignDefault(e,r,t.default)))}}t.assignDefaults=assignDefaults;function assignDefault(e,t,r){const{gen:n,compositeRule:o,data:i,opts:c}=e;if(r===undefined)return;const u=(0,s._)`${i}${(0,s.getProperty)(t)}`;if(o){(0,a.checkStrictMode)(e,`default is ignored for: ${u}`);return}let d=(0,s._)`${u} === undefined`;if(c.useDefaults==="empty"){d=(0,s._)`${d} || ${u} === null || ${u} === ""`}n.if(d,(0,s._)`${u} = ${(0,s.stringify)(r)}`)}},7357:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const s=r(4152);const a=r(3967);const n=r(2175);const o=r(3967);const i=r(4017);const c=r(272);const u=r(7390);const d=r(4109);const l=r(4492);const f=r(3877);const p=r(7545);const h=r(1069);function validateFunctionCode(e){if(isSchemaObj(e)){checkKeywords(e);if(schemaCxtHasRules(e)){topSchemaObjCode(e);return}}validateFunction(e,(()=>(0,s.topBoolOrEmptySchema)(e)))}t.validateFunctionCode=validateFunctionCode;function validateFunction({gen:e,validateName:t,schema:r,schemaEnv:s,opts:a},n){if(a.code.es5){e.func(t,(0,d._)`${l.default.data}, ${l.default.valCxt}`,s.$async,(()=>{e.code((0,d._)`"use strict"; ${funcSourceUrl(r,a)}`);destructureValCxtES5(e,a);e.code(n)}))}else{e.func(t,(0,d._)`${l.default.data}, ${destructureValCxt(a)}`,s.$async,(()=>e.code(funcSourceUrl(r,a)).code(n)))}}function destructureValCxt(e){return(0,d._)`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${e.dynamicRef?(0,d._)`, ${l.default.dynamicAnchors}={}`:d.nil}}={}`}function destructureValCxtES5(e,t){e.if(l.default.valCxt,(()=>{e.var(l.default.instancePath,(0,d._)`${l.default.valCxt}.${l.default.instancePath}`);e.var(l.default.parentData,(0,d._)`${l.default.valCxt}.${l.default.parentData}`);e.var(l.default.parentDataProperty,(0,d._)`${l.default.valCxt}.${l.default.parentDataProperty}`);e.var(l.default.rootData,(0,d._)`${l.default.valCxt}.${l.default.rootData}`);if(t.dynamicRef)e.var(l.default.dynamicAnchors,(0,d._)`${l.default.valCxt}.${l.default.dynamicAnchors}`)}),(()=>{e.var(l.default.instancePath,(0,d._)`""`);e.var(l.default.parentData,(0,d._)`undefined`);e.var(l.default.parentDataProperty,(0,d._)`undefined`);e.var(l.default.rootData,l.default.data);if(t.dynamicRef)e.var(l.default.dynamicAnchors,(0,d._)`{}`)}))}function topSchemaObjCode(e){const{schema:t,opts:r,gen:s}=e;validateFunction(e,(()=>{if(r.$comment&&t.$comment)commentKeyword(e);checkNoDefault(e);s.let(l.default.vErrors,null);s.let(l.default.errors,0);if(r.unevaluated)resetEvaluated(e);typeAndKeywords(e);returnResults(e)}));return}function resetEvaluated(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,d._)`${r}.evaluated`);t.if((0,d._)`${e.evaluated}.dynamicProps`,(()=>t.assign((0,d._)`${e.evaluated}.props`,(0,d._)`undefined`)));t.if((0,d._)`${e.evaluated}.dynamicItems`,(()=>t.assign((0,d._)`${e.evaluated}.items`,(0,d._)`undefined`)))}function funcSourceUrl(e,t){const r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,d._)`/*# sourceURL=${r} */`:d.nil}function subschemaCode(e,t){if(isSchemaObj(e)){checkKeywords(e);if(schemaCxtHasRules(e)){subSchemaObjCode(e,t);return}}(0,s.boolOrEmptySchema)(e,t)}function schemaCxtHasRules({schema:e,self:t}){if(typeof e=="boolean")return!e;for(const r in e)if(t.RULES.all[r])return true;return false}function isSchemaObj(e){return typeof e.schema!="boolean"}function subSchemaObjCode(e,t){const{schema:r,gen:s,opts:a}=e;if(a.$comment&&r.$comment)commentKeyword(e);updateContext(e);checkAsyncSchema(e);const n=s.const("_errs",l.default.errors);typeAndKeywords(e,n);s.var(t,(0,d._)`${n} === ${l.default.errors}`)}function checkKeywords(e){(0,p.checkUnknownRules)(e);checkRefsAndKeywords(e)}function typeAndKeywords(e,t){if(e.opts.jtd)return schemaKeywords(e,[],false,t);const r=(0,a.getSchemaTypes)(e.schema);const s=(0,a.coerceAndCheckDataType)(e,r);schemaKeywords(e,r,!s,t)}function checkRefsAndKeywords(e){const{schema:t,errSchemaPath:r,opts:s,self:a}=e;if(t.$ref&&s.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(t,a.RULES)){a.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}}function checkNoDefault(e){const{schema:t,opts:r}=e;if(t.default!==undefined&&r.useDefaults&&r.strictSchema){(0,p.checkStrictMode)(e,"default is ignored in the schema root")}}function updateContext(e){const t=e.schema[e.opts.schemaId];if(t)e.baseId=(0,f.resolveUrl)(e.opts.uriResolver,e.baseId,t)}function checkAsyncSchema(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function commentKeyword({gen:e,schemaEnv:t,schema:r,errSchemaPath:s,opts:a}){const n=r.$comment;if(a.$comment===true){e.code((0,d._)`${l.default.self}.logger.log(${n})`)}else if(typeof a.$comment=="function"){const r=(0,d.str)`${s}/$comment`;const a=e.scopeValue("root",{ref:t.root});e.code((0,d._)`${l.default.self}.opts.$comment(${n}, ${r}, ${a}.schema)`)}}function returnResults(e){const{gen:t,schemaEnv:r,validateName:s,ValidationError:a,opts:n}=e;if(r.$async){t.if((0,d._)`${l.default.errors} === 0`,(()=>t.return(l.default.data)),(()=>t.throw((0,d._)`new ${a}(${l.default.vErrors})`)))}else{t.assign((0,d._)`${s}.errors`,l.default.vErrors);if(n.unevaluated)assignEvaluated(e);t.return((0,d._)`${l.default.errors} === 0`)}}function assignEvaluated({gen:e,evaluated:t,props:r,items:s}){if(r instanceof d.Name)e.assign((0,d._)`${t}.props`,r);if(s instanceof d.Name)e.assign((0,d._)`${t}.items`,s)}function schemaKeywords(e,t,r,s){const{gen:a,schema:i,data:c,allErrors:u,opts:f,self:h}=e;const{RULES:m}=h;if(i.$ref&&(f.ignoreKeywordsWithRef||!(0,p.schemaHasRulesButRef)(i,m))){a.block((()=>keywordCode(e,"$ref",m.all.$ref.definition)));return}if(!f.jtd)checkStrictTypes(e,t);a.block((()=>{for(const e of m.rules)groupKeywords(e);groupKeywords(m.post)}));function groupKeywords(p){if(!(0,n.shouldUseGroup)(i,p))return;if(p.type){a.if((0,o.checkDataType)(p.type,c,f.strictNumbers));iterateKeywords(e,p);if(t.length===1&&t[0]===p.type&&r){a.else();(0,o.reportTypeError)(e)}a.endIf()}else{iterateKeywords(e,p)}if(!u)a.if((0,d._)`${l.default.errors} === ${s||0}`)}}function iterateKeywords(e,t){const{gen:r,schema:s,opts:{useDefaults:a}}=e;if(a)(0,i.assignDefaults)(e,t.type);r.block((()=>{for(const r of t.rules){if((0,n.shouldUseRule)(s,r)){keywordCode(e,r.keyword,r.definition,t.type)}}}))}function checkStrictTypes(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;checkContextTypes(e,t);if(!e.opts.allowUnionTypes)checkMultipleTypes(e,t);checkKeywordTypes(e,e.dataTypes)}function checkContextTypes(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((t=>{if(!includesType(e.dataTypes,t)){strictTypesError(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)}}));e.dataTypes=e.dataTypes.filter((e=>includesType(t,e)))}function checkMultipleTypes(e,t){if(t.length>1&&!(t.length===2&&t.includes("null"))){strictTypesError(e,"use allowUnionTypes to allow union type keyword")}}function checkKeywordTypes(e,t){const r=e.self.RULES.all;for(const s in r){const a=r[s];if(typeof a=="object"&&(0,n.shouldUseRule)(e.schema,a)){const{type:r}=a.definition;if(r.length&&!r.some((e=>hasApplicableType(t,e)))){strictTypesError(e,`missing type "${r.join(",")}" for keyword "${s}"`)}}}}function hasApplicableType(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function includesType(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function strictTypesError(e,t){const r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`;(0,p.checkStrictMode)(e,t,e.opts.strictTypes)}class KeywordCxt{constructor(e,t,r){(0,c.validateKeywordUsage)(e,t,r);this.gen=e.gen;this.allErrors=e.allErrors;this.keyword=r;this.data=e.data;this.schema=e.schema[r];this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data;this.schemaValue=(0,p.schemaRefOrVal)(e,this.schema,r,this.$data);this.schemaType=t.schemaType;this.parentSchema=e.schema;this.params={};this.it=e;this.def=t;if(this.$data){this.schemaCode=e.gen.const("vSchema",getData(this.$data,e))}else{this.schemaCode=this.schemaValue;if(!(0,c.validSchemaType)(this.schema,t.schemaType,t.allowUndefined)){throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`)}}if("code"in t?t.trackErrors:t.errors!==false){this.errsCount=e.gen.const("_errs",l.default.errors)}}result(e,t,r){this.failResult((0,d.not)(e),t,r)}failResult(e,t,r){this.gen.if(e);if(r)r();else this.error();if(t){this.gen.else();t();if(this.allErrors)this.gen.endIf()}else{if(this.allErrors)this.gen.endIf();else this.gen.else()}}pass(e,t){this.failResult((0,d.not)(e),undefined,t)}fail(e){if(e===undefined){this.error();if(!this.allErrors)this.gen.if(false);return}this.gen.if(e);this.error();if(this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail((0,d._)`${t} !== undefined && (${(0,d.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t);this._error(e,r);this.setParams({});return}this._error(e,r)}_error(e,t){(e?h.reportExtraError:h.reportError)(this,this.def.error,t)}$dataError(){(0,h.reportError)(this,this.def.$dataError||h.keyword$DataError)}reset(){if(this.errsCount===undefined)throw new Error('add "trackErrors" to keyword definition');(0,h.resetErrorsCount)(this.gen,this.errsCount)}ok(e){if(!this.allErrors)this.gen.if(e)}setParams(e,t){if(t)Object.assign(this.params,e);else this.params=e}block$data(e,t,r=d.nil){this.gen.block((()=>{this.check$data(e,r);t()}))}check$data(e=d.nil,t=d.nil){if(!this.$data)return;const{gen:r,schemaCode:s,schemaType:a,def:n}=this;r.if((0,d.or)((0,d._)`${s} === undefined`,t));if(e!==d.nil)r.assign(e,true);if(a.length||n.validateSchema){r.elseIf(this.invalid$data());this.$dataError();if(e!==d.nil)r.assign(e,false)}r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:r,def:s,it:a}=this;return(0,d.or)(wrong$DataType(),invalid$DataSchema());function wrong$DataType(){if(r.length){if(!(t instanceof d.Name))throw new Error("ajv implementation error");const e=Array.isArray(r)?r:[r];return(0,d._)`${(0,o.checkDataTypes)(e,t,a.opts.strictNumbers,o.DataType.Wrong)}`}return d.nil}function invalid$DataSchema(){if(s.validateSchema){const r=e.scopeValue("validate$data",{ref:s.validateSchema});return(0,d._)`!${r}(${t})`}return d.nil}}subschema(e,t){const r=(0,u.getSubschema)(this.it,e);(0,u.extendSubschemaData)(r,this.it,e);(0,u.extendSubschemaMode)(r,e);const s={...this.it,...r,items:undefined,props:undefined};subschemaCode(s,t);return s}mergeEvaluated(e,t){const{it:r,gen:s}=this;if(!r.opts.unevaluated)return;if(r.props!==true&&e.props!==undefined){r.props=p.mergeEvaluated.props(s,e.props,r.props,t)}if(r.items!==true&&e.items!==undefined){r.items=p.mergeEvaluated.items(s,e.items,r.items,t)}}mergeValidEvaluated(e,t){const{it:r,gen:s}=this;if(r.opts.unevaluated&&(r.props!==true||r.items!==true)){s.if(t,(()=>this.mergeEvaluated(e,d.Name)));return true}}}t.KeywordCxt=KeywordCxt;function keywordCode(e,t,r,s){const a=new KeywordCxt(e,r,t);if("code"in r){r.code(a,s)}else if(a.$data&&r.validate){(0,c.funcKeywordCode)(a,r)}else if("macro"in r){(0,c.macroKeywordCode)(a,r)}else if(r.compile||r.validate){(0,c.funcKeywordCode)(a,r)}}const m=/^\/(?:[^~]|~0|~1)*$/;const y=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function getData(e,{dataLevel:t,dataNames:r,dataPathArr:s}){let a;let n;if(e==="")return l.default.rootData;if(e[0]==="/"){if(!m.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);a=e;n=l.default.rootData}else{const o=y.exec(e);if(!o)throw new Error(`Invalid JSON-pointer: ${e}`);const i=+o[1];a=o[2];if(a==="#"){if(i>=t)throw new Error(errorMsg("property/index",i));return s[t-i]}if(i>t)throw new Error(errorMsg("data",i));n=r[t-i];if(!a)return n}let o=n;const i=a.split("/");for(const e of i){if(e){n=(0,d._)`${n}${(0,d.getProperty)((0,p.unescapeJsonPointer)(e))}`;o=(0,d._)`${o} && ${n}`}}return o;function errorMsg(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}t.getData=getData},272:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const s=r(4109);const a=r(4492);const n=r(6086);const o=r(1069);function macroKeywordCode(e,t){const{gen:r,keyword:a,schema:n,parentSchema:o,it:i}=e;const c=t.macro.call(i.self,n,o,i);const u=useKeyword(r,a,c);if(i.opts.validateSchema!==false)i.self.validateSchema(c,true);const d=r.name("valid");e.subschema({schema:c,schemaPath:s.nil,errSchemaPath:`${i.errSchemaPath}/${a}`,topSchemaRef:u,compositeRule:true},d);e.pass(d,(()=>e.error(true)))}t.macroKeywordCode=macroKeywordCode;function funcKeywordCode(e,t){var r;const{gen:o,keyword:i,schema:c,parentSchema:u,$data:d,it:l}=e;checkAsyncKeyword(l,t);const f=!d&&t.compile?t.compile.call(l.self,c,u,l):t.validate;const p=useKeyword(o,i,f);const h=o.let("valid");e.block$data(h,validateKeyword);e.ok((r=t.valid)!==null&&r!==void 0?r:h);function validateKeyword(){if(t.errors===false){assignValid();if(t.modifying)modifyData(e);reportErrs((()=>e.error()))}else{const r=t.async?validateAsync():validateSync();if(t.modifying)modifyData(e);reportErrs((()=>addErrs(e,r)))}}function validateAsync(){const e=o.let("ruleErrs",null);o.try((()=>assignValid((0,s._)`await `)),(t=>o.assign(h,false).if((0,s._)`${t} instanceof ${l.ValidationError}`,(()=>o.assign(e,(0,s._)`${t}.errors`)),(()=>o.throw(t)))));return e}function validateSync(){const e=(0,s._)`${p}.errors`;o.assign(e,null);assignValid(s.nil);return e}function assignValid(r=(t.async?(0,s._)`await `:s.nil)){const i=l.opts.passContext?a.default.this:a.default.self;const c=!("compile"in t&&!d||t.schema===false);o.assign(h,(0,s._)`${r}${(0,n.callValidateCode)(e,p,i,c)}`,t.modifying)}function reportErrs(e){var r;o.if((0,s.not)((r=t.valid)!==null&&r!==void 0?r:h),e)}}t.funcKeywordCode=funcKeywordCode;function modifyData(e){const{gen:t,data:r,it:a}=e;t.if(a.parentData,(()=>t.assign(r,(0,s._)`${a.parentData}[${a.parentDataProperty}]`)))}function addErrs(e,t){const{gen:r}=e;r.if((0,s._)`Array.isArray(${t})`,(()=>{r.assign(a.default.vErrors,(0,s._)`${a.default.vErrors} === null ? ${t} : ${a.default.vErrors}.concat(${t})`).assign(a.default.errors,(0,s._)`${a.default.vErrors}.length`);(0,o.extendErrors)(e)}),(()=>e.error()))}function checkAsyncKeyword({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function useKeyword(e,t,r){if(r===undefined)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,s.stringify)(r)})}function validSchemaType(e,t,r=false){return!t.length||t.some((t=>t==="array"?Array.isArray(e):t==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==t||r&&typeof e=="undefined"))}t.validSchemaType=validSchemaType;function validateKeywordUsage({schema:e,opts:t,self:r,errSchemaPath:s},a,n){if(Array.isArray(a.keyword)?!a.keyword.includes(n):a.keyword!==n){throw new Error("ajv implementation error")}const o=a.dependencies;if(o===null||o===void 0?void 0:o.some((t=>!Object.prototype.hasOwnProperty.call(e,t)))){throw new Error(`parent schema must have dependencies of ${n}: ${o.join(",")}`)}if(a.validateSchema){const o=a.validateSchema(e[n]);if(!o){const e=`keyword "${n}" value is invalid at path "${s}": `+r.errorsText(a.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(e);else throw new Error(e)}}}t.validateKeywordUsage=validateKeywordUsage},7390:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const s=r(4109);const a=r(7545);function getSubschema(e,{keyword:t,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:i,topSchemaRef:c}){if(t!==undefined&&n!==undefined){throw new Error('both "keyword" and "schema" passed, only one allowed')}if(t!==undefined){const n=e.schema[t];return r===undefined?{schema:n,schemaPath:(0,s._)`${e.schemaPath}${(0,s.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:n[r],schemaPath:(0,s._)`${e.schemaPath}${(0,s.getProperty)(t)}${(0,s.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,a.escapeFragment)(r)}`}}if(n!==undefined){if(o===undefined||i===undefined||c===undefined){throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"')}return{schema:n,schemaPath:o,topSchemaRef:c,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}t.getSubschema=getSubschema;function extendSubschemaData(e,t,{dataProp:r,dataPropType:n,data:o,dataTypes:i,propertyName:c}){if(o!==undefined&&r!==undefined){throw new Error('both "data" and "dataProp" passed, only one allowed')}const{gen:u}=t;if(r!==undefined){const{errorPath:o,dataPathArr:i,opts:c}=t;const d=u.let("data",(0,s._)`${t.data}${(0,s.getProperty)(r)}`,true);dataContextProps(d);e.errorPath=(0,s.str)`${o}${(0,a.getErrorPath)(r,n,c.jsPropertySyntax)}`;e.parentDataProperty=(0,s._)`${r}`;e.dataPathArr=[...i,e.parentDataProperty]}if(o!==undefined){const t=o instanceof s.Name?o:u.let("data",o,true);dataContextProps(t);if(c!==undefined)e.propertyName=c}if(i)e.dataTypes=i;function dataContextProps(r){e.data=r;e.dataLevel=t.dataLevel+1;e.dataTypes=[];t.definedProperties=new Set;e.parentData=t.data;e.dataNames=[...t.dataNames,r]}}t.extendSubschemaData=extendSubschemaData;function extendSubschemaMode(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:s,createErrors:a,allErrors:n}){if(s!==undefined)e.compositeRule=s;if(a!==undefined)e.createErrors=a;if(n!==undefined)e.allErrors=n;e.jtdDiscriminator=t;e.jtdMetadata=r}t.extendSubschemaMode=extendSubschemaMode},3834:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var s=r(7357);Object.defineProperty(t,"KeywordCxt",{enumerable:true,get:function(){return s.KeywordCxt}});var a=r(4109);Object.defineProperty(t,"_",{enumerable:true,get:function(){return a._}});Object.defineProperty(t,"str",{enumerable:true,get:function(){return a.str}});Object.defineProperty(t,"stringify",{enumerable:true,get:function(){return a.stringify}});Object.defineProperty(t,"nil",{enumerable:true,get:function(){return a.nil}});Object.defineProperty(t,"Name",{enumerable:true,get:function(){return a.Name}});Object.defineProperty(t,"CodeGen",{enumerable:true,get:function(){return a.CodeGen}});const n=r(5919);const o=r(9984);const i=r(521);const c=r(960);const u=r(4109);const d=r(3877);const l=r(3967);const f=r(7545);const p=r(7918);const h=r(4095);const defaultRegExp=(e,t)=>new RegExp(e,t);defaultRegExp.code="new RegExp";const m=["removeAdditional","useDefaults","coerceTypes"];const y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]);const g={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."};const v={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};const $=200;function requiredOptions(e){var t,r,s,a,n,o,i,c,u,d,l,f,p,m,y,g,v,b,w,E,S,P,C,x,k;const N=e.strict;const O=(t=e.code)===null||t===void 0?void 0:t.optimize;const R=O===true||O===undefined?1:O||0;const T=(s=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&s!==void 0?s:defaultRegExp;const j=(a=e.uriResolver)!==null&&a!==void 0?a:h.default;return{strictSchema:(o=(n=e.strictSchema)!==null&&n!==void 0?n:N)!==null&&o!==void 0?o:true,strictNumbers:(c=(i=e.strictNumbers)!==null&&i!==void 0?i:N)!==null&&c!==void 0?c:true,strictTypes:(d=(u=e.strictTypes)!==null&&u!==void 0?u:N)!==null&&d!==void 0?d:"log",strictTuples:(f=(l=e.strictTuples)!==null&&l!==void 0?l:N)!==null&&f!==void 0?f:"log",strictRequired:(m=(p=e.strictRequired)!==null&&p!==void 0?p:N)!==null&&m!==void 0?m:false,code:e.code?{...e.code,optimize:R,regExp:T}:{optimize:R,regExp:T},loopRequired:(y=e.loopRequired)!==null&&y!==void 0?y:$,loopEnum:(g=e.loopEnum)!==null&&g!==void 0?g:$,meta:(v=e.meta)!==null&&v!==void 0?v:true,messages:(b=e.messages)!==null&&b!==void 0?b:true,inlineRefs:(w=e.inlineRefs)!==null&&w!==void 0?w:true,schemaId:(E=e.schemaId)!==null&&E!==void 0?E:"$id",addUsedSchema:(S=e.addUsedSchema)!==null&&S!==void 0?S:true,validateSchema:(P=e.validateSchema)!==null&&P!==void 0?P:true,validateFormats:(C=e.validateFormats)!==null&&C!==void 0?C:true,unicodeRegExp:(x=e.unicodeRegExp)!==null&&x!==void 0?x:true,int32range:(k=e.int32range)!==null&&k!==void 0?k:true,uriResolver:j}}class Ajv{constructor(e={}){this.schemas={};this.refs={};this.formats={};this._compilations=new Set;this._loading={};this._cache=new Map;e=this.opts={...e,...requiredOptions(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new u.ValueScope({scope:{},prefixes:y,es5:t,lines:r});this.logger=getLogger(e.logger);const s=e.validateFormats;e.validateFormats=false;this.RULES=(0,i.getRules)();checkOptions.call(this,g,e,"NOT SUPPORTED");checkOptions.call(this,v,e,"DEPRECATED","warn");this._metaOpts=getMetaSchemaOptions.call(this);if(e.formats)addInitialFormats.call(this);this._addVocabularies();this._addDefaultMetaSchema();if(e.keywords)addInitialKeywords.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);addInitialSchemas.call(this);e.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:r}=this.opts;let s=p;if(r==="id"){s={...p};s.id=s.$id;delete s.$id}if(t&&e)this.addMetaSchema(s,s[r],false)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:undefined}validate(e,t){let r;if(typeof e=="string"){r=this.getSchema(e);if(!r)throw new Error(`no schema with key or ref "${e}"`)}else{r=this.compile(e)}const s=r(t);if(!("$async"in r))this.errors=r.errors;return s}compile(e,t){const r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function"){throw new Error("options.loadSchema should be a function")}const{loadSchema:r}=this.opts;return runCompileAsync.call(this,e,t);async function runCompileAsync(e,t){await loadMetaSchema.call(this,e.$schema);const r=this._addSchema(e,t);return r.validate||_compileAsync.call(this,r)}async function loadMetaSchema(e){if(e&&!this.getSchema(e)){await runCompileAsync.call(this,{$ref:e},true)}}async function _compileAsync(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof o.default))throw t;checkLoaded.call(this,t);await loadMissingSchema.call(this,t.missingSchema);return _compileAsync.call(this,e)}}function checkLoaded({missingSchema:e,missingRef:t}){if(this.refs[e]){throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}}async function loadMissingSchema(e){const r=await _loadSchema.call(this,e);if(!this.refs[e])await loadMetaSchema.call(this,r.$schema);if(!this.refs[e])this.addSchema(r,e,t)}async function _loadSchema(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,s=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,undefined,r,s);return this}let a;if(typeof e==="object"){const{schemaId:t}=this.opts;a=e[t];if(a!==undefined&&typeof a!="string"){throw new Error(`schema ${t} must be string`)}}t=(0,d.normalizeId)(t||a);this._checkUnique(t);this.schemas[t]=this._addSchema(e,r,t,s,true);return this}addMetaSchema(e,t,r=this.opts.validateSchema){this.addSchema(e,t,true,r);return this}validateSchema(e,t){if(typeof e=="boolean")return true;let r;r=e.$schema;if(r!==undefined&&typeof r!="string"){throw new Error("$schema must be a string")}r=r||this.opts.defaultMeta||this.defaultMeta();if(!r){this.logger.warn("meta-schema not available");this.errors=null;return true}const s=this.validate(r,e);if(!s&&t){const e="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(e);else throw new Error(e)}return s}getSchema(e){let t;while(typeof(t=getSchEnv.call(this,e))=="string")e=t;if(t===undefined){const{schemaId:r}=this.opts;const s=new c.SchemaEnv({schema:{},schemaId:r});t=c.resolveSchema.call(this,s,e);if(!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp){this._removeAllSchemas(this.schemas,e);this._removeAllSchemas(this.refs,e);return this}switch(typeof e){case"undefined":this._removeAllSchemas(this.schemas);this._removeAllSchemas(this.refs);this._cache.clear();return this;case"string":{const t=getSchEnv.call(this,e);if(typeof t=="object")this._cache.delete(t.schema);delete this.schemas[e];delete this.refs[e];return this}case"object":{const t=e;this._cache.delete(t);let r=e[this.opts.schemaId];if(r){r=(0,d.normalizeId)(r);delete this.schemas[r];delete this.refs[r]}return this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if(typeof e=="string"){r=e;if(typeof t=="object"){this.logger.warn("these parameters are deprecated, see docs for addKeyword");t.keyword=r}}else if(typeof e=="object"&&t===undefined){t=e;r=t.keyword;if(Array.isArray(r)&&!r.length){throw new Error("addKeywords: keyword must be string or non-empty array")}}else{throw new Error("invalid addKeywords parameters")}checkKeyword.call(this,r,t);if(!t){(0,f.eachItem)(r,(e=>addRule.call(this,e)));return this}keywordMetaschema.call(this,t);const s={...t,type:(0,l.getJSONTypes)(t.type),schemaType:(0,l.getJSONTypes)(t.schemaType)};(0,f.eachItem)(r,s.type.length===0?e=>addRule.call(this,e,s):e=>s.type.forEach((t=>addRule.call(this,e,s,t))));return this}getKeyword(e){const t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e];delete t.all[e];for(const r of t.rules){const t=r.rules.findIndex((t=>t.keyword===e));if(t>=0)r.rules.splice(t,1)}return this}addFormat(e,t){if(typeof t=="string")t=new RegExp(t);this.formats[e]=t;return this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){if(!e||e.length===0)return"No errors";return e.map((e=>`${r}${e.instancePath} ${e.message}`)).reduce(((e,r)=>e+t+r))}$dataMetaSchema(e,t){const r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const s of t){const t=s.split("/").slice(1);let a=e;for(const e of t)a=a[e];for(const e in r){const t=r[e];if(typeof t!="object")continue;const{$data:s}=t.definition;const n=a[e];if(s&&n)a[e]=schemaOrData(n)}}return e}_removeAllSchemas(e,t){for(const r in e){const s=e[r];if(!t||t.test(r)){if(typeof s=="string"){delete e[r]}else if(s&&!s.meta){this._cache.delete(s.schema);delete e[r]}}}}_addSchema(e,t,r,s=this.opts.validateSchema,a=this.opts.addUsedSchema){let n;const{schemaId:o}=this.opts;if(typeof e=="object"){n=e[o]}else{if(this.opts.jtd)throw new Error("schema must be object");else if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let i=this._cache.get(e);if(i!==undefined)return i;r=(0,d.normalizeId)(n||r);const u=d.getSchemaRefs.call(this,e,r);i=new c.SchemaEnv({schema:e,schemaId:o,meta:t,baseId:r,localRefs:u});this._cache.set(i.schema,i);if(a&&!r.startsWith("#")){if(r)this._checkUnique(r);this.refs[r]=i}if(s)this.validateSchema(e,true);return i}_checkUnique(e){if(this.schemas[e]||this.refs[e]){throw new Error(`schema with key or id "${e}" already exists`)}}_compileSchemaEnv(e){if(e.meta)this._compileMetaSchema(e);else c.compileSchema.call(this,e);if(!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,e)}finally{this.opts=t}}}t["default"]=Ajv;Ajv.ValidationError=n.default;Ajv.MissingRefError=o.default;function checkOptions(e,t,r,s="error"){for(const a in e){const n=a;if(n in t)this.logger[s](`${r}: option ${a}. ${e[n]}`)}}function getSchEnv(e){e=(0,d.normalizeId)(e);return this.schemas[e]||this.refs[e]}function addInitialSchemas(){const e=this.opts.schemas;if(!e)return;if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function addInitialFormats(){for(const e in this.opts.formats){const t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function addInitialKeywords(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];if(!r.keyword)r.keyword=t;this.addKeyword(r)}}function getMetaSchemaOptions(){const e={...this.opts};for(const t of m)delete e[t];return e}const b={log(){},warn(){},error(){}};function getLogger(e){if(e===false)return b;if(e===undefined)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}const w=/^[a-z_$][a-z0-9_$:-]*$/i;function checkKeyword(e,t){const{RULES:r}=this;(0,f.eachItem)(e,(e=>{if(r.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!w.test(e))throw new Error(`Keyword ${e} has invalid name`)}));if(!t)return;if(t.$data&&!("code"in t||"validate"in t)){throw new Error('$data keyword must have "code" or "validate" function')}}function addRule(e,t,r){var s;const a=t===null||t===void 0?void 0:t.post;if(r&&a)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:n}=this;let o=a?n.post:n.rules.find((({type:e})=>e===r));if(!o){o={type:r,rules:[]};n.rules.push(o)}n.keywords[e]=true;if(!t)return;const i={keyword:e,definition:{...t,type:(0,l.getJSONTypes)(t.type),schemaType:(0,l.getJSONTypes)(t.schemaType)}};if(t.before)addBeforeRule.call(this,o,i,t.before);else o.rules.push(i);n.all[e]=i;(s=t.implements)===null||s===void 0?void 0:s.forEach((e=>this.addKeyword(e)))}function addBeforeRule(e,t,r){const s=e.rules.findIndex((e=>e.keyword===r));if(s>=0){e.rules.splice(s,0,t)}else{e.rules.push(t);this.logger.warn(`rule ${r} is not defined`)}}function keywordMetaschema(e){let{metaSchema:t}=e;if(t===undefined)return;if(e.$data&&this.opts.$data)t=schemaOrData(t);e.validateSchema=this.compile(t,true)}const E={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function schemaOrData(e){return{anyOf:[e,E]}}},9987:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(7447);s.code='require("ajv/dist/runtime/equal").default';t["default"]=s},4624:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});function ucs2length(e){const t=e.length;let r=0;let s=0;let a;while(s=55296&&a<=56319&&s{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(199);s.code='require("ajv/dist/runtime/uri").default';t["default"]=s},5919:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});class ValidationError extends Error{constructor(e){super("validation failed");this.errors=e;this.ajv=this.validation=true}}t["default"]=ValidationError},8268:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.validateAdditionalItems=void 0;const s=r(4109);const a=r(7545);const n={message:({params:{len:e}})=>(0,s.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,s._)`{limit: ${e}}`};const o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:n,code(e){const{parentSchema:t,it:r}=e;const{items:s}=t;if(!Array.isArray(s)){(0,a.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}validateAdditionalItems(e,s)}};function validateAdditionalItems(e,t){const{gen:r,schema:n,data:o,keyword:i,it:c}=e;c.items=true;const u=r.const("len",(0,s._)`${o}.length`);if(n===false){e.setParams({len:t.length});e.pass((0,s._)`${u} <= ${t.length}`)}else if(typeof n=="object"&&!(0,a.alwaysValidSchema)(c,n)){const a=r.var("valid",(0,s._)`${u} <= ${t.length}`);r.if((0,s.not)(a),(()=>validateItems(a)));e.ok(a)}function validateItems(n){r.forRange("i",t.length,u,(t=>{e.subschema({keyword:i,dataProp:t,dataPropType:a.Type.Num},n);if(!c.allErrors)r.if((0,s.not)(n),(()=>r.break()))}))}}t.validateAdditionalItems=validateAdditionalItems;t["default"]=o},5506:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(6086);const a=r(4109);const n=r(4492);const o=r(7545);const i={message:"must NOT have additional properties",params:({params:e})=>(0,a._)`{additionalProperty: ${e.additionalProperty}}`};const c={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:true,trackErrors:true,error:i,code(e){const{gen:t,schema:r,parentSchema:i,data:c,errsCount:u,it:d}=e;if(!u)throw new Error("ajv implementation error");const{allErrors:l,opts:f}=d;d.props=true;if(f.removeAdditional!=="all"&&(0,o.alwaysValidSchema)(d,r))return;const p=(0,s.allSchemaProperties)(i.properties);const h=(0,s.allSchemaProperties)(i.patternProperties);checkAdditionalProperties();e.ok((0,a._)`${u} === ${n.default.errors}`);function checkAdditionalProperties(){t.forIn("key",c,(e=>{if(!p.length&&!h.length)additionalPropertyCode(e);else t.if(isAdditional(e),(()=>additionalPropertyCode(e)))}))}function isAdditional(r){let n;if(p.length>8){const e=(0,o.schemaRefOrVal)(d,i.properties,"properties");n=(0,s.isOwnProperty)(t,e,r)}else if(p.length){n=(0,a.or)(...p.map((e=>(0,a._)`${r} === ${e}`)))}else{n=a.nil}if(h.length){n=(0,a.or)(n,...h.map((t=>(0,a._)`${(0,s.usePattern)(e,t)}.test(${r})`)))}return(0,a.not)(n)}function deleteAdditional(e){t.code((0,a._)`delete ${c}[${e}]`)}function additionalPropertyCode(s){if(f.removeAdditional==="all"||f.removeAdditional&&r===false){deleteAdditional(s);return}if(r===false){e.setParams({additionalProperty:s});e.error();if(!l)t.break();return}if(typeof r=="object"&&!(0,o.alwaysValidSchema)(d,r)){const r=t.name("valid");if(f.removeAdditional==="failing"){applyAdditionalSchema(s,r,false);t.if((0,a.not)(r),(()=>{e.reset();deleteAdditional(s)}))}else{applyAdditionalSchema(s,r);if(!l)t.if((0,a.not)(r),(()=>t.break()))}}}function applyAdditionalSchema(t,r,s){const a={keyword:"additionalProperties",dataProp:t,dataPropType:o.Type.Str};if(s===false){Object.assign(a,{compositeRule:true,createErrors:false,allErrors:false})}e.subschema(a,r)}}};t["default"]=c},2962:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(7545);const a={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:a}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const n=t.name("valid");r.forEach(((t,r)=>{if((0,s.alwaysValidSchema)(a,t))return;const o=e.subschema({keyword:"allOf",schemaProp:r},n);e.ok(n);e.mergeEvaluated(o)}))}};t["default"]=a},1549:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(6086);const a={keyword:"anyOf",schemaType:"array",trackErrors:true,code:s.validateUnion,error:{message:"must match a schema in anyOf"}};t["default"]=a},9251:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(4109);const a=r(7545);const n={message:({params:{min:e,max:t}})=>t===undefined?(0,s.str)`must contain at least ${e} valid item(s)`:(0,s.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===undefined?(0,s._)`{minContains: ${e}}`:(0,s._)`{minContains: ${e}, maxContains: ${t}}`};const o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:true,error:n,code(e){const{gen:t,schema:r,parentSchema:n,data:o,it:i}=e;let c;let u;const{minContains:d,maxContains:l}=n;if(i.opts.next){c=d===undefined?1:d;u=l}else{c=1}const f=t.const("len",(0,s._)`${o}.length`);e.setParams({min:c,max:u});if(u===undefined&&c===0){(0,a.checkStrictMode)(i,`"minContains" == 0 without "maxContains": "contains" keyword ignored`);return}if(u!==undefined&&c>u){(0,a.checkStrictMode)(i,`"minContains" > "maxContains" is always invalid`);e.fail();return}if((0,a.alwaysValidSchema)(i,r)){let t=(0,s._)`${f} >= ${c}`;if(u!==undefined)t=(0,s._)`${t} && ${f} <= ${u}`;e.pass(t);return}i.items=true;const p=t.name("valid");if(u===undefined&&c===1){validateItems(p,(()=>t.if(p,(()=>t.break()))))}else if(c===0){t.let(p,true);if(u!==undefined)t.if((0,s._)`${o}.length > 0`,validateItemsWithCount)}else{t.let(p,false);validateItemsWithCount()}e.result(p,(()=>e.reset()));function validateItemsWithCount(){const e=t.name("_valid");const r=t.let("count",0);validateItems(e,(()=>t.if(e,(()=>checkLimits(r)))))}function validateItems(r,s){t.forRange("i",0,f,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:a.Type.Num,compositeRule:true},r);s()}))}function checkLimits(e){t.code((0,s._)`${e}++`);if(u===undefined){t.if((0,s._)`${e} >= ${c}`,(()=>t.assign(p,true).break()))}else{t.if((0,s._)`${e} > ${u}`,(()=>t.assign(p,false).break()));if(c===1)t.assign(p,true);else t.if((0,s._)`${e} >= ${c}`,(()=>t.assign(p,true)))}}}};t["default"]=o},8243:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const s=r(4109);const a=r(7545);const n=r(6086);t.error={message:({params:{property:e,depsCount:t,deps:r}})=>{const a=t===1?"property":"properties";return(0,s.str)`must have ${a} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:a}})=>(0,s._)`{property: ${e}, - missingProperty: ${a}, - depsCount: ${t}, - deps: ${r}}`};const o={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,r]=splitDependencies(e);validatePropertyDeps(e,t);validateSchemaDeps(e,r)}};function splitDependencies({schema:e}){const t={};const r={};for(const s in e){if(s==="__proto__")continue;const a=Array.isArray(e[s])?t:r;a[s]=e[s]}return[t,r]}function validatePropertyDeps(e,t=e.schema){const{gen:r,data:a,it:o}=e;if(Object.keys(t).length===0)return;const i=r.let("missing");for(const c in t){const u=t[c];if(u.length===0)continue;const d=(0,n.propertyInData)(r,a,c,o.opts.ownProperties);e.setParams({property:c,depsCount:u.length,deps:u.join(", ")});if(o.allErrors){r.if(d,(()=>{for(const t of u){(0,n.checkReportMissingProp)(e,t)}}))}else{r.if((0,s._)`${d} && (${(0,n.checkMissingProp)(e,u,i)})`);(0,n.reportMissingProp)(e,i);r.else()}}}t.validatePropertyDeps=validatePropertyDeps;function validateSchemaDeps(e,t=e.schema){const{gen:r,data:s,keyword:o,it:i}=e;const c=r.name("valid");for(const u in t){if((0,a.alwaysValidSchema)(i,t[u]))continue;r.if((0,n.propertyInData)(r,s,u,i.opts.ownProperties),(()=>{const t=e.subschema({keyword:o,schemaProp:u},c);e.mergeValidEvaluated(t,c)}),(()=>r.var(c,true)));e.ok(c)}}t.validateSchemaDeps=validateSchemaDeps;t["default"]=o},2062:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(4109);const a=r(7545);const n={message:({params:e})=>(0,s.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,s._)`{failingKeyword: ${e.ifClause}}`};const o={keyword:"if",schemaType:["object","boolean"],trackErrors:true,error:n,code(e){const{gen:t,parentSchema:r,it:n}=e;if(r.then===undefined&&r.else===undefined){(0,a.checkStrictMode)(n,'"if" without "then" and "else" is ignored')}const o=hasSchema(n,"then");const i=hasSchema(n,"else");if(!o&&!i)return;const c=t.let("valid",true);const u=t.name("_valid");validateIf();e.reset();if(o&&i){const r=t.let("ifClause");e.setParams({ifClause:r});t.if(u,validateClause("then",r),validateClause("else",r))}else if(o){t.if(u,validateClause("then"))}else{t.if((0,s.not)(u),validateClause("else"))}e.pass(c,(()=>e.error(true)));function validateIf(){const t=e.subschema({keyword:"if",compositeRule:true,createErrors:false,allErrors:false},u);e.mergeEvaluated(t)}function validateClause(r,a){return()=>{const n=e.subschema({keyword:r},u);t.assign(c,u);e.mergeValidEvaluated(n,c);if(a)t.assign(a,(0,s._)`${r}`);else e.setParams({ifClause:r})}}}};function hasSchema(e,t){const r=e.schema[t];return r!==undefined&&!(0,a.alwaysValidSchema)(e,r)}t["default"]=o},4576:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(8268);const a=r(6282);const n=r(1198);const o=r(4437);const i=r(9251);const c=r(8243);const u=r(7558);const d=r(5506);const l=r(6096);const f=r(4496);const p=r(7676);const h=r(1549);const m=r(4201);const y=r(2962);const g=r(2062);const v=r(6918);function getApplicator(e=false){const t=[p.default,h.default,m.default,y.default,g.default,v.default,u.default,d.default,c.default,l.default,f.default];if(e)t.push(a.default,o.default);else t.push(s.default,n.default);t.push(i.default);return t}t["default"]=getApplicator},1198:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.validateTuple=void 0;const s=r(4109);const a=r(7545);const n=r(6086);const o={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return validateTuple(e,"additionalItems",t);r.items=true;if((0,a.alwaysValidSchema)(r,t))return;e.ok((0,n.validateArray)(e))}};function validateTuple(e,t,r=e.schema){const{gen:n,parentSchema:o,data:i,keyword:c,it:u}=e;checkStrictTuple(o);if(u.opts.unevaluated&&r.length&&u.items!==true){u.items=a.mergeEvaluated.items(n,r.length,u.items)}const d=n.name("valid");const l=n.const("len",(0,s._)`${i}.length`);r.forEach(((t,r)=>{if((0,a.alwaysValidSchema)(u,t))return;n.if((0,s._)`${l} > ${r}`,(()=>e.subschema({keyword:c,schemaProp:r,dataProp:r},d)));e.ok(d)}));function checkStrictTuple(e){const{opts:s,errSchemaPath:n}=u;const o=r.length;const i=o===e.minItems&&(o===e.maxItems||e[t]===false);if(s.strictTuples&&!i){const e=`"${c}" is ${o}-tuple, but minItems or maxItems/${t} are not specified or different at path "${n}"`;(0,a.checkStrictMode)(u,e,s.strictTuples)}}}t.validateTuple=validateTuple;t["default"]=o},4437:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(4109);const a=r(7545);const n=r(6086);const o=r(8268);const i={message:({params:{len:e}})=>(0,s.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,s._)`{limit: ${e}}`};const c={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:i,code(e){const{schema:t,parentSchema:r,it:s}=e;const{prefixItems:i}=r;s.items=true;if((0,a.alwaysValidSchema)(s,t))return;if(i)(0,o.validateAdditionalItems)(e,i);else e.ok((0,n.validateArray)(e))}};t["default"]=c},7676:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(7545);const a={keyword:"not",schemaType:["object","boolean"],trackErrors:true,code(e){const{gen:t,schema:r,it:a}=e;if((0,s.alwaysValidSchema)(a,r)){e.fail();return}const n=t.name("valid");e.subschema({keyword:"not",compositeRule:true,createErrors:false,allErrors:false},n);e.failResult(n,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};t["default"]=a},4201:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(4109);const a=r(7545);const n={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,s._)`{passingSchemas: ${e.passing}}`};const o={keyword:"oneOf",schemaType:"array",trackErrors:true,error:n,code(e){const{gen:t,schema:r,parentSchema:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;const i=r;const c=t.let("valid",false);const u=t.let("passing",null);const d=t.name("_valid");e.setParams({passing:u});t.block(validateOneOf);e.result(c,(()=>e.reset()),(()=>e.error(true)));function validateOneOf(){i.forEach(((r,n)=>{let i;if((0,a.alwaysValidSchema)(o,r)){t.var(d,true)}else{i=e.subschema({keyword:"oneOf",schemaProp:n,compositeRule:true},d)}if(n>0){t.if((0,s._)`${d} && ${c}`).assign(c,false).assign(u,(0,s._)`[${u}, ${n}]`).else()}t.if(d,(()=>{t.assign(c,true);t.assign(u,n);if(i)e.mergeEvaluated(i,s.Name)}))}))}}};t["default"]=o},4496:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(6086);const a=r(4109);const n=r(7545);const o=r(7545);const i={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:i,parentSchema:c,it:u}=e;const{opts:d}=u;const l=(0,s.allSchemaProperties)(r);const f=l.filter((e=>(0,n.alwaysValidSchema)(u,r[e])));if(l.length===0||f.length===l.length&&(!u.opts.unevaluated||u.props===true)){return}const p=d.strictSchema&&!d.allowMatchingProperties&&c.properties;const h=t.name("valid");if(u.props!==true&&!(u.props instanceof a.Name)){u.props=(0,o.evaluatedPropsToName)(t,u.props)}const{props:m}=u;validatePatternProperties();function validatePatternProperties(){for(const e of l){if(p)checkMatchingProperties(e);if(u.allErrors){validateProperties(e)}else{t.var(h,true);validateProperties(e);t.if(h)}}}function checkMatchingProperties(e){for(const t in p){if(new RegExp(e).test(t)){(0,n.checkStrictMode)(u,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}}}function validateProperties(r){t.forIn("key",i,(n=>{t.if((0,a._)`${(0,s.usePattern)(e,r)}.test(${n})`,(()=>{const s=f.includes(r);if(!s){e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:n,dataPropType:o.Type.Str},h)}if(u.opts.unevaluated&&m!==true){t.assign((0,a._)`${m}[${n}]`,true)}else if(!s&&!u.allErrors){t.if((0,a.not)(h),(()=>t.break()))}}))}))}}};t["default"]=i},6282:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(1198);const a={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,s.validateTuple)(e,"items")};t["default"]=a},6096:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(7357);const a=r(6086);const n=r(7545);const o=r(5506);const i={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,parentSchema:i,data:c,it:u}=e;if(u.opts.removeAdditional==="all"&&i.additionalProperties===undefined){o.default.code(new s.KeywordCxt(u,o.default,"additionalProperties"))}const d=(0,a.allSchemaProperties)(r);for(const e of d){u.definedProperties.add(e)}if(u.opts.unevaluated&&d.length&&u.props!==true){u.props=n.mergeEvaluated.props(t,(0,n.toHash)(d),u.props)}const l=d.filter((e=>!(0,n.alwaysValidSchema)(u,r[e])));if(l.length===0)return;const f=t.name("valid");for(const r of l){if(hasDefault(r)){applyPropertySchema(r)}else{t.if((0,a.propertyInData)(t,c,r,u.opts.ownProperties));applyPropertySchema(r);if(!u.allErrors)t.else().var(f,true);t.endIf()}e.it.definedProperties.add(r);e.ok(f)}function hasDefault(e){return u.opts.useDefaults&&!u.compositeRule&&r[e].default!==undefined}function applyPropertySchema(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},f)}}};t["default"]=i},7558:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(4109);const a=r(7545);const n={message:"property name must be valid",params:({params:e})=>(0,s._)`{propertyName: ${e.propertyName}}`};const o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:n,code(e){const{gen:t,schema:r,data:n,it:o}=e;if((0,a.alwaysValidSchema)(o,r))return;const i=t.name("valid");t.forIn("key",n,(r=>{e.setParams({propertyName:r});e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:true},i);t.if((0,s.not)(i),(()=>{e.error(true);if(!o.allErrors)t.break()}))}));e.ok(i)}};t["default"]=o},6918:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(7545);const a={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===undefined)(0,s.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};t["default"]=a},6086:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const s=r(4109);const a=r(7545);const n=r(4492);const o=r(7545);function checkReportMissingProp(e,t){const{gen:r,data:a,it:n}=e;r.if(noPropertyInData(r,a,t,n.opts.ownProperties),(()=>{e.setParams({missingProperty:(0,s._)`${t}`},true);e.error()}))}t.checkReportMissingProp=checkReportMissingProp;function checkMissingProp({gen:e,data:t,it:{opts:r}},a,n){return(0,s.or)(...a.map((a=>(0,s.and)(noPropertyInData(e,t,a,r.ownProperties),(0,s._)`${n} = ${a}`))))}t.checkMissingProp=checkMissingProp;function reportMissingProp(e,t){e.setParams({missingProperty:t},true);e.error()}t.reportMissingProp=reportMissingProp;function hasPropFunc(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,s._)`Object.prototype.hasOwnProperty`})}t.hasPropFunc=hasPropFunc;function isOwnProperty(e,t,r){return(0,s._)`${hasPropFunc(e)}.call(${t}, ${r})`}t.isOwnProperty=isOwnProperty;function propertyInData(e,t,r,a){const n=(0,s._)`${t}${(0,s.getProperty)(r)} !== undefined`;return a?(0,s._)`${n} && ${isOwnProperty(e,t,r)}`:n}t.propertyInData=propertyInData;function noPropertyInData(e,t,r,a){const n=(0,s._)`${t}${(0,s.getProperty)(r)} === undefined`;return a?(0,s.or)(n,(0,s.not)(isOwnProperty(e,t,r))):n}t.noPropertyInData=noPropertyInData;function allSchemaProperties(e){return e?Object.keys(e).filter((e=>e!=="__proto__")):[]}t.allSchemaProperties=allSchemaProperties;function schemaProperties(e,t){return allSchemaProperties(t).filter((r=>!(0,a.alwaysValidSchema)(e,t[r])))}t.schemaProperties=schemaProperties;function callValidateCode({schemaCode:e,data:t,it:{gen:r,topSchemaRef:a,schemaPath:o,errorPath:i},it:c},u,d,l){const f=l?(0,s._)`${e}, ${t}, ${a}${o}`:t;const p=[[n.default.instancePath,(0,s.strConcat)(n.default.instancePath,i)],[n.default.parentData,c.parentData],[n.default.parentDataProperty,c.parentDataProperty],[n.default.rootData,n.default.rootData]];if(c.opts.dynamicRef)p.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);const h=(0,s._)`${f}, ${r.object(...p)}`;return d!==s.nil?(0,s._)`${u}.call(${d}, ${h})`:(0,s._)`${u}(${h})`}t.callValidateCode=callValidateCode;const i=(0,s._)`new RegExp`;function usePattern({gen:e,it:{opts:t}},r){const a=t.unicodeRegExp?"u":"";const{regExp:n}=t.code;const c=n(r,a);return e.scopeValue("pattern",{key:c.toString(),ref:c,code:(0,s._)`${n.code==="new RegExp"?i:(0,o.useFunc)(e,n)}(${r}, ${a})`})}t.usePattern=usePattern;function validateArray(e){const{gen:t,data:r,keyword:n,it:o}=e;const i=t.name("valid");if(o.allErrors){const e=t.let("valid",true);validateItems((()=>t.assign(e,false)));return e}t.var(i,true);validateItems((()=>t.break()));return i;function validateItems(o){const c=t.const("len",(0,s._)`${r}.length`);t.forRange("i",0,c,(r=>{e.subschema({keyword:n,dataProp:r,dataPropType:a.Type.Num},i);t.if((0,s.not)(i),o)}))}}t.validateArray=validateArray;function validateUnion(e){const{gen:t,schema:r,keyword:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const i=r.some((e=>(0,a.alwaysValidSchema)(o,e)));if(i&&!o.opts.unevaluated)return;const c=t.let("valid",false);const u=t.name("_valid");t.block((()=>r.forEach(((r,a)=>{const o=e.subschema({keyword:n,schemaProp:a,compositeRule:true},u);t.assign(c,(0,s._)`${c} || ${u}`);const i=e.mergeValidEvaluated(o,u);if(!i)t.if((0,s.not)(c))}))));e.result(c,(()=>e.reset()),(()=>e.error(true)))}t.validateUnion=validateUnion},8795:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const r={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t["default"]=r},9827:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(8795);const a=r(9873);const n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",s.default,a.default];t["default"]=n},9873:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.callRef=t.getValidate=void 0;const s=r(9984);const a=r(6086);const n=r(4109);const o=r(4492);const i=r(960);const c=r(7545);const u={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:a}=e;const{baseId:o,schemaEnv:c,validateName:u,opts:d,self:l}=a;const{root:f}=c;if((r==="#"||r==="#/")&&o===f.baseId)return callRootRef();const p=i.resolveRef.call(l,f,o,r);if(p===undefined)throw new s.default(a.opts.uriResolver,o,r);if(p instanceof i.SchemaEnv)return callValidate(p);return inlineRefSchema(p);function callRootRef(){if(c===f)return callRef(e,u,c,c.$async);const r=t.scopeValue("root",{ref:f});return callRef(e,(0,n._)`${r}.validate`,f,f.$async)}function callValidate(t){const r=getValidate(e,t);callRef(e,r,t,t.$async)}function inlineRefSchema(s){const a=t.scopeValue("schema",d.code.source===true?{ref:s,code:(0,n.stringify)(s)}:{ref:s});const o=t.name("valid");const i=e.subschema({schema:s,dataTypes:[],schemaPath:n.nil,topSchemaRef:a,errSchemaPath:r},o);e.mergeEvaluated(i);e.ok(o)}}};function getValidate(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,n._)`${r.scopeValue("wrapper",{ref:t})}.validate`}t.getValidate=getValidate;function callRef(e,t,r,s){const{gen:i,it:u}=e;const{allErrors:d,schemaEnv:l,opts:f}=u;const p=f.passContext?o.default.this:n.nil;if(s)callAsyncRef();else callSyncRef();function callAsyncRef(){if(!l.$async)throw new Error("async schema referenced by sync schema");const r=i.let("valid");i.try((()=>{i.code((0,n._)`await ${(0,a.callValidateCode)(e,t,p)}`);addEvaluatedFrom(t);if(!d)i.assign(r,true)}),(e=>{i.if((0,n._)`!(${e} instanceof ${u.ValidationError})`,(()=>i.throw(e)));addErrorsFrom(e);if(!d)i.assign(r,false)}));e.ok(r)}function callSyncRef(){e.result((0,a.callValidateCode)(e,t,p),(()=>addEvaluatedFrom(t)),(()=>addErrorsFrom(t)))}function addErrorsFrom(e){const t=(0,n._)`${e}.errors`;i.assign(o.default.vErrors,(0,n._)`${o.default.vErrors} === null ? ${t} : ${o.default.vErrors}.concat(${t})`);i.assign(o.default.errors,(0,n._)`${o.default.vErrors}.length`)}function addEvaluatedFrom(e){var t;if(!u.opts.unevaluated)return;const s=(t=r===null||r===void 0?void 0:r.validate)===null||t===void 0?void 0:t.evaluated;if(u.props!==true){if(s&&!s.dynamicProps){if(s.props!==undefined){u.props=c.mergeEvaluated.props(i,s.props,u.props)}}else{const t=i.var("props",(0,n._)`${e}.evaluated.props`);u.props=c.mergeEvaluated.props(i,t,u.props,n.Name)}}if(u.items!==true){if(s&&!s.dynamicItems){if(s.items!==undefined){u.items=c.mergeEvaluated.items(i,s.items,u.items)}}else{const t=i.var("items",(0,n._)`${e}.evaluated.items`);u.items=c.mergeEvaluated.items(i,t,u.items,n.Name)}}}}t.callRef=callRef;t["default"]=u},8222:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(4109);const a=r(3547);const n=r(960);const o=r(7545);const i={message:({params:{discrError:e,tagName:t}})=>e===a.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,s._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`};const c={keyword:"discriminator",type:"object",schemaType:"object",error:i,code(e){const{gen:t,data:r,schema:i,parentSchema:c,it:u}=e;const{oneOf:d}=c;if(!u.opts.discriminator){throw new Error("discriminator: requires discriminator option")}const l=i.propertyName;if(typeof l!="string")throw new Error("discriminator: requires propertyName");if(i.mapping)throw new Error("discriminator: mapping is not supported");if(!d)throw new Error("discriminator: requires oneOf keyword");const f=t.let("valid",false);const p=t.const("tag",(0,s._)`${r}${(0,s.getProperty)(l)}`);t.if((0,s._)`typeof ${p} == "string"`,(()=>validateMapping()),(()=>e.error(false,{discrError:a.DiscrError.Tag,tag:p,tagName:l})));e.ok(f);function validateMapping(){const r=getMapping();t.if(false);for(const e in r){t.elseIf((0,s._)`${p} === ${e}`);t.assign(f,applyTagSchema(r[e]))}t.else();e.error(false,{discrError:a.DiscrError.Mapping,tag:p,tagName:l});t.endIf()}function applyTagSchema(r){const a=t.name("valid");const n=e.subschema({keyword:"oneOf",schemaProp:r},a);e.mergeEvaluated(n,s.Name);return a}function getMapping(){var e;const t={};const r=hasRequired(c);let s=true;for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.DiscrError=void 0;var r;(function(e){e["Tag"]="tag";e["Mapping"]="mapping"})(r=t.DiscrError||(t.DiscrError={}))},8056:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(9827);const a=r(4463);const n=r(4576);const o=r(7596);const i=r(1654);const c=[s.default,a.default,(0,n.default)(),o.default,i.metadataVocabulary,i.contentVocabulary];t["default"]=c},3875:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(4109);const a={message:({schemaCode:e})=>(0,s.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,s._)`{format: ${e}}`};const n={keyword:"format",type:["number","string"],schemaType:"string",$data:true,error:a,code(e,t){const{gen:r,data:a,$data:n,schema:o,schemaCode:i,it:c}=e;const{opts:u,errSchemaPath:d,schemaEnv:l,self:f}=c;if(!u.validateFormats)return;if(n)validate$DataFormat();else validateFormat();function validate$DataFormat(){const n=r.scopeValue("formats",{ref:f.formats,code:u.code.formats});const o=r.const("fDef",(0,s._)`${n}[${i}]`);const c=r.let("fType");const d=r.let("format");r.if((0,s._)`typeof ${o} == "object" && !(${o} instanceof RegExp)`,(()=>r.assign(c,(0,s._)`${o}.type || "string"`).assign(d,(0,s._)`${o}.validate`)),(()=>r.assign(c,(0,s._)`"string"`).assign(d,o)));e.fail$data((0,s.or)(unknownFmt(),invalidFmt()));function unknownFmt(){if(u.strictSchema===false)return s.nil;return(0,s._)`${i} && !${d}`}function invalidFmt(){const e=l.$async?(0,s._)`(${o}.async ? await ${d}(${a}) : ${d}(${a}))`:(0,s._)`${d}(${a})`;const r=(0,s._)`(typeof ${d} == "function" ? ${e} : ${d}.test(${a}))`;return(0,s._)`${d} && ${d} !== true && ${c} === ${t} && !${r}`}}function validateFormat(){const n=f.formats[o];if(!n){unknownFormat();return}if(n===true)return;const[i,c,p]=getFormat(n);if(i===t)e.pass(validCondition());function unknownFormat(){if(u.strictSchema===false){f.logger.warn(unknownMsg());return}throw new Error(unknownMsg());function unknownMsg(){return`unknown format "${o}" ignored in schema at path "${d}"`}}function getFormat(e){const t=e instanceof RegExp?(0,s.regexpCode)(e):u.code.formats?(0,s._)`${u.code.formats}${(0,s.getProperty)(o)}`:undefined;const a=r.scopeValue("formats",{key:o,ref:e,code:t});if(typeof e=="object"&&!(e instanceof RegExp)){return[e.type||"string",e.validate,(0,s._)`${a}.validate`]}return["string",e,a]}function validCondition(){if(typeof n=="object"&&!(n instanceof RegExp)&&n.async){if(!l.$async)throw new Error("async format in sync schema");return(0,s._)`await ${p}(${a})`}return typeof c=="function"?(0,s._)`${p}(${a})`:(0,s._)`${p}.test(${a})`}}}};t["default"]=n},7596:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(3875);const a=[s.default];t["default"]=a},1654:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.contentVocabulary=t.metadataVocabulary=void 0;t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},3838:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(4109);const a=r(7545);const n=r(9987);const o={message:"must be equal to constant",params:({schemaCode:e})=>(0,s._)`{allowedValue: ${e}}`};const i={keyword:"const",$data:true,error:o,code(e){const{gen:t,data:r,$data:o,schemaCode:i,schema:c}=e;if(o||c&&typeof c=="object"){e.fail$data((0,s._)`!${(0,a.useFunc)(t,n.default)}(${r}, ${i})`)}else{e.fail((0,s._)`${c} !== ${r}`)}}};t["default"]=i},6923:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(4109);const a=r(7545);const n=r(9987);const o={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,s._)`{allowedValues: ${e}}`};const i={keyword:"enum",schemaType:"array",$data:true,error:o,code(e){const{gen:t,data:r,$data:o,schema:i,schemaCode:c,it:u}=e;if(!o&&i.length===0)throw new Error("enum must have non-empty array");const d=i.length>=u.opts.loopEnum;let l;const getEql=()=>l!==null&&l!==void 0?l:l=(0,a.useFunc)(t,n.default);let f;if(d||o){f=t.let("valid");e.block$data(f,loopEnum)}else{if(!Array.isArray(i))throw new Error("ajv implementation error");const e=t.const("vSchema",c);f=(0,s.or)(...i.map(((t,r)=>equalCode(e,r))))}e.pass(f);function loopEnum(){t.assign(f,false);t.forOf("v",c,(e=>t.if((0,s._)`${getEql()}(${r}, ${e})`,(()=>t.assign(f,true).break()))))}function equalCode(e,t){const a=i[t];return typeof a==="object"&&a!==null?(0,s._)`${getEql()}(${r}, ${e}[${t}])`:(0,s._)`${r} === ${a}`}}};t["default"]=i},4463:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(6974);const a=r(873);const n=r(5534);const o=r(6880);const i=r(490);const c=r(1022);const u=r(3480);const d=r(4214);const l=r(3838);const f=r(6923);const p=[s.default,a.default,n.default,o.default,i.default,c.default,u.default,d.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},l.default,f.default];t["default"]=p},3480:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(4109);const a={message({keyword:e,schemaCode:t}){const r=e==="maxItems"?"more":"fewer";return(0,s.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,s._)`{limit: ${e}}`};const n={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:true,error:a,code(e){const{keyword:t,data:r,schemaCode:a}=e;const n=t==="maxItems"?s.operators.GT:s.operators.LT;e.fail$data((0,s._)`${r}.length ${n} ${a}`)}};t["default"]=n},5534:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(4109);const a=r(7545);const n=r(4624);const o={message({keyword:e,schemaCode:t}){const r=e==="maxLength"?"more":"fewer";return(0,s.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,s._)`{limit: ${e}}`};const i={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:true,error:o,code(e){const{keyword:t,data:r,schemaCode:o,it:i}=e;const c=t==="maxLength"?s.operators.GT:s.operators.LT;const u=i.opts.unicode===false?(0,s._)`${r}.length`:(0,s._)`${(0,a.useFunc)(e.gen,n.default)}(${r})`;e.fail$data((0,s._)`${u} ${c} ${o}`)}};t["default"]=i},6974:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(4109);const a=s.operators;const n={maximum:{okStr:"<=",ok:a.LTE,fail:a.GT},minimum:{okStr:">=",ok:a.GTE,fail:a.LT},exclusiveMaximum:{okStr:"<",ok:a.LT,fail:a.GTE},exclusiveMinimum:{okStr:">",ok:a.GT,fail:a.LTE}};const o={message:({keyword:e,schemaCode:t})=>(0,s.str)`must be ${n[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,s._)`{comparison: ${n[e].okStr}, limit: ${t}}`};const i={keyword:Object.keys(n),type:"number",schemaType:"number",$data:true,error:o,code(e){const{keyword:t,data:r,schemaCode:a}=e;e.fail$data((0,s._)`${r} ${n[t].fail} ${a} || isNaN(${r})`)}};t["default"]=i},490:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(4109);const a={message({keyword:e,schemaCode:t}){const r=e==="maxProperties"?"more":"fewer";return(0,s.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,s._)`{limit: ${e}}`};const n={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:true,error:a,code(e){const{keyword:t,data:r,schemaCode:a}=e;const n=t==="maxProperties"?s.operators.GT:s.operators.LT;e.fail$data((0,s._)`Object.keys(${r}).length ${n} ${a}`)}};t["default"]=n},873:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(4109);const a={message:({schemaCode:e})=>(0,s.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,s._)`{multipleOf: ${e}}`};const n={keyword:"multipleOf",type:"number",schemaType:"number",$data:true,error:a,code(e){const{gen:t,data:r,schemaCode:a,it:n}=e;const o=n.opts.multipleOfPrecision;const i=t.let("res");const c=o?(0,s._)`Math.abs(Math.round(${i}) - ${i}) > 1e-${o}`:(0,s._)`${i} !== parseInt(${i})`;e.fail$data((0,s._)`(${a} === 0 || (${i} = ${r}/${a}, ${c}))`)}};t["default"]=n},6880:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(6086);const a=r(4109);const n={message:({schemaCode:e})=>(0,a.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,a._)`{pattern: ${e}}`};const o={keyword:"pattern",type:"string",schemaType:"string",$data:true,error:n,code(e){const{data:t,$data:r,schema:n,schemaCode:o,it:i}=e;const c=i.opts.unicodeRegExp?"u":"";const u=r?(0,a._)`(new RegExp(${o}, ${c}))`:(0,s.usePattern)(e,n);e.fail$data((0,a._)`!${u}.test(${t})`)}};t["default"]=o},1022:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(6086);const a=r(4109);const n=r(7545);const o={message:({params:{missingProperty:e}})=>(0,a.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,a._)`{missingProperty: ${e}}`};const i={keyword:"required",type:"object",schemaType:"array",$data:true,error:o,code(e){const{gen:t,schema:r,schemaCode:o,data:i,$data:c,it:u}=e;const{opts:d}=u;if(!c&&r.length===0)return;const l=r.length>=d.loopRequired;if(u.allErrors)allErrorsMode();else exitOnErrorMode();if(d.strictRequired){const t=e.parentSchema.properties;const{definedProperties:s}=e.it;for(const e of r){if((t===null||t===void 0?void 0:t[e])===undefined&&!s.has(e)){const t=u.schemaEnv.baseId+u.errSchemaPath;const r=`required property "${e}" is not defined at "${t}" (strictRequired)`;(0,n.checkStrictMode)(u,r,u.opts.strictRequired)}}}function allErrorsMode(){if(l||c){e.block$data(a.nil,loopAllRequired)}else{for(const t of r){(0,s.checkReportMissingProp)(e,t)}}}function exitOnErrorMode(){const a=t.let("missing");if(l||c){const r=t.let("valid",true);e.block$data(r,(()=>loopUntilMissing(a,r)));e.ok(r)}else{t.if((0,s.checkMissingProp)(e,r,a));(0,s.reportMissingProp)(e,a);t.else()}}function loopAllRequired(){t.forOf("prop",o,(r=>{e.setParams({missingProperty:r});t.if((0,s.noPropertyInData)(t,i,r,d.ownProperties),(()=>e.error()))}))}function loopUntilMissing(r,n){e.setParams({missingProperty:r});t.forOf(r,o,(()=>{t.assign(n,(0,s.propertyInData)(t,i,r,d.ownProperties));t.if((0,a.not)(n),(()=>{e.error();t.break()}))}),a.nil)}}};t["default"]=i},4214:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(3967);const a=r(4109);const n=r(7545);const o=r(9987);const i={message:({params:{i:e,j:t}})=>(0,a.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,a._)`{i: ${e}, j: ${t}}`};const c={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:true,error:i,code(e){const{gen:t,data:r,$data:i,schema:c,parentSchema:u,schemaCode:d,it:l}=e;if(!i&&!c)return;const f=t.let("valid");const p=u.items?(0,s.getSchemaTypes)(u.items):[];e.block$data(f,validateUniqueItems,(0,a._)`${d} === false`);e.ok(f);function validateUniqueItems(){const s=t.let("i",(0,a._)`${r}.length`);const n=t.let("j");e.setParams({i:s,j:n});t.assign(f,true);t.if((0,a._)`${s} > 1`,(()=>(canOptimize()?loopN:loopN2)(s,n)))}function canOptimize(){return p.length>0&&!p.some((e=>e==="object"||e==="array"))}function loopN(n,o){const i=t.name("item");const c=(0,s.checkDataTypes)(p,i,l.opts.strictNumbers,s.DataType.Wrong);const u=t.const("indices",(0,a._)`{}`);t.for((0,a._)`;${n}--;`,(()=>{t.let(i,(0,a._)`${r}[${n}]`);t.if(c,(0,a._)`continue`);if(p.length>1)t.if((0,a._)`typeof ${i} == "string"`,(0,a._)`${i} += "_"`);t.if((0,a._)`typeof ${u}[${i}] == "number"`,(()=>{t.assign(o,(0,a._)`${u}[${i}]`);e.error();t.assign(f,false).break()})).code((0,a._)`${u}[${i}] = ${n}`)}))}function loopN2(s,i){const c=(0,n.useFunc)(t,o.default);const u=t.name("outer");t.label(u).for((0,a._)`;${s}--;`,(()=>t.for((0,a._)`${i} = ${s}; ${i}--;`,(()=>t.if((0,a._)`${c}(${r}[${s}], ${r}[${i}])`,(()=>{e.error();t.assign(f,false).break(u)}))))))}}};t["default"]=c},7447:e=>{"use strict";e.exports=function equal(e,t){if(e===t)return true;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return false;var r,s,a;if(Array.isArray(e)){r=e.length;if(r!=t.length)return false;for(s=r;s--!==0;)if(!equal(e[s],t[s]))return false;return true}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();a=Object.keys(e);r=a.length;if(r!==Object.keys(t).length)return false;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,a[s]))return false;for(s=r;s--!==0;){var n=a[s];if(!equal(e[n],t[n]))return false}return true}return e!==e&&t!==t}},7243:e=>{"use strict";var t=e.exports=function(e,t,r){if(typeof t=="function"){r=t;t={}}r=t.cb||r;var s=typeof r=="function"?r:r.pre||function(){};var a=r.post||function(){};_traverse(t,s,a,e,"",e)};t.keywords={additionalItems:true,items:true,contains:true,additionalProperties:true,propertyNames:true,not:true,if:true,then:true,else:true};t.arrayKeywords={items:true,allOf:true,anyOf:true,oneOf:true};t.propsKeywords={$defs:true,definitions:true,properties:true,patternProperties:true,dependencies:true};t.skipKeywords={default:true,enum:true,const:true,required:true,maximum:true,minimum:true,exclusiveMaximum:true,exclusiveMinimum:true,multipleOf:true,maxLength:true,minLength:true,pattern:true,format:true,maxItems:true,minItems:true,uniqueItems:true,maxProperties:true,minProperties:true};function _traverse(e,r,s,a,n,o,i,c,u,d){if(a&&typeof a=="object"&&!Array.isArray(a)){r(a,n,o,i,c,u,d);for(var l in a){var f=a[l];if(Array.isArray(f)){if(l in t.arrayKeywords){for(var p=0;p1){t[0]=t[0].slice(0,-1);var s=t.length-1;for(var a=1;a= 0x80 (not a basic code point)","invalid-input":"Invalid input"};var g=n-o;var v=Math.floor;var $=String.fromCharCode;function error$1(e){throw new RangeError(y[e])}function map(e,t){var r=[];var s=e.length;while(s--){r[s]=t(e[s])}return r}function mapDomain(e,t){var r=e.split("@");var s="";if(r.length>1){s=r[0]+"@";e=r[1]}e=e.replace(m,".");var a=e.split(".");var n=map(a,t).join(".");return s+n}function ucs2decode(e){var t=[];var r=0;var s=e.length;while(r=55296&&a<=56319&&r>1;e+=v(e/t);for(;e>g*i>>1;s+=n){e=v(e/g)}return v(s+(g+1)*e/(e+c))};var P=function decode(e){var t=[];var r=e.length;var s=0;var c=l;var u=d;var p=e.lastIndexOf(f);if(p<0){p=0}for(var h=0;h=128){error$1("not-basic")}t.push(e.charCodeAt(h))}for(var m=p>0?p+1:0;m=r){error$1("invalid-input")}var b=w(e.charCodeAt(m++));if(b>=n||b>v((a-s)/g)){error$1("overflow")}s+=b*g;var E=$<=u?o:$>=u+i?i:$-u;if(bv(a/P)){error$1("overflow")}g*=P}var C=t.length+1;u=S(s-y,C,y==0);if(v(s/C)>a-c){error$1("overflow")}c+=v(s/C);s%=C;t.splice(s++,0,c)}return String.fromCodePoint.apply(String,t)};var C=function encode(e){var t=[];e=ucs2decode(e);var r=e.length;var s=l;var c=0;var u=d;var p=true;var h=false;var m=undefined;try{for(var y=e[Symbol.iterator](),g;!(p=(g=y.next()).done);p=true){var b=g.value;if(b<128){t.push($(b))}}}catch(e){h=true;m=e}finally{try{if(!p&&y.return){y.return()}}finally{if(h){throw m}}}var w=t.length;var P=w;if(w){t.push(f)}while(P=s&&Tv((a-c)/j)){error$1("overflow")}c+=(C-s)*j;s=C;var I=true;var D=false;var A=undefined;try{for(var M=e[Symbol.iterator](),F;!(I=(F=M.next()).done);I=true){var V=F.value;if(Va){error$1("overflow")}if(V==s){var U=c;for(var z=n;;z+=n){var K=z<=u?o:z>=u+i?i:z-u;if(U>6|192).toString(16).toUpperCase()+"%"+(t&63|128).toString(16).toUpperCase();else r="%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(t&63|128).toString(16).toUpperCase();return r}function pctDecChars(e){var t="";var r=0;var s=e.length;while(r=194&&a<224){if(s-r>=6){var n=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((a&31)<<6|n&63)}else{t+=e.substr(r,6)}r+=6}else if(a>=224){if(s-r>=9){var o=parseInt(e.substr(r+4,2),16);var i=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((a&15)<<12|(o&63)<<6|i&63)}else{t+=e.substr(r,9)}r+=9}else{t+=e.substr(r,3);r+=3}}return t}function _normalizeComponentEncoding(e,t){function decodeUnreserved(e){var r=pctDecChars(e);return!r.match(t.UNRESERVED)?e:r}if(e.scheme)e.scheme=String(e.scheme).replace(t.PCT_ENCODED,decodeUnreserved).toLowerCase().replace(t.NOT_SCHEME,"");if(e.userinfo!==undefined)e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,decodeUnreserved).replace(t.NOT_USERINFO,pctEncChar).replace(t.PCT_ENCODED,toUpperCase);if(e.host!==undefined)e.host=String(e.host).replace(t.PCT_ENCODED,decodeUnreserved).toLowerCase().replace(t.NOT_HOST,pctEncChar).replace(t.PCT_ENCODED,toUpperCase);if(e.path!==undefined)e.path=String(e.path).replace(t.PCT_ENCODED,decodeUnreserved).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,pctEncChar).replace(t.PCT_ENCODED,toUpperCase);if(e.query!==undefined)e.query=String(e.query).replace(t.PCT_ENCODED,decodeUnreserved).replace(t.NOT_QUERY,pctEncChar).replace(t.PCT_ENCODED,toUpperCase);if(e.fragment!==undefined)e.fragment=String(e.fragment).replace(t.PCT_ENCODED,decodeUnreserved).replace(t.NOT_FRAGMENT,pctEncChar).replace(t.PCT_ENCODED,toUpperCase);return e}function _stripLeadingZeros(e){return e.replace(/^0*(.*)/,"$1")||"0"}function _normalizeIPv4(e,t){var r=e.match(t.IPV4ADDRESS)||[];var a=s(r,2),n=a[1];if(n){return n.split(".").map(_stripLeadingZeros).join(".")}else{return e}}function _normalizeIPv6(e,t){var r=e.match(t.IPV6ADDRESS)||[];var a=s(r,3),n=a[1],o=a[2];if(n){var i=n.toLowerCase().split("::").reverse(),c=s(i,2),u=c[0],d=c[1];var l=d?d.split(":").map(_stripLeadingZeros):[];var f=u.split(":").map(_stripLeadingZeros);var p=t.IPV4ADDRESS.test(f[f.length-1]);var h=p?7:8;var m=f.length-h;var y=Array(h);for(var g=0;g1){var w=y.slice(0,$.index);var E=y.slice($.index+$.length);b=w.join(":")+"::"+E.join(":")}else{b=y.join(":")}if(o){b+="%"+o}return b}else{return e}}var R=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;var T="".match(/(){0}/)[1]===undefined;function parse(e){var s=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var a={};var n=s.iri!==false?r:t;if(s.reference==="suffix")e=(s.scheme?s.scheme+":":"")+"//"+e;var o=e.match(R);if(o){if(T){a.scheme=o[1];a.userinfo=o[3];a.host=o[4];a.port=parseInt(o[5],10);a.path=o[6]||"";a.query=o[7];a.fragment=o[8];if(isNaN(a.port)){a.port=o[5]}}else{a.scheme=o[1]||undefined;a.userinfo=e.indexOf("@")!==-1?o[3]:undefined;a.host=e.indexOf("//")!==-1?o[4]:undefined;a.port=parseInt(o[5],10);a.path=o[6]||"";a.query=e.indexOf("?")!==-1?o[7]:undefined;a.fragment=e.indexOf("#")!==-1?o[8]:undefined;if(isNaN(a.port)){a.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:undefined}}if(a.host){a.host=_normalizeIPv6(_normalizeIPv4(a.host,n),n)}if(a.scheme===undefined&&a.userinfo===undefined&&a.host===undefined&&a.port===undefined&&!a.path&&a.query===undefined){a.reference="same-document"}else if(a.scheme===undefined){a.reference="relative"}else if(a.fragment===undefined){a.reference="absolute"}else{a.reference="uri"}if(s.reference&&s.reference!=="suffix"&&s.reference!==a.reference){a.error=a.error||"URI is not a "+s.reference+" reference."}var i=O[(s.scheme||a.scheme||"").toLowerCase()];if(!s.unicodeSupport&&(!i||!i.unicodeSupport)){if(a.host&&(s.domainHost||i&&i.domainHost)){try{a.host=N.toASCII(a.host.replace(n.PCT_ENCODED,pctDecChars).toLowerCase())}catch(e){a.error=a.error||"Host's domain name can not be converted to ASCII via punycode: "+e}}_normalizeComponentEncoding(a,t)}else{_normalizeComponentEncoding(a,n)}if(i&&i.parse){i.parse(a,s)}}else{a.error=a.error||"URI can not be parsed."}return a}function _recomposeAuthority(e,s){var a=s.iri!==false?r:t;var n=[];if(e.userinfo!==undefined){n.push(e.userinfo);n.push("@")}if(e.host!==undefined){n.push(_normalizeIPv6(_normalizeIPv4(String(e.host),a),a).replace(a.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"})))}if(typeof e.port==="number"||typeof e.port==="string"){n.push(":");n.push(String(e.port))}return n.length?n.join(""):undefined}var j=/^\.\.?\//;var I=/^\/\.(\/|$)/;var D=/^\/\.\.(\/|$)/;var A=/^\/?(?:.|\n)*?(?=\/|$)/;function removeDotSegments(e){var t=[];while(e.length){if(e.match(j)){e=e.replace(j,"")}else if(e.match(I)){e=e.replace(I,"/")}else if(e.match(D)){e=e.replace(D,"/");t.pop()}else if(e==="."||e===".."){e=""}else{var r=e.match(A);if(r){var s=r[0];e=e.slice(s.length);t.push(s)}else{throw new Error("Unexpected dot segment condition")}}}return t.join("")}function serialize(e){var s=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var a=s.iri?r:t;var n=[];var o=O[(s.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize)o.serialize(e,s);if(e.host){if(a.IPV6ADDRESS.test(e.host)){}else if(s.domainHost||o&&o.domainHost){try{e.host=!s.iri?N.toASCII(e.host.replace(a.PCT_ENCODED,pctDecChars).toLowerCase()):N.toUnicode(e.host)}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(!s.iri?"ASCII":"Unicode")+" via punycode: "+t}}}_normalizeComponentEncoding(e,a);if(s.reference!=="suffix"&&e.scheme){n.push(e.scheme);n.push(":")}var i=_recomposeAuthority(e,s);if(i!==undefined){if(s.reference!=="suffix"){n.push("//")}n.push(i);if(e.path&&e.path.charAt(0)!=="/"){n.push("/")}}if(e.path!==undefined){var c=e.path;if(!s.absolutePath&&(!o||!o.absolutePath)){c=removeDotSegments(c)}if(i===undefined){c=c.replace(/^\/\//,"/%2F")}n.push(c)}if(e.query!==undefined){n.push("?");n.push(e.query)}if(e.fragment!==undefined){n.push("#");n.push(e.fragment)}return n.join("")}function resolveComponents(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var s=arguments[3];var a={};if(!s){e=parse(serialize(e,r),r);t=parse(serialize(t,r),r)}r=r||{};if(!r.tolerant&&t.scheme){a.scheme=t.scheme;a.userinfo=t.userinfo;a.host=t.host;a.port=t.port;a.path=removeDotSegments(t.path||"");a.query=t.query}else{if(t.userinfo!==undefined||t.host!==undefined||t.port!==undefined){a.userinfo=t.userinfo;a.host=t.host;a.port=t.port;a.path=removeDotSegments(t.path||"");a.query=t.query}else{if(!t.path){a.path=e.path;if(t.query!==undefined){a.query=t.query}else{a.query=e.query}}else{if(t.path.charAt(0)==="/"){a.path=removeDotSegments(t.path)}else{if((e.userinfo!==undefined||e.host!==undefined||e.port!==undefined)&&!e.path){a.path="/"+t.path}else if(!e.path){a.path=t.path}else{a.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path}a.path=removeDotSegments(a.path)}a.query=t.query}a.userinfo=e.userinfo;a.host=e.host;a.port=e.port}a.scheme=e.scheme}a.fragment=t.fragment;return a}function resolve(e,t,r){var s=assign({scheme:"null"},r);return serialize(resolveComponents(parse(e,s),parse(t,s),s,true),s)}function normalize(e,t){if(typeof e==="string"){e=serialize(parse(e,t),t)}else if(typeOf(e)==="object"){e=parse(serialize(e,t),t)}return e}function equal(e,t,r){if(typeof e==="string"){e=serialize(parse(e,r),r)}else if(typeOf(e)==="object"){e=serialize(e,r)}if(typeof t==="string"){t=serialize(parse(t,r),r)}else if(typeOf(t)==="object"){t=serialize(t,r)}return e===t}function escapeComponent(e,s){return e&&e.toString().replace(!s||!s.iri?t.ESCAPE:r.ESCAPE,pctEncChar)}function unescapeComponent(e,s){return e&&e.toString().replace(!s||!s.iri?t.PCT_ENCODED:r.PCT_ENCODED,pctDecChars)}var M={scheme:"http",domainHost:true,parse:function parse(e,t){if(!e.host){e.error=e.error||"HTTP URIs must have a host."}return e},serialize:function serialize(e,t){var r=String(e.scheme).toLowerCase()==="https";if(e.port===(r?443:80)||e.port===""){e.port=undefined}if(!e.path){e.path="/"}return e}};var F={scheme:"https",domainHost:M.domainHost,parse:M.parse,serialize:M.serialize};function isSecure(e){return typeof e.secure==="boolean"?e.secure:String(e.scheme).toLowerCase()==="wss"}var V={scheme:"ws",domainHost:true,parse:function parse(e,t){var r=e;r.secure=isSecure(r);r.resourceName=(r.path||"/")+(r.query?"?"+r.query:"");r.path=undefined;r.query=undefined;return r},serialize:function serialize(e,t){if(e.port===(isSecure(e)?443:80)||e.port===""){e.port=undefined}if(typeof e.secure==="boolean"){e.scheme=e.secure?"wss":"ws";e.secure=undefined}if(e.resourceName){var r=e.resourceName.split("?"),a=s(r,2),n=a[0],o=a[1];e.path=n&&n!=="/"?n:undefined;e.query=o;e.resourceName=undefined}e.fragment=undefined;return e}};var U={scheme:"wss",domainHost:V.domainHost,parse:V.parse,serialize:V.serialize};var z={};var K=true;var q="[A-Za-z0-9\\-\\.\\_\\~"+(K?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]";var L="[0-9A-Fa-f]";var H=subexp(subexp("%[EFef]"+L+"%"+L+L+"%"+L+L)+"|"+subexp("%[89A-Fa-f]"+L+"%"+L+L)+"|"+subexp("%"+L+L));var G="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]";var J="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]";var B=merge(J,'[\\"\\\\]');var W="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]";var Z=new RegExp(q,"g");var Q=new RegExp(H,"g");var Y=new RegExp(merge("[^]",G,"[\\.]",'[\\"]',B),"g");var X=new RegExp(merge("[^]",q,W),"g");var ee=X;function decodeUnreserved(e){var t=pctDecChars(e);return!t.match(Z)?e:t}var te={scheme:"mailto",parse:function parse$$1(e,t){var r=e;var s=r.to=r.path?r.path.split(","):[];r.path=undefined;if(r.query){var a=false;var n={};var o=r.query.split("&");for(var i=0,c=o.length;i{"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},9520:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')}};var t={};function __nccwpck_require__(r){var s=t[r];if(s!==undefined){return s.exports}var a=t[r]={exports:{}};var n=true;try{e[r].call(a.exports,a,a.exports,__nccwpck_require__);n=false}finally{if(n)delete t[r]}return a.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(4711);module.exports=r})(); \ No newline at end of file diff --git a/packages/toolkit/utils/compiled/ajv/license b/packages/toolkit/utils/compiled/ajv/license deleted file mode 100644 index 139162ad2c38..000000000000 --- a/packages/toolkit/utils/compiled/ajv/license +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-2021 Evgeny Poberezkin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/packages/toolkit/utils/compiled/ajv/package.json b/packages/toolkit/utils/compiled/ajv/package.json deleted file mode 100644 index 0b3effe3e67f..000000000000 --- a/packages/toolkit/utils/compiled/ajv/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"ajv","author":"Evgeny Poberezkin","version":"8.11.0","funding":{"type":"github","url":"https://github.com/sponsors/epoberezkin"},"license":"MIT","types":"types/ajv.d.ts"} diff --git a/packages/toolkit/utils/compiled/ajv/types/ajv.d.ts b/packages/toolkit/utils/compiled/ajv/types/ajv.d.ts deleted file mode 100644 index c1d8e8d864f9..000000000000 --- a/packages/toolkit/utils/compiled/ajv/types/ajv.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { AnySchemaObject } from './types'; -import AjvCore from './core'; -declare class Ajv extends AjvCore { - _addVocabularies(): void; - _addDefaultMetaSchema(): void; - defaultMeta(): string | AnySchemaObject | undefined; -} -export default Ajv; -export { Format, FormatDefinition, AsyncFormatDefinition, KeywordDefinition, KeywordErrorDefinition, CodeKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition, Vocabulary, Schema, SchemaObject, AnySchemaObject, AsyncSchema, AnySchema, ValidateFunction, AsyncValidateFunction, SchemaValidateFunction, ErrorObject, ErrorNoParams, } from "./types"; -export { Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions } from "./core"; -export { SchemaCxt, SchemaObjCxt } from "./compile"; -export { KeywordCxt } from "./compile/validate"; -export { DefinedError } from "./vocabularies/errors"; -export { JSONType } from "./compile/rules"; -export { JSONSchemaType } from "./types/json-schema"; -export { _, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions } from "./compile/codegen"; diff --git a/packages/toolkit/utils/compiled/ajv/types/compile/codegen/code.d.ts b/packages/toolkit/utils/compiled/ajv/types/compile/codegen/code.d.ts deleted file mode 100644 index 8023c1817c8f..000000000000 --- a/packages/toolkit/utils/compiled/ajv/types/compile/codegen/code.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -export declare abstract class _CodeOrName { - abstract readonly str: string; - abstract readonly names: UsedNames; - abstract toString(): string; - abstract emptyStr(): boolean; -} -export declare const IDENTIFIER: RegExp; -export declare class Name extends _CodeOrName { - readonly str: string; - constructor(s: string); - toString(): string; - emptyStr(): boolean; - get names(): UsedNames; -} -export declare class _Code extends _CodeOrName { - readonly _items: readonly CodeItem[]; - private _str?; - private _names?; - constructor(code: string | readonly CodeItem[]); - toString(): string; - emptyStr(): boolean; - get str(): string; - get names(): UsedNames; -} -export declare type CodeItem = Name | string | number | boolean | null; -export declare type UsedNames = Record; -export declare type Code = _Code | Name; -export declare type SafeExpr = Code | number | boolean | null; -export declare const nil: _Code; -declare type CodeArg = SafeExpr | string | undefined; -export declare function _(strs: TemplateStringsArray, ...args: CodeArg[]): _Code; -export declare function str(strs: TemplateStringsArray, ...args: (CodeArg | string[])[]): _Code; -export declare function addCodeArg(code: CodeItem[], arg: CodeArg | string[]): void; -export declare function strConcat(c1: Code, c2: Code): Code; -export declare function stringify(x: unknown): Code; -export declare function safeStringify(x: unknown): string; -export declare function getProperty(key: Code | string | number): Code; -export declare function getEsmExportName(key: Code | string | number): Code; -export declare function regexpCode(rx: RegExp): Code; -export {}; diff --git a/packages/toolkit/utils/compiled/ajv/types/compile/codegen/index.d.ts b/packages/toolkit/utils/compiled/ajv/types/compile/codegen/index.d.ts deleted file mode 100644 index b13289eb929f..000000000000 --- a/packages/toolkit/utils/compiled/ajv/types/compile/codegen/index.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -import type { ScopeValueSets, NameValue, ValueScope, ValueScopeName } from './scope'; -import { _Code, Code, Name } from './code'; -import { Scope } from './scope'; -export { _, str, strConcat, nil, getProperty, stringify, regexpCode, Name, Code } from "./code"; -export { Scope, ScopeStore, ValueScope, ValueScopeName, ScopeValueSets, varKinds } from "./scope"; -export declare type SafeExpr = Code | number | boolean | null; -export declare type Block = Code | (() => void); -export declare const operators: { - GT: _Code; - GTE: _Code; - LT: _Code; - LTE: _Code; - EQ: _Code; - NEQ: _Code; - NOT: _Code; - OR: _Code; - AND: _Code; - ADD: _Code; -}; -export interface CodeGenOptions { - es5?: boolean; - lines?: boolean; - ownProperties?: boolean; -} -export declare class CodeGen { - readonly _scope: Scope; - readonly _extScope: ValueScope; - readonly _values: ScopeValueSets; - private readonly _nodes; - private readonly _blockStarts; - private readonly _constants; - private readonly opts; - constructor(extScope: ValueScope, opts?: CodeGenOptions); - toString(): string; - name(prefix: string): Name; - scopeName(prefix: string): ValueScopeName; - scopeValue(prefixOrName: ValueScopeName | string, value: NameValue): Name; - getScopeValue(prefix: string, keyOrRef: unknown): ValueScopeName | undefined; - scopeRefs(scopeName: Name): Code; - scopeCode(): Code; - private _def; - const(nameOrPrefix: Name | string, rhs: SafeExpr, _constant?: boolean): Name; - let(nameOrPrefix: Name | string, rhs?: SafeExpr, _constant?: boolean): Name; - var(nameOrPrefix: Name | string, rhs?: SafeExpr, _constant?: boolean): Name; - assign(lhs: Code, rhs: SafeExpr, sideEffects?: boolean): CodeGen; - add(lhs: Code, rhs: SafeExpr): CodeGen; - code(c: Block | SafeExpr): CodeGen; - object(...keyValues: [Name | string, SafeExpr | string][]): _Code; - if(condition: Code | boolean, thenBody?: Block, elseBody?: Block): CodeGen; - elseIf(condition: Code | boolean): CodeGen; - else(): CodeGen; - endIf(): CodeGen; - private _for; - for(iteration: Code, forBody?: Block): CodeGen; - forRange(nameOrPrefix: Name | string, from: SafeExpr, to: SafeExpr, forBody: (index: Name) => void, varKind?: Code): CodeGen; - forOf(nameOrPrefix: Name | string, iterable: Code, forBody: (item: Name) => void, varKind?: Code): CodeGen; - forIn(nameOrPrefix: Name | string, obj: Code, forBody: (item: Name) => void, varKind?: Code): CodeGen; - endFor(): CodeGen; - label(label: Name): CodeGen; - break(label?: Code): CodeGen; - return(value: Block | SafeExpr): CodeGen; - try(tryBody: Block, catchCode?: (e: Name) => void, finallyCode?: Block): CodeGen; - throw(error: Code): CodeGen; - block(body?: Block, nodeCount?: number): CodeGen; - endBlock(nodeCount?: number): CodeGen; - func(name: Name, args?: Code, async?: boolean, funcBody?: Block): CodeGen; - endFunc(): CodeGen; - optimize(n?: number): void; - private _leafNode; - private _blockNode; - private _endBlockNode; - private _elseNode; - private get _root(); - private get _currNode(); - private set _currNode(value); -} -export declare function not(x: T): T; -export declare function and(...args: Code[]): Code; -export declare function or(...args: Code[]): Code; diff --git a/packages/toolkit/utils/compiled/ajv/types/compile/codegen/scope.d.ts b/packages/toolkit/utils/compiled/ajv/types/compile/codegen/scope.d.ts deleted file mode 100644 index f3dd87938901..000000000000 --- a/packages/toolkit/utils/compiled/ajv/types/compile/codegen/scope.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { Code, Name } from './code'; -interface NameGroup { - prefix: string; - index: number; -} -export interface NameValue { - ref: ValueReference; - key?: unknown; - code?: Code; -} -export declare type ValueReference = unknown; -interface ScopeOptions { - prefixes?: Set; - parent?: Scope; -} -interface ValueScopeOptions extends ScopeOptions { - scope: ScopeStore; - es5?: boolean; - lines?: boolean; -} -export declare type ScopeStore = Record; -declare type ScopeValues = { - [Prefix in string]?: Map; -}; -export declare type ScopeValueSets = { - [Prefix in string]?: Set; -}; -export declare enum UsedValueState { - Started = 0, - Completed = 1 -} -export declare type UsedScopeValues = { - [Prefix in string]?: Map; -}; -export declare const varKinds: { - const: Name; - let: Name; - var: Name; -}; -export declare class Scope { - protected readonly _names: { - [Prefix in string]?: NameGroup; - }; - protected readonly _prefixes?: Set; - protected readonly _parent?: Scope; - constructor({ prefixes, parent }?: ScopeOptions); - toName(nameOrPrefix: Name | string): Name; - name(prefix: string): Name; - protected _newName(prefix: string): string; - private _nameGroup; -} -interface ScopePath { - property: string; - itemIndex: number; -} -export declare class ValueScopeName extends Name { - readonly prefix: string; - value?: NameValue; - scopePath?: Code; - constructor(prefix: string, nameStr: string); - setValue(value: NameValue, { property, itemIndex }: ScopePath): void; -} -interface VSOptions extends ValueScopeOptions { - _n: Code; -} -export declare class ValueScope extends Scope { - protected readonly _values: ScopeValues; - protected readonly _scope: ScopeStore; - readonly opts: VSOptions; - constructor(opts: ValueScopeOptions); - get(): ScopeStore; - name(prefix: string): ValueScopeName; - value(nameOrPrefix: ValueScopeName | string, value: NameValue): ValueScopeName; - getValue(prefix: string, keyOrRef: unknown): ValueScopeName | undefined; - scopeRefs(scopeName: Name, values?: ScopeValues | ScopeValueSets): Code; - scopeCode(values?: ScopeValues | ScopeValueSets, usedValues?: UsedScopeValues, getCode?: (n: ValueScopeName) => Code | undefined): Code; - private _reduceValues; -} -export {}; diff --git a/packages/toolkit/utils/compiled/ajv/types/compile/errors.d.ts b/packages/toolkit/utils/compiled/ajv/types/compile/errors.d.ts deleted file mode 100644 index 749e193d0388..000000000000 --- a/packages/toolkit/utils/compiled/ajv/types/compile/errors.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { KeywordErrorCxt, KeywordErrorDefinition } from '../types'; -import { CodeGen, Code, Name } from './codegen'; -export declare const keywordError: KeywordErrorDefinition; -export declare const keyword$DataError: KeywordErrorDefinition; -export interface ErrorPaths { - instancePath?: Code; - schemaPath?: string; - parentSchema?: boolean; -} -export declare function reportError(cxt: KeywordErrorCxt, error?: KeywordErrorDefinition, errorPaths?: ErrorPaths, overrideAllErrors?: boolean): void; -export declare function reportExtraError(cxt: KeywordErrorCxt, error?: KeywordErrorDefinition, errorPaths?: ErrorPaths): void; -export declare function resetErrorsCount(gen: CodeGen, errsCount: Name): void; -export declare function extendErrors({ gen, keyword, schemaValue, data, errsCount, it, }: KeywordErrorCxt): void; diff --git a/packages/toolkit/utils/compiled/ajv/types/compile/index.d.ts b/packages/toolkit/utils/compiled/ajv/types/compile/index.d.ts deleted file mode 100644 index 202086fff440..000000000000 --- a/packages/toolkit/utils/compiled/ajv/types/compile/index.d.ts +++ /dev/null @@ -1,80 +0,0 @@ -import type { AnySchema, AnySchemaObject, AnyValidateFunction, EvaluatedProperties, EvaluatedItems } from '../types'; -import type Ajv from '../core'; -import type { InstanceOptions } from '../core'; -import { CodeGen, Name, Code, ValueScopeName } from './codegen'; -import { LocalRefs } from './resolve'; -import { JSONType } from './rules'; -export declare type SchemaRefs = { - [Ref in string]?: SchemaEnv | AnySchema; -}; -export interface SchemaCxt { - readonly gen: CodeGen; - readonly allErrors?: boolean; - readonly data: Name; - readonly parentData: Name; - readonly parentDataProperty: Code | number; - readonly dataNames: Name[]; - readonly dataPathArr: (Code | number)[]; - readonly dataLevel: number; - dataTypes: JSONType[]; - definedProperties: Set; - readonly topSchemaRef: Code; - readonly validateName: Name; - evaluated?: Name; - readonly ValidationError?: Name; - readonly schema: AnySchema; - readonly schemaEnv: SchemaEnv; - readonly rootId: string; - baseId: string; - readonly schemaPath: Code; - readonly errSchemaPath: string; - readonly errorPath: Code; - readonly propertyName?: Name; - readonly compositeRule?: boolean; - props?: EvaluatedProperties | Name; - items?: EvaluatedItems | Name; - jtdDiscriminator?: string; - jtdMetadata?: boolean; - readonly createErrors?: boolean; - readonly opts: InstanceOptions; - readonly self: Ajv; -} -export interface SchemaObjCxt extends SchemaCxt { - readonly schema: AnySchemaObject; -} -interface SchemaEnvArgs { - readonly schema: AnySchema; - readonly schemaId?: "$id" | "id"; - readonly root?: SchemaEnv; - readonly baseId?: string; - readonly schemaPath?: string; - readonly localRefs?: LocalRefs; - readonly meta?: boolean; -} -export declare class SchemaEnv implements SchemaEnvArgs { - readonly schema: AnySchema; - readonly schemaId?: "$id" | "id"; - readonly root: SchemaEnv; - baseId: string; - schemaPath?: string; - localRefs?: LocalRefs; - readonly meta?: boolean; - readonly $async?: boolean; - readonly refs: SchemaRefs; - readonly dynamicAnchors: { - [Ref in string]?: true; - }; - validate?: AnyValidateFunction; - validateName?: ValueScopeName; - serialize?: (data: unknown) => string; - serializeName?: ValueScopeName; - parse?: (data: string) => unknown; - parseName?: ValueScopeName; - constructor(env: SchemaEnvArgs); -} -export declare function compileSchema(this: Ajv, sch: SchemaEnv): SchemaEnv; -export declare function resolveRef(this: Ajv, root: SchemaEnv, baseId: string, ref: string): AnySchema | SchemaEnv | undefined; -export declare function getCompilingSchema(this: Ajv, schEnv: SchemaEnv): SchemaEnv | void; -export declare function resolveSchema(this: Ajv, root: SchemaEnv, // root object with properties schema, refs TODO below SchemaEnv is assigned to it -ref: string): SchemaEnv | undefined; -export {}; diff --git a/packages/toolkit/utils/compiled/ajv/types/compile/ref_error.d.ts b/packages/toolkit/utils/compiled/ajv/types/compile/ref_error.d.ts deleted file mode 100644 index 3716faf4c7c9..000000000000 --- a/packages/toolkit/utils/compiled/ajv/types/compile/ref_error.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UriResolver } from '../types'; -export default class MissingRefError extends Error { - readonly missingRef: string; - readonly missingSchema: string; - constructor(resolver: UriResolver, baseId: string, ref: string, msg?: string); -} diff --git a/packages/toolkit/utils/compiled/ajv/types/compile/resolve.d.ts b/packages/toolkit/utils/compiled/ajv/types/compile/resolve.d.ts deleted file mode 100644 index 651853741c2f..000000000000 --- a/packages/toolkit/utils/compiled/ajv/types/compile/resolve.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { AnySchema, AnySchemaObject, UriResolver } from '../types'; -import type Ajv from '../ajv'; -import type { URIComponents } from '../../uri-js'; -export declare type LocalRefs = { - [Ref in string]?: AnySchemaObject; -}; -export declare function inlineRef(schema: AnySchema, limit?: boolean | number): boolean; -export declare function getFullPath(resolver: UriResolver, id?: string, normalize?: boolean): string; -export declare function _getFullPath(resolver: UriResolver, p: URIComponents): string; -export declare function normalizeId(id: string | undefined): string; -export declare function resolveUrl(resolver: UriResolver, baseId: string, id: string): string; -export declare function getSchemaRefs(this: Ajv, schema: AnySchema, baseId: string): LocalRefs; diff --git a/packages/toolkit/utils/compiled/ajv/types/compile/rules.d.ts b/packages/toolkit/utils/compiled/ajv/types/compile/rules.d.ts deleted file mode 100644 index 4c9d45c58ff5..000000000000 --- a/packages/toolkit/utils/compiled/ajv/types/compile/rules.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { AddedKeywordDefinition } from '../types'; -declare const _jsonTypes: readonly ["string", "number", "integer", "boolean", "null", "object", "array"]; -export declare type JSONType = typeof _jsonTypes[number]; -export declare function isJSONType(x: unknown): x is JSONType; -declare type ValidationTypes = { - [K in JSONType]: boolean | RuleGroup | undefined; -}; -export interface ValidationRules { - rules: RuleGroup[]; - post: RuleGroup; - all: { - [Key in string]?: boolean | Rule; - }; - keywords: { - [Key in string]?: boolean; - }; - types: ValidationTypes; -} -export interface RuleGroup { - type?: JSONType; - rules: Rule[]; -} -export interface Rule { - keyword: string; - definition: AddedKeywordDefinition; -} -export declare function getRules(): ValidationRules; -export {}; diff --git a/packages/toolkit/utils/compiled/ajv/types/compile/util.d.ts b/packages/toolkit/utils/compiled/ajv/types/compile/util.d.ts deleted file mode 100644 index 25bc5ce146bf..000000000000 --- a/packages/toolkit/utils/compiled/ajv/types/compile/util.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { AnySchema, EvaluatedProperties, EvaluatedItems } from '../types'; -import type { SchemaCxt, SchemaObjCxt } from '.'; -import { Code, Name, CodeGen } from './codegen'; -import type { Rule, ValidationRules } from './rules'; -export declare function toHash(arr: T[]): { - [K in T]?: true; -}; -export declare function alwaysValidSchema(it: SchemaCxt, schema: AnySchema): boolean | void; -export declare function checkUnknownRules(it: SchemaCxt, schema?: AnySchema): void; -export declare function schemaHasRules(schema: AnySchema, rules: { - [Key in string]?: boolean | Rule; -}): boolean; -export declare function schemaHasRulesButRef(schema: AnySchema, RULES: ValidationRules): boolean; -export declare function schemaRefOrVal({ topSchemaRef, schemaPath }: SchemaObjCxt, schema: unknown, keyword: string, $data?: string | false): Code | number | boolean; -export declare function unescapeFragment(str: string): string; -export declare function escapeFragment(str: string | number): string; -export declare function escapeJsonPointer(str: string | number): string; -export declare function unescapeJsonPointer(str: string): string; -export declare function eachItem(xs: T | T[], f: (x: T) => void): void; -declare type SomeEvaluated = EvaluatedProperties | EvaluatedItems; -declare type MergeEvaluatedFunc = (gen: CodeGen, from: Name | T, to: Name | Exclude | undefined, toName?: typeof Name) => Name | T; -interface MergeEvaluated { - props: MergeEvaluatedFunc; - items: MergeEvaluatedFunc; -} -export declare const mergeEvaluated: MergeEvaluated; -export declare function evaluatedPropsToName(gen: CodeGen, ps?: EvaluatedProperties): Name; -export declare function setEvaluated(gen: CodeGen, props: Name, ps: { - [K in string]?: true; -}): void; -export declare function useFunc(gen: CodeGen, f: { - code: string; -}): Name; -export declare enum Type { - Num = 0, - Str = 1 -} -export declare function getErrorPath(dataProp: Name | string | number, dataPropType?: Type, jsPropertySyntax?: boolean): Code | string; -export declare function checkStrictMode(it: SchemaCxt, msg: string, mode?: boolean | "log"): void; -export {}; diff --git a/packages/toolkit/utils/compiled/ajv/types/compile/validate/index.d.ts b/packages/toolkit/utils/compiled/ajv/types/compile/validate/index.d.ts deleted file mode 100644 index 4a8614a8354b..000000000000 --- a/packages/toolkit/utils/compiled/ajv/types/compile/validate/index.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import type { AddedKeywordDefinition, AnySchemaObject, KeywordErrorCxt, KeywordCxtParams } from '../../types'; -import type { SchemaCxt, SchemaObjCxt } from '..'; -import { SubschemaArgs } from './subschema'; -import { Code, Name, CodeGen } from '../codegen'; -import type { JSONType } from '../rules'; -import { ErrorPaths } from '../errors'; -export declare function validateFunctionCode(it: SchemaCxt): void; -export declare class KeywordCxt implements KeywordErrorCxt { - readonly gen: CodeGen; - readonly allErrors?: boolean; - readonly keyword: string; - readonly data: Name; - readonly $data?: string | false; - schema: any; - readonly schemaValue: Code | number | boolean; - readonly schemaCode: Code | number | boolean; - readonly schemaType: JSONType[]; - readonly parentSchema: AnySchemaObject; - readonly errsCount?: Name; - params: KeywordCxtParams; - readonly it: SchemaObjCxt; - readonly def: AddedKeywordDefinition; - constructor(it: SchemaObjCxt, def: AddedKeywordDefinition, keyword: string); - result(condition: Code, successAction?: () => void, failAction?: () => void): void; - failResult(condition: Code, successAction?: () => void, failAction?: () => void): void; - pass(condition: Code, failAction?: () => void): void; - fail(condition?: Code): void; - fail$data(condition: Code): void; - error(append?: boolean, errorParams?: KeywordCxtParams, errorPaths?: ErrorPaths): void; - private _error; - $dataError(): void; - reset(): void; - ok(cond: Code | boolean): void; - setParams(obj: KeywordCxtParams, assign?: true): void; - block$data(valid: Name, codeBlock: () => void, $dataValid?: Code): void; - check$data(valid?: Name, $dataValid?: Code): void; - invalid$data(): Code; - subschema(appl: SubschemaArgs, valid: Name): SchemaCxt; - mergeEvaluated(schemaCxt: SchemaCxt, toName?: typeof Name): void; - mergeValidEvaluated(schemaCxt: SchemaCxt, valid: Name): boolean | void; -} -export declare function getData($data: string, { dataLevel, dataNames, dataPathArr }: SchemaCxt): Code | number; diff --git a/packages/toolkit/utils/compiled/ajv/types/compile/validate/subschema.d.ts b/packages/toolkit/utils/compiled/ajv/types/compile/validate/subschema.d.ts deleted file mode 100644 index ae3a851f4143..000000000000 --- a/packages/toolkit/utils/compiled/ajv/types/compile/validate/subschema.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -import type { AnySchema } from '../../types'; -import type { SchemaObjCxt } from '..'; -import { Code, Name } from '../codegen'; -import { Type } from '../util'; -import type { JSONType } from '../rules'; -export interface SubschemaContext { - schema: AnySchema; - schemaPath: Code; - errSchemaPath: string; - topSchemaRef?: Code; - errorPath?: Code; - dataLevel?: number; - dataTypes?: JSONType[]; - data?: Name; - parentData?: Name; - parentDataProperty?: Code | number; - dataNames?: Name[]; - dataPathArr?: (Code | number)[]; - propertyName?: Name; - jtdDiscriminator?: string; - jtdMetadata?: boolean; - compositeRule?: true; - createErrors?: boolean; - allErrors?: boolean; -} -export declare type SubschemaArgs = Partial<{ - keyword: string; - schemaProp: string | number; - schema: AnySchema; - schemaPath: Code; - errSchemaPath: string; - topSchemaRef: Code; - data: Name | Code; - dataProp: Code | string | number; - dataTypes: JSONType[]; - definedProperties: Set; - propertyName: Name; - dataPropType: Type; - jtdDiscriminator: string; - jtdMetadata: boolean; - compositeRule: true; - createErrors: boolean; - allErrors: boolean; -}>; -export declare function getSubschema(it: SchemaObjCxt, { keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }: SubschemaArgs): SubschemaContext; -export declare function extendSubschemaData(subschema: SubschemaContext, it: SchemaObjCxt, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }: SubschemaArgs): void; -export declare function extendSubschemaMode(subschema: SubschemaContext, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }: SubschemaArgs): void; diff --git a/packages/toolkit/utils/compiled/ajv/types/core.d.ts b/packages/toolkit/utils/compiled/ajv/types/core.d.ts deleted file mode 100644 index c3e8dda959fe..000000000000 --- a/packages/toolkit/utils/compiled/ajv/types/core.d.ts +++ /dev/null @@ -1,173 +0,0 @@ -export { Format, FormatDefinition, AsyncFormatDefinition, KeywordDefinition, KeywordErrorDefinition, CodeKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition, Vocabulary, Schema, SchemaObject, AnySchemaObject, AsyncSchema, AnySchema, ValidateFunction, AsyncValidateFunction, AnyValidateFunction, ErrorObject, ErrorNoParams, } from "./types"; -export { SchemaCxt, SchemaObjCxt } from "./compile"; -export interface Plugin { - (ajv: Ajv, options?: Opts): Ajv; - [prop: string]: any; -} -export { KeywordCxt } from "./compile/validate"; -export { DefinedError } from "./vocabularies/errors"; -export { JSONType } from "./compile/rules"; -export { JSONSchemaType } from "./types/json-schema"; -export { JTDSchemaType, SomeJTDSchemaType, JTDDataType } from "./types/jtd-schema"; -export { _, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions } from "./compile/codegen"; -import type { Schema, AnySchema, AnySchemaObject, SchemaObject, AsyncSchema, Vocabulary, KeywordDefinition, AddedKeywordDefinition, AnyValidateFunction, ValidateFunction, AsyncValidateFunction, ErrorObject, Format, AddedFormat, RegExpEngine, UriResolver } from './types'; -import type { JSONSchemaType } from './types/json-schema'; -import type { JTDSchemaType, SomeJTDSchemaType, JTDDataType } from './types/jtd-schema'; -import ValidationError from './runtime/validation_error'; -import MissingRefError from './compile/ref_error'; -import { ValidationRules } from './compile/rules'; -import { SchemaEnv } from './compile'; -import { Code, ValueScope } from './compile/codegen'; -export declare type Options = CurrentOptions & DeprecatedOptions; -export interface CurrentOptions { - strict?: boolean | "log"; - strictSchema?: boolean | "log"; - strictNumbers?: boolean | "log"; - strictTypes?: boolean | "log"; - strictTuples?: boolean | "log"; - strictRequired?: boolean | "log"; - allowMatchingProperties?: boolean; - allowUnionTypes?: boolean; - validateFormats?: boolean; - $data?: boolean; - allErrors?: boolean; - verbose?: boolean; - discriminator?: boolean; - unicodeRegExp?: boolean; - timestamp?: "string" | "date"; - parseDate?: boolean; - allowDate?: boolean; - $comment?: true | ((comment: string, schemaPath?: string, rootSchema?: AnySchemaObject) => unknown); - formats?: { - [Name in string]?: Format; - }; - keywords?: Vocabulary; - schemas?: AnySchema[] | { - [Key in string]?: AnySchema; - }; - logger?: Logger | false; - loadSchema?: (uri: string) => Promise; - removeAdditional?: boolean | "all" | "failing"; - useDefaults?: boolean | "empty"; - coerceTypes?: boolean | "array"; - next?: boolean; - unevaluated?: boolean; - dynamicRef?: boolean; - schemaId?: "id" | "$id"; - jtd?: boolean; - meta?: SchemaObject | boolean; - defaultMeta?: string | AnySchemaObject; - validateSchema?: boolean | "log"; - addUsedSchema?: boolean; - inlineRefs?: boolean | number; - passContext?: boolean; - loopRequired?: number; - loopEnum?: number; - ownProperties?: boolean; - multipleOfPrecision?: number; - int32range?: boolean; - messages?: boolean; - code?: CodeOptions; - uriResolver?: UriResolver; -} -export interface CodeOptions { - es5?: boolean; - esm?: boolean; - lines?: boolean; - optimize?: boolean | number; - formats?: Code; - source?: boolean; - process?: (code: string, schema?: SchemaEnv) => string; - regExp?: RegExpEngine; -} -interface InstanceCodeOptions extends CodeOptions { - regExp: RegExpEngine; - optimize: number; -} -interface DeprecatedOptions { - /** @deprecated */ - ignoreKeywordsWithRef?: boolean; - /** @deprecated */ - jsPropertySyntax?: boolean; - /** @deprecated */ - unicode?: boolean; -} -declare type RequiredInstanceOptions = { - [K in "strictSchema" | "strictNumbers" | "strictTypes" | "strictTuples" | "strictRequired" | "inlineRefs" | "loopRequired" | "loopEnum" | "meta" | "messages" | "schemaId" | "addUsedSchema" | "validateSchema" | "validateFormats" | "int32range" | "unicodeRegExp" | "uriResolver"]: NonNullable; -} & { - code: InstanceCodeOptions; -}; -export declare type InstanceOptions = Options & RequiredInstanceOptions; -export interface Logger { - log(...args: unknown[]): unknown; - warn(...args: unknown[]): unknown; - error(...args: unknown[]): unknown; -} -export default class Ajv { - opts: InstanceOptions; - errors?: ErrorObject[] | null; - logger: Logger; - readonly scope: ValueScope; - readonly schemas: { - [Key in string]?: SchemaEnv; - }; - readonly refs: { - [Ref in string]?: SchemaEnv | string; - }; - readonly formats: { - [Name in string]?: AddedFormat; - }; - readonly RULES: ValidationRules; - readonly _compilations: Set; - private readonly _loading; - private readonly _cache; - private readonly _metaOpts; - static ValidationError: typeof ValidationError; - static MissingRefError: typeof MissingRefError; - constructor(opts?: Options); - _addVocabularies(): void; - _addDefaultMetaSchema(): void; - defaultMeta(): string | AnySchemaObject | undefined; - validate(schema: Schema | string, data: unknown): boolean; - validate(schemaKeyRef: AnySchema | string, data: unknown): boolean | Promise; - validate(schema: Schema | JSONSchemaType | string, data: unknown): data is T; - validate(schema: JTDSchemaType, data: unknown): data is T; - validate(schema: T, data: unknown): data is JTDDataType; - validate(schema: AsyncSchema, data: unknown | T): Promise; - validate(schemaKeyRef: AnySchema | string, data: unknown): data is T | Promise; - compile(schema: Schema | JSONSchemaType, _meta?: boolean): ValidateFunction; - compile(schema: JTDSchemaType, _meta?: boolean): ValidateFunction; - compile(schema: T, _meta?: boolean): ValidateFunction>; - compile(schema: AsyncSchema, _meta?: boolean): AsyncValidateFunction; - compile(schema: AnySchema, _meta?: boolean): AnyValidateFunction; - compileAsync(schema: SchemaObject | JSONSchemaType, _meta?: boolean): Promise>; - compileAsync(schema: JTDSchemaType, _meta?: boolean): Promise>; - compileAsync(schema: AsyncSchema, meta?: boolean): Promise>; - compileAsync(schema: AnySchemaObject, meta?: boolean): Promise>; - addSchema(schema: AnySchema | AnySchema[], // If array is passed, `key` will be ignored - key?: string, // Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. - _meta?: boolean, // true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. - _validateSchema?: boolean | "log"): Ajv; - addMetaSchema(schema: AnySchemaObject, key?: string, // schema key - _validateSchema?: boolean | "log"): Ajv; - validateSchema(schema: AnySchema, throwOrLogError?: boolean): boolean | Promise; - getSchema(keyRef: string): AnyValidateFunction | undefined; - removeSchema(schemaKeyRef?: AnySchema | string | RegExp): Ajv; - addVocabulary(definitions: Vocabulary): Ajv; - addKeyword(kwdOrDef: string | KeywordDefinition, def?: KeywordDefinition): Ajv; - getKeyword(keyword: string): AddedKeywordDefinition | boolean; - removeKeyword(keyword: string): Ajv; - addFormat(name: string, format: Format): Ajv; - errorsText(errors?: ErrorObject[] | null | undefined, // optional array of validation errors - { separator, dataVar }?: ErrorsTextOptions): string; - $dataMetaSchema(metaSchema: AnySchemaObject, keywordsJsonPointers: string[]): AnySchemaObject; - private _removeAllSchemas; - _addSchema(schema: AnySchema, meta?: boolean, baseId?: string, validateSchema?: boolean | "log", addSchema?: boolean): SchemaEnv; - private _checkUnique; - private _compileSchemaEnv; - private _compileMetaSchema; -} -export interface ErrorsTextOptions { - separator?: string; - dataVar?: string; -} diff --git a/packages/toolkit/utils/compiled/ajv/types/runtime/validation_error.d.ts b/packages/toolkit/utils/compiled/ajv/types/runtime/validation_error.d.ts deleted file mode 100644 index b616bd8864cc..000000000000 --- a/packages/toolkit/utils/compiled/ajv/types/runtime/validation_error.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ErrorObject } from '../types'; -export default class ValidationError extends Error { - readonly errors: Partial[]; - readonly ajv: true; - readonly validation: true; - constructor(errors: Partial[]); -} diff --git a/packages/toolkit/utils/compiled/ajv/types/types/index.d.ts b/packages/toolkit/utils/compiled/ajv/types/types/index.d.ts deleted file mode 100644 index 552c184c1f90..000000000000 --- a/packages/toolkit/utils/compiled/ajv/types/types/index.d.ts +++ /dev/null @@ -1,183 +0,0 @@ -import * as URI from '../../uri-js'; -import type { CodeGen, Code, Name, ScopeValueSets, ValueScopeName } from '../compile/codegen'; -import type { SchemaEnv, SchemaCxt, SchemaObjCxt } from '../compile'; -import type { JSONType } from '../compile/rules'; -import type { KeywordCxt } from '../compile/validate'; -import type Ajv from '../core'; -interface _SchemaObject { - id?: string; - $id?: string; - $schema?: string; - [x: string]: any; -} -export interface SchemaObject extends _SchemaObject { - id?: string; - $id?: string; - $schema?: string; - $async?: false; - [x: string]: any; -} -export interface AsyncSchema extends _SchemaObject { - $async: true; -} -export declare type AnySchemaObject = SchemaObject | AsyncSchema; -export declare type Schema = SchemaObject | boolean; -export declare type AnySchema = Schema | AsyncSchema; -export declare type SchemaMap = { - [Key in string]?: AnySchema; -}; -export interface SourceCode { - validateName: ValueScopeName; - validateCode: string; - scopeValues: ScopeValueSets; - evaluated?: Code; -} -export interface DataValidationCxt { - instancePath: string; - parentData: { - [K in T]: any; - }; - parentDataProperty: T; - rootData: Record | any[]; - dynamicAnchors: { - [Ref in string]?: ValidateFunction; - }; -} -export interface ValidateFunction { - (this: Ajv | any, data: any, dataCxt?: DataValidationCxt): data is T; - errors?: null | ErrorObject[]; - evaluated?: Evaluated; - schema: AnySchema; - schemaEnv: SchemaEnv; - source?: SourceCode; -} -export interface JTDParser { - (json: string): T | undefined; - message?: string; - position?: number; -} -export declare type EvaluatedProperties = { - [K in string]?: true; -} | true; -export declare type EvaluatedItems = number | true; -export interface Evaluated { - props?: EvaluatedProperties; - items?: EvaluatedItems; - dynamicProps: boolean; - dynamicItems: boolean; -} -export interface AsyncValidateFunction extends ValidateFunction { - (...args: Parameters>): Promise; - $async: true; -} -export declare type AnyValidateFunction = ValidateFunction | AsyncValidateFunction; -export interface ErrorObject, S = unknown> { - keyword: K; - instancePath: string; - schemaPath: string; - params: P; - propertyName?: string; - message?: string; - schema?: S; - parentSchema?: AnySchemaObject; - data?: unknown; -} -export declare type ErrorNoParams = ErrorObject, S>; -interface _KeywordDef { - keyword: string | string[]; - type?: JSONType | JSONType[]; - schemaType?: JSONType | JSONType[]; - allowUndefined?: boolean; - $data?: boolean; - implements?: string[]; - before?: string; - post?: boolean; - metaSchema?: AnySchemaObject; - validateSchema?: AnyValidateFunction; - dependencies?: string[]; - error?: KeywordErrorDefinition; - $dataError?: KeywordErrorDefinition; -} -export interface CodeKeywordDefinition extends _KeywordDef { - code: (cxt: KeywordCxt, ruleType?: string) => void; - trackErrors?: boolean; -} -export declare type MacroKeywordFunc = (schema: any, parentSchema: AnySchemaObject, it: SchemaCxt) => AnySchema; -export declare type CompileKeywordFunc = (schema: any, parentSchema: AnySchemaObject, it: SchemaObjCxt) => DataValidateFunction; -export interface DataValidateFunction { - (...args: Parameters): boolean | Promise; - errors?: Partial[]; -} -export interface SchemaValidateFunction { - (schema: any, data: any, parentSchema?: AnySchemaObject, dataCxt?: DataValidationCxt): boolean | Promise; - errors?: Partial[]; -} -export interface FuncKeywordDefinition extends _KeywordDef { - validate?: SchemaValidateFunction | DataValidateFunction; - compile?: CompileKeywordFunc; - schema?: boolean; - modifying?: boolean; - async?: boolean; - valid?: boolean; - errors?: boolean | "full"; -} -export interface MacroKeywordDefinition extends FuncKeywordDefinition { - macro: MacroKeywordFunc; -} -export declare type KeywordDefinition = CodeKeywordDefinition | FuncKeywordDefinition | MacroKeywordDefinition; -export declare type AddedKeywordDefinition = KeywordDefinition & { - type: JSONType[]; - schemaType: JSONType[]; -}; -export interface KeywordErrorDefinition { - message: string | Code | ((cxt: KeywordErrorCxt) => string | Code); - params?: Code | ((cxt: KeywordErrorCxt) => Code); -} -export declare type Vocabulary = (KeywordDefinition | string)[]; -export interface KeywordErrorCxt { - gen: CodeGen; - keyword: string; - data: Name; - $data?: string | false; - schema: any; - parentSchema?: AnySchemaObject; - schemaCode: Code | number | boolean; - schemaValue: Code | number | boolean; - schemaType?: JSONType[]; - errsCount?: Name; - params: KeywordCxtParams; - it: SchemaCxt; -} -export declare type KeywordCxtParams = { - [P in string]?: Code | string | number; -}; -export declare type FormatValidator = (data: T) => boolean; -export declare type FormatCompare = (data1: T, data2: T) => number | undefined; -export declare type AsyncFormatValidator = (data: T) => Promise; -export interface FormatDefinition { - type?: T extends string ? "string" | undefined : "number"; - validate: FormatValidator | (T extends string ? string | RegExp : never); - async?: false | undefined; - compare?: FormatCompare; -} -export interface AsyncFormatDefinition { - type?: T extends string ? "string" | undefined : "number"; - validate: AsyncFormatValidator; - async: true; - compare?: FormatCompare; -} -export declare type AddedFormat = true | RegExp | FormatValidator | FormatDefinition | FormatDefinition | AsyncFormatDefinition | AsyncFormatDefinition; -export declare type Format = AddedFormat | string; -export interface RegExpEngine { - (pattern: string, u: string): RegExpLike; - code: string; -} -export interface RegExpLike { - test: (s: string) => boolean; -} -export interface UriResolver { - parse(uri: string): URI.URIComponents; - resolve(base: string, path: string): string; - serialize(component: URI.URIComponents): string; -} -export {}; diff --git a/packages/toolkit/utils/compiled/ajv/types/types/json-schema.d.ts b/packages/toolkit/utils/compiled/ajv/types/types/json-schema.d.ts deleted file mode 100644 index 78ec842fa840..000000000000 --- a/packages/toolkit/utils/compiled/ajv/types/types/json-schema.d.ts +++ /dev/null @@ -1,124 +0,0 @@ -declare type StrictNullChecksWrapper = undefined extends null ? `strictNullChecks must be true in tsconfig to use ${Name}` : Type; -declare type UnionToIntersection = (U extends any ? (_: U) => void : never) extends (_: infer I) => void ? I : never; -export declare type SomeJSONSchema = UncheckedJSONSchemaType; -declare type UncheckedPartialSchema = Partial>; -export declare type PartialSchema = StrictNullChecksWrapper<"PartialSchema", UncheckedPartialSchema>; -declare type JSONType = IsPartial extends true ? T | undefined : T; -interface NumberKeywords { - minimum?: number; - maximum?: number; - exclusiveMinimum?: number; - exclusiveMaximum?: number; - multipleOf?: number; - format?: string; -} -interface StringKeywords { - minLength?: number; - maxLength?: number; - pattern?: string; - format?: string; -} -declare type UncheckedJSONSchemaType = (// these two unions allow arbitrary unions of types -{ - anyOf: readonly UncheckedJSONSchemaType[]; -} | { - oneOf: readonly UncheckedJSONSchemaType[]; -} | ({ - type: readonly (T extends number ? JSONType<"number" | "integer", IsPartial> : T extends string ? JSONType<"string", IsPartial> : T extends boolean ? JSONType<"boolean", IsPartial> : never)[]; -} & UnionToIntersection) | ((T extends number ? { - type: JSONType<"number" | "integer", IsPartial>; -} & NumberKeywords : T extends string ? { - type: JSONType<"string", IsPartial>; -} & StringKeywords : T extends boolean ? { - type: JSONType<"boolean", IsPartial>; -} : T extends readonly [any, ...any[]] ? { - type: JSONType<"array", IsPartial>; - items: { - readonly [K in keyof T]-?: UncheckedJSONSchemaType & Nullable; - } & { - length: T["length"]; - }; - minItems: T["length"]; -} & ({ - maxItems: T["length"]; -} | { - additionalItems: false; -}) : T extends readonly any[] ? { - type: JSONType<"array", IsPartial>; - items: UncheckedJSONSchemaType; - contains?: UncheckedPartialSchema; - minItems?: number; - maxItems?: number; - minContains?: number; - maxContains?: number; - uniqueItems?: true; - additionalItems?: never; -} : T extends Record ? { - type: JSONType<"object", IsPartial>; - additionalProperties?: boolean | UncheckedJSONSchemaType; - unevaluatedProperties?: boolean | UncheckedJSONSchemaType; - properties?: IsPartial extends true ? Partial> : UncheckedPropertiesSchema; - patternProperties?: Record>; - propertyNames?: Omit, "type"> & { - type?: "string"; - }; - dependencies?: { - [K in keyof T]?: Readonly<(keyof T)[]> | UncheckedPartialSchema; - }; - dependentRequired?: { - [K in keyof T]?: Readonly<(keyof T)[]>; - }; - dependentSchemas?: { - [K in keyof T]?: UncheckedPartialSchema; - }; - minProperties?: number; - maxProperties?: number; -} & (IsPartial extends true ? { - required: Readonly<(keyof T)[]>; -} : [UncheckedRequiredMembers] extends [never] ? { - required?: Readonly[]>; -} : { - required: Readonly[]>; -}) : T extends null ? { - type: JSONType<"null", IsPartial>; - nullable: true; -} : never) & { - allOf?: Readonly[]>; - anyOf?: Readonly[]>; - oneOf?: Readonly[]>; - if?: UncheckedPartialSchema; - then?: UncheckedPartialSchema; - else?: UncheckedPartialSchema; - not?: UncheckedPartialSchema; -})) & { - [keyword: string]: any; - $id?: string; - $ref?: string; - $defs?: Record>; - definitions?: Record>; -}; -export declare type JSONSchemaType = StrictNullChecksWrapper<"JSONSchemaType", UncheckedJSONSchemaType>; -declare type Known = { - [key: string]: Known; -} | [Known, ...Known[]] | Known[] | number | string | boolean | null; -declare type UncheckedPropertiesSchema = { - [K in keyof T]-?: (UncheckedJSONSchemaType & Nullable) | { - $ref: string; - }; -}; -export declare type PropertiesSchema = StrictNullChecksWrapper<"PropertiesSchema", UncheckedPropertiesSchema>; -declare type UncheckedRequiredMembers = { - [K in keyof T]-?: undefined extends T[K] ? never : K; -}[keyof T]; -export declare type RequiredMembers = StrictNullChecksWrapper<"RequiredMembers", UncheckedRequiredMembers>; -declare type Nullable = undefined extends T ? { - nullable: true; - const?: null; - enum?: Readonly<(T | null)[]>; - default?: T | null; -} : { - const?: T; - enum?: Readonly; - default?: T; -}; -export {}; diff --git a/packages/toolkit/utils/compiled/ajv/types/types/jtd-schema.d.ts b/packages/toolkit/utils/compiled/ajv/types/types/jtd-schema.d.ts deleted file mode 100644 index 3004e5e5be37..000000000000 --- a/packages/toolkit/utils/compiled/ajv/types/types/jtd-schema.d.ts +++ /dev/null @@ -1,169 +0,0 @@ -/** numeric strings */ -declare type NumberType = "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32"; -/** string strings */ -declare type StringType = "string" | "timestamp"; -/** Generic JTD Schema without inference of the represented type */ -export declare type SomeJTDSchemaType = (// ref -{ - ref: string; -} | { - type: NumberType | StringType | "boolean"; -} | { - enum: string[]; -} | { - elements: SomeJTDSchemaType; -} | { - values: SomeJTDSchemaType; -} | { - properties: Record; - optionalProperties?: Record; - additionalProperties?: boolean; -} | { - properties?: Record; - optionalProperties: Record; - additionalProperties?: boolean; -} | { - discriminator: string; - mapping: Record; -} | {}) & { - nullable?: boolean; - metadata?: Record; - definitions?: Record; -}; -/** required keys of an object, not undefined */ -declare type RequiredKeys = { - [K in keyof T]-?: undefined extends T[K] ? never : K; -}[keyof T]; -/** optional or undifined-able keys of an object */ -declare type OptionalKeys = { - [K in keyof T]-?: undefined extends T[K] ? K : never; -}[keyof T]; -/** type is true if T is a union type */ -declare type IsUnion_ = false extends (T extends unknown ? ([U] extends [T] ? false : true) : never) ? false : true; -declare type IsUnion = IsUnion_; -/** type is true if T is identically E */ -declare type TypeEquality = [T] extends [E] ? ([E] extends [T] ? true : false) : false; -/** type is true if T or null is identically E or null*/ -declare type NullTypeEquality = TypeEquality; -/** gets only the string literals of a type or null if a type isn't a string literal */ -declare type EnumString = [T] extends [never] ? null : T extends string ? string extends T ? null : T : null; -/** true if type is a union of string literals */ -declare type IsEnum = null extends EnumString> ? false : true; -/** true only if all types are array types (not tuples) */ -declare type IsElements = false extends IsUnion ? [T] extends [readonly unknown[]] ? undefined extends T[0.5] ? false : true : false : false; -/** true if the the type is a values type */ -declare type IsValues = false extends IsUnion> ? TypeEquality, string> : false; -/** true if type is a proeprties type and Union is false, or type is a discriminator type and Union is true */ -declare type IsRecord = Union extends IsUnion> ? null extends EnumString> ? false : true : false; -/** actual schema */ -export declare type JTDSchemaType = Record> = (// refs - where null wasn't specified, must match exactly -(null extends EnumString ? never : ({ - [K in keyof D]: [T] extends [D[K]] ? { - ref: K; - } : never; -}[keyof D] & { - nullable?: false; -}) | (null extends T ? { - [K in keyof D]: [Exclude] extends [Exclude] ? { - ref: K; - } : never; -}[keyof D] & { - nullable: true; -} : never)) | (unknown extends T ? { - nullable?: boolean; -} : never) | ((true extends NullTypeEquality ? { - type: NumberType; -} : true extends NullTypeEquality ? { - type: "boolean"; -} : true extends NullTypeEquality ? { - type: StringType; -} : true extends NullTypeEquality ? { - type: "timestamp"; -} : true extends IsEnum ? { - enum: EnumString>[]; -} : true extends IsElements> ? T extends readonly (infer E)[] ? { - elements: JTDSchemaType; -} : never : true extends IsValues ? T extends Record ? { - values: JTDSchemaType; -} : never : true extends IsRecord ? ([RequiredKeys>] extends [never] ? { - properties?: Record; -} : { - properties: { - [K in RequiredKeys]: JTDSchemaType; - }; -}) & ([OptionalKeys>] extends [never] ? { - optionalProperties?: Record; -} : { - optionalProperties: { - [K in OptionalKeys]: JTDSchemaType, D>; - }; -}) & { - additionalProperties?: boolean; -} : true extends IsRecord ? { - [K in keyof Exclude]-?: Exclude[K] extends string ? { - discriminator: K; - mapping: { - [M in Exclude[K]]: JTDSchemaType, D>; - }; - } : never; -}[keyof Exclude] : never) & (null extends T ? { - nullable: true; -} : { - nullable?: false; -}))) & { - metadata?: Record; - definitions?: { - [K in keyof D]: JTDSchemaType; - }; -}; -declare type JTDDataDef> = // ref -(S extends { - ref: string; -} ? D extends { - [K in S["ref"]]: infer V; -} ? JTDDataDef : never : S extends { - type: NumberType; -} ? number : S extends { - type: "boolean"; -} ? boolean : S extends { - type: "string"; -} ? string : S extends { - type: "timestamp"; -} ? string | Date : S extends { - enum: readonly (infer E)[]; -} ? string extends E ? never : [E] extends [string] ? E : never : S extends { - elements: infer E; -} ? JTDDataDef[] : S extends { - properties: Record; - optionalProperties?: Record; - additionalProperties?: boolean; -} ? { - -readonly [K in keyof S["properties"]]-?: JTDDataDef; -} & { - -readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef; -} & ([S["additionalProperties"]] extends [true] ? Record : unknown) : S extends { - properties?: Record; - optionalProperties: Record; - additionalProperties?: boolean; -} ? { - -readonly [K in keyof S["properties"]]-?: JTDDataDef; -} & { - -readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef; -} & ([S["additionalProperties"]] extends [true] ? Record : unknown) : S extends { - values: infer V; -} ? Record> : S extends { - discriminator: infer M; - mapping: Record; -} ? [M] extends [string] ? { - [K in keyof S["mapping"]]: JTDDataDef & { - [KM in M]: K; - }; -}[keyof S["mapping"]] : never : unknown) | (S extends { - nullable: true; -} ? null : never); -export declare type JTDDataType = S extends { - definitions: Record; -} ? JTDDataDef : JTDDataDef>; -export {}; diff --git a/packages/toolkit/utils/compiled/ajv/types/vocabularies/errors.d.ts b/packages/toolkit/utils/compiled/ajv/types/vocabularies/errors.d.ts deleted file mode 100644 index c89691ff5cfb..000000000000 --- a/packages/toolkit/utils/compiled/ajv/types/vocabularies/errors.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type DefinedError = any; \ No newline at end of file diff --git a/packages/toolkit/utils/compiled/ajv/uri-js.d.ts b/packages/toolkit/utils/compiled/ajv/uri-js.d.ts deleted file mode 100644 index da51e2352770..000000000000 --- a/packages/toolkit/utils/compiled/ajv/uri-js.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -export interface URIComponents { - scheme?: string; - userinfo?: string; - host?: string; - port?: number | string; - path?: string; - query?: string; - fragment?: string; - reference?: string; - error?: string; -} -export interface URIOptions { - scheme?: string; - reference?: string; - tolerant?: boolean; - absolutePath?: boolean; - iri?: boolean; - unicodeSupport?: boolean; - domainHost?: boolean; -} -export interface URISchemeHandler { - scheme: string; - parse(components: ParentComponents, options: Options): Components; - serialize(components: Components, options: Options): ParentComponents; - unicodeSupport?: boolean; - domainHost?: boolean; - absolutePath?: boolean; -} -export interface URIRegExps { - NOT_SCHEME: RegExp; - NOT_USERINFO: RegExp; - NOT_HOST: RegExp; - NOT_PATH: RegExp; - NOT_PATH_NOSCHEME: RegExp; - NOT_QUERY: RegExp; - NOT_FRAGMENT: RegExp; - ESCAPE: RegExp; - UNRESERVED: RegExp; - OTHER_CHARS: RegExp; - PCT_ENCODED: RegExp; - IPV4ADDRESS: RegExp; - IPV6ADDRESS: RegExp; -} -export declare const SCHEMES: { - [scheme: string]: URISchemeHandler; -}; -export declare function pctEncChar(chr: string): string; -export declare function pctDecChars(str: string): string; -export declare function parse(uriString: string, options?: URIOptions): URIComponents; -export declare function removeDotSegments(input: string): string; -export declare function serialize(components: URIComponents, options?: URIOptions): string; -export declare function resolveComponents(base: URIComponents, relative: URIComponents, options?: URIOptions, skipNormalization?: boolean): URIComponents; -export declare function resolve(baseURI: string, relativeURI: string, options?: URIOptions): string; -export declare function normalize(uri: string, options?: URIOptions): string; -export declare function normalize(uri: URIComponents, options?: URIOptions): URIComponents; -export declare function equal(uriA: string, uriB: string, options?: URIOptions): boolean; -export declare function equal(uriA: URIComponents, uriB: URIComponents, options?: URIOptions): boolean; -export declare function escapeComponent(str: string, options?: URIOptions): string; -export declare function unescapeComponent(str: string, options?: URIOptions): string; diff --git a/packages/toolkit/utils/compiled/better-ajv-errors/index.d.ts b/packages/toolkit/utils/compiled/better-ajv-errors/index.d.ts deleted file mode 100644 index a2ac5f9bc2ef..000000000000 --- a/packages/toolkit/utils/compiled/better-ajv-errors/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export = any; diff --git a/packages/toolkit/utils/compiled/better-ajv-errors/index.js b/packages/toolkit/utils/compiled/better-ajv-errors/index.js deleted file mode 100644 index 905f91b80812..000000000000 --- a/packages/toolkit/utils/compiled/better-ajv-errors/index.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{var e={727:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const r="[";const n="]";const o="{";const a="}";const s=":";const i=",";const l="true";const c="false";const u="null";const f='"';const h=new Map([["t",l],["f",c],["n",u]]);const d=new Map([[f,f],["\\","\\"],["/","/"],["b","\b"],["n","\n"],["f","\f"],["r","\r"],["t","\t"]]);const p=new Map([[r,"Punctuator"],[n,"Punctuator"],[o,"Punctuator"],[a,"Punctuator"],[s,"Punctuator"],[i,"Punctuator"],[l,"Boolean"],[c,"Boolean"],[u,"Null"]]);class ErrorWithLocation extends Error{constructor(e,{line:t,column:r,index:n}){super(`${e} (${t}:${r})`);this.line=t;this.column=r;this.index=n}}class UnexpectedChar extends ErrorWithLocation{constructor(e,t){super(`Unexpected character ${e} found.`,t)}}class UnexpectedToken extends ErrorWithLocation{constructor(e){super(`Unexpected token ${e.type}(${e.value}) found.`,e.loc.start)}}class UnexpectedEOF extends ErrorWithLocation{constructor(e){super("Unexpected end of input found.",e)}}const g='"';const v="/";const b="*";const m={comments:false,ranges:false};function isWhitespace(e){return/[\s\n]/.test(e)}function isDigit(e){return e>="0"&&e<="9"}function isHexDigit(e){return isDigit(e)||/[a-f]/i.test(e)}function isPositiveDigit(e){return e>="1"&&e<="9"}function isKeywordStart(e){return/[tfn]/.test(e)}function isNumberStart(e){return isDigit(e)||e==="."||e==="-"}function tokenize(e,t){t=Object.freeze({...m,...t});let r=-1;let n=1;let o=0;let a=false;const s=[];function createToken(e,r,n,o){const a=n.offset+r.length;let s=t.ranges?{range:[n.offset,a]}:undefined;return{type:e,value:r,loc:{start:n,end:o||{line:n.line,column:n.column+r.length,offset:a}},...s}}function next(){let t=e.charAt(++r);if(a){n++;o=1;a=false}else{o++}if(t==="\r"){a=true;if(e.charAt(r+1)==="\n"){r++}}else if(t==="\n"){a=true}return t}function locate(){return{line:n,column:o,offset:r}}function readKeyword(t){let n=h.get(t);if(e.slice(r,r+n.length)===n){r+=n.length-1;o+=n.length-1;return{value:n,c:next()}}for(let t=1;t=0){r+=t.slice(o,n);const a=t.charAt(n+1);if(d.has(a)){r+=d.get(a);o=n+2}else if(a==="u"){const a=t.slice(n+2,n+6);if(a.length<4||/[^0-9a-f]/i.test(a)){throw new ErrorWithLocation(`Invalid unicode escape \\u${a}.`,{line:e.loc.start.line,column:e.loc.start.column+n,offset:e.loc.start.offset+n})}r+=String.fromCharCode(parseInt(a,16));o=n+6}else{throw new ErrorWithLocation(`Invalid escape \\${a}.`,{line:e.loc.start.line,column:e.loc.start.column+n,offset:e.loc.start.offset+n})}n=t.indexOf("\\",o)}r+=t.slice(o);return r}function getLiteralValue(e){switch(e.type){case"Boolean":return e.value==="true";case"Number":return Number(e.value);case"Null":return null;case"String":return getStringValue(e)}}function parse(e,t){t=Object.freeze({...w,...t});const r=tokenize(e,{comments:!!t.comments,ranges:!!t.ranges});let n=0;function nextNoComments(){return r[n++]}function nextSkipComments(){const e=r[n++];if(e&&e.type.endsWith("Comment")){return nextSkipComments()}return e}const o=t.comments?nextSkipComments:nextNoComments;function assertTokenValue(e,t){if(!e||e.value!==t){throw new UnexpectedToken(e)}}function assertTokenType(e,t){if(!e||e.type!==t){throw new UnexpectedToken(e)}}function createRange(e,r){return t.ranges?{range:[e.offset,r.offset]}:undefined}function createLiteralNode(e){const t=createRange(e.loc.start,e.loc.end);return{type:e.type,value:getLiteralValue(e),loc:{start:{...e.loc.start},end:{...e.loc.end}},...t}}function parseProperty(e){assertTokenType(e,"String");const t=createLiteralNode(e);e=o();assertTokenValue(e,":");const r=parseValue();const n=createRange(t.loc.start,r.loc.end);return y.member(t,r,{loc:{start:{...t.loc.start},end:{...r.loc.end}},...n})}function parseObject(e){assertTokenValue(e,"{");const t=[];let r=o();if(r&&r.value!=="}"){do{t.push(parseProperty(r));r=o();if(r.value===","){r=o()}else{break}}while(r)}assertTokenValue(r,"}");const n=createRange(e.loc.start,r.loc.end);return y.object(t,{loc:{start:{...e.loc.start},end:{...r.loc.end}},...n})}function parseArray(e){assertTokenValue(e,"[");const t=[];let r=o();if(r&&r.value!=="]"){do{t.push(parseValue(r));r=o();if(r.value===","){r=o()}else{break}}while(r)}assertTokenValue(r,"]");const n=createRange(e.loc.start,r.loc.end);return y.array(t,{type:"Array",elements:t,loc:{start:{...e.loc.start},end:{...r.loc.end}},...n})}function parseValue(e){e=e||o();switch(e.type){case"String":case"Boolean":case"Number":case"Null":return createLiteralNode(e);case"Punctuator":if(e.value==="{"){return parseObject(e)}else if(e.value==="["){return parseArray(e)}default:throw new UnexpectedToken(e)}}const a=parseValue();const s=o();if(s){throw new UnexpectedToken(s)}const i={loc:{start:{line:1,column:1,offset:0},end:{...a.loc.end}}};if(t.tokens){i.tokens=r}if(t.ranges){i.range=createRange(i.loc.start,i.loc.end)}return y.document(a,i)}const O=new Map([["Document",["body"]],["Object",["members"]],["Member",["name","value"]],["Array",["elements"]],["String",[]],["Number",[]],["Boolean",[]],["Null",[]]]);function isObject(e){return e&&typeof e==="object"}function isNode(e){return isObject(e)&&typeof e.type==="string"}function traverse(e,t){function visitNode(e,r){if(typeof t.enter==="function"){t.enter(e,r)}for(const t of O.get(e.type)){const r=e[t];if(isObject(r)){if(Array.isArray(r)){r.forEach((t=>visitNode(t,e)))}else if(isNode(r)){visitNode(r,e)}}}if(typeof t.exit==="function"){t.exit(e,r)}}visitNode(e)}function iterator(e,t=(()=>true)){const r=[];traverse(e,{enter(e,t){r.push({node:e,parent:t,phase:"enter"})},exit(e,t){r.push({node:e,parent:t,phase:"exit"})}});return r.filter(t).values()}function evaluate(e){switch(e.type){case"String":case"Number":case"Boolean":return e.value;case"Null":return null;case"Array":return e.elements.map(evaluate);case"Object":{const t={};e.members.forEach((e=>{t[evaluate(e.name)]=evaluate(e.value)}));return t}case"Document":return evaluate(e.body);case"Property":throw new Error("Cannot evaluate object property outside of an object.");default:throw new Error(`Unknown node type ${e.type}.`)}}function print(e,{indent:t=0}={}){const r=evaluate(e);return JSON.stringify(r,null,t)}t.evaluate=evaluate;t.iterator=iterator;t.parse=parse;t.print=print;t.tokenize=tokenize;t.traverse=traverse;t.types=y},571:(e,t,r)=>{"use strict";e=r.nmd(e);const n=r(755);const wrapAnsi16=(e,t)=>function(){const r=e.apply(n,arguments);return`[${r+t}m`};const wrapAnsi256=(e,t)=>function(){const r=e.apply(n,arguments);return`[${38+t};5;${r}m`};const wrapAnsi16m=(e,t)=>function(){const r=e.apply(n,arguments);return`[${38+t};2;${r[0]};${r[1]};${r[2]}m`};function assembleStyles(){const e=new Map;const t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.grey=t.color.gray;for(const r of Object.keys(t)){const n=t[r];for(const r of Object.keys(n)){const o=n[r];t[r]={open:`[${o[0]}m`,close:`[${o[1]}m`};n[r]=t[r];e.set(o[0],o[1])}Object.defineProperty(t,r,{value:n,enumerable:false});Object.defineProperty(t,"codes",{value:e,enumerable:false})}const ansi2ansi=e=>e;const rgb2rgb=(e,t,r)=>[e,t,r];t.color.close="";t.bgColor.close="";t.color.ansi={ansi:wrapAnsi16(ansi2ansi,0)};t.color.ansi256={ansi256:wrapAnsi256(ansi2ansi,0)};t.color.ansi16m={rgb:wrapAnsi16m(rgb2rgb,0)};t.bgColor.ansi={ansi:wrapAnsi16(ansi2ansi,10)};t.bgColor.ansi256={ansi256:wrapAnsi256(ansi2ansi,10)};t.bgColor.ansi16m={rgb:wrapAnsi16m(rgb2rgb,10)};for(let e of Object.keys(n)){if(typeof n[e]!=="object"){continue}const r=n[e];if(e==="ansi16"){e="ansi"}if("ansi16"in r){t.color.ansi[e]=wrapAnsi16(r.ansi16,0);t.bgColor.ansi[e]=wrapAnsi16(r.ansi16,10)}if("ansi256"in r){t.color.ansi256[e]=wrapAnsi256(r.ansi256,0);t.bgColor.ansi256[e]=wrapAnsi256(r.ansi256,10)}if("rgb"in r){t.color.ansi16m[e]=wrapAnsi16m(r.rgb,0);t.bgColor.ansi16m[e]=wrapAnsi16m(r.rgb,10)}}return t}Object.defineProperty(e,"exports",{enumerable:true,get:assembleStyles})},44:(e,t,r)=>{"use strict";e=r.nmd(e);const wrapAnsi16=(e,t)=>(...r)=>{const n=e(...r);return`[${n+t}m`};const wrapAnsi256=(e,t)=>(...r)=>{const n=e(...r);return`[${38+t};5;${n}m`};const wrapAnsi16m=(e,t)=>(...r)=>{const n=e(...r);return`[${38+t};2;${n[0]};${n[1]};${n[2]}m`};const ansi2ansi=e=>e;const rgb2rgb=(e,t,r)=>[e,t,r];const setLazyProperty=(e,t,r)=>{Object.defineProperty(e,t,{get:()=>{const n=r();Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true});return n},enumerable:true,configurable:true})};let n;const makeDynamicStyles=(e,t,o,a)=>{if(n===undefined){n=r(767)}const s=a?10:0;const i={};for(const[r,a]of Object.entries(n)){const n=r==="ansi16"?"ansi":r;if(r===t){i[n]=e(o,s)}else if(typeof a==="object"){i[n]=e(a[t],s)}}return i};function assembleStyles(){const e=new Map;const t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.gray=t.color.blackBright;t.bgColor.bgGray=t.bgColor.bgBlackBright;t.color.grey=t.color.blackBright;t.bgColor.bgGrey=t.bgColor.bgBlackBright;for(const[r,n]of Object.entries(t)){for(const[r,o]of Object.entries(n)){t[r]={open:`[${o[0]}m`,close:`[${o[1]}m`};n[r]=t[r];e.set(o[0],o[1])}Object.defineProperty(t,r,{value:n,enumerable:false})}Object.defineProperty(t,"codes",{value:e,enumerable:false});t.color.close="";t.bgColor.close="";setLazyProperty(t.color,"ansi",(()=>makeDynamicStyles(wrapAnsi16,"ansi16",ansi2ansi,false)));setLazyProperty(t.color,"ansi256",(()=>makeDynamicStyles(wrapAnsi256,"ansi256",ansi2ansi,false)));setLazyProperty(t.color,"ansi16m",(()=>makeDynamicStyles(wrapAnsi16m,"rgb",rgb2rgb,false)));setLazyProperty(t.bgColor,"ansi",(()=>makeDynamicStyles(wrapAnsi16,"ansi16",ansi2ansi,true)));setLazyProperty(t.bgColor,"ansi256",(()=>makeDynamicStyles(wrapAnsi256,"ansi256",ansi2ansi,true)));setLazyProperty(t.bgColor,"ansi16m",(()=>makeDynamicStyles(wrapAnsi16m,"rgb",rgb2rgb,true)));return t}Object.defineProperty(e,"exports",{enumerable:true,get:assembleStyles})},228:(e,t,r)=>{var n=Object.defineProperty;var o=Object.defineProperties;var a=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyDescriptors;var i=Object.getOwnPropertyNames;var l=Object.getOwnPropertySymbols;var c=Object.prototype.hasOwnProperty;var u=Object.prototype.propertyIsEnumerable;var __defNormalProp=(e,t,r)=>t in e?n(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r;var __spreadValues=(e,t)=>{for(var r in t||(t={}))if(c.call(t,r))__defNormalProp(e,r,t[r]);if(l)for(var r of l(t)){if(u.call(t,r))__defNormalProp(e,r,t[r])}return e};var __spreadProps=(e,t)=>o(e,s(t));var __export=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:true})};var __copyProps=(e,t,r,o)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let s of i(t))if(!c.call(e,s)&&s!==r)n(e,s,{get:()=>t[s],enumerable:!(o=a(t,s))||o.enumerable})}return e};var __toCommonJS=e=>__copyProps(n({},"__esModule",{value:true}),e);var f={};__export(f,{createErrorInstances:()=>createErrorInstances,default:()=>helpers_default,filterRedundantErrors:()=>filterRedundantErrors,makeTree:()=>makeTree});e.exports=__toCommonJS(f);var h=r(694);var d=r(109);const p=/\/[\w_-]+(\/\d+)?/g;function makeTree(e=[]){const t={children:{}};e.forEach((e=>{const r=typeof e.instancePath!=="undefined"?e.instancePath:e.dataPath;const n=r===""?[""]:r.match(p);n&&n.reduce(((t,r,o)=>{t.children[r]=t.children[r]||{children:{},errors:[]};if(o===n.length-1){t.children[r].errors.push(e)}return t.children[r]}),t)}));return t}function filterRedundantErrors(e,t,r){(0,h.getErrors)(e).forEach((t=>{if((0,h.isRequiredError)(t)){e.errors=[t];e.children={}}}));if((0,h.getErrors)(e).some(h.isAnyOfError)){if(Object.keys(e.children).length>0){delete e.errors}}if(e.errors&&e.errors.length&&(0,h.getErrors)(e).every(h.isEnumError)){if((0,h.getSiblings)(t)(e).filter(h.notUndefined).some(h.getErrors)){delete t.children[r]}}Object.entries(e.children).forEach((([t,r])=>filterRedundantErrors(r,e,t)))}function createErrorInstances(e,t){const r=(0,h.getErrors)(e);if(r.length&&r.every(h.isEnumError)){const e=new Set((0,h.concatAll)([])(r.map((e=>e.params.allowedValues))));const n=[...e];const o=r[0];return[new d.EnumValidationError(__spreadProps(__spreadValues({},o),{params:{allowedValues:n}}),t)]}else{return(0,h.concatAll)(r.reduce(((e,r)=>{switch(r.keyword){case"additionalProperties":return e.concat(new d.AdditionalPropValidationError(r,t));case"required":return e.concat(new d.RequiredValidationError(r,t));default:return e.concat(new d.DefaultValidationError(r,t))}}),[]))((0,h.getChildren)(e).map((e=>createErrorInstances(e,t))))}}var helpers_default=(e,t)=>{const r=makeTree(e||[]);filterRedundantErrors(r);return createErrorInstances(r,t)};0&&0},281:(e,t,r)=>{var n=Object.create;var o=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var i=Object.getPrototypeOf;var l=Object.prototype.hasOwnProperty;var __export=(e,t)=>{for(var r in t)o(e,r,{get:t[r],enumerable:true})};var __copyProps=(e,t,r,n)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of s(t))if(!l.call(e,i)&&i!==r)o(e,i,{get:()=>t[i],enumerable:!(n=a(t,i))||n.enumerable})}return e};var __toESM=(e,t,r)=>(r=e!=null?n(i(e)):{},__copyProps(t||!e||!e.__esModule?o(r,"default",{value:e,enumerable:true}):r,e));var __toCommonJS=e=>__copyProps(o({},"__esModule",{value:true}),e);var c={};__export(c,{default:()=>src_default});e.exports=__toCommonJS(c);var u=r(727);var f=__toESM(r(228));var src_default=(e,t,r,n={})=>{const{format:o="cli",indent:a=null,json:s=null}=n;const i=s||JSON.stringify(t,null,a);const l=(0,u.parse)(i);const customErrorToText=e=>e.print().join("\n");const customErrorToStructure=e=>e.getError();const c=(0,f.default)(r,{data:t,schema:e,jsonAst:l,jsonRaw:i});if(o==="cli"){return c.map(customErrorToText).join("\n\n")}else{return c.map(customErrorToStructure)}};0&&0},60:(e,t,r)=>{var n=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var __export=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:true})};var __copyProps=(e,t,r,i)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let l of a(t))if(!s.call(e,l)&&l!==r)n(e,l,{get:()=>t[l],enumerable:!(i=o(t,l))||i.enumerable})}return e};var __toCommonJS=e=>__copyProps(n({},"__esModule",{value:true}),e);var i={};__export(i,{default:()=>getDecoratedDataPath});e.exports=__toCommonJS(i);var l=r(381);function getDecoratedDataPath(e,t){let r="";(0,l.getPointers)(t).reduce(((e,n)=>{switch(e.type){case"Object":{r+=`/${n}`;const o=e.members.filter((e=>e.name.value===n));if(o.length!==1){throw new Error(`Couldn't find property ${n} of ${t}`)}return o[0].value}case"Array":{r+=`/${n}${getTypeName(e.elements[n])}`;return e.elements[n]}default:console.log(e)}}),e.body);return r}function getTypeName(e){if(!e||!e.elements){return""}const t=e.elements.filter((e=>e&&e.name&&e.name.value==="type"));if(!t.length){return""}return t[0].value&&`:${t[0].value.value}`||""}0&&0},28:(e,t,r)=>{var n=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var __export=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:true})};var __copyProps=(e,t,r,i)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let l of a(t))if(!s.call(e,l)&&l!==r)n(e,l,{get:()=>t[l],enumerable:!(i=o(t,l))||i.enumerable})}return e};var __toCommonJS=e=>__copyProps(n({},"__esModule",{value:true}),e);var i={};__export(i,{default:()=>getMetaFromPath});e.exports=__toCommonJS(i);var l=r(381);function getMetaFromPath(e,t,r){const n=(0,l.getPointers)(t);const o=n.length-1;return n.reduce(((e,n,a)=>{switch(e.type){case"Object":{const s=e.members.filter((e=>e.name.value===n));if(s.length!==1){throw new Error(`Couldn't find property ${n} of ${t}`)}const{name:i,value:l}=s[0];return r&&a===o?i:l}case"Array":return e.elements[n];default:console.log(e)}}),e.body)}0&&0},131:(e,t,r)=>{var n=Object.create;var o=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var i=Object.getPrototypeOf;var l=Object.prototype.hasOwnProperty;var __export=(e,t)=>{for(var r in t)o(e,r,{get:t[r],enumerable:true})};var __copyProps=(e,t,r,n)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of s(t))if(!l.call(e,i)&&i!==r)o(e,i,{get:()=>t[i],enumerable:!(n=a(t,i))||n.enumerable})}return e};var __toESM=(e,t,r)=>(r=e!=null?n(i(e)):{},__copyProps(t||!e||!e.__esModule?o(r,"default",{value:e,enumerable:true}):r,e));var __toCommonJS=e=>__copyProps(o({},"__esModule",{value:true}),e);var c={};__export(c,{getDecoratedDataPath:()=>f.default,getMetaFromPath:()=>u.default});e.exports=__toCommonJS(c);var u=__toESM(r(28));var f=__toESM(r(60));0&&0},381:e=>{var t=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var __export=(e,r)=>{for(var n in r)t(e,n,{get:r[n],enumerable:true})};var __copyProps=(e,a,s,i)=>{if(a&&typeof a==="object"||typeof a==="function"){for(let l of n(a))if(!o.call(e,l)&&l!==s)t(e,l,{get:()=>a[l],enumerable:!(i=r(a,l))||i.enumerable})}return e};var __toCommonJS=e=>__copyProps(t({},"__esModule",{value:true}),e);var a={};__export(a,{getPointers:()=>getPointers});e.exports=__toCommonJS(a);const getPointers=e=>e.split("/").slice(1).map((e=>e.split("~1").join("/").split("~0").join("~")));0&&0},694:e=>{var t=Object.defineProperty;var r=Object.defineProperties;var n=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyDescriptors;var a=Object.getOwnPropertyNames;var s=Object.getOwnPropertySymbols;var i=Object.prototype.hasOwnProperty;var l=Object.prototype.propertyIsEnumerable;var __defNormalProp=(e,r,n)=>r in e?t(e,r,{enumerable:true,configurable:true,writable:true,value:n}):e[r]=n;var __spreadValues=(e,t)=>{for(var r in t||(t={}))if(i.call(t,r))__defNormalProp(e,r,t[r]);if(s)for(var r of s(t)){if(l.call(t,r))__defNormalProp(e,r,t[r])}return e};var __spreadProps=(e,t)=>r(e,o(t));var __export=(e,r)=>{for(var n in r)t(e,n,{get:r[n],enumerable:true})};var __copyProps=(e,r,o,s)=>{if(r&&typeof r==="object"||typeof r==="function"){for(let l of a(r))if(!i.call(e,l)&&l!==o)t(e,l,{get:()=>r[l],enumerable:!(s=n(r,l))||s.enumerable})}return e};var __toCommonJS=e=>__copyProps(t({},"__esModule",{value:true}),e);var c={};__export(c,{concatAll:()=>concatAll,getChildren:()=>getChildren,getErrors:()=>getErrors,getSiblings:()=>getSiblings,isAnyOfError:()=>f,isEnumError:()=>h,isRequiredError:()=>u,notUndefined:()=>notUndefined});e.exports=__toCommonJS(c);const eq=e=>t=>e===t;const not=e=>t=>!e(t);const getValues=e=>Object.values(e);const notUndefined=e=>e!==void 0;const isXError=e=>t=>t.keyword===e;const u=isXError("required");const f=isXError("anyOf");const h=isXError("enum");const getErrors=e=>e&&e.errors?e.errors.map((e=>e.keyword==="errorMessage"?__spreadProps(__spreadValues({},e.params.errors[0]),{message:e.message}):e)):[];const getChildren=e=>e&&getValues(e.children)||[];const getSiblings=e=>t=>getChildren(e).filter(not(eq(t)));const concatAll=e=>t=>t.reduce(((e,t)=>e.concat(t)),e);0&&0},997:(e,t,r)=>{var n=Object.create;var o=Object.defineProperty;var a=Object.defineProperties;var s=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyDescriptors;var l=Object.getOwnPropertyNames;var c=Object.getOwnPropertySymbols;var u=Object.getPrototypeOf;var f=Object.prototype.hasOwnProperty;var h=Object.prototype.propertyIsEnumerable;var __defNormalProp=(e,t,r)=>t in e?o(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r;var __spreadValues=(e,t)=>{for(var r in t||(t={}))if(f.call(t,r))__defNormalProp(e,r,t[r]);if(c)for(var r of c(t)){if(h.call(t,r))__defNormalProp(e,r,t[r])}return e};var __spreadProps=(e,t)=>a(e,i(t));var __export=(e,t)=>{for(var r in t)o(e,r,{get:t[r],enumerable:true})};var __copyProps=(e,t,r,n)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let a of l(t))if(!f.call(e,a)&&a!==r)o(e,a,{get:()=>t[a],enumerable:!(n=s(t,a))||n.enumerable})}return e};var __toESM=(e,t,r)=>(r=e!=null?n(u(e)):{},__copyProps(t||!e||!e.__esModule?o(r,"default",{value:e,enumerable:true}):r,e));var __toCommonJS=e=>__copyProps(o({},"__esModule",{value:true}),e);var d={};__export(d,{default:()=>AdditionalPropValidationError});e.exports=__toCommonJS(d);var p=__toESM(r(584));var g=__toESM(r(272));class AdditionalPropValidationError extends g.default{constructor(...e){super(...e);this.options.isIdentifierLocation=true}print(){const{message:e,params:t}=this.options;const r=[p.default`{red {bold ADDTIONAL PROPERTY} ${e}}\n`];return r.concat(this.getCodeFrame(p.default`😲 {magentaBright ${t.additionalProperty}} is not expected to be here!`,`${this.instancePath}/${t.additionalProperty}`))}getError(){const{params:e}=this.options;return __spreadProps(__spreadValues({},this.getLocation(`${this.instancePath}/${e.additionalProperty}`)),{error:`${this.getDecoratedPath()} Property ${e.additionalProperty} is not expected to be here`,path:this.instancePath})}}0&&0},272:(e,t,r)=>{var n=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var __export=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:true})};var __copyProps=(e,t,r,i)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let l of a(t))if(!s.call(e,l)&&l!==r)n(e,l,{get:()=>t[l],enumerable:!(i=o(t,l))||i.enumerable})}return e};var __toCommonJS=e=>__copyProps(n({},"__esModule",{value:true}),e);var i={};__export(i,{default:()=>BaseValidationError});e.exports=__toCommonJS(i);var l=r(135);var c=r(131);class BaseValidationError{constructor(e={isIdentifierLocation:false},{data:t,schema:r,jsonAst:n,jsonRaw:o}){this.options=e;this.data=t;this.schema=r;this.jsonAst=n;this.jsonRaw=o}getLocation(e=this.instancePath){const{isIdentifierLocation:t,isSkipEndLocation:r}=this.options;const{loc:n}=(0,c.getMetaFromPath)(this.jsonAst,e,t);return{start:n.start,end:r?void 0:n.end}}getDecoratedPath(e=this.instancePath){const t=(0,c.getDecoratedDataPath)(this.jsonAst,e);return t}getCodeFrame(e,t=this.instancePath){return(0,l.codeFrameColumns)(this.jsonRaw,this.getLocation(t),{highlightCode:true,message:e})}get instancePath(){return typeof this.options.instancePath!=="undefined"?this.options.instancePath:this.options.dataPath}print(){throw new Error(`Implement the 'print' method inside ${this.constructor.name}!`)}getError(){throw new Error(`Implement the 'getError' method inside ${this.constructor.name}!`)}}0&&0},64:(e,t,r)=>{var n=Object.create;var o=Object.defineProperty;var a=Object.defineProperties;var s=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyDescriptors;var l=Object.getOwnPropertyNames;var c=Object.getOwnPropertySymbols;var u=Object.getPrototypeOf;var f=Object.prototype.hasOwnProperty;var h=Object.prototype.propertyIsEnumerable;var __defNormalProp=(e,t,r)=>t in e?o(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r;var __spreadValues=(e,t)=>{for(var r in t||(t={}))if(f.call(t,r))__defNormalProp(e,r,t[r]);if(c)for(var r of c(t)){if(h.call(t,r))__defNormalProp(e,r,t[r])}return e};var __spreadProps=(e,t)=>a(e,i(t));var __export=(e,t)=>{for(var r in t)o(e,r,{get:t[r],enumerable:true})};var __copyProps=(e,t,r,n)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let a of l(t))if(!f.call(e,a)&&a!==r)o(e,a,{get:()=>t[a],enumerable:!(n=s(t,a))||n.enumerable})}return e};var __toESM=(e,t,r)=>(r=e!=null?n(u(e)):{},__copyProps(t||!e||!e.__esModule?o(r,"default",{value:e,enumerable:true}):r,e));var __toCommonJS=e=>__copyProps(o({},"__esModule",{value:true}),e);var d={};__export(d,{default:()=>DefaultValidationError});e.exports=__toCommonJS(d);var p=__toESM(r(584));var g=__toESM(r(272));class DefaultValidationError extends g.default{print(){const{keyword:e,message:t}=this.options;const r=[p.default`{red {bold ${e.toUpperCase()}} ${t}}\n`];return r.concat(this.getCodeFrame(p.default`👈🏽 {magentaBright ${e}} ${t}`))}getError(){const{keyword:e,message:t}=this.options;return __spreadProps(__spreadValues({},this.getLocation()),{error:`${this.getDecoratedPath()}: ${e} ${t}`,path:this.instancePath})}}0&&0},421:(e,t,r)=>{var n=Object.create;var o=Object.defineProperty;var a=Object.defineProperties;var s=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyDescriptors;var l=Object.getOwnPropertyNames;var c=Object.getOwnPropertySymbols;var u=Object.getPrototypeOf;var f=Object.prototype.hasOwnProperty;var h=Object.prototype.propertyIsEnumerable;var __defNormalProp=(e,t,r)=>t in e?o(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r;var __spreadValues=(e,t)=>{for(var r in t||(t={}))if(f.call(t,r))__defNormalProp(e,r,t[r]);if(c)for(var r of c(t)){if(h.call(t,r))__defNormalProp(e,r,t[r])}return e};var __spreadProps=(e,t)=>a(e,i(t));var __export=(e,t)=>{for(var r in t)o(e,r,{get:t[r],enumerable:true})};var __copyProps=(e,t,r,n)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let a of l(t))if(!f.call(e,a)&&a!==r)o(e,a,{get:()=>t[a],enumerable:!(n=s(t,a))||n.enumerable})}return e};var __toESM=(e,t,r)=>(r=e!=null?n(u(e)):{},__copyProps(t||!e||!e.__esModule?o(r,"default",{value:e,enumerable:true}):r,e));var __toCommonJS=e=>__copyProps(o({},"__esModule",{value:true}),e);var d={};__export(d,{default:()=>EnumValidationError});e.exports=__toCommonJS(d);var p=__toESM(r(584));var g=__toESM(r(954));var v=__toESM(r(472));var b=__toESM(r(272));class EnumValidationError extends b.default{print(){const{message:e,params:{allowedValues:t}}=this.options;const r=this.findBestMatch();const n=[p.default`{red {bold ENUM} ${e}}`,p.default`{red (${t.join(", ")})}\n`];return n.concat(this.getCodeFrame(r!==null?p.default`👈🏽 Did you mean {magentaBright ${r}} here?`:p.default`👈🏽 Unexpected value, should be equal to one of the allowed values`))}getError(){const{message:e,params:t}=this.options;const r=this.findBestMatch();const n=t.allowedValues.join(", ");const o=__spreadProps(__spreadValues({},this.getLocation()),{error:`${this.getDecoratedPath()} ${e}: ${n}`,path:this.instancePath});if(r!==null){o.suggestion=`Did you mean ${r}?`}return o}findBestMatch(){const{params:{allowedValues:e}}=this.options;const t=this.instancePath===""?this.data:v.default.get(this.data,this.instancePath);if(!t){return null}const r=e.map((e=>({value:e,weight:(0,g.default)(e,t.toString())}))).sort(((e,t)=>e.weight>t.weight?1:e.weight{var n=Object.create;var o=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var i=Object.getPrototypeOf;var l=Object.prototype.hasOwnProperty;var __export=(e,t)=>{for(var r in t)o(e,r,{get:t[r],enumerable:true})};var __copyProps=(e,t,r,n)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of s(t))if(!l.call(e,i)&&i!==r)o(e,i,{get:()=>t[i],enumerable:!(n=a(t,i))||n.enumerable})}return e};var __toESM=(e,t,r)=>(r=e!=null?n(i(e)):{},__copyProps(t||!e||!e.__esModule?o(r,"default",{value:e,enumerable:true}):r,e));var __toCommonJS=e=>__copyProps(o({},"__esModule",{value:true}),e);var c={};__export(c,{AdditionalPropValidationError:()=>f.default,DefaultValidationError:()=>d.default,EnumValidationError:()=>h.default,RequiredValidationError:()=>u.default});e.exports=__toCommonJS(c);var u=__toESM(r(318));var f=__toESM(r(997));var h=__toESM(r(421));var d=__toESM(r(64));0&&0},318:(e,t,r)=>{var n=Object.create;var o=Object.defineProperty;var a=Object.defineProperties;var s=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyDescriptors;var l=Object.getOwnPropertyNames;var c=Object.getOwnPropertySymbols;var u=Object.getPrototypeOf;var f=Object.prototype.hasOwnProperty;var h=Object.prototype.propertyIsEnumerable;var __defNormalProp=(e,t,r)=>t in e?o(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r;var __spreadValues=(e,t)=>{for(var r in t||(t={}))if(f.call(t,r))__defNormalProp(e,r,t[r]);if(c)for(var r of c(t)){if(h.call(t,r))__defNormalProp(e,r,t[r])}return e};var __spreadProps=(e,t)=>a(e,i(t));var __export=(e,t)=>{for(var r in t)o(e,r,{get:t[r],enumerable:true})};var __copyProps=(e,t,r,n)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let a of l(t))if(!f.call(e,a)&&a!==r)o(e,a,{get:()=>t[a],enumerable:!(n=s(t,a))||n.enumerable})}return e};var __toESM=(e,t,r)=>(r=e!=null?n(u(e)):{},__copyProps(t||!e||!e.__esModule?o(r,"default",{value:e,enumerable:true}):r,e));var __toCommonJS=e=>__copyProps(o({},"__esModule",{value:true}),e);var d={};__export(d,{default:()=>RequiredValidationError});e.exports=__toCommonJS(d);var p=__toESM(r(584));var g=__toESM(r(272));class RequiredValidationError extends g.default{getLocation(e=this.instancePath){const{start:t}=super.getLocation(e);return{start:t}}print(){const{message:e,params:t}=this.options;const r=[p.default`{red {bold REQUIRED} ${e}}\n`];return r.concat(this.getCodeFrame(p.default`☹️ {magentaBright ${t.missingProperty}} is missing here!`))}getError(){const{message:e}=this.options;return __spreadProps(__spreadValues({},this.getLocation()),{error:`${this.getDecoratedPath()} ${e}`,path:this.instancePath})}}0&&0},673:(e,t,r)=>{"use strict";const n=r(434);const o=r(571);const a=r(332).stdout;const s=r(956);const i=process.platform==="win32"&&!(process.env.TERM||"").toLowerCase().startsWith("xterm");const l=["ansi","ansi","ansi256","ansi16m"];const c=new Set(["gray"]);const u=Object.create(null);function applyOptions(e,t){t=t||{};const r=a?a.level:0;e.level=t.level===undefined?r:t.level;e.enabled="enabled"in t?t.enabled:e.level>0}function Chalk(e){if(!this||!(this instanceof Chalk)||this.template){const t={};applyOptions(t,e);t.template=function(){const e=[].slice.call(arguments);return chalkTag.apply(null,[t.template].concat(e))};Object.setPrototypeOf(t,Chalk.prototype);Object.setPrototypeOf(t.template,t);t.template.constructor=Chalk;return t.template}applyOptions(this,e)}if(i){o.blue.open=""}for(const e of Object.keys(o)){o[e].closeRe=new RegExp(n(o[e].close),"g");u[e]={get(){const t=o[e];return build.call(this,this._styles?this._styles.concat(t):[t],this._empty,e)}}}u.visible={get(){return build.call(this,this._styles||[],true,"visible")}};o.color.closeRe=new RegExp(n(o.color.close),"g");for(const e of Object.keys(o.color.ansi)){if(c.has(e)){continue}u[e]={get(){const t=this.level;return function(){const r=o.color[l[t]][e].apply(null,arguments);const n={open:r,close:o.color.close,closeRe:o.color.closeRe};return build.call(this,this._styles?this._styles.concat(n):[n],this._empty,e)}}}}o.bgColor.closeRe=new RegExp(n(o.bgColor.close),"g");for(const e of Object.keys(o.bgColor.ansi)){if(c.has(e)){continue}const t="bg"+e[0].toUpperCase()+e.slice(1);u[t]={get(){const t=this.level;return function(){const r=o.bgColor[l[t]][e].apply(null,arguments);const n={open:r,close:o.bgColor.close,closeRe:o.bgColor.closeRe};return build.call(this,this._styles?this._styles.concat(n):[n],this._empty,e)}}}}const f=Object.defineProperties((()=>{}),u);function build(e,t,r){const builder=function(){return applyStyle.apply(builder,arguments)};builder._styles=e;builder._empty=t;const n=this;Object.defineProperty(builder,"level",{enumerable:true,get(){return n.level},set(e){n.level=e}});Object.defineProperty(builder,"enabled",{enumerable:true,get(){return n.enabled},set(e){n.enabled=e}});builder.hasGrey=this.hasGrey||r==="gray"||r==="grey";builder.__proto__=f;return builder}function applyStyle(){const e=arguments;const t=e.length;let r=String(arguments[0]);if(t===0){return""}if(t>1){for(let n=1;n{"use strict";const t=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;const r=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;const n=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;const o=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi;const a=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function unescape(e){if(e[0]==="u"&&e.length===5||e[0]==="x"&&e.length===3){return String.fromCharCode(parseInt(e.slice(1),16))}return a.get(e)||e}function parseArguments(e,t){const r=[];const a=t.trim().split(/\s*,\s*/g);let s;for(const t of a){if(!isNaN(t)){r.push(Number(t))}else if(s=t.match(n)){r.push(s[2].replace(o,((e,t,r)=>t?unescape(t):r)))}else{throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`)}}return r}function parseStyle(e){r.lastIndex=0;const t=[];let n;while((n=r.exec(e))!==null){const e=n[1];if(n[2]){const r=parseArguments(e,n[2]);t.push([e].concat(r))}else{t.push([e])}}return t}function buildStyle(e,t){const r={};for(const e of t){for(const t of e.styles){r[t[0]]=e.inverse?null:t.slice(1)}}let n=e;for(const e of Object.keys(r)){if(Array.isArray(r[e])){if(!(e in n)){throw new Error(`Unknown Chalk style: ${e}`)}if(r[e].length>0){n=n[e].apply(n,r[e])}else{n=n[e]}}}return n}e.exports=(e,r)=>{const n=[];const o=[];let a=[];r.replace(t,((t,r,s,i,l,c)=>{if(r){a.push(unescape(r))}else if(i){const t=a.join("");a=[];o.push(n.length===0?t:buildStyle(e,n)(t));n.push({inverse:s,styles:parseStyle(i)})}else if(l){if(n.length===0){throw new Error("Found extraneous } in Chalk template literal")}o.push(buildStyle(e,n)(a.join("")));a=[];n.pop()}else{a.push(c)}}));o.push(a.join(""));if(n.length>0){const e=`Chalk template literal is missing ${n.length} closing bracket${n.length===1?"":"s"} (\`}\`)`;throw new Error(e)}return o.join("")}},584:(e,t,r)=>{"use strict";const n=r(44);const{stdout:o,stderr:a}=r(242);const{stringReplaceAll:s,stringEncaseCRLFWithFirstIndex:i}=r(905);const{isArray:l}=Array;const c=["ansi","ansi","ansi256","ansi16m"];const u=Object.create(null);const applyOptions=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3)){throw new Error("The `level` option should be an integer from 0 to 3")}const r=o?o.level:0;e.level=t.level===undefined?r:t.level};class ChalkClass{constructor(e){return chalkFactory(e)}}const chalkFactory=e=>{const t={};applyOptions(t,e);t.template=(...e)=>chalkTag(t.template,...e);Object.setPrototypeOf(t,Chalk.prototype);Object.setPrototypeOf(t.template,t);t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")};t.template.Instance=ChalkClass;return t.template};function Chalk(e){return chalkFactory(e)}for(const[e,t]of Object.entries(n)){u[e]={get(){const r=createBuilder(this,createStyler(t.open,t.close,this._styler),this._isEmpty);Object.defineProperty(this,e,{value:r});return r}}}u.visible={get(){const e=createBuilder(this,this._styler,true);Object.defineProperty(this,"visible",{value:e});return e}};const f=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const e of f){u[e]={get(){const{level:t}=this;return function(...r){const o=createStyler(n.color[c[t]][e](...r),n.color.close,this._styler);return createBuilder(this,o,this._isEmpty)}}}}for(const e of f){const t="bg"+e[0].toUpperCase()+e.slice(1);u[t]={get(){const{level:t}=this;return function(...r){const o=createStyler(n.bgColor[c[t]][e](...r),n.bgColor.close,this._styler);return createBuilder(this,o,this._isEmpty)}}}}const h=Object.defineProperties((()=>{}),{...u,level:{enumerable:true,get(){return this._generator.level},set(e){this._generator.level=e}}});const createStyler=(e,t,r)=>{let n;let o;if(r===undefined){n=e;o=t}else{n=r.openAll+e;o=t+r.closeAll}return{open:e,close:t,openAll:n,closeAll:o,parent:r}};const createBuilder=(e,t,r)=>{const builder=(...e)=>{if(l(e[0])&&l(e[0].raw)){return applyStyle(builder,chalkTag(builder,...e))}return applyStyle(builder,e.length===1?""+e[0]:e.join(" "))};Object.setPrototypeOf(builder,h);builder._generator=e;builder._styler=t;builder._isEmpty=r;return builder};const applyStyle=(e,t)=>{if(e.level<=0||!t){return e._isEmpty?"":t}let r=e._styler;if(r===undefined){return t}const{openAll:n,closeAll:o}=r;if(t.indexOf("")!==-1){while(r!==undefined){t=s(t,r.close,r.open);r=r.parent}}const a=t.indexOf("\n");if(a!==-1){t=i(t,o,n,a)}return n+t+o};let d;const chalkTag=(e,...t)=>{const[n]=t;if(!l(n)||!l(n.raw)){return t.join(" ")}const o=t.slice(1);const a=[n.raw[0]];for(let e=1;e{"use strict";const t=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;const r=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;const n=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;const o=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;const a=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function unescape(e){const t=e[0]==="u";const r=e[1]==="{";if(t&&!r&&e.length===5||e[0]==="x"&&e.length===3){return String.fromCharCode(parseInt(e.slice(1),16))}if(t&&r){return String.fromCodePoint(parseInt(e.slice(2,-1),16))}return a.get(e)||e}function parseArguments(e,t){const r=[];const a=t.trim().split(/\s*,\s*/g);let s;for(const t of a){const a=Number(t);if(!Number.isNaN(a)){r.push(a)}else if(s=t.match(n)){r.push(s[2].replace(o,((e,t,r)=>t?unescape(t):r)))}else{throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`)}}return r}function parseStyle(e){r.lastIndex=0;const t=[];let n;while((n=r.exec(e))!==null){const e=n[1];if(n[2]){const r=parseArguments(e,n[2]);t.push([e].concat(r))}else{t.push([e])}}return t}function buildStyle(e,t){const r={};for(const e of t){for(const t of e.styles){r[t[0]]=e.inverse?null:t.slice(1)}}let n=e;for(const[e,t]of Object.entries(r)){if(!Array.isArray(t)){continue}if(!(e in n)){throw new Error(`Unknown Chalk style: ${e}`)}n=t.length>0?n[e](...t):n[e]}return n}e.exports=(e,r)=>{const n=[];const o=[];let a=[];r.replace(t,((t,r,s,i,l,c)=>{if(r){a.push(unescape(r))}else if(i){const t=a.join("");a=[];o.push(n.length===0?t:buildStyle(e,n)(t));n.push({inverse:s,styles:parseStyle(i)})}else if(l){if(n.length===0){throw new Error("Found extraneous } in Chalk template literal")}o.push(buildStyle(e,n)(a.join("")));a=[];n.pop()}else{a.push(c)}}));o.push(a.join(""));if(n.length>0){const e=`Chalk template literal is missing ${n.length} closing bracket${n.length===1?"":"s"} (\`}\`)`;throw new Error(e)}return o.join("")}},905:e=>{"use strict";const stringReplaceAll=(e,t,r)=>{let n=e.indexOf(t);if(n===-1){return e}const o=t.length;let a=0;let s="";do{s+=e.substr(a,n-a)+t+r;a=n+o;n=e.indexOf(t,a)}while(n!==-1);s+=e.substr(a);return s};const stringEncaseCRLFWithFirstIndex=(e,t,r,n)=>{let o=0;let a="";do{const s=e[n-1]==="\r";a+=e.substr(o,(s?n-1:n)-o)+t+(s?"\r\n":"\n")+r;o=n+1;n=e.indexOf("\n",o)}while(n!==-1);a+=e.substr(o);return a};e.exports={stringReplaceAll:stringReplaceAll,stringEncaseCRLFWithFirstIndex:stringEncaseCRLFWithFirstIndex}},461:(e,t,r)=>{var n=r(391);var o={};for(var a in n){if(n.hasOwnProperty(a)){o[n[a]]=a}}var s=e.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var i in s){if(s.hasOwnProperty(i)){if(!("channels"in s[i])){throw new Error("missing channels property: "+i)}if(!("labels"in s[i])){throw new Error("missing channel labels property: "+i)}if(s[i].labels.length!==s[i].channels){throw new Error("channel and label counts mismatch: "+i)}var l=s[i].channels;var c=s[i].labels;delete s[i].channels;delete s[i].labels;Object.defineProperty(s[i],"channels",{value:l});Object.defineProperty(s[i],"labels",{value:c})}}s.rgb.hsl=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;var o=Math.min(t,r,n);var a=Math.max(t,r,n);var s=a-o;var i;var l;var c;if(a===o){i=0}else if(t===a){i=(r-n)/s}else if(r===a){i=2+(n-t)/s}else if(n===a){i=4+(t-r)/s}i=Math.min(i*60,360);if(i<0){i+=360}c=(o+a)/2;if(a===o){l=0}else if(c<=.5){l=s/(a+o)}else{l=s/(2-a-o)}return[i,l*100,c*100]};s.rgb.hsv=function(e){var t;var r;var n;var o;var a;var s=e[0]/255;var i=e[1]/255;var l=e[2]/255;var c=Math.max(s,i,l);var u=c-Math.min(s,i,l);var diffc=function(e){return(c-e)/6/u+1/2};if(u===0){o=a=0}else{a=u/c;t=diffc(s);r=diffc(i);n=diffc(l);if(s===c){o=n-r}else if(i===c){o=1/3+t-n}else if(l===c){o=2/3+r-t}if(o<0){o+=1}else if(o>1){o-=1}}return[o*360,a*100,c*100]};s.rgb.hwb=function(e){var t=e[0];var r=e[1];var n=e[2];var o=s.rgb.hsl(e)[0];var a=1/255*Math.min(t,Math.min(r,n));n=1-1/255*Math.max(t,Math.max(r,n));return[o,a*100,n*100]};s.rgb.cmyk=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;var o;var a;var s;var i;i=Math.min(1-t,1-r,1-n);o=(1-t-i)/(1-i)||0;a=(1-r-i)/(1-i)||0;s=(1-n-i)/(1-i)||0;return[o*100,a*100,s*100,i*100]};function comparativeDistance(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2)}s.rgb.keyword=function(e){var t=o[e];if(t){return t}var r=Infinity;var a;for(var s in n){if(n.hasOwnProperty(s)){var i=n[s];var l=comparativeDistance(e,i);if(l.04045?Math.pow((t+.055)/1.055,2.4):t/12.92;r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92;n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var o=t*.4124+r*.3576+n*.1805;var a=t*.2126+r*.7152+n*.0722;var s=t*.0193+r*.1192+n*.9505;return[o*100,a*100,s*100]};s.rgb.lab=function(e){var t=s.rgb.xyz(e);var r=t[0];var n=t[1];var o=t[2];var a;var i;var l;r/=95.047;n/=100;o/=108.883;r=r>.008856?Math.pow(r,1/3):7.787*r+16/116;n=n>.008856?Math.pow(n,1/3):7.787*n+16/116;o=o>.008856?Math.pow(o,1/3):7.787*o+16/116;a=116*n-16;i=500*(r-n);l=200*(n-o);return[a,i,l]};s.hsl.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var n=e[2]/100;var o;var a;var s;var i;var l;if(r===0){l=n*255;return[l,l,l]}if(n<.5){a=n*(1+r)}else{a=n+r-n*r}o=2*n-a;i=[0,0,0];for(var c=0;c<3;c++){s=t+1/3*-(c-1);if(s<0){s++}if(s>1){s--}if(6*s<1){l=o+(a-o)*6*s}else if(2*s<1){l=a}else if(3*s<2){l=o+(a-o)*(2/3-s)*6}else{l=o}i[c]=l*255}return i};s.hsl.hsv=function(e){var t=e[0];var r=e[1]/100;var n=e[2]/100;var o=r;var a=Math.max(n,.01);var s;var i;n*=2;r*=n<=1?n:2-n;o*=a<=1?a:2-a;i=(n+r)/2;s=n===0?2*o/(a+o):2*r/(n+r);return[t,s*100,i*100]};s.hsv.rgb=function(e){var t=e[0]/60;var r=e[1]/100;var n=e[2]/100;var o=Math.floor(t)%6;var a=t-Math.floor(t);var s=255*n*(1-r);var i=255*n*(1-r*a);var l=255*n*(1-r*(1-a));n*=255;switch(o){case 0:return[n,l,s];case 1:return[i,n,s];case 2:return[s,n,l];case 3:return[s,i,n];case 4:return[l,s,n];case 5:return[n,s,i]}};s.hsv.hsl=function(e){var t=e[0];var r=e[1]/100;var n=e[2]/100;var o=Math.max(n,.01);var a;var s;var i;i=(2-r)*n;a=(2-r)*o;s=r*o;s/=a<=1?a:2-a;s=s||0;i/=2;return[t,s*100,i*100]};s.hwb.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var n=e[2]/100;var o=r+n;var a;var s;var i;var l;if(o>1){r/=o;n/=o}a=Math.floor(6*t);s=1-n;i=6*t-a;if((a&1)!==0){i=1-i}l=r+i*(s-r);var c;var u;var f;switch(a){default:case 6:case 0:c=s;u=l;f=r;break;case 1:c=l;u=s;f=r;break;case 2:c=r;u=s;f=l;break;case 3:c=r;u=l;f=s;break;case 4:c=l;u=r;f=s;break;case 5:c=s;u=r;f=l;break}return[c*255,u*255,f*255]};s.cmyk.rgb=function(e){var t=e[0]/100;var r=e[1]/100;var n=e[2]/100;var o=e[3]/100;var a;var s;var i;a=1-Math.min(1,t*(1-o)+o);s=1-Math.min(1,r*(1-o)+o);i=1-Math.min(1,n*(1-o)+o);return[a*255,s*255,i*255]};s.xyz.rgb=function(e){var t=e[0]/100;var r=e[1]/100;var n=e[2]/100;var o;var a;var s;o=t*3.2406+r*-1.5372+n*-.4986;a=t*-.9689+r*1.8758+n*.0415;s=t*.0557+r*-.204+n*1.057;o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92;a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*12.92;s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92;o=Math.min(Math.max(0,o),1);a=Math.min(Math.max(0,a),1);s=Math.min(Math.max(0,s),1);return[o*255,a*255,s*255]};s.xyz.lab=function(e){var t=e[0];var r=e[1];var n=e[2];var o;var a;var s;t/=95.047;r/=100;n/=108.883;t=t>.008856?Math.pow(t,1/3):7.787*t+16/116;r=r>.008856?Math.pow(r,1/3):7.787*r+16/116;n=n>.008856?Math.pow(n,1/3):7.787*n+16/116;o=116*r-16;a=500*(t-r);s=200*(r-n);return[o,a,s]};s.lab.xyz=function(e){var t=e[0];var r=e[1];var n=e[2];var o;var a;var s;a=(t+16)/116;o=r/500+a;s=a-n/200;var i=Math.pow(a,3);var l=Math.pow(o,3);var c=Math.pow(s,3);a=i>.008856?i:(a-16/116)/7.787;o=l>.008856?l:(o-16/116)/7.787;s=c>.008856?c:(s-16/116)/7.787;o*=95.047;a*=100;s*=108.883;return[o,a,s]};s.lab.lch=function(e){var t=e[0];var r=e[1];var n=e[2];var o;var a;var s;o=Math.atan2(n,r);a=o*360/2/Math.PI;if(a<0){a+=360}s=Math.sqrt(r*r+n*n);return[t,s,a]};s.lch.lab=function(e){var t=e[0];var r=e[1];var n=e[2];var o;var a;var s;s=n/360*2*Math.PI;o=r*Math.cos(s);a=r*Math.sin(s);return[t,o,a]};s.rgb.ansi16=function(e){var t=e[0];var r=e[1];var n=e[2];var o=1 in arguments?arguments[1]:s.rgb.hsv(e)[2];o=Math.round(o/50);if(o===0){return 30}var a=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(t/255));if(o===2){a+=60}return a};s.hsv.ansi16=function(e){return s.rgb.ansi16(s.hsv.rgb(e),e[2])};s.rgb.ansi256=function(e){var t=e[0];var r=e[1];var n=e[2];if(t===r&&r===n){if(t<8){return 16}if(t>248){return 231}return Math.round((t-8)/247*24)+232}var o=16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5);return o};s.ansi16.rgb=function(e){var t=e%10;if(t===0||t===7){if(e>50){t+=3.5}t=t/10.5*255;return[t,t,t]}var r=(~~(e>50)+1)*.5;var n=(t&1)*r*255;var o=(t>>1&1)*r*255;var a=(t>>2&1)*r*255;return[n,o,a]};s.ansi256.rgb=function(e){if(e>=232){var t=(e-232)*10+8;return[t,t,t]}e-=16;var r;var n=Math.floor(e/36)/5*255;var o=Math.floor((r=e%36)/6)/5*255;var a=r%6/5*255;return[n,o,a]};s.rgb.hex=function(e){var t=((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255);var r=t.toString(16).toUpperCase();return"000000".substring(r.length)+r};s.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t){return[0,0,0]}var r=t[0];if(t[0].length===3){r=r.split("").map((function(e){return e+e})).join("")}var n=parseInt(r,16);var o=n>>16&255;var a=n>>8&255;var s=n&255;return[o,a,s]};s.rgb.hcg=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;var o=Math.max(Math.max(t,r),n);var a=Math.min(Math.min(t,r),n);var s=o-a;var i;var l;if(s<1){i=a/(1-s)}else{i=0}if(s<=0){l=0}else if(o===t){l=(r-n)/s%6}else if(o===r){l=2+(n-t)/s}else{l=4+(t-r)/s+4}l/=6;l%=1;return[l*360,s*100,i*100]};s.hsl.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var n=1;var o=0;if(r<.5){n=2*t*r}else{n=2*t*(1-r)}if(n<1){o=(r-.5*n)/(1-n)}return[e[0],n*100,o*100]};s.hsv.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var n=t*r;var o=0;if(n<1){o=(r-n)/(1-n)}return[e[0],n*100,o*100]};s.hcg.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var n=e[2]/100;if(r===0){return[n*255,n*255,n*255]}var o=[0,0,0];var a=t%1*6;var s=a%1;var i=1-s;var l=0;switch(Math.floor(a)){case 0:o[0]=1;o[1]=s;o[2]=0;break;case 1:o[0]=i;o[1]=1;o[2]=0;break;case 2:o[0]=0;o[1]=1;o[2]=s;break;case 3:o[0]=0;o[1]=i;o[2]=1;break;case 4:o[0]=s;o[1]=0;o[2]=1;break;default:o[0]=1;o[1]=0;o[2]=i}l=(1-r)*n;return[(r*o[0]+l)*255,(r*o[1]+l)*255,(r*o[2]+l)*255]};s.hcg.hsv=function(e){var t=e[1]/100;var r=e[2]/100;var n=t+r*(1-t);var o=0;if(n>0){o=t/n}return[e[0],o*100,n*100]};s.hcg.hsl=function(e){var t=e[1]/100;var r=e[2]/100;var n=r*(1-t)+.5*t;var o=0;if(n>0&&n<.5){o=t/(2*n)}else if(n>=.5&&n<1){o=t/(2*(1-n))}return[e[0],o*100,n*100]};s.hcg.hwb=function(e){var t=e[1]/100;var r=e[2]/100;var n=t+r*(1-t);return[e[0],(n-t)*100,(1-n)*100]};s.hwb.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var n=1-r;var o=n-t;var a=0;if(o<1){a=(n-o)/(1-o)}return[e[0],o*100,a*100]};s.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};s.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};s.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};s.gray.hsl=s.gray.hsv=function(e){return[0,0,e[0]]};s.gray.hwb=function(e){return[0,100,e[0]]};s.gray.cmyk=function(e){return[0,0,0,e[0]]};s.gray.lab=function(e){return[e[0],0,0]};s.gray.hex=function(e){var t=Math.round(e[0]/100*255)&255;var r=(t<<16)+(t<<8)+t;var n=r.toString(16).toUpperCase();return"000000".substring(n.length)+n};s.rgb.gray=function(e){var t=(e[0]+e[1]+e[2])/3;return[t/255*100]}},755:(e,t,r)=>{var n=r(461);var o=r(974);var a={};var s=Object.keys(n);function wrapRaw(e){var wrappedFn=function(t){if(t===undefined||t===null){return t}if(arguments.length>1){t=Array.prototype.slice.call(arguments)}return e(t)};if("conversion"in e){wrappedFn.conversion=e.conversion}return wrappedFn}function wrapRounded(e){var wrappedFn=function(t){if(t===undefined||t===null){return t}if(arguments.length>1){t=Array.prototype.slice.call(arguments)}var r=e(t);if(typeof r==="object"){for(var n=r.length,o=0;o{var n=r(461);function buildGraph(){var e={};var t=Object.keys(n);for(var r=t.length,o=0;o{const n=r(866);const o={};for(const e of Object.keys(n)){o[n[e]]=e}const a={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};e.exports=a;for(const e of Object.keys(a)){if(!("channels"in a[e])){throw new Error("missing channels property: "+e)}if(!("labels"in a[e])){throw new Error("missing channel labels property: "+e)}if(a[e].labels.length!==a[e].channels){throw new Error("channel and label counts mismatch: "+e)}const{channels:t,labels:r}=a[e];delete a[e].channels;delete a[e].labels;Object.defineProperty(a[e],"channels",{value:t});Object.defineProperty(a[e],"labels",{value:r})}a.rgb.hsl=function(e){const t=e[0]/255;const r=e[1]/255;const n=e[2]/255;const o=Math.min(t,r,n);const a=Math.max(t,r,n);const s=a-o;let i;let l;if(a===o){i=0}else if(t===a){i=(r-n)/s}else if(r===a){i=2+(n-t)/s}else if(n===a){i=4+(t-r)/s}i=Math.min(i*60,360);if(i<0){i+=360}const c=(o+a)/2;if(a===o){l=0}else if(c<=.5){l=s/(a+o)}else{l=s/(2-a-o)}return[i,l*100,c*100]};a.rgb.hsv=function(e){let t;let r;let n;let o;let a;const s=e[0]/255;const i=e[1]/255;const l=e[2]/255;const c=Math.max(s,i,l);const u=c-Math.min(s,i,l);const diffc=function(e){return(c-e)/6/u+1/2};if(u===0){o=0;a=0}else{a=u/c;t=diffc(s);r=diffc(i);n=diffc(l);if(s===c){o=n-r}else if(i===c){o=1/3+t-n}else if(l===c){o=2/3+r-t}if(o<0){o+=1}else if(o>1){o-=1}}return[o*360,a*100,c*100]};a.rgb.hwb=function(e){const t=e[0];const r=e[1];let n=e[2];const o=a.rgb.hsl(e)[0];const s=1/255*Math.min(t,Math.min(r,n));n=1-1/255*Math.max(t,Math.max(r,n));return[o,s*100,n*100]};a.rgb.cmyk=function(e){const t=e[0]/255;const r=e[1]/255;const n=e[2]/255;const o=Math.min(1-t,1-r,1-n);const a=(1-t-o)/(1-o)||0;const s=(1-r-o)/(1-o)||0;const i=(1-n-o)/(1-o)||0;return[a*100,s*100,i*100,o*100]};function comparativeDistance(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}a.rgb.keyword=function(e){const t=o[e];if(t){return t}let r=Infinity;let a;for(const t of Object.keys(n)){const o=n[t];const s=comparativeDistance(e,o);if(s.04045?((t+.055)/1.055)**2.4:t/12.92;r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;const o=t*.4124+r*.3576+n*.1805;const a=t*.2126+r*.7152+n*.0722;const s=t*.0193+r*.1192+n*.9505;return[o*100,a*100,s*100]};a.rgb.lab=function(e){const t=a.rgb.xyz(e);let r=t[0];let n=t[1];let o=t[2];r/=95.047;n/=100;o/=108.883;r=r>.008856?r**(1/3):7.787*r+16/116;n=n>.008856?n**(1/3):7.787*n+16/116;o=o>.008856?o**(1/3):7.787*o+16/116;const s=116*n-16;const i=500*(r-n);const l=200*(n-o);return[s,i,l]};a.hsl.rgb=function(e){const t=e[0]/360;const r=e[1]/100;const n=e[2]/100;let o;let a;let s;if(r===0){s=n*255;return[s,s,s]}if(n<.5){o=n*(1+r)}else{o=n+r-n*r}const i=2*n-o;const l=[0,0,0];for(let e=0;e<3;e++){a=t+1/3*-(e-1);if(a<0){a++}if(a>1){a--}if(6*a<1){s=i+(o-i)*6*a}else if(2*a<1){s=o}else if(3*a<2){s=i+(o-i)*(2/3-a)*6}else{s=i}l[e]=s*255}return l};a.hsl.hsv=function(e){const t=e[0];let r=e[1]/100;let n=e[2]/100;let o=r;const a=Math.max(n,.01);n*=2;r*=n<=1?n:2-n;o*=a<=1?a:2-a;const s=(n+r)/2;const i=n===0?2*o/(a+o):2*r/(n+r);return[t,i*100,s*100]};a.hsv.rgb=function(e){const t=e[0]/60;const r=e[1]/100;let n=e[2]/100;const o=Math.floor(t)%6;const a=t-Math.floor(t);const s=255*n*(1-r);const i=255*n*(1-r*a);const l=255*n*(1-r*(1-a));n*=255;switch(o){case 0:return[n,l,s];case 1:return[i,n,s];case 2:return[s,n,l];case 3:return[s,i,n];case 4:return[l,s,n];case 5:return[n,s,i]}};a.hsv.hsl=function(e){const t=e[0];const r=e[1]/100;const n=e[2]/100;const o=Math.max(n,.01);let a;let s;s=(2-r)*n;const i=(2-r)*o;a=r*o;a/=i<=1?i:2-i;a=a||0;s/=2;return[t,a*100,s*100]};a.hwb.rgb=function(e){const t=e[0]/360;let r=e[1]/100;let n=e[2]/100;const o=r+n;let a;if(o>1){r/=o;n/=o}const s=Math.floor(6*t);const i=1-n;a=6*t-s;if((s&1)!==0){a=1-a}const l=r+a*(i-r);let c;let u;let f;switch(s){default:case 6:case 0:c=i;u=l;f=r;break;case 1:c=l;u=i;f=r;break;case 2:c=r;u=i;f=l;break;case 3:c=r;u=l;f=i;break;case 4:c=l;u=r;f=i;break;case 5:c=i;u=r;f=l;break}return[c*255,u*255,f*255]};a.cmyk.rgb=function(e){const t=e[0]/100;const r=e[1]/100;const n=e[2]/100;const o=e[3]/100;const a=1-Math.min(1,t*(1-o)+o);const s=1-Math.min(1,r*(1-o)+o);const i=1-Math.min(1,n*(1-o)+o);return[a*255,s*255,i*255]};a.xyz.rgb=function(e){const t=e[0]/100;const r=e[1]/100;const n=e[2]/100;let o;let a;let s;o=t*3.2406+r*-1.5372+n*-.4986;a=t*-.9689+r*1.8758+n*.0415;s=t*.0557+r*-.204+n*1.057;o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92;a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92;s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92;o=Math.min(Math.max(0,o),1);a=Math.min(Math.max(0,a),1);s=Math.min(Math.max(0,s),1);return[o*255,a*255,s*255]};a.xyz.lab=function(e){let t=e[0];let r=e[1];let n=e[2];t/=95.047;r/=100;n/=108.883;t=t>.008856?t**(1/3):7.787*t+16/116;r=r>.008856?r**(1/3):7.787*r+16/116;n=n>.008856?n**(1/3):7.787*n+16/116;const o=116*r-16;const a=500*(t-r);const s=200*(r-n);return[o,a,s]};a.lab.xyz=function(e){const t=e[0];const r=e[1];const n=e[2];let o;let a;let s;a=(t+16)/116;o=r/500+a;s=a-n/200;const i=a**3;const l=o**3;const c=s**3;a=i>.008856?i:(a-16/116)/7.787;o=l>.008856?l:(o-16/116)/7.787;s=c>.008856?c:(s-16/116)/7.787;o*=95.047;a*=100;s*=108.883;return[o,a,s]};a.lab.lch=function(e){const t=e[0];const r=e[1];const n=e[2];let o;const a=Math.atan2(n,r);o=a*360/2/Math.PI;if(o<0){o+=360}const s=Math.sqrt(r*r+n*n);return[t,s,o]};a.lch.lab=function(e){const t=e[0];const r=e[1];const n=e[2];const o=n/360*2*Math.PI;const a=r*Math.cos(o);const s=r*Math.sin(o);return[t,a,s]};a.rgb.ansi16=function(e,t=null){const[r,n,o]=e;let s=t===null?a.rgb.hsv(e)[2]:t;s=Math.round(s/50);if(s===0){return 30}let i=30+(Math.round(o/255)<<2|Math.round(n/255)<<1|Math.round(r/255));if(s===2){i+=60}return i};a.hsv.ansi16=function(e){return a.rgb.ansi16(a.hsv.rgb(e),e[2])};a.rgb.ansi256=function(e){const t=e[0];const r=e[1];const n=e[2];if(t===r&&r===n){if(t<8){return 16}if(t>248){return 231}return Math.round((t-8)/247*24)+232}const o=16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5);return o};a.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7){if(e>50){t+=3.5}t=t/10.5*255;return[t,t,t]}const r=(~~(e>50)+1)*.5;const n=(t&1)*r*255;const o=(t>>1&1)*r*255;const a=(t>>2&1)*r*255;return[n,o,a]};a.ansi256.rgb=function(e){if(e>=232){const t=(e-232)*10+8;return[t,t,t]}e-=16;let t;const r=Math.floor(e/36)/5*255;const n=Math.floor((t=e%36)/6)/5*255;const o=t%6/5*255;return[r,n,o]};a.rgb.hex=function(e){const t=((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255);const r=t.toString(16).toUpperCase();return"000000".substring(r.length)+r};a.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t){return[0,0,0]}let r=t[0];if(t[0].length===3){r=r.split("").map((e=>e+e)).join("")}const n=parseInt(r,16);const o=n>>16&255;const a=n>>8&255;const s=n&255;return[o,a,s]};a.rgb.hcg=function(e){const t=e[0]/255;const r=e[1]/255;const n=e[2]/255;const o=Math.max(Math.max(t,r),n);const a=Math.min(Math.min(t,r),n);const s=o-a;let i;let l;if(s<1){i=a/(1-s)}else{i=0}if(s<=0){l=0}else if(o===t){l=(r-n)/s%6}else if(o===r){l=2+(n-t)/s}else{l=4+(t-r)/s}l/=6;l%=1;return[l*360,s*100,i*100]};a.hsl.hcg=function(e){const t=e[1]/100;const r=e[2]/100;const n=r<.5?2*t*r:2*t*(1-r);let o=0;if(n<1){o=(r-.5*n)/(1-n)}return[e[0],n*100,o*100]};a.hsv.hcg=function(e){const t=e[1]/100;const r=e[2]/100;const n=t*r;let o=0;if(n<1){o=(r-n)/(1-n)}return[e[0],n*100,o*100]};a.hcg.rgb=function(e){const t=e[0]/360;const r=e[1]/100;const n=e[2]/100;if(r===0){return[n*255,n*255,n*255]}const o=[0,0,0];const a=t%1*6;const s=a%1;const i=1-s;let l=0;switch(Math.floor(a)){case 0:o[0]=1;o[1]=s;o[2]=0;break;case 1:o[0]=i;o[1]=1;o[2]=0;break;case 2:o[0]=0;o[1]=1;o[2]=s;break;case 3:o[0]=0;o[1]=i;o[2]=1;break;case 4:o[0]=s;o[1]=0;o[2]=1;break;default:o[0]=1;o[1]=0;o[2]=i}l=(1-r)*n;return[(r*o[0]+l)*255,(r*o[1]+l)*255,(r*o[2]+l)*255]};a.hcg.hsv=function(e){const t=e[1]/100;const r=e[2]/100;const n=t+r*(1-t);let o=0;if(n>0){o=t/n}return[e[0],o*100,n*100]};a.hcg.hsl=function(e){const t=e[1]/100;const r=e[2]/100;const n=r*(1-t)+.5*t;let o=0;if(n>0&&n<.5){o=t/(2*n)}else if(n>=.5&&n<1){o=t/(2*(1-n))}return[e[0],o*100,n*100]};a.hcg.hwb=function(e){const t=e[1]/100;const r=e[2]/100;const n=t+r*(1-t);return[e[0],(n-t)*100,(1-n)*100]};a.hwb.hcg=function(e){const t=e[1]/100;const r=e[2]/100;const n=1-r;const o=n-t;let a=0;if(o<1){a=(n-o)/(1-o)}return[e[0],o*100,a*100]};a.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};a.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};a.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};a.gray.hsl=function(e){return[0,0,e[0]]};a.gray.hsv=a.gray.hsl;a.gray.hwb=function(e){return[0,100,e[0]]};a.gray.cmyk=function(e){return[0,0,0,e[0]]};a.gray.lab=function(e){return[e[0],0,0]};a.gray.hex=function(e){const t=Math.round(e[0]/100*255)&255;const r=(t<<16)+(t<<8)+t;const n=r.toString(16).toUpperCase();return"000000".substring(n.length)+n};a.rgb.gray=function(e){const t=(e[0]+e[1]+e[2])/3;return[t/255*100]}},767:(e,t,r)=>{const n=r(226);const o=r(392);const a={};const s=Object.keys(n);function wrapRaw(e){const wrappedFn=function(...t){const r=t[0];if(r===undefined||r===null){return r}if(r.length>1){t=r}return e(t)};if("conversion"in e){wrappedFn.conversion=e.conversion}return wrappedFn}function wrapRounded(e){const wrappedFn=function(...t){const r=t[0];if(r===undefined||r===null){return r}if(r.length>1){t=r}const n=e(t);if(typeof n==="object"){for(let e=n.length,t=0;t{a[e]={};Object.defineProperty(a[e],"channels",{value:n[e].channels});Object.defineProperty(a[e],"labels",{value:n[e].labels});const t=o(e);const r=Object.keys(t);r.forEach((r=>{const n=t[r];a[e][r]=wrapRounded(n);a[e][r].raw=wrapRaw(n)}))}));e.exports=a},392:(e,t,r)=>{const n=r(226);function buildGraph(){const e={};const t=Object.keys(n);for(let r=t.length,n=0;n{"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},866:e=>{"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},434:e=>{"use strict";var t=/[|\\{}()[\]^$+*?.]/g;e.exports=function(e){if(typeof e!=="string"){throw new TypeError("Expected a string")}return e.replace(t,"\\$&")}},419:e=>{"use strict";e.exports=(e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":e.length===1?"-":"--";const n=t.indexOf(r+e);const o=t.indexOf("--");return n!==-1&&(o===-1?true:n{"use strict";e.exports=(e,t=process.argv)=>{const r=e.startsWith("-")?"":e.length===1?"-":"--";const n=t.indexOf(r+e);const o=t.indexOf("--");return n!==-1&&(o===-1||n{Object.defineProperty(t,"__esModule",{value:true});t["default"]=/((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g;t.matchToToken=function(e){var t={type:"invalid",value:e[0],closed:undefined};if(e[1])t.type="string",t.closed=!!(e[3]||e[4]);else if(e[5])t.type="comment";else if(e[6])t.type="comment",t.closed=!!e[7];else if(e[8])t.type="regex";else if(e[9])t.type="number";else if(e[10])t.type="name";else if(e[11])t.type="punctuator";else if(e[12])t.type="whitespace";return t}},472:(e,t)=>{var r=/~/;var n=/~[01]/g;function escapeReplacer(e){switch(e){case"~1":return"/";case"~0":return"~"}throw new Error("Invalid tilde escape: "+e)}function untilde(e){if(!r.test(e))return e;return e.replace(n,escapeReplacer)}function setter(e,t,r){var n;var o;for(var a=1,s=t.length;aa;if(typeof e[n]==="undefined"){if(Array.isArray(e)&&n==="-"){n=e.length}if(o){if(t[a]!==""&&t[a]{"use strict";const t=[];const r=[];const leven=(e,n)=>{if(e===n){return 0}const o=e;if(e.length>n.length){e=n;n=o}let a=e.length;let s=n.length;while(a>0&&e.charCodeAt(~-a)===n.charCodeAt(~-s)){a--;s--}let i=0;while(ic?f>c?c+1:f:f>u?u+1:f}}return c};e.exports=leven;e.exports["default"]=leven},332:(e,t,r)=>{"use strict";const n=r(37);const o=r(419);const a=process.env;let s;if(o("no-color")||o("no-colors")||o("color=false")){s=false}else if(o("color")||o("colors")||o("color=true")||o("color=always")){s=true}if("FORCE_COLOR"in a){s=a.FORCE_COLOR.length===0||parseInt(a.FORCE_COLOR,10)!==0}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e){if(s===false){return 0}if(o("color=16m")||o("color=full")||o("color=truecolor")){return 3}if(o("color=256")){return 2}if(e&&!e.isTTY&&s!==true){return 0}const t=s?1:0;if(process.platform==="win32"){const e=n.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in a){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in a))||a.CI_NAME==="codeship"){return 1}return t}if("TEAMCITY_VERSION"in a){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(a.TEAMCITY_VERSION)?1:0}if(a.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in a){const e=parseInt((a.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(a.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(a.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(a.TERM)){return 1}if("COLORTERM"in a){return 1}if(a.TERM==="dumb"){return t}return t}function getSupportLevel(e){const t=supportsColor(e);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:getSupportLevel(process.stdout),stderr:getSupportLevel(process.stderr)}},242:(e,t,r)=>{"use strict";const n=r(37);const o=r(224);const a=r(975);const{env:s}=process;let i;if(a("no-color")||a("no-colors")||a("color=false")||a("color=never")){i=0}else if(a("color")||a("colors")||a("color=true")||a("color=always")){i=1}if("FORCE_COLOR"in s){if(s.FORCE_COLOR==="true"){i=1}else if(s.FORCE_COLOR==="false"){i=0}else{i=s.FORCE_COLOR.length===0?1:Math.min(parseInt(s.FORCE_COLOR,10),3)}}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e,t){if(i===0){return 0}if(a("color=16m")||a("color=full")||a("color=truecolor")){return 3}if(a("color=256")){return 2}if(e&&!t&&i===undefined){return 0}const r=i||0;if(s.TERM==="dumb"){return r}if(process.platform==="win32"){const e=n.release().split(".");if(Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in s){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in s))||s.CI_NAME==="codeship"){return 1}return r}if("TEAMCITY_VERSION"in s){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0}if(s.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in s){const e=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(s.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)){return 1}if("COLORTERM"in s){return 1}return r}function getSupportLevel(e){const t=supportsColor(e,e&&e.isTTY);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:translateLevel(supportsColor(true,o.isatty(1))),stderr:translateLevel(supportsColor(true,o.isatty(2)))}},37:e=>{"use strict";e.exports=require("os")},224:e=>{"use strict";e.exports=require("tty")},135:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.codeFrameColumns=codeFrameColumns;t["default"]=_default;var n=r(606);var o=_interopRequireWildcard(r(673),true);function _getRequireWildcardCache(e){if(typeof WeakMap!=="function")return null;var t=new WeakMap;var r=new WeakMap;return(_getRequireWildcardCache=function(e){return e?r:t})(e)}function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule){return e}if(e===null||typeof e!=="object"&&typeof e!=="function"){return{default:e}}var r=_getRequireWildcardCache(t);if(r&&r.has(e)){return r.get(e)}var n={};var o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e){if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;if(s&&(s.get||s.set)){Object.defineProperty(n,a,s)}else{n[a]=e[a]}}}n.default=e;if(r){r.set(e,n)}return n}let a=undefined;function getChalk(e){if(e){var t;(t=a)!=null?t:a=new o.default.constructor({enabled:true,level:1});return a}return o.default}let s=false;function getDefs(e){return{gutter:e.grey,marker:e.red.bold,message:e.red.bold}}const i=/\r\n|[\n\r\u2028\u2029]/;function getMarkerLines(e,t,r){const n=Object.assign({column:0,line:-1},e.start);const o=Object.assign({},n,e.end);const{linesAbove:a=2,linesBelow:s=3}=r||{};const i=n.line;const l=n.column;const c=o.line;const u=o.column;let f=Math.max(i-(a+1),0);let h=Math.min(t.length,c+s);if(i===-1){f=0}if(c===-1){h=t.length}const d=c-i;const p={};if(d){for(let e=0;e<=d;e++){const r=e+i;if(!l){p[r]=true}else if(e===0){const e=t[r-1].length;p[r]=[l,e-l+1]}else if(e===d){p[r]=[0,u]}else{const n=t[r-e].length;p[r]=[0,n]}}}else{if(l===u){if(l){p[i]=[l,0]}else{p[i]=true}}else{p[i]=[l,u-l]}}return{start:f,end:h,markerLines:p}}function codeFrameColumns(e,t,r={}){const o=(r.highlightCode||r.forceColor)&&(0,n.shouldHighlight)(r);const a=getChalk(r.forceColor);const s=getDefs(a);const maybeHighlight=(e,t)=>o?e(t):t;const l=e.split(i);const{start:c,end:u,markerLines:f}=getMarkerLines(t,l,r);const h=t.start&&typeof t.start.column==="number";const d=String(u).length;const p=o?(0,n.default)(e,r):e;let g=p.split(i,u).slice(c,u).map(((e,t)=>{const n=c+1+t;const o=` ${n}`.slice(-d);const a=` ${o} |`;const i=f[n];const l=!f[n+1];if(i){let t="";if(Array.isArray(i)){const n=e.slice(0,Math.max(i[0]-1,0)).replace(/[^\t]/g," ");const o=i[1]||1;t=["\n ",maybeHighlight(s.gutter,a.replace(/\d/g," "))," ",n,maybeHighlight(s.marker,"^").repeat(o)].join("");if(l&&r.message){t+=" "+maybeHighlight(s.message,r.message)}}return[maybeHighlight(s.marker,">"),maybeHighlight(s.gutter,a),e.length>0?` ${e}`:"",t].join("")}else{return` ${maybeHighlight(s.gutter,a)}${e.length>0?` ${e}`:""}`}})).join("\n");if(r.message&&!h){g=`${" ".repeat(d+1)}${r.message}\n${g}`}if(o){return a.reset(g)}else{return g}}function _default(e,t,r,n={}){if(!s){s=true;const e="Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";if(process.emitWarning){process.emitWarning(e,"DeprecationWarning")}else{const t=new Error(e);t.name="DeprecationWarning";console.warn(new Error(e))}}r=Math.max(r,0);const o={start:{column:r,line:t}};return codeFrameColumns(e,o,n)}},828:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.isIdentifierChar=isIdentifierChar;t.isIdentifierName=isIdentifierName;t.isIdentifierStart=isIdentifierStart;let r="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ";let n="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_";const o=new RegExp("["+r+"]");const a=new RegExp("["+r+n+"]");r=n=null;const s=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,3104,541,1507,4938,6,4191];const i=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239];function isInAstralSet(e,t){let r=65536;for(let n=0,o=t.length;ne)return false;r+=t[n+1];if(r>=e)return true}return false}function isIdentifierStart(e){if(e<65)return e===36;if(e<=90)return true;if(e<97)return e===95;if(e<=122)return true;if(e<=65535){return e>=170&&o.test(String.fromCharCode(e))}return isInAstralSet(e,s)}function isIdentifierChar(e){if(e<48)return e===36;if(e<58)return true;if(e<65)return false;if(e<=90)return true;if(e<97)return e===95;if(e<=122)return true;if(e<=65535){return e>=170&&a.test(String.fromCharCode(e))}return isInAstralSet(e,s)||isInAstralSet(e,i)}function isIdentifierName(e){let t=true;for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:true});Object.defineProperty(t,"isIdentifierChar",{enumerable:true,get:function(){return n.isIdentifierChar}});Object.defineProperty(t,"isIdentifierName",{enumerable:true,get:function(){return n.isIdentifierName}});Object.defineProperty(t,"isIdentifierStart",{enumerable:true,get:function(){return n.isIdentifierStart}});Object.defineProperty(t,"isKeyword",{enumerable:true,get:function(){return o.isKeyword}});Object.defineProperty(t,"isReservedWord",{enumerable:true,get:function(){return o.isReservedWord}});Object.defineProperty(t,"isStrictBindOnlyReservedWord",{enumerable:true,get:function(){return o.isStrictBindOnlyReservedWord}});Object.defineProperty(t,"isStrictBindReservedWord",{enumerable:true,get:function(){return o.isStrictBindReservedWord}});Object.defineProperty(t,"isStrictReservedWord",{enumerable:true,get:function(){return o.isStrictReservedWord}});var n=r(828);var o=r(314)},314:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.isKeyword=isKeyword;t.isReservedWord=isReservedWord;t.isStrictBindOnlyReservedWord=isStrictBindOnlyReservedWord;t.isStrictBindReservedWord=isStrictBindReservedWord;t.isStrictReservedWord=isStrictReservedWord;const r={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]};const n=new Set(r.keyword);const o=new Set(r.strict);const a=new Set(r.strictBind);function isReservedWord(e,t){return t&&e==="await"||e==="enum"}function isStrictReservedWord(e,t){return isReservedWord(e,t)||o.has(e)}function isStrictBindOnlyReservedWord(e){return a.has(e)}function isStrictBindReservedWord(e,t){return isStrictReservedWord(e,t)||isStrictBindOnlyReservedWord(e)}function isKeyword(e){return n.has(e)}},606:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=highlight;t.shouldHighlight=shouldHighlight;var n=r(629);var o=r(620);var a=_interopRequireWildcard(r(673),true);function _getRequireWildcardCache(e){if(typeof WeakMap!=="function")return null;var t=new WeakMap;var r=new WeakMap;return(_getRequireWildcardCache=function(e){return e?r:t})(e)}function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule){return e}if(e===null||typeof e!=="object"&&typeof e!=="function"){return{default:e}}var r=_getRequireWildcardCache(t);if(r&&r.has(e)){return r.get(e)}var n={};var o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e){if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;if(s&&(s.get||s.set)){Object.defineProperty(n,a,s)}else{n[a]=e[a]}}}n.default=e;if(r){r.set(e,n)}return n}const s=new Set(["as","async","from","get","of","set"]);function getDefs(e){return{keyword:e.cyan,capitalized:e.yellow,jsxIdentifier:e.yellow,punctuator:e.yellow,number:e.magenta,string:e.green,regex:e.magenta,comment:e.grey,invalid:e.white.bgRed.bold}}const i=/\r\n|[\n\r\u2028\u2029]/;const l=/^[()[\]{}]$/;let c;{const e=/^[a-z][\w-]*$/i;const getTokenType=function(t,r,n){if(t.type==="name"){if((0,o.isKeyword)(t.value)||(0,o.isStrictReservedWord)(t.value,true)||s.has(t.value)){return"keyword"}if(e.test(t.value)&&(n[r-1]==="<"||n.slice(r-2,r)=="t(e))).join("\n")}else{r+=o}}return r}function shouldHighlight(e){return a.default.level>0||e.forceColor}let u=undefined;function getChalk(e){if(e){var t;(t=u)!=null?t:u=new a.default.constructor({enabled:true,level:1});return u}return a.default}{{t.getChalk=e=>getChalk(e.forceColor)}}function highlight(e,t={}){if(e!==""&&shouldHighlight(t)){const r=getDefs(getChalk(t.forceColor));return highlightTokens(r,e)}else{return e}}}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var o=t[r]={id:r,loaded:false,exports:{}};var a=true;try{e[r](o,o.exports,__nccwpck_require__);a=false}finally{if(a)delete t[r]}o.loaded=true;return o.exports}(()=>{__nccwpck_require__.nmd=e=>{e.paths=[];if(!e.children)e.children=[];return e}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(281);module.exports=r})(); \ No newline at end of file diff --git a/packages/toolkit/utils/compiled/better-ajv-errors/license b/packages/toolkit/utils/compiled/better-ajv-errors/license deleted file mode 100644 index b7bb4793297b..000000000000 --- a/packages/toolkit/utils/compiled/better-ajv-errors/license +++ /dev/null @@ -1,13 +0,0 @@ -Copyright 2018 Atlassian Pty Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/packages/toolkit/utils/compiled/better-ajv-errors/package.json b/packages/toolkit/utils/compiled/better-ajv-errors/package.json deleted file mode 100644 index d2ec28657944..000000000000 --- a/packages/toolkit/utils/compiled/better-ajv-errors/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"better-ajv-errors","author":"Rifat Nabi ","version":"1.2.0","license":"Apache-2.0","types":"index.d.ts"} diff --git a/packages/toolkit/utils/package.json b/packages/toolkit/utils/package.json index f0ca6f7f8ca4..c4b538122a8a 100644 --- a/packages/toolkit/utils/package.json +++ b/packages/toolkit/utils/package.json @@ -50,7 +50,6 @@ "import": "./dist/esm/universal/pluginDagSort.js", "default": "./dist/cjs/universal/pluginDagSort.js" }, - "./ajv": "./compiled/ajv/index.js", "./commander": "./compiled/commander/index.js", "./ora": "./compiled/ora/index.js", "./glob": "./compiled/glob/index.js", @@ -65,11 +64,9 @@ "./gzip-size": "./compiled/gzip-size/index.js", "./mime-types": "./compiled/mime-types/index.js", "./strip-ansi": "./compiled/strip-ansi/index.js", - "./ajv-keywords": "./compiled/ajv-keywords/index.js", "./browserslist": "./compiled/browserslist/index.js", "./webpack-chain": "./compiled/webpack-chain/index.js", - "./tsconfig-paths": "./compiled/tsconfig-paths/index.js", - "./better-ajv-errors": "./compiled/better-ajv-errors/index.js" + "./tsconfig-paths": "./compiled/tsconfig-paths/index.js" }, "publishConfig": { "registry": "https://registry.npmjs.org/", @@ -104,7 +101,6 @@ "import": "./dist/esm/universal/pluginDagSort.js", "default": "./dist/cjs/universal/pluginDagSort.js" }, - "./ajv": "./dist/compiled/ajv/index.js", "./commander": "./dist/compiled/commander/index.js", "./ora": "./dist/compiled/ora/index.js", "./glob": "./dist/compiled/glob/index.js", @@ -119,11 +115,9 @@ "./gzip-size": "./dist/compiled/gzip-size/index.js", "./mime-types": "./dist/compiled/mime-types/index.js", "./strip-ansi": "./dist/compiled/strip-ansi/index.js", - "./ajv-keywords": "./dist/compiled/ajv-keywords/index.js", "./browserslist": "./dist/compiled/browserslist/index.js", "./webpack-chain": "./dist/compiled/webpack-chain/index.js", - "./tsconfig-paths": "./dist/compiled/tsconfig-paths/index.js", - "./better-ajv-errors": "./dist/compiled/better-ajv-errors/index.js" + "./tsconfig-paths": "./dist/compiled/tsconfig-paths/index.js" } }, "typesVersions": { @@ -143,15 +137,9 @@ "universal/plugin-dag-sort": [ "./dist/types/universal/pluginDagSort.d.ts" ], - "ajv": [ - "./dist/compiled/ajv/types/ajv.d.ts" - ], "execa": [ "./dist/compiled/execa/index.d.ts" ], - "ajv/json-schema": [ - "./dist/compiled/ajv/types/types/json-schema.d.ts" - ], "glob": [ "./dist/compiled/glob/index.d.ts" ], @@ -185,9 +173,6 @@ "strip-ansi": [ "./dist/compiled/strip-ansi/index.d.ts" ], - "ajv-keywords": [ - "./dist/compiled/ajv-keywords/index.d.ts" - ], "browserslist": [ "./dist/compiled/browserslist/index.d.ts" ], @@ -197,9 +182,6 @@ "tsconfig-paths": [ "./dist/compiled/tsconfig-paths/lib/index.d.ts" ], - "better-ajv-errors": [ - "./dist/compiled/better-ajv-errors/index.d.ts" - ], "commander": [ "./dist/compiled/commander/typings/index.d.ts" ], diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6d4e70dcf5a3..7b2cb58499da 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1623,7 +1623,7 @@ importers: version: 18.2.0(react@18.2.0) rspress: specifier: 1.5.0 - version: 1.5.0(esbuild@0.17.19)(react-dom@18.2.0)(react@18.2.0)(ts-node@10.9.1)(webpack@5.88.1) + version: 1.5.0(esbuild@0.17.19)(react-dom@18.2.0)(react@18.2.0)(ts-node@10.9.1)(webpack@5.89.0) packages/document/main-doc: dependencies: @@ -1663,7 +1663,7 @@ importers: version: 18.2.0(react@18.2.0) rspress: specifier: 1.5.0 - version: 1.5.0(esbuild@0.17.19)(react-dom@18.2.0)(react@18.2.0)(ts-node@10.9.1)(webpack@5.88.1) + version: 1.5.0(esbuild@0.17.19)(react-dom@18.2.0)(react@18.2.0)(ts-node@10.9.1)(webpack@5.89.0) ts-node: specifier: ^10.9.1 version: 10.9.1(@types/node@16.11.68)(typescript@5.0.4) @@ -1687,7 +1687,7 @@ importers: version: 18.2.0(react@18.2.0) rspress: specifier: 1.5.0 - version: 1.5.0(esbuild@0.17.19)(react-dom@18.2.0)(react@18.2.0)(ts-node@10.9.1)(webpack@5.88.1) + version: 1.5.0(esbuild@0.17.19)(react-dom@18.2.0)(react@18.2.0)(ts-node@10.9.1)(webpack@5.89.0) packages/generator/generator-cases: dependencies: @@ -4839,7 +4839,7 @@ importers: version: link:../../toolkit/utils '@rspack/dev-client': specifier: 0.3.2 - version: 0.3.2(react-refresh@0.14.0)(webpack-hot-middleware@2.25.4)(webpack@5.88.1) + version: 0.3.2(react-refresh@0.14.0)(webpack-hot-middleware@2.25.4)(webpack@5.89.0) '@storybook/components': specifier: ^7.5.1 version: 7.5.1(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0) @@ -4866,7 +4866,7 @@ importers: version: 7.5.1 '@storybook/react-docgen-typescript-plugin': specifier: 1.0.6--canary.9.0c3f3b7.0 - version: 1.0.6--canary.9.0c3f3b7.0(typescript@5.2.2)(webpack@5.88.1) + version: 1.0.6--canary.9.0c3f3b7.0(typescript@5.2.2)(webpack@5.89.0) '@storybook/router': specifier: ^7.5.1 version: 7.5.1(react-dom@18.2.0)(react@18.2.0) @@ -5455,12 +5455,6 @@ importers: address: specifier: 1.1.2 version: 1.1.2 - ajv: - specifier: 8.11.0 - version: 8.11.0 - ajv-keywords: - specifier: 5.1.0 - version: 5.1.0(ajv@8.11.0) ansi-escapes: specifier: 4.3.2 version: 4.3.2 @@ -5476,9 +5470,6 @@ importers: babel-plugin-transform-react-remove-prop-types: specifier: 0.4.24 version: 0.4.24 - better-ajv-errors: - specifier: 1.2.0 - version: 1.2.0(ajv@8.11.0) browserslist: specifier: 4.20.2 version: 4.20.2 @@ -11778,11 +11769,6 @@ packages: resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} engines: {node: '>=12.22'} - /@humanwhocodes/momoa@2.0.4: - resolution: {integrity: sha512-RE815I4arJFtt+FVeU1Tgp9/Xvecacji8w/V6XtXsWWH/wz/eNkNbhb+ny/+PlVZjV0rxQpRSQKNKE3lcktHEA==} - engines: {node: '>=10.10.0'} - dev: true - /@humanwhocodes/object-schema@1.2.1: resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} @@ -12187,14 +12173,14 @@ packages: read-yaml-file: 1.1.0 dev: false - /@mdx-js/loader@2.2.1(webpack@5.88.1): + /@mdx-js/loader@2.2.1(webpack@5.89.0): resolution: {integrity: sha512-J4E8A5H+xtk4otZiEZ5AXl61Tj04Avm5MqLQazITdI3+puVXVnTTuZUKM1oNHTtfDIfOl0uMt+o/Ij+x6Fvf+g==} peerDependencies: webpack: '>=4' dependencies: '@mdx-js/mdx': 2.2.1 source-map: 0.7.4 - webpack: 5.88.1(esbuild@0.17.19) + webpack: 5.89.0(esbuild@0.17.19) transitivePeerDependencies: - supports-color dev: true @@ -13170,7 +13156,7 @@ packages: optionalDependencies: fsevents: 2.3.2 - /@pmmmwh/react-refresh-webpack-plugin@0.5.10(react-refresh@0.14.0)(webpack-hot-middleware@2.25.4)(webpack@5.88.1): + /@pmmmwh/react-refresh-webpack-plugin@0.5.10(react-refresh@0.14.0)(webpack-hot-middleware@2.25.4)(webpack@5.89.0): resolution: {integrity: sha512-j0Ya0hCFZPd4x40qLzbhGsh9TMtdb+CJQiso+WxLOPNasohq9cc5SNUcwsZaRH6++Xh91Xkm/xHCkuIiIu0LUA==} engines: {node: '>= 10.13'} peerDependencies: @@ -13206,7 +13192,7 @@ packages: react-refresh: 0.14.0 schema-utils: 3.3.0 source-map: 0.7.4 - webpack: 5.88.1(esbuild@0.18.20) + webpack: 5.89.0(esbuild@0.18.20) webpack-hot-middleware: 2.25.4 dev: false @@ -13247,6 +13233,46 @@ packages: schema-utils: 3.3.0 source-map: 0.7.4 webpack: 5.88.1(esbuild@0.17.19) + dev: false + + /@pmmmwh/react-refresh-webpack-plugin@0.5.10(react-refresh@0.14.0)(webpack@5.89.0): + resolution: {integrity: sha512-j0Ya0hCFZPd4x40qLzbhGsh9TMtdb+CJQiso+WxLOPNasohq9cc5SNUcwsZaRH6++Xh91Xkm/xHCkuIiIu0LUA==} + engines: {node: '>= 10.13'} + peerDependencies: + '@types/webpack': 4.x || 5.x + react-refresh: '>=0.10.0 <1.0.0' + sockjs-client: ^1.4.0 + type-fest: '>=0.17.0 <4.0.0' + webpack: '>=4.43.0 <6.0.0' + webpack-dev-server: 3.x || 4.x + webpack-hot-middleware: 2.x + webpack-plugin-serve: 0.x || 1.x + peerDependenciesMeta: + '@types/webpack': + optional: true + sockjs-client: + optional: true + type-fest: + optional: true + webpack-dev-server: + optional: true + webpack-hot-middleware: + optional: true + webpack-plugin-serve: + optional: true + dependencies: + ansi-html-community: 0.0.8 + common-path-prefix: 3.0.0 + core-js-pure: 3.26.0 + error-stack-parser: 2.1.4 + find-up: 5.0.0 + html-entities: 2.3.3 + loader-utils: 2.0.4 + react-refresh: 0.14.0 + schema-utils: 3.3.0 + source-map: 0.7.4 + webpack: 5.89.0(esbuild@0.17.19) + dev: true /@polka/url@0.5.0: resolution: {integrity: sha512-oZLYFEAzUKyi3SKnXvj32ZCEGH6RDnao7COuCVhDydMS9NrCSVXhM79VaKyP5+Zc33m0QXEd2DN3UkU7OsHcfw==} @@ -14874,11 +14900,11 @@ packages: p-map: 4.0.0 dev: false - /@rsbuild/plugin-react@0.0.13(esbuild@0.17.19)(react-dom@18.2.0)(react@18.2.0)(ts-node@10.9.1)(webpack@5.88.1): + /@rsbuild/plugin-react@0.0.13(esbuild@0.17.19)(react-dom@18.2.0)(react@18.2.0)(ts-node@10.9.1)(webpack@5.89.0): resolution: {integrity: sha512-G8rXlh0XYLrHrFzyr8vi6ePSrGSFqlYd7M6hMRbpBTRNUpoH4ftgmtSOVuuLAwrCDzZbjRRW9lHrrmoKwvScXg==} dependencies: '@rsbuild/shared': 0.0.13(esbuild@0.17.19)(react-dom@18.2.0)(react@18.2.0)(ts-node@10.9.1) - '@rspack/plugin-react-refresh': 0.3.10(react-refresh@0.14.0)(webpack@5.88.1) + '@rspack/plugin-react-refresh': 0.3.10(react-refresh@0.14.0)(webpack@5.89.0) react-refresh: 0.14.0 transitivePeerDependencies: - '@babel/traverse' @@ -14905,12 +14931,12 @@ packages: - webpack-plugin-serve dev: true - /@rsbuild/plugin-svgr@0.0.13(esbuild@0.17.19)(react-dom@18.2.0)(react@18.2.0)(ts-node@10.9.1)(webpack@5.88.1): + /@rsbuild/plugin-svgr@0.0.13(esbuild@0.17.19)(react-dom@18.2.0)(react@18.2.0)(ts-node@10.9.1)(webpack@5.89.0): resolution: {integrity: sha512-P09Fx3Ep05ir35LkLXnpHVZRPdjavqS8qA0ngQpkYC+eX+c5PGy4SWpyXMoWRqY2+fOiYCiHp+WV0Mc/HxFxJg==} dependencies: '@rsbuild/shared': 0.0.13(esbuild@0.17.19)(react-dom@18.2.0)(react@18.2.0)(ts-node@10.9.1) '@svgr/webpack': 8.0.1 - url-loader: 4.1.1(file-loader@6.2.0)(webpack@5.88.1) + url-loader: 4.1.1(webpack@5.89.0) transitivePeerDependencies: - '@babel/traverse' - '@swc/core' @@ -15096,7 +15122,7 @@ packages: - webpack-plugin-serve dev: false - /@rspack/dev-client@0.3.2(react-refresh@0.14.0)(webpack-hot-middleware@2.25.4)(webpack@5.88.1): + /@rspack/dev-client@0.3.2(react-refresh@0.14.0)(webpack-hot-middleware@2.25.4)(webpack@5.89.0): resolution: {integrity: sha512-t/4b6rzMh13pi0JARj85xaU02FNihUmGGpsHsG3UdqM1pVzS3z6Kl6h0FrmMG8NNJAvoTT0p6drltdijIxb6Qw==} peerDependencies: react-refresh: '>=0.10.0 <1.0.0' @@ -15104,7 +15130,7 @@ packages: react-refresh: optional: true dependencies: - '@pmmmwh/react-refresh-webpack-plugin': 0.5.10(react-refresh@0.14.0)(webpack-hot-middleware@2.25.4)(webpack@5.88.1) + '@pmmmwh/react-refresh-webpack-plugin': 0.5.10(react-refresh@0.14.0)(webpack-hot-middleware@2.25.4)(webpack@5.89.0) react-refresh: 0.14.0 transitivePeerDependencies: - '@types/webpack' @@ -15151,19 +15177,41 @@ packages: - webpack-dev-server - webpack-hot-middleware - webpack-plugin-serve + dev: false + + /@rspack/plugin-react-refresh@0.3.10(react-refresh@0.14.0)(webpack@5.89.0): + resolution: {integrity: sha512-oeCsfEXRguZox5rNyV3ifbyk3G578YZ+5l0ZNCk/tDF5xQnMeJ9vRJ7iFYcHVcuZhZQhuxCwLzeXJ5RNWleqig==} + peerDependencies: + react-refresh: '>=0.10.0 <1.0.0' + peerDependenciesMeta: + react-refresh: + optional: true + dependencies: + '@pmmmwh/react-refresh-webpack-plugin': 0.5.10(react-refresh@0.14.0)(webpack@5.89.0) + react-refresh: 0.14.0 + schema-utils: 4.2.0 + transitivePeerDependencies: + - '@types/webpack' + - sockjs-client + - type-fest + - webpack + - webpack-dev-server + - webpack-hot-middleware + - webpack-plugin-serve + dev: true - /@rspress/core@1.5.0(esbuild@0.17.19)(ts-node@10.9.1)(webpack@5.88.1): + /@rspress/core@1.5.0(esbuild@0.17.19)(ts-node@10.9.1)(webpack@5.89.0): resolution: {integrity: sha512-HiH0T6Zrm0csvUifpuwNJZj64T6LRMKD9aSge6GK2So/GAAiB/Itq4o3tTMDT6i7mejxvyh13A/9w8jjEboUcw==} engines: {node: '>=14.17.6'} dependencies: '@loadable/component': 5.15.2(react@18.2.0) - '@mdx-js/loader': 2.2.1(webpack@5.88.1) + '@mdx-js/loader': 2.2.1(webpack@5.89.0) '@mdx-js/mdx': 2.2.1 '@mdx-js/react': 2.2.1(react@18.2.0) '@modern-js/utils': link:packages/toolkit/utils '@rsbuild/core': 0.0.13(esbuild@0.17.19)(react-dom@18.2.0)(react@18.2.0)(ts-node@10.9.1) - '@rsbuild/plugin-react': 0.0.13(esbuild@0.17.19)(react-dom@18.2.0)(react@18.2.0)(ts-node@10.9.1)(webpack@5.88.1) - '@rsbuild/plugin-svgr': 0.0.13(esbuild@0.17.19)(react-dom@18.2.0)(react@18.2.0)(ts-node@10.9.1)(webpack@5.88.1) + '@rsbuild/plugin-react': 0.0.13(esbuild@0.17.19)(react-dom@18.2.0)(react@18.2.0)(ts-node@10.9.1)(webpack@5.89.0) + '@rsbuild/plugin-svgr': 0.0.13(esbuild@0.17.19)(react-dom@18.2.0)(react@18.2.0)(ts-node@10.9.1)(webpack@5.89.0) '@rspress/mdx-rs': 0.4.1 '@rspress/plugin-auto-nav-sidebar': 1.5.0(esbuild@0.17.19)(react-dom@18.2.0)(react@18.2.0)(ts-node@10.9.1) '@rspress/plugin-container-syntax': 1.5.0(esbuild@0.17.19)(react-dom@18.2.0)(react@18.2.0)(ts-node@10.9.1) @@ -15171,7 +15219,7 @@ packages: '@rspress/plugin-medium-zoom': 1.5.0(@rspress/runtime@1.5.0) '@rspress/runtime': 1.5.0(esbuild@0.17.19)(ts-node@10.9.1) '@rspress/shared': 1.5.0(esbuild@0.17.19)(react-dom@18.2.0)(react@18.2.0)(ts-node@10.9.1) - '@rspress/theme-default': 1.5.0(esbuild@0.17.19)(postcss@8.4.21)(ts-node@10.9.1)(webpack@5.88.1) + '@rspress/theme-default': 1.5.0(esbuild@0.17.19)(postcss@8.4.21)(ts-node@10.9.1)(webpack@5.89.0) '@types/compression': 1.7.2 '@types/polka': 0.5.4 autoprefixer: 10.4.13(postcss@8.4.21) @@ -15212,7 +15260,7 @@ packages: rspack-plugin-virtual-module: 0.1.12 sirv: 2.0.3 source-map: 0.7.4 - string-replace-loader: 3.1.0(webpack@5.88.1) + string-replace-loader: 3.1.0(webpack@5.89.0) tailwindcss: 3.2.7(postcss@8.4.21)(ts-node@10.9.1) unified: 10.1.2 unist-util-visit: 4.1.1 @@ -15453,7 +15501,7 @@ packages: - webpack-cli dev: true - /@rspress/theme-default@1.5.0(esbuild@0.17.19)(postcss@8.4.21)(ts-node@10.9.1)(webpack@5.88.1): + /@rspress/theme-default@1.5.0(esbuild@0.17.19)(postcss@8.4.21)(ts-node@10.9.1)(webpack@5.89.0): resolution: {integrity: sha512-lXfZqjok6pBOahoILIMr8iT8PjT+W+65vBDQDIbugUWHTCKl+LUwyrbaNILFyrYCnjA6+Uv+XwOymrwUrE455Q==} engines: {node: '>=14.17.6'} dependencies: @@ -15477,7 +15525,7 @@ packages: react-helmet-async: 1.3.0(react-dom@18.2.0)(react@18.2.0) react-syntax-highlighter: 15.5.0(react@18.2.0) rspack-plugin-virtual-module: 0.1.12 - string-replace-loader: 3.1.0(webpack@5.88.1) + string-replace-loader: 3.1.0(webpack@5.89.0) tailwindcss: 3.2.7(postcss@8.4.21)(ts-node@10.9.1) transitivePeerDependencies: - '@babel/traverse' @@ -16237,7 +16285,7 @@ packages: resolution: {integrity: sha512-nfZC103z9Cy27FrJKUr2IjDuVt8Mvn1Z5gZ0TtJihoK7sfLTv29nd/XU9zzrb/epM3o8UEzc63xZZsMaToDbAw==} dev: false - /@storybook/react-docgen-typescript-plugin@1.0.6--canary.9.0c3f3b7.0(typescript@5.2.2)(webpack@5.88.1): + /@storybook/react-docgen-typescript-plugin@1.0.6--canary.9.0c3f3b7.0(typescript@5.2.2)(webpack@5.89.0): resolution: {integrity: sha512-KUqXC3oa9JuQ0kZJLBhVdS4lOneKTOopnNBK4tUAgoxWQ3u/IjzdueZjFr7gyBrXMoU6duutk3RQR9u8ZpYJ4Q==} peerDependencies: typescript: '>= 4.x' @@ -16251,7 +16299,7 @@ packages: react-docgen-typescript: 2.2.2(typescript@5.2.2) tslib: 2.4.0 typescript: 5.2.2 - webpack: 5.88.1(esbuild@0.18.20) + webpack: 5.89.0(esbuild@0.18.20) transitivePeerDependencies: - supports-color dev: false @@ -19039,20 +19087,6 @@ packages: resolution: {integrity: sha512-qzxS7/bW/LSiKZzdZw3isPjiVmzXbJLM3ImZZ62WMR3oJQAyqy094Nnb0TA2ZZm65xB7nu0acfTQ99z7wwCDCw==} dev: false - /better-ajv-errors@1.2.0(ajv@8.11.0): - resolution: {integrity: sha512-UW+IsFycygIo7bclP9h5ugkNH8EjCSgqyFB/yQ4Hqqa1OEYDtb0uFIkYE0b6+CjkgJYVM5UKI/pJPxjYe9EZlA==} - engines: {node: '>= 12.13.0'} - peerDependencies: - ajv: 4.11.8 - 8 - dependencies: - '@babel/code-frame': 7.22.13 - '@humanwhocodes/momoa': 2.0.4 - ajv: 8.11.0 - chalk: 4.1.2 - jsonpointer: 5.0.0 - leven: 3.1.0 - dev: true - /better-opn@3.0.2: resolution: {integrity: sha512-aVNobHnJqLiUelTaHat9DZ1qM2w0C0Eym4LPI/3JxOnSokGVdsl1T1kN7TFvsEAD8G47A6VKQ0TVHqbBnYMJlQ==} engines: {node: '>=12.0.0'} @@ -25357,11 +25391,6 @@ packages: engines: {'0': node >= 0.2.0} dev: true - /jsonpointer@5.0.0: - resolution: {integrity: sha512-PNYZIdMjVIvVgDSYKTT63Y+KZ6IZvGRNNWcxwD+GNnUz1MKPfv30J8ueCjdwcN0nDx2SlshgyB7Oy0epAzVRRg==} - engines: {node: '>=0.10.0'} - dev: true - /jstransformer@1.0.0: resolution: {integrity: sha512-C9YK3Rf8q6VAPDCCU9fnqo3mAfOH6vUGnMcP4AQAYIEpWtfGLpwOTmZ+igtdK5y+VvI2n3CyYSzy4Qh34eq24A==} dependencies: @@ -30859,12 +30888,12 @@ packages: fs-extra: 11.1.1 dev: true - /rspress@1.5.0(esbuild@0.17.19)(react-dom@18.2.0)(react@18.2.0)(ts-node@10.9.1)(webpack@5.88.1): + /rspress@1.5.0(esbuild@0.17.19)(react-dom@18.2.0)(react@18.2.0)(ts-node@10.9.1)(webpack@5.89.0): resolution: {integrity: sha512-aAjyzDXYOn8eu2v5w8EeELAAXcmM10UpIReq/h0Ff713vPI1epfDVQyCaEaHDKoWQ4BPxQbVlxVbsmG+tXYJZg==} hasBin: true dependencies: '@modern-js/node-bundle-require': link:packages/toolkit/node-bundle-require - '@rspress/core': 1.5.0(esbuild@0.17.19)(ts-node@10.9.1)(webpack@5.88.1) + '@rspress/core': 1.5.0(esbuild@0.17.19)(ts-node@10.9.1)(webpack@5.89.0) '@rspress/shared': 1.5.0(esbuild@0.17.19)(react-dom@18.2.0)(react@18.2.0)(ts-node@10.9.1) cac: 6.7.14 chalk: 5.3.0 @@ -31609,14 +31638,14 @@ packages: char-regex: 1.0.2 strip-ansi: 6.0.1 - /string-replace-loader@3.1.0(webpack@5.88.1): + /string-replace-loader@3.1.0(webpack@5.89.0): resolution: {integrity: sha512-5AOMUZeX5HE/ylKDnEa/KKBqvlnFmRZudSOjVJHxhoJg9QYTwl1rECx7SLR8BBH7tfxb4Rp7EM2XVfQFxIhsbQ==} peerDependencies: webpack: ^5 dependencies: loader-utils: 2.0.4 schema-utils: 3.3.0 - webpack: 5.88.1(esbuild@0.17.19) + webpack: 5.89.0(esbuild@0.17.19) dev: true /string-similarity@4.0.4: @@ -32283,6 +32312,32 @@ packages: serialize-javascript: 6.0.1 terser: 5.19.2 webpack: 5.88.1(esbuild@0.18.20) + dev: true + + /terser-webpack-plugin@5.3.9(esbuild@0.18.20)(webpack@5.89.0): + resolution: {integrity: sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==} + engines: {node: '>= 10.13.0'} + peerDependencies: + '@swc/core': '*' + esbuild: '*' + uglify-js: '*' + webpack: ^5.1.0 + peerDependenciesMeta: + '@swc/core': + optional: true + esbuild: + optional: true + uglify-js: + optional: true + dependencies: + '@jridgewell/trace-mapping': 0.3.19 + esbuild: 0.18.20 + jest-worker: 27.5.1 + schema-utils: 3.3.0 + serialize-javascript: 6.0.1 + terser: 5.19.2 + webpack: 5.89.0(esbuild@0.18.20) + dev: false /terser@5.19.2: resolution: {integrity: sha512-qC5+dmecKJA4cpYxRa5aVkKehYsQKc+AHeKl0Oe62aYjBL8ZA33tTljktDHJSaxxMnbI5ZYw+o/S2DxxLu8OfA==} @@ -33218,6 +33273,22 @@ packages: webpack: 5.88.1(esbuild@0.17.19) dev: true + /url-loader@4.1.1(webpack@5.89.0): + resolution: {integrity: sha512-3BTV812+AVHHOJQO8O5MkWgZ5aosP7GnROJwvzLS9hWDj00lZ6Z0wNak423Lp9PBZN05N+Jk/N5Si8jRAlGyWA==} + engines: {node: '>= 10.13.0'} + peerDependencies: + file-loader: '*' + webpack: ^4.0.0 || ^5.0.0 + peerDependenciesMeta: + file-loader: + optional: true + dependencies: + loader-utils: 2.0.4 + mime-types: 2.1.35 + schema-utils: 3.3.0 + webpack: 5.89.0(esbuild@0.17.19) + dev: true + /url-parse@1.5.10: resolution: {integrity: sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==} dependencies: @@ -34040,6 +34111,7 @@ packages: - '@swc/core' - esbuild - uglify-js + dev: true /webpack@5.89.0(esbuild@0.17.19): resolution: {integrity: sha512-qyfIC10pOr70V+jkmud8tMfajraGCZMBWJtrmuBymQKCrLTRejBI8STDp1MCyZu/QTdZSeacCQYpYNQVOzX5kw==} @@ -34081,6 +34153,46 @@ packages: - uglify-js dev: true + /webpack@5.89.0(esbuild@0.18.20): + resolution: {integrity: sha512-qyfIC10pOr70V+jkmud8tMfajraGCZMBWJtrmuBymQKCrLTRejBI8STDp1MCyZu/QTdZSeacCQYpYNQVOzX5kw==} + engines: {node: '>=10.13.0'} + hasBin: true + peerDependencies: + webpack-cli: '*' + peerDependenciesMeta: + webpack-cli: + optional: true + dependencies: + '@types/eslint-scope': 3.7.3 + '@types/estree': 1.0.0 + '@webassemblyjs/ast': 1.11.6 + '@webassemblyjs/wasm-edit': 1.11.6 + '@webassemblyjs/wasm-parser': 1.11.6 + acorn: 8.10.0 + acorn-import-assertions: 1.9.0(acorn@8.10.0) + browserslist: 4.20.2 + chrome-trace-event: 1.0.3 + enhanced-resolve: 5.15.0 + es-module-lexer: 1.2.1 + eslint-scope: 5.1.1 + events: 3.3.0 + glob-to-regexp: 0.4.1 + graceful-fs: 4.2.10 + json-parse-even-better-errors: 2.3.1 + loader-runner: 4.3.0 + mime-types: 2.1.35 + neo-async: 2.6.2 + schema-utils: 3.3.0 + tapable: 2.2.1 + terser-webpack-plugin: 5.3.9(esbuild@0.18.20)(webpack@5.89.0) + watchpack: 2.4.0 + webpack-sources: 3.2.3 + transitivePeerDependencies: + - '@swc/core' + - esbuild + - uglify-js + dev: false + /websocket@1.0.34: resolution: {integrity: sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ==} engines: {node: '>=4.0.0'} diff --git a/scripts/prebundle/package.json b/scripts/prebundle/package.json index c94a55343215..c7a1b8258c3a 100644 --- a/scripts/prebundle/package.json +++ b/scripts/prebundle/package.json @@ -40,14 +40,11 @@ "@types/url-join": "4.0.1", "@types/webpack-bundle-analyzer": "4.6.0", "address": "1.1.2", - "ajv": "8.11.0", - "ajv-keywords": "5.1.0", "ansi-escapes": "4.3.2", "autoprefixer": "10.4.13", "babel-loader": "9.1.3", "babel-plugin-lodash": "3.3.4", "babel-plugin-transform-react-remove-prop-types": "0.4.24", - "better-ajv-errors": "1.2.0", "browserslist": "4.20.2", "chalk": "4.1.2", "chokidar": "3.5.3", diff --git a/scripts/prebundle/src/constant.ts b/scripts/prebundle/src/constant.ts index b334874e3a1e..4a3f8a30955d 100644 --- a/scripts/prebundle/src/constant.ts +++ b/scripts/prebundle/src/constant.ts @@ -1,6 +1,6 @@ import { basename, join } from 'path'; import glob from 'fast-glob'; -import { copyFileSync, copySync, moveSync } from 'fs-extra'; +import { copyFileSync, copySync } from 'fs-extra'; import { replaceFileContent } from './helper'; import type { TaskConfig } from './types'; @@ -130,50 +130,6 @@ export const TASKS: TaskConfig[] = [ }); }, }, - { - name: 'ajv', - beforeBundle(task) { - replaceFileContent(task.depEntry, content => { - const addExports = `exports.codegen = require("./compile/codegen");`; - if (content.includes(addExports)) { - return content; - } - return `${content}\n${addExports}`; - }); - }, - afterBundle(task) { - // Fix dts-packer failed to handle uri-js type - moveSync( - join(task.distPath, 'uri-js/dist/es5/uri.all.d.ts'), - join(task.distPath, 'uri-js.d.ts'), - ); - }, - emitFiles: [ - { - path: 'codegen.js', - content: `module.exports = require('./').codegen;`, - }, - { - path: 'types/vocabularies/errors.d.ts', - content: 'export type DefinedError = any;', - }, - ], - }, - { - name: 'ajv-keywords', - ignoreDts: true, - externals: { - ajv: '../ajv', - 'ajv/dist/compile/codegen': '../ajv/codegen', - }, - }, - { - name: 'better-ajv-errors', - ignoreDts: true, - externals: { - ajv: '../ajv', - }, - }, ], }, { From a68a2e9a8043f6908975f3b0f25d82caff2c1f9a Mon Sep 17 00:00:00 2001 From: qixuan <58852732+GiveMe-A-Name@users.noreply.github.com> Date: Mon, 6 Nov 2023 14:58:49 +0800 Subject: [PATCH 5/8] fix(prod-server): inject reporter from req (#4919) --- .changeset/unlucky-adults-stare.md | 6 ++++++ packages/server/prod-server/src/libs/context/context.ts | 3 +++ packages/server/prod-server/src/type.ts | 2 ++ 3 files changed, 11 insertions(+) create mode 100644 .changeset/unlucky-adults-stare.md diff --git a/.changeset/unlucky-adults-stare.md b/.changeset/unlucky-adults-stare.md new file mode 100644 index 000000000000..2fbd9af4cf57 --- /dev/null +++ b/.changeset/unlucky-adults-stare.md @@ -0,0 +1,6 @@ +--- +'@modern-js/prod-server': patch +--- + +fix(prod-server): inject reporter from req +fix(prod-server): 从 req 里拿到 reporter 去注入 diff --git a/packages/server/prod-server/src/libs/context/context.ts b/packages/server/prod-server/src/libs/context/context.ts index 53d96217e595..1af1631a5c8a 100644 --- a/packages/server/prod-server/src/libs/context/context.ts +++ b/packages/server/prod-server/src/libs/context/context.ts @@ -74,6 +74,9 @@ export class ModernServerContext implements ModernServerContextInterface { this.res, cutNameByHyphen(options?.metaName || 'modern-js'), ); + + // inject reporter from req if it has. + req.reporter && (this.reporter = req.reporter); } private get parsedURL() { diff --git a/packages/server/prod-server/src/type.ts b/packages/server/prod-server/src/type.ts index 154fb5711afd..bc33d59c0968 100644 --- a/packages/server/prod-server/src/type.ts +++ b/packages/server/prod-server/src/type.ts @@ -9,6 +9,7 @@ import type { NextFunction, ModernServerContext, InternalPlugins, + Reporter, } from '@modern-js/types'; import type { ModernRouteInterface } from './libs/route'; @@ -16,6 +17,7 @@ declare module 'http' { interface IncomingMessage { logger: Logger; metrics: Metrics; + reporter?: Reporter; body?: any; } From 0c1a6273971f0d6e1ffabec2fa3683aa909b83f2 Mon Sep 17 00:00:00 2001 From: 10Derozan Date: Mon, 6 Nov 2023 16:29:33 +0800 Subject: [PATCH 6/8] chore(module-tools): remove unuse schema (#4921) --- .changeset/red-laws-scream.md | 6 + .../module-tools/src/config/legacySchema.ts | 197 -------------- .../module-tools/src/config/schema.ts | 252 ------------------ 3 files changed, 6 insertions(+), 449 deletions(-) create mode 100644 .changeset/red-laws-scream.md delete mode 100644 packages/solutions/module-tools/src/config/legacySchema.ts delete mode 100644 packages/solutions/module-tools/src/config/schema.ts diff --git a/.changeset/red-laws-scream.md b/.changeset/red-laws-scream.md new file mode 100644 index 000000000000..9080e7e04660 --- /dev/null +++ b/.changeset/red-laws-scream.md @@ -0,0 +1,6 @@ +--- +'@modern-js/module-tools': patch +--- + +chore(module-tools): remove unuse schema +chore(module-tools): 移除没有使用的 schema diff --git a/packages/solutions/module-tools/src/config/legacySchema.ts b/packages/solutions/module-tools/src/config/legacySchema.ts deleted file mode 100644 index a264b2018dbd..000000000000 --- a/packages/solutions/module-tools/src/config/legacySchema.ts +++ /dev/null @@ -1,197 +0,0 @@ -export const targets = [ - 'es5', - 'es6', - 'es2015', - 'es2016', - 'es2017', - 'es2018', - 'es2019', - 'es2020', - // The default target is esnext which means that by default, assume all of the latest JavaScript and CSS features are supported. - 'esnext', -]; - -export const presets = [ - 'npm-library', - 'npm-library-with-umd', - 'npm-component', - 'npm-component-with-umd', - ...[ - 'npm-library', - 'npm-library-with-umd', - 'npm-component', - 'npm-component-with-umd', - ].reduce((ret, crt) => { - return [...ret, ...targets.map(t => `${crt}-${t}`)]; - }, []), -]; - -const properties = { - target: { - enum: targets, - }, - format: { - enum: ['cjs', 'esm', 'umd'], - }, - sourceMap: { - enum: [true, false, 'inline', 'external'], - }, - buildType: { - enum: ['bundle', 'bundleless'], - }, - bundleOptions: { - type: 'object', - properties: { - getModuleId: { - instanceof: 'Function', - }, - entry: { - type: 'object', - }, - splitting: { - type: 'boolean', - }, - externals: { - type: 'array', - items: { - anyOf: [ - { - instanceof: 'RegExp', - }, - { - typeof: 'string', - }, - ], - }, - }, - platform: { - enum: ['node', 'browser'], - }, - minify: { - enum: ['esbuild', 'terser', false], - }, - skipDeps: { - type: 'boolean', - }, - }, - }, - bundlelessOptions: { - type: 'object', - properties: { - sourceDir: { - type: 'string', - }, - style: { - type: 'object', - properties: { - compileMode: { - enum: ['all', 'only-compiled-code', 'only-source-code', false], - }, - path: { type: 'string' }, - }, - }, - static: { - type: 'object', - properties: { - path: { type: 'string' }, - }, - }, - }, - }, - - tsconfig: { - type: 'string', - }, - enableDts: { - type: 'boolean', - }, - dtsOnly: { - type: 'boolean', - }, - - outputPath: { type: 'string' }, -}; - -export const buildSchema = [ - { - target: 'output.buildConfig', - schema: { - if: { - type: 'array', - }, - then: { - items: [{ type: 'object', properties, additionalProperties: false }], - }, - else: { type: 'object', properties, additionalProperties: false }, - }, - }, - { - target: 'output.buildPreset', - schema: { - enum: presets, - }, - }, -]; - -const PACKAGE_MODE_LIST = [ - 'universal-js', - 'universal-js-lite', - 'browser-js', - 'browser-js-lite', - 'node-js', -]; - -export const outputSchema = [ - /** packageMode will deprecated */ - { - target: 'output.packageMode', - schema: { enum: PACKAGE_MODE_LIST }, - }, - /** packageFields will deprecated */ - { - target: 'output.packageFields', - schema: { typeof: 'object' }, - }, - /** enableSourceMap will deprecated */ - { - target: 'output.enableSourceMap', - schema: { typeof: 'boolean' }, - }, - /** importStyle will deprecated */ - { - target: 'output.importStyle', - schema: { - enum: ['compiled-code', 'source-code'], - }, - }, - /** assetsPath will deprecated */ - { - target: 'output.assetsPath', - schema: { - typeof: 'string', - default: 'styles', - }, - }, - ...buildSchema, -]; - -export const sourceSchema = [ - { - target: 'source.jsxTransformRuntime', - schema: { - // https://babeljs.io/docs/en/babel-preset-react#runtime - enum: ['classic', 'automatic'], - }, - }, -]; - -export const toolsSchema = [ - { - target: 'tools.speedy', - schema: { - typeof: ['object', 'function'], - }, - }, -]; - -export const legacySchema = [...sourceSchema, ...outputSchema, ...toolsSchema]; diff --git a/packages/solutions/module-tools/src/config/schema.ts b/packages/solutions/module-tools/src/config/schema.ts deleted file mode 100644 index d19c00b66cfd..000000000000 --- a/packages/solutions/module-tools/src/config/schema.ts +++ /dev/null @@ -1,252 +0,0 @@ -export const targets = [ - 'es5', - 'es6', - 'es2015', - 'es2016', - 'es2017', - 'es2018', - 'es2019', - 'es2020', - 'es2021', - 'es2022', - // The default target is esnext which means that by default, assume all of the latest JavaScript and CSS features are supported. - 'esnext', -]; - -export const presets = [ - 'npm-library', - 'npm-library-with-umd', - 'npm-component', - 'npm-component-with-umd', - ...[ - 'npm-library', - 'npm-library-with-umd', - 'npm-component', - 'npm-component-with-umd', - ].reduce((ret, crt) => { - return [...ret, ...targets.map(t => `${crt}-${t}`)]; - }, []), - 'modern-js-node', - 'modern-js-universal', -]; -const buildConfigProperties = { - alias: { - typeof: ['object', 'function'], - }, - hooks: { - // TODO: improve it - type: 'array', - }, - resolve: { - // TODO: add properties - type: 'object', - }, - banner: { - // TODO: add properties - type: 'object', - }, - asset: { - type: 'object', - }, - autoExternal: { - if: { - type: 'object', - }, - then: { - properties: { - dependencies: { type: 'boolean' }, - peerDependencies: { type: 'boolean' }, - }, - }, - else: { type: 'boolean' }, - }, - buildType: { - enum: ['bundle', 'bundleless'], - }, - copy: { - type: 'object', - properties: { - patterns: { - type: 'array', - items: { - type: 'object', - properties: { - from: { type: 'string' }, - to: { type: 'string' }, - context: { type: 'string' }, - globOptions: { type: 'object' }, - }, - }, - }, - options: { - type: 'object', - properties: { - concurrency: { - type: 'number', - }, - }, - }, - }, - }, - define: { - typeof: 'object', - }, - dts: { - if: { type: 'object' }, - then: { - properties: { - distPath: { type: 'string' }, - tsconfigPath: { type: 'string' }, - abortOnError: { type: 'boolean' }, - respectExternal: { - type: 'boolean', - }, - }, - }, - else: { type: 'boolean' }, - }, - autoExtension: { - type: 'boolean', - }, - externals: { - type: 'array', - items: { - anyOf: [ - { - instanceof: 'RegExp', - }, - { - typeof: 'string', - }, - ], - }, - }, - format: { - enum: ['cjs', 'esm', 'iife', 'umd'], - }, - input: { - type: ['array', 'object'], - }, - jsx: { - enum: ['automatic', 'transform', 'preserve'], - }, - minify: { - if: { - type: 'object', - }, - else: { enum: ['esbuild', 'terser', false] }, - }, - outDir: { type: 'string' }, - platform: { - enum: ['node', 'browser'], - }, - sourceDir: { - typeof: 'string', - }, - sourceMap: { - enum: [true, false, 'inline', 'external'], - }, - splitting: { - type: 'boolean', - }, - style: { - // TODO: add properties - type: 'object', - }, - redirect: { - type: 'object', - }, - target: { - enum: targets, - }, - umdGlobals: { - type: 'object', - }, - esbuildOpitons: { - instanceof: 'Function', - }, - umdModuleName: { - anyOf: [ - { - instanceof: 'Function', - }, - { - typeof: 'string', - }, - ], - }, - shims: { - type: 'boolean', - }, - sideEffects: { - anyOf: [ - { - type: 'array', - items: { - instanceof: 'RegExp', - }, - }, - { - type: 'boolean', - }, - { - instanceof: 'Function', - }, - ], - }, - externalHelpers: { - type: 'boolean', - }, - tsconfig: { - type: 'string', - }, - transformImport: { - type: 'array', - }, - transformLodash: { - type: 'boolean', - }, - sourceType: { - enum: ['commonjs', 'module'], - }, -}; -export const buildConfig = { - target: 'buildConfig', - schema: { - if: { - type: 'array', - }, - then: { - items: [ - { - type: 'object', - properties: buildConfigProperties, - }, - ], - }, - else: { - type: 'object', - properties: buildConfigProperties, - }, - }, -}; -export const buildPreset = { - target: 'buildPreset', - schema: { - if: { type: 'string' }, - then: { - enum: presets, - }, - else: { typeof: 'function' }, - }, -}; - -export const legacy = { - target: 'legacy', - schema: { - type: 'boolean', - }, -}; - -export const schema = [buildConfig, buildPreset, legacy]; -export { legacySchema } from './legacySchema'; From 2803118d3c84b7ebf38b8fbe06b517ba95b552b0 Mon Sep 17 00:00:00 2001 From: Asuka109 Date: Mon, 6 Nov 2023 17:48:06 +0800 Subject: [PATCH 7/8] feat(devtools): merge mountpoint into client package (#4920) --- .../src => client/exports}/.eslintrc.js | 4 + packages/devtools/client/exports/mount.mjs | 49 +++++++++ packages/devtools/client/modern.config.ts | 24 +++- packages/devtools/client/package.json | 7 ++ .../plugins}/radix-token-transformer.js | 0 .../components/Breadcrumbs.module.scss | 0 .../{ => client}/components/Breadcrumbs.tsx | 0 .../src/{ => client}/components/Link.tsx | 0 .../src/{ => client}/components/NavLink.tsx | 0 .../components/ObjectInspector.module.scss | 0 .../components/ObjectInspector.tsx | 0 .../{ => client}/components/SelectLink.tsx | 0 .../components/ServerRoute/Base.module.scss | 0 .../components/ServerRoute/Base.tsx | 0 .../components/ServerRoute/Context.tsx | 0 .../ClientRoute/LegacyRoute/Stats.tsx | 0 .../ClientRoute/RemixRoute/Context.ts | 0 .../ClientRoute/RemixRoute/Route.module.scss | 0 .../ClientRoute/RemixRoute/Route.tsx | 0 .../ClientRoute/RemixRoute/Stats.tsx | 0 .../EntryRoute/ClientRoute/Stats.tsx | 2 +- .../EntryRoute/ClientRoute/index.ts | 0 .../ServerRoute/EntryRoute/Route.tsx | 0 .../ServerRoute/EntryRoute/Stats.module.scss | 0 .../ServerRoute/EntryRoute/Stats.tsx | 2 +- .../ServerRoute/EntryRoute/index.ts | 0 .../components/ServerRoute/Route.tsx | 0 .../components/ServerRoute/Unknown.tsx | 0 .../src/{ => client}/components/Theme.tsx | 0 .../client/src/{ => client}/constants.tsx | 0 .../config/[toolkit].[type]/page.loader.ts | 0 .../routes/config/[toolkit].[type]/page.tsx | 4 +- .../routes/config/layout.config.tsx | 0 .../routes/config/layout.module.scss | 0 .../src/{ => client}/routes/config/layout.tsx | 0 .../{ => client}/routes/config/page.loader.ts | 0 .../src/{ => client}/routes/config/page.tsx | 0 .../routes/context/builder/page.tsx | 4 +- .../routes/context/framework/page.tsx | 4 +- .../routes/context/layout.config.tsx | 2 +- .../{ => client}/routes/context/layout.tsx | 0 .../routes/context/page.loader.ts | 0 .../src/{ => client}/routes/context/page.tsx | 0 .../src/{ => client}/routes/layout.config.tsx | 0 .../{ => client}/routes/layout.module.scss | 2 +- .../client/src/{ => client}/routes/layout.tsx | 16 ++- .../{ => client}/routes/overview/heading.svg | 0 .../routes/overview/layout.config.tsx | 0 .../routes/overview/page.module.scss | 0 .../src/{ => client}/routes/overview/page.tsx | 2 +- .../src/{ => client}/routes/page.loader.ts | 0 .../client/src/{ => client}/routes/page.tsx | 0 .../routes/pages/layout.config.ts | 0 .../routes/pages/layout.module.scss | 0 .../src/{ => client}/routes/pages/layout.tsx | 0 .../routes/pages/page.module.scss | 0 .../src/{ => client}/routes/pages/page.tsx | 6 +- .../client/src/{ => client}/rpc/index.ts | 2 +- .../client/src/{ => client}/stores/index.tsx | 8 +- .../src/{ => client}/styles/breakpoints.scss | 0 .../client/src/{ => client}/styles/theme.scss | 2 +- .../client/src/{ => client}/types/index.ts | 0 .../client/src/{ => client}/utils/context.tsx | 0 .../client/src/{ => client}/utils/hooks.ts | 0 .../client/src/{ => client}/utils/index.ts | 0 .../devtools/client/src/modern-app-env.d.ts | 2 + .../components/Devtools/Action.module.scss | 0 .../src/mount}/components/Devtools/Action.tsx | 12 +- .../components/Devtools/FrameBox.module.scss | 0 .../mount}/components/Devtools/FrameBox.tsx | 0 .../mount}/components/Devtools/heading.svg | 0 .../src/mount}/components/Devtools/xmark.svg | 0 .../src/mount}/components/LoadingIcon.tsx | 0 .../src/mount}/components/Portal.tsx | 0 .../src/mount}/components/Visible.tsx | 0 packages/devtools/client/src/mount/index.tsx | 7 ++ .../src => client/src/mount}/types.d.ts | 0 .../src/mount}/utils/draggable.ts | 0 .../devtools/client/src/routes/layout.css | 3 - packages/devtools/client/tsconfig.json | 2 +- packages/devtools/kit/src/mount-point.ts | 3 + packages/devtools/mount/.browserslistrc | 5 - packages/devtools/mount/.eslintrc.js | 4 - packages/devtools/mount/CHANGELOG.md | 67 ------------ packages/devtools/mount/README.md | 37 ------- packages/devtools/mount/modern.config.ts | 68 ------------ packages/devtools/mount/package.json | 50 --------- packages/devtools/mount/src/index.tsx | 1 - .../devtools/mount/src/modern-app-env.d.ts | 3 - packages/devtools/mount/src/mount.tsx | 37 ------- packages/devtools/mount/tsconfig.json | 13 --- packages/devtools/plugin/package.json | 1 - packages/devtools/plugin/src/cli.ts | 11 +- packages/devtools/plugin/src/runtime.ts | 12 -- pnpm-lock.yaml | 103 +----------------- 95 files changed, 139 insertions(+), 442 deletions(-) rename packages/devtools/{mount/src => client/exports}/.eslintrc.js (71%) create mode 100644 packages/devtools/client/exports/mount.mjs rename packages/devtools/{mount/plugin => client/plugins}/radix-token-transformer.js (100%) rename packages/devtools/client/src/{ => client}/components/Breadcrumbs.module.scss (100%) rename packages/devtools/client/src/{ => client}/components/Breadcrumbs.tsx (100%) rename packages/devtools/client/src/{ => client}/components/Link.tsx (100%) rename packages/devtools/client/src/{ => client}/components/NavLink.tsx (100%) rename packages/devtools/client/src/{ => client}/components/ObjectInspector.module.scss (100%) rename packages/devtools/client/src/{ => client}/components/ObjectInspector.tsx (100%) rename packages/devtools/client/src/{ => client}/components/SelectLink.tsx (100%) rename packages/devtools/client/src/{ => client}/components/ServerRoute/Base.module.scss (100%) rename packages/devtools/client/src/{ => client}/components/ServerRoute/Base.tsx (100%) rename packages/devtools/client/src/{ => client}/components/ServerRoute/Context.tsx (100%) rename packages/devtools/client/src/{ => client}/components/ServerRoute/EntryRoute/ClientRoute/LegacyRoute/Stats.tsx (100%) rename packages/devtools/client/src/{ => client}/components/ServerRoute/EntryRoute/ClientRoute/RemixRoute/Context.ts (100%) rename packages/devtools/client/src/{ => client}/components/ServerRoute/EntryRoute/ClientRoute/RemixRoute/Route.module.scss (100%) rename packages/devtools/client/src/{ => client}/components/ServerRoute/EntryRoute/ClientRoute/RemixRoute/Route.tsx (100%) rename packages/devtools/client/src/{ => client}/components/ServerRoute/EntryRoute/ClientRoute/RemixRoute/Stats.tsx (100%) rename packages/devtools/client/src/{ => client}/components/ServerRoute/EntryRoute/ClientRoute/Stats.tsx (96%) rename packages/devtools/client/src/{ => client}/components/ServerRoute/EntryRoute/ClientRoute/index.ts (100%) rename packages/devtools/client/src/{ => client}/components/ServerRoute/EntryRoute/Route.tsx (100%) rename packages/devtools/client/src/{ => client}/components/ServerRoute/EntryRoute/Stats.module.scss (100%) rename packages/devtools/client/src/{ => client}/components/ServerRoute/EntryRoute/Stats.tsx (95%) rename packages/devtools/client/src/{ => client}/components/ServerRoute/EntryRoute/index.ts (100%) rename packages/devtools/client/src/{ => client}/components/ServerRoute/Route.tsx (100%) rename packages/devtools/client/src/{ => client}/components/ServerRoute/Unknown.tsx (100%) rename packages/devtools/client/src/{ => client}/components/Theme.tsx (100%) rename packages/devtools/client/src/{ => client}/constants.tsx (100%) rename packages/devtools/client/src/{ => client}/routes/config/[toolkit].[type]/page.loader.ts (100%) rename packages/devtools/client/src/{ => client}/routes/config/[toolkit].[type]/page.tsx (80%) rename packages/devtools/client/src/{ => client}/routes/config/layout.config.tsx (100%) rename packages/devtools/client/src/{ => client}/routes/config/layout.module.scss (100%) rename packages/devtools/client/src/{ => client}/routes/config/layout.tsx (100%) rename packages/devtools/client/src/{ => client}/routes/config/page.loader.ts (100%) rename packages/devtools/client/src/{ => client}/routes/config/page.tsx (100%) rename packages/devtools/client/src/{ => client}/routes/context/builder/page.tsx (70%) rename packages/devtools/client/src/{ => client}/routes/context/framework/page.tsx (70%) rename packages/devtools/client/src/{ => client}/routes/context/layout.config.tsx (82%) rename packages/devtools/client/src/{ => client}/routes/context/layout.tsx (100%) rename packages/devtools/client/src/{ => client}/routes/context/page.loader.ts (100%) rename packages/devtools/client/src/{ => client}/routes/context/page.tsx (100%) rename packages/devtools/client/src/{ => client}/routes/layout.config.tsx (100%) rename packages/devtools/client/src/{ => client}/routes/layout.module.scss (97%) rename packages/devtools/client/src/{ => client}/routes/layout.tsx (86%) rename packages/devtools/client/src/{ => client}/routes/overview/heading.svg (100%) rename packages/devtools/client/src/{ => client}/routes/overview/layout.config.tsx (100%) rename packages/devtools/client/src/{ => client}/routes/overview/page.module.scss (100%) rename packages/devtools/client/src/{ => client}/routes/overview/page.tsx (99%) rename packages/devtools/client/src/{ => client}/routes/page.loader.ts (100%) rename packages/devtools/client/src/{ => client}/routes/page.tsx (100%) rename packages/devtools/client/src/{ => client}/routes/pages/layout.config.ts (100%) rename packages/devtools/client/src/{ => client}/routes/pages/layout.module.scss (100%) rename packages/devtools/client/src/{ => client}/routes/pages/layout.tsx (100%) rename packages/devtools/client/src/{ => client}/routes/pages/page.module.scss (100%) rename packages/devtools/client/src/{ => client}/routes/pages/page.tsx (92%) rename packages/devtools/client/src/{ => client}/rpc/index.ts (95%) rename packages/devtools/client/src/{ => client}/stores/index.tsx (95%) rename packages/devtools/client/src/{ => client}/styles/breakpoints.scss (100%) rename packages/devtools/client/src/{ => client}/styles/theme.scss (98%) rename packages/devtools/client/src/{ => client}/types/index.ts (100%) rename packages/devtools/client/src/{ => client}/utils/context.tsx (100%) rename packages/devtools/client/src/{ => client}/utils/hooks.ts (100%) rename packages/devtools/client/src/{ => client}/utils/index.ts (100%) rename packages/devtools/{mount/src => client/src/mount}/components/Devtools/Action.module.scss (100%) rename packages/devtools/{mount/src => client/src/mount}/components/Devtools/Action.tsx (88%) rename packages/devtools/{mount/src => client/src/mount}/components/Devtools/FrameBox.module.scss (100%) rename packages/devtools/{mount/src => client/src/mount}/components/Devtools/FrameBox.tsx (100%) rename packages/devtools/{mount/src => client/src/mount}/components/Devtools/heading.svg (100%) rename packages/devtools/{mount/src => client/src/mount}/components/Devtools/xmark.svg (100%) rename packages/devtools/{mount/src => client/src/mount}/components/LoadingIcon.tsx (100%) rename packages/devtools/{mount/src => client/src/mount}/components/Portal.tsx (100%) rename packages/devtools/{mount/src => client/src/mount}/components/Visible.tsx (100%) create mode 100644 packages/devtools/client/src/mount/index.tsx rename packages/devtools/{mount/src => client/src/mount}/types.d.ts (100%) rename packages/devtools/{mount/src => client/src/mount}/utils/draggable.ts (100%) delete mode 100644 packages/devtools/client/src/routes/layout.css delete mode 100644 packages/devtools/mount/.browserslistrc delete mode 100644 packages/devtools/mount/.eslintrc.js delete mode 100644 packages/devtools/mount/CHANGELOG.md delete mode 100644 packages/devtools/mount/README.md delete mode 100644 packages/devtools/mount/modern.config.ts delete mode 100644 packages/devtools/mount/package.json delete mode 100644 packages/devtools/mount/src/index.tsx delete mode 100644 packages/devtools/mount/src/modern-app-env.d.ts delete mode 100644 packages/devtools/mount/src/mount.tsx delete mode 100644 packages/devtools/mount/tsconfig.json delete mode 100644 packages/devtools/plugin/src/runtime.ts diff --git a/packages/devtools/mount/src/.eslintrc.js b/packages/devtools/client/exports/.eslintrc.js similarity index 71% rename from packages/devtools/mount/src/.eslintrc.js rename to packages/devtools/client/exports/.eslintrc.js index fafc00323057..4a96c063fb6f 100644 --- a/packages/devtools/mount/src/.eslintrc.js +++ b/packages/devtools/client/exports/.eslintrc.js @@ -1,3 +1,4 @@ +/** @type {import('eslint').Linter.Config} */ // eslint-disable-next-line import/no-commonjs module.exports = { root: true, @@ -6,4 +7,7 @@ module.exports = { tsconfigRootDir: __dirname, project: ['../tsconfig.json'], }, + rules: { + curly: 'off', + }, }; diff --git a/packages/devtools/client/exports/mount.mjs b/packages/devtools/client/exports/mount.mjs new file mode 100644 index 000000000000..daf3253269fa --- /dev/null +++ b/packages/devtools/client/exports/mount.mjs @@ -0,0 +1,49 @@ +/* WARNING: NO ES6 SYNTAX HERE!!! */ +/* eslint-disable no-inner-declarations */ +/* eslint-disable no-var */ +import routesManifest from '../dist/routes-manifest.json'; + +(function () { + /** + * @param {import('@modern-js/devtools-kit').SetupClientOptions} options + */ + function mountDevTools(options) { + var container = document.createElement('div'); + container.className = '_modern_js_devtools_container'; + document.body.appendChild(container); + + var shadow = container.attachShadow({ mode: 'closed' }); + + routesManifest.routeAssets.mount.assets.forEach(function (asset) { + var el; + if (asset.endsWith('.js')) { + el = document.createElement('script'); + el.src = asset; + } else if (asset.endsWith('.css')) { + el = document.createElement('link'); + el.href = asset; + el.rel = 'stylesheet'; + } + shadow.appendChild(el); + }); + + var app = document.createElement('div'); + app.className = '_modern_js_devtools_mountpoint theme-register'; + var appGlobalExport = `_modern_js_devtools_app`; + window[appGlobalExport] = { + container: app, + options, + }; + shadow.appendChild(app); + } + + try { + // eslint-disable-next-line no-undef + var opts = decodeURIComponent(__resourceQuery); + mountDevTools(opts); + } catch (err) { + var e = new Error('Failed to execute mount point of DevTools.'); + e.cause = err; + console.error(e); + } +})(); diff --git a/packages/devtools/client/modern.config.ts b/packages/devtools/client/modern.config.ts index 93e0d16523bd..f3b9030be60e 100644 --- a/packages/devtools/client/modern.config.ts +++ b/packages/devtools/client/modern.config.ts @@ -1,6 +1,7 @@ import { appTools, defineConfig } from '@modern-js/app-tools'; +import { nanoid } from '@modern-js/utils'; import { ROUTE_BASENAME } from '@modern-js/devtools-kit'; -import { version } from './package.json'; +import packageMeta from './package.json'; // https://modernjs.dev/en/configure/app/usage export default defineConfig<'rspack'>({ @@ -14,12 +15,21 @@ export default defineConfig<'rspack'>({ port: 8780, }, source: { + mainEntryName: 'client', + entries: { + mount: { + entry: './src/mount/index.tsx', + disableMount: true, + }, + }, preEntry: [ require.resolve('modern-normalize/modern-normalize.css'), - './src/styles/theme.scss', + require.resolve('@radix-ui/themes/styles.css'), ], globalVars: { - 'process.env.PKG_VERSION': version, + 'process.env.VERSION': packageMeta.version, + 'process.env.PKG_VERSION': packageMeta.version, + 'process.env.DEVTOOLS_MARK': nanoid(), }, }, output: { @@ -29,6 +39,14 @@ export default defineConfig<'rspack'>({ postcss: (config, { addPlugins }) => { addPlugins(require('postcss-custom-media')); }, + bundlerChain(chain) { + chain.module + .rule('RADIX_TOKEN') + .test(/\/@radix-ui\/themes\/styles\.css/) + .use('RADIX_TOKEN') + .loader('./plugins/radix-token-transformer.js') + .options({ root: '.theme-register' }); + }, }, plugins: [appTools({ bundler: 'experimental-rspack' })], }); diff --git a/packages/devtools/client/package.json b/packages/devtools/client/package.json index ab207855fb41..9232d9f839b2 100644 --- a/packages/devtools/client/package.json +++ b/packages/devtools/client/package.json @@ -17,6 +17,12 @@ "files": [ "dist" ], + "main": "./dist/html/client/index.html", + "exports": { + ".": "./dist/html/client/index.html", + "./mount": "./exports/mount.mjs", + "./package.json": "./package.json" + }, "dependencies": {}, "devDependencies": { "@modern-js-app/eslint-config": "workspace:*", @@ -26,6 +32,7 @@ "@modern-js/devtools-kit": "workspace:*", "@modern-js/eslint-config": "workspace:*", "@modern-js/plugin-proxy": "workspace:*", + "@modern-js/utils": "workspace:*", "@modern-js/runtime": "workspace:*", "@modern-js/tsconfig": "workspace:*", "@modern-js/types": "workspace:*", diff --git a/packages/devtools/mount/plugin/radix-token-transformer.js b/packages/devtools/client/plugins/radix-token-transformer.js similarity index 100% rename from packages/devtools/mount/plugin/radix-token-transformer.js rename to packages/devtools/client/plugins/radix-token-transformer.js diff --git a/packages/devtools/client/src/components/Breadcrumbs.module.scss b/packages/devtools/client/src/client/components/Breadcrumbs.module.scss similarity index 100% rename from packages/devtools/client/src/components/Breadcrumbs.module.scss rename to packages/devtools/client/src/client/components/Breadcrumbs.module.scss diff --git a/packages/devtools/client/src/components/Breadcrumbs.tsx b/packages/devtools/client/src/client/components/Breadcrumbs.tsx similarity index 100% rename from packages/devtools/client/src/components/Breadcrumbs.tsx rename to packages/devtools/client/src/client/components/Breadcrumbs.tsx diff --git a/packages/devtools/client/src/components/Link.tsx b/packages/devtools/client/src/client/components/Link.tsx similarity index 100% rename from packages/devtools/client/src/components/Link.tsx rename to packages/devtools/client/src/client/components/Link.tsx diff --git a/packages/devtools/client/src/components/NavLink.tsx b/packages/devtools/client/src/client/components/NavLink.tsx similarity index 100% rename from packages/devtools/client/src/components/NavLink.tsx rename to packages/devtools/client/src/client/components/NavLink.tsx diff --git a/packages/devtools/client/src/components/ObjectInspector.module.scss b/packages/devtools/client/src/client/components/ObjectInspector.module.scss similarity index 100% rename from packages/devtools/client/src/components/ObjectInspector.module.scss rename to packages/devtools/client/src/client/components/ObjectInspector.module.scss diff --git a/packages/devtools/client/src/components/ObjectInspector.tsx b/packages/devtools/client/src/client/components/ObjectInspector.tsx similarity index 100% rename from packages/devtools/client/src/components/ObjectInspector.tsx rename to packages/devtools/client/src/client/components/ObjectInspector.tsx diff --git a/packages/devtools/client/src/components/SelectLink.tsx b/packages/devtools/client/src/client/components/SelectLink.tsx similarity index 100% rename from packages/devtools/client/src/components/SelectLink.tsx rename to packages/devtools/client/src/client/components/SelectLink.tsx diff --git a/packages/devtools/client/src/components/ServerRoute/Base.module.scss b/packages/devtools/client/src/client/components/ServerRoute/Base.module.scss similarity index 100% rename from packages/devtools/client/src/components/ServerRoute/Base.module.scss rename to packages/devtools/client/src/client/components/ServerRoute/Base.module.scss diff --git a/packages/devtools/client/src/components/ServerRoute/Base.tsx b/packages/devtools/client/src/client/components/ServerRoute/Base.tsx similarity index 100% rename from packages/devtools/client/src/components/ServerRoute/Base.tsx rename to packages/devtools/client/src/client/components/ServerRoute/Base.tsx diff --git a/packages/devtools/client/src/components/ServerRoute/Context.tsx b/packages/devtools/client/src/client/components/ServerRoute/Context.tsx similarity index 100% rename from packages/devtools/client/src/components/ServerRoute/Context.tsx rename to packages/devtools/client/src/client/components/ServerRoute/Context.tsx diff --git a/packages/devtools/client/src/components/ServerRoute/EntryRoute/ClientRoute/LegacyRoute/Stats.tsx b/packages/devtools/client/src/client/components/ServerRoute/EntryRoute/ClientRoute/LegacyRoute/Stats.tsx similarity index 100% rename from packages/devtools/client/src/components/ServerRoute/EntryRoute/ClientRoute/LegacyRoute/Stats.tsx rename to packages/devtools/client/src/client/components/ServerRoute/EntryRoute/ClientRoute/LegacyRoute/Stats.tsx diff --git a/packages/devtools/client/src/components/ServerRoute/EntryRoute/ClientRoute/RemixRoute/Context.ts b/packages/devtools/client/src/client/components/ServerRoute/EntryRoute/ClientRoute/RemixRoute/Context.ts similarity index 100% rename from packages/devtools/client/src/components/ServerRoute/EntryRoute/ClientRoute/RemixRoute/Context.ts rename to packages/devtools/client/src/client/components/ServerRoute/EntryRoute/ClientRoute/RemixRoute/Context.ts diff --git a/packages/devtools/client/src/components/ServerRoute/EntryRoute/ClientRoute/RemixRoute/Route.module.scss b/packages/devtools/client/src/client/components/ServerRoute/EntryRoute/ClientRoute/RemixRoute/Route.module.scss similarity index 100% rename from packages/devtools/client/src/components/ServerRoute/EntryRoute/ClientRoute/RemixRoute/Route.module.scss rename to packages/devtools/client/src/client/components/ServerRoute/EntryRoute/ClientRoute/RemixRoute/Route.module.scss diff --git a/packages/devtools/client/src/components/ServerRoute/EntryRoute/ClientRoute/RemixRoute/Route.tsx b/packages/devtools/client/src/client/components/ServerRoute/EntryRoute/ClientRoute/RemixRoute/Route.tsx similarity index 100% rename from packages/devtools/client/src/components/ServerRoute/EntryRoute/ClientRoute/RemixRoute/Route.tsx rename to packages/devtools/client/src/client/components/ServerRoute/EntryRoute/ClientRoute/RemixRoute/Route.tsx diff --git a/packages/devtools/client/src/components/ServerRoute/EntryRoute/ClientRoute/RemixRoute/Stats.tsx b/packages/devtools/client/src/client/components/ServerRoute/EntryRoute/ClientRoute/RemixRoute/Stats.tsx similarity index 100% rename from packages/devtools/client/src/components/ServerRoute/EntryRoute/ClientRoute/RemixRoute/Stats.tsx rename to packages/devtools/client/src/client/components/ServerRoute/EntryRoute/ClientRoute/RemixRoute/Stats.tsx diff --git a/packages/devtools/client/src/components/ServerRoute/EntryRoute/ClientRoute/Stats.tsx b/packages/devtools/client/src/client/components/ServerRoute/EntryRoute/ClientRoute/Stats.tsx similarity index 96% rename from packages/devtools/client/src/components/ServerRoute/EntryRoute/ClientRoute/Stats.tsx rename to packages/devtools/client/src/client/components/ServerRoute/EntryRoute/ClientRoute/Stats.tsx index 6842fb5119d9..26a00d34c25b 100644 --- a/packages/devtools/client/src/components/ServerRoute/EntryRoute/ClientRoute/Stats.tsx +++ b/packages/devtools/client/src/client/components/ServerRoute/EntryRoute/ClientRoute/Stats.tsx @@ -5,7 +5,7 @@ import React from 'react'; import { useSnapshot } from 'valtio'; import { LegacyRouteStats } from './LegacyRoute/Stats'; import { RemixRouteStats } from './RemixRoute/Stats'; -import { useStore } from '@/stores'; +import { useStore } from '@/client/stores'; export interface ClientRouteStatsProps { route: ServerRoute; diff --git a/packages/devtools/client/src/components/ServerRoute/EntryRoute/ClientRoute/index.ts b/packages/devtools/client/src/client/components/ServerRoute/EntryRoute/ClientRoute/index.ts similarity index 100% rename from packages/devtools/client/src/components/ServerRoute/EntryRoute/ClientRoute/index.ts rename to packages/devtools/client/src/client/components/ServerRoute/EntryRoute/ClientRoute/index.ts diff --git a/packages/devtools/client/src/components/ServerRoute/EntryRoute/Route.tsx b/packages/devtools/client/src/client/components/ServerRoute/EntryRoute/Route.tsx similarity index 100% rename from packages/devtools/client/src/components/ServerRoute/EntryRoute/Route.tsx rename to packages/devtools/client/src/client/components/ServerRoute/EntryRoute/Route.tsx diff --git a/packages/devtools/client/src/components/ServerRoute/EntryRoute/Stats.module.scss b/packages/devtools/client/src/client/components/ServerRoute/EntryRoute/Stats.module.scss similarity index 100% rename from packages/devtools/client/src/components/ServerRoute/EntryRoute/Stats.module.scss rename to packages/devtools/client/src/client/components/ServerRoute/EntryRoute/Stats.module.scss diff --git a/packages/devtools/client/src/components/ServerRoute/EntryRoute/Stats.tsx b/packages/devtools/client/src/client/components/ServerRoute/EntryRoute/Stats.tsx similarity index 95% rename from packages/devtools/client/src/components/ServerRoute/EntryRoute/Stats.tsx rename to packages/devtools/client/src/client/components/ServerRoute/EntryRoute/Stats.tsx index 5d5f13661e06..0cb611ddc967 100644 --- a/packages/devtools/client/src/components/ServerRoute/EntryRoute/Stats.tsx +++ b/packages/devtools/client/src/client/components/ServerRoute/EntryRoute/Stats.tsx @@ -4,7 +4,7 @@ import { useSnapshot } from 'valtio'; import type { ServerRoute } from '@modern-js/types'; import { Box, Flex, Strong, Text } from '@radix-ui/themes'; import styles from './Stats.module.scss'; -import { useStore } from '@/stores'; +import { useStore } from '@/client/stores'; export interface EntryStatsProps { route: ServerRoute; diff --git a/packages/devtools/client/src/components/ServerRoute/EntryRoute/index.ts b/packages/devtools/client/src/client/components/ServerRoute/EntryRoute/index.ts similarity index 100% rename from packages/devtools/client/src/components/ServerRoute/EntryRoute/index.ts rename to packages/devtools/client/src/client/components/ServerRoute/EntryRoute/index.ts diff --git a/packages/devtools/client/src/components/ServerRoute/Route.tsx b/packages/devtools/client/src/client/components/ServerRoute/Route.tsx similarity index 100% rename from packages/devtools/client/src/components/ServerRoute/Route.tsx rename to packages/devtools/client/src/client/components/ServerRoute/Route.tsx diff --git a/packages/devtools/client/src/components/ServerRoute/Unknown.tsx b/packages/devtools/client/src/client/components/ServerRoute/Unknown.tsx similarity index 100% rename from packages/devtools/client/src/components/ServerRoute/Unknown.tsx rename to packages/devtools/client/src/client/components/ServerRoute/Unknown.tsx diff --git a/packages/devtools/client/src/components/Theme.tsx b/packages/devtools/client/src/client/components/Theme.tsx similarity index 100% rename from packages/devtools/client/src/components/Theme.tsx rename to packages/devtools/client/src/client/components/Theme.tsx diff --git a/packages/devtools/client/src/constants.tsx b/packages/devtools/client/src/client/constants.tsx similarity index 100% rename from packages/devtools/client/src/constants.tsx rename to packages/devtools/client/src/client/constants.tsx diff --git a/packages/devtools/client/src/routes/config/[toolkit].[type]/page.loader.ts b/packages/devtools/client/src/client/routes/config/[toolkit].[type]/page.loader.ts similarity index 100% rename from packages/devtools/client/src/routes/config/[toolkit].[type]/page.loader.ts rename to packages/devtools/client/src/client/routes/config/[toolkit].[type]/page.loader.ts diff --git a/packages/devtools/client/src/routes/config/[toolkit].[type]/page.tsx b/packages/devtools/client/src/client/routes/config/[toolkit].[type]/page.tsx similarity index 80% rename from packages/devtools/client/src/routes/config/[toolkit].[type]/page.tsx rename to packages/devtools/client/src/client/routes/config/[toolkit].[type]/page.tsx index c9634a1b4d05..7df3a3b5f595 100644 --- a/packages/devtools/client/src/routes/config/[toolkit].[type]/page.tsx +++ b/packages/devtools/client/src/client/routes/config/[toolkit].[type]/page.tsx @@ -1,8 +1,8 @@ import React from 'react'; import { useSnapshot } from 'valtio'; import { useParams } from '@modern-js/runtime/router'; -import { useStore } from '@/stores'; -import { ObjectInspector } from '@/components/ObjectInspector'; +import { useStore } from '@/client/stores'; +import { ObjectInspector } from '@/client/components/ObjectInspector'; const Page: React.FC = () => { const $store = useStore(); diff --git a/packages/devtools/client/src/routes/config/layout.config.tsx b/packages/devtools/client/src/client/routes/config/layout.config.tsx similarity index 100% rename from packages/devtools/client/src/routes/config/layout.config.tsx rename to packages/devtools/client/src/client/routes/config/layout.config.tsx diff --git a/packages/devtools/client/src/routes/config/layout.module.scss b/packages/devtools/client/src/client/routes/config/layout.module.scss similarity index 100% rename from packages/devtools/client/src/routes/config/layout.module.scss rename to packages/devtools/client/src/client/routes/config/layout.module.scss diff --git a/packages/devtools/client/src/routes/config/layout.tsx b/packages/devtools/client/src/client/routes/config/layout.tsx similarity index 100% rename from packages/devtools/client/src/routes/config/layout.tsx rename to packages/devtools/client/src/client/routes/config/layout.tsx diff --git a/packages/devtools/client/src/routes/config/page.loader.ts b/packages/devtools/client/src/client/routes/config/page.loader.ts similarity index 100% rename from packages/devtools/client/src/routes/config/page.loader.ts rename to packages/devtools/client/src/client/routes/config/page.loader.ts diff --git a/packages/devtools/client/src/routes/config/page.tsx b/packages/devtools/client/src/client/routes/config/page.tsx similarity index 100% rename from packages/devtools/client/src/routes/config/page.tsx rename to packages/devtools/client/src/client/routes/config/page.tsx diff --git a/packages/devtools/client/src/routes/context/builder/page.tsx b/packages/devtools/client/src/client/routes/context/builder/page.tsx similarity index 70% rename from packages/devtools/client/src/routes/context/builder/page.tsx rename to packages/devtools/client/src/client/routes/context/builder/page.tsx index 72f1a1056575..001d6751837d 100644 --- a/packages/devtools/client/src/routes/context/builder/page.tsx +++ b/packages/devtools/client/src/client/routes/context/builder/page.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { useSnapshot } from 'valtio'; -import { useStore } from '@/stores'; -import { ObjectInspector } from '@/components/ObjectInspector'; +import { useStore } from '@/client/stores'; +import { ObjectInspector } from '@/client/components/ObjectInspector'; const Page: React.FC = () => { const $store = useStore(); diff --git a/packages/devtools/client/src/routes/context/framework/page.tsx b/packages/devtools/client/src/client/routes/context/framework/page.tsx similarity index 70% rename from packages/devtools/client/src/routes/context/framework/page.tsx rename to packages/devtools/client/src/client/routes/context/framework/page.tsx index f344f4f5d058..50ebb8c74c69 100644 --- a/packages/devtools/client/src/routes/context/framework/page.tsx +++ b/packages/devtools/client/src/client/routes/context/framework/page.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { useSnapshot } from 'valtio'; -import { useStore } from '@/stores'; -import { ObjectInspector } from '@/components/ObjectInspector'; +import { useStore } from '@/client/stores'; +import { ObjectInspector } from '@/client/components/ObjectInspector'; const Page: React.FC = () => { const $store = useStore(); diff --git a/packages/devtools/client/src/routes/context/layout.config.tsx b/packages/devtools/client/src/client/routes/context/layout.config.tsx similarity index 82% rename from packages/devtools/client/src/routes/context/layout.config.tsx rename to packages/devtools/client/src/client/routes/context/layout.config.tsx index 5738b2434b16..a88ee22370cb 100644 --- a/packages/devtools/client/src/routes/context/layout.config.tsx +++ b/packages/devtools/client/src/client/routes/context/layout.config.tsx @@ -1,4 +1,4 @@ -import { SelectLink } from '@/components/SelectLink'; +import { SelectLink } from '@/client/components/SelectLink'; export const handle = { breadcrumb: [ diff --git a/packages/devtools/client/src/routes/context/layout.tsx b/packages/devtools/client/src/client/routes/context/layout.tsx similarity index 100% rename from packages/devtools/client/src/routes/context/layout.tsx rename to packages/devtools/client/src/client/routes/context/layout.tsx diff --git a/packages/devtools/client/src/routes/context/page.loader.ts b/packages/devtools/client/src/client/routes/context/page.loader.ts similarity index 100% rename from packages/devtools/client/src/routes/context/page.loader.ts rename to packages/devtools/client/src/client/routes/context/page.loader.ts diff --git a/packages/devtools/client/src/routes/context/page.tsx b/packages/devtools/client/src/client/routes/context/page.tsx similarity index 100% rename from packages/devtools/client/src/routes/context/page.tsx rename to packages/devtools/client/src/client/routes/context/page.tsx diff --git a/packages/devtools/client/src/routes/layout.config.tsx b/packages/devtools/client/src/client/routes/layout.config.tsx similarity index 100% rename from packages/devtools/client/src/routes/layout.config.tsx rename to packages/devtools/client/src/client/routes/layout.config.tsx diff --git a/packages/devtools/client/src/routes/layout.module.scss b/packages/devtools/client/src/client/routes/layout.module.scss similarity index 97% rename from packages/devtools/client/src/routes/layout.module.scss rename to packages/devtools/client/src/client/routes/layout.module.scss index 4d99a8b90543..0d46a1e4da2f 100644 --- a/packages/devtools/client/src/routes/layout.module.scss +++ b/packages/devtools/client/src/client/routes/layout.module.scss @@ -1,4 +1,4 @@ -@import '@/styles/theme.scss'; +@import '@/client/styles/theme.scss'; .wrapper { --navigator-width: var(--space-8); diff --git a/packages/devtools/client/src/routes/layout.tsx b/packages/devtools/client/src/client/routes/layout.tsx similarity index 86% rename from packages/devtools/client/src/routes/layout.tsx rename to packages/devtools/client/src/client/routes/layout.tsx index 9d0b88d2e28a..c03db42a8b85 100644 --- a/packages/devtools/client/src/routes/layout.tsx +++ b/packages/devtools/client/src/client/routes/layout.tsx @@ -1,5 +1,5 @@ -import './layout.css'; -import React from 'react'; +import '@/client/styles/theme.scss'; +import React, { useEffect } from 'react'; import { NavLink, Outlet } from '@modern-js/runtime/router'; import { Box, @@ -11,10 +11,10 @@ import { } from '@radix-ui/themes'; import { HiOutlineMoon, HiOutlineSun } from 'react-icons/hi2'; import styles from './layout.module.scss'; -import { StoreContextProvider, useStoreSnapshot } from '@/stores'; -import { Theme } from '@/components/Theme'; -import { InternalTab } from '@/types'; -import { Breadcrumbs } from '@/components/Breadcrumbs'; +import { StoreContextProvider, useStoreSnapshot } from '@/client/stores'; +import { Theme } from '@/client/components/Theme'; +import { InternalTab } from '@/client/types'; +import { Breadcrumbs } from '@/client/components/Breadcrumbs'; const NavigateButton: React.FC<{ tab: InternalTab }> = ({ tab }) => { let to = ''; @@ -26,6 +26,10 @@ const NavigateButton: React.FC<{ tab: InternalTab }> = ({ tab }) => { throw new Error(`Invalid tab view of "${tab.name}".`); } + useEffect(() => { + document.documentElement.classList.add('theme-register'); + }, []); + return ( diff --git a/packages/devtools/client/src/routes/overview/heading.svg b/packages/devtools/client/src/client/routes/overview/heading.svg similarity index 100% rename from packages/devtools/client/src/routes/overview/heading.svg rename to packages/devtools/client/src/client/routes/overview/heading.svg diff --git a/packages/devtools/client/src/routes/overview/layout.config.tsx b/packages/devtools/client/src/client/routes/overview/layout.config.tsx similarity index 100% rename from packages/devtools/client/src/routes/overview/layout.config.tsx rename to packages/devtools/client/src/client/routes/overview/layout.config.tsx diff --git a/packages/devtools/client/src/routes/overview/page.module.scss b/packages/devtools/client/src/client/routes/overview/page.module.scss similarity index 100% rename from packages/devtools/client/src/routes/overview/page.module.scss rename to packages/devtools/client/src/client/routes/overview/page.module.scss diff --git a/packages/devtools/client/src/routes/overview/page.tsx b/packages/devtools/client/src/client/routes/overview/page.tsx similarity index 99% rename from packages/devtools/client/src/routes/overview/page.tsx rename to packages/devtools/client/src/client/routes/overview/page.tsx index 7c15092ceb5a..139a65a3d375 100644 --- a/packages/devtools/client/src/routes/overview/page.tsx +++ b/packages/devtools/client/src/client/routes/overview/page.tsx @@ -12,7 +12,7 @@ import { parseURL } from 'ufo'; import { useSnapshot } from 'valtio'; import srcHeading from './heading.svg'; import styles from './page.module.scss'; -import { useStore } from '@/stores'; +import { useStore } from '@/client/stores'; const BUNDLER_PACKAGE_NAMES = { webpack: 'webpack', diff --git a/packages/devtools/client/src/routes/page.loader.ts b/packages/devtools/client/src/client/routes/page.loader.ts similarity index 100% rename from packages/devtools/client/src/routes/page.loader.ts rename to packages/devtools/client/src/client/routes/page.loader.ts diff --git a/packages/devtools/client/src/routes/page.tsx b/packages/devtools/client/src/client/routes/page.tsx similarity index 100% rename from packages/devtools/client/src/routes/page.tsx rename to packages/devtools/client/src/client/routes/page.tsx diff --git a/packages/devtools/client/src/routes/pages/layout.config.ts b/packages/devtools/client/src/client/routes/pages/layout.config.ts similarity index 100% rename from packages/devtools/client/src/routes/pages/layout.config.ts rename to packages/devtools/client/src/client/routes/pages/layout.config.ts diff --git a/packages/devtools/client/src/routes/pages/layout.module.scss b/packages/devtools/client/src/client/routes/pages/layout.module.scss similarity index 100% rename from packages/devtools/client/src/routes/pages/layout.module.scss rename to packages/devtools/client/src/client/routes/pages/layout.module.scss diff --git a/packages/devtools/client/src/routes/pages/layout.tsx b/packages/devtools/client/src/client/routes/pages/layout.tsx similarity index 100% rename from packages/devtools/client/src/routes/pages/layout.tsx rename to packages/devtools/client/src/client/routes/pages/layout.tsx diff --git a/packages/devtools/client/src/routes/pages/page.module.scss b/packages/devtools/client/src/client/routes/pages/page.module.scss similarity index 100% rename from packages/devtools/client/src/routes/pages/page.module.scss rename to packages/devtools/client/src/client/routes/pages/page.module.scss diff --git a/packages/devtools/client/src/routes/pages/page.tsx b/packages/devtools/client/src/client/routes/pages/page.tsx similarity index 92% rename from packages/devtools/client/src/routes/pages/page.tsx rename to packages/devtools/client/src/client/routes/pages/page.tsx index 4fe28392083d..a5520116f7dc 100644 --- a/packages/devtools/client/src/routes/pages/page.tsx +++ b/packages/devtools/client/src/client/routes/pages/page.tsx @@ -4,12 +4,12 @@ import { useSnapshot } from 'valtio'; import { parseURL, withTrailingSlash } from 'ufo'; import { HiOutlineArrowsRightLeft } from 'react-icons/hi2'; import styles from './page.module.scss'; -import { useStore } from '@/stores'; +import { useStore } from '@/client/stores'; import { MatchServerRouteValue, MatchUrlContext, -} from '@/components/ServerRoute/Context'; -import { ServerRoute } from '@/components/ServerRoute/Route'; +} from '@/client/components/ServerRoute/Context'; +import { ServerRoute } from '@/client/components/ServerRoute/Route'; const Page: React.FC = () => { const $store = useStore(); diff --git a/packages/devtools/client/src/rpc/index.ts b/packages/devtools/client/src/client/rpc/index.ts similarity index 95% rename from packages/devtools/client/src/rpc/index.ts rename to packages/devtools/client/src/client/rpc/index.ts index d9f1f7e6f77a..b19472a5c5d7 100644 --- a/packages/devtools/client/src/rpc/index.ts +++ b/packages/devtools/client/src/client/rpc/index.ts @@ -1,6 +1,6 @@ import { ClientFunctions, ServerFunctions } from '@modern-js/devtools-kit'; import { createBirpc } from 'birpc'; -import { StoreContextValue } from '@/types'; +import { StoreContextValue } from '@/client/types'; export interface SetupOptions { url: string; diff --git a/packages/devtools/client/src/stores/index.tsx b/packages/devtools/client/src/client/stores/index.tsx similarity index 95% rename from packages/devtools/client/src/stores/index.tsx rename to packages/devtools/client/src/client/stores/index.tsx index d7461ad46912..9b2e40493a24 100644 --- a/packages/devtools/client/src/stores/index.tsx +++ b/packages/devtools/client/src/client/stores/index.tsx @@ -14,10 +14,10 @@ import { ClientDefinition, } from '@modern-js/devtools-kit'; import { ref, useSnapshot } from 'valtio'; -import { setupServerConnection } from '@/rpc'; -import { useProxyFrom } from '@/utils/hooks'; -import { StoreContextValue } from '@/types'; -import { getDefaultTabs } from '@/constants'; +import { setupServerConnection } from '@/client/rpc'; +import { useProxyFrom } from '@/client/utils/hooks'; +import { StoreContextValue } from '@/client/types'; +import { getDefaultTabs } from '@/client/constants'; const StoreContext = createContext(null); diff --git a/packages/devtools/client/src/styles/breakpoints.scss b/packages/devtools/client/src/client/styles/breakpoints.scss similarity index 100% rename from packages/devtools/client/src/styles/breakpoints.scss rename to packages/devtools/client/src/client/styles/breakpoints.scss diff --git a/packages/devtools/client/src/styles/theme.scss b/packages/devtools/client/src/client/styles/theme.scss similarity index 98% rename from packages/devtools/client/src/styles/theme.scss rename to packages/devtools/client/src/client/styles/theme.scss index 27713af91bd1..4afd2cbab297 100644 --- a/packages/devtools/client/src/styles/theme.scss +++ b/packages/devtools/client/src/client/styles/theme.scss @@ -3,4 +3,4 @@ button { cursor: pointer; -} \ No newline at end of file +} diff --git a/packages/devtools/client/src/types/index.ts b/packages/devtools/client/src/client/types/index.ts similarity index 100% rename from packages/devtools/client/src/types/index.ts rename to packages/devtools/client/src/client/types/index.ts diff --git a/packages/devtools/client/src/utils/context.tsx b/packages/devtools/client/src/client/utils/context.tsx similarity index 100% rename from packages/devtools/client/src/utils/context.tsx rename to packages/devtools/client/src/client/utils/context.tsx diff --git a/packages/devtools/client/src/utils/hooks.ts b/packages/devtools/client/src/client/utils/hooks.ts similarity index 100% rename from packages/devtools/client/src/utils/hooks.ts rename to packages/devtools/client/src/client/utils/hooks.ts diff --git a/packages/devtools/client/src/utils/index.ts b/packages/devtools/client/src/client/utils/index.ts similarity index 100% rename from packages/devtools/client/src/utils/index.ts rename to packages/devtools/client/src/client/utils/index.ts diff --git a/packages/devtools/client/src/modern-app-env.d.ts b/packages/devtools/client/src/modern-app-env.d.ts index 3f453508cee1..81f14de367e8 100644 --- a/packages/devtools/client/src/modern-app-env.d.ts +++ b/packages/devtools/client/src/modern-app-env.d.ts @@ -1,3 +1,5 @@ /// /// /// + +declare let __resourceQuery: string; diff --git a/packages/devtools/mount/src/components/Devtools/Action.module.scss b/packages/devtools/client/src/mount/components/Devtools/Action.module.scss similarity index 100% rename from packages/devtools/mount/src/components/Devtools/Action.module.scss rename to packages/devtools/client/src/mount/components/Devtools/Action.module.scss diff --git a/packages/devtools/mount/src/components/Devtools/Action.tsx b/packages/devtools/client/src/mount/components/Devtools/Action.tsx similarity index 88% rename from packages/devtools/mount/src/components/Devtools/Action.tsx rename to packages/devtools/client/src/mount/components/Devtools/Action.tsx index 2e94a43e45ba..f3fa45e06877 100644 --- a/packages/devtools/mount/src/components/Devtools/Action.tsx +++ b/packages/devtools/client/src/mount/components/Devtools/Action.tsx @@ -1,13 +1,18 @@ -import { ROUTE_BASENAME, SetupClientOptions } from '@modern-js/devtools-kit'; +import { + ClientDefinition, + ROUTE_BASENAME, + SetupClientOptions, +} from '@modern-js/devtools-kit'; import React, { useState } from 'react'; import { useEvent, useToggle } from 'react-use'; import { Flex, Theme } from '@radix-ui/themes'; import { parseURL, stringifyParsedURL, withQuery } from 'ufo'; +import _ from 'lodash'; import Visible from '../Visible'; import styles from './Action.module.scss'; import { FrameBox } from './FrameBox'; import { ReactComponent as DevToolsIcon } from './heading.svg'; -import { useStickyDraggable } from '@/utils/draggable'; +import { useStickyDraggable } from '@/mount/utils/draggable'; const parseDataSource = (url: string) => { const newSrc = parseURL(url); @@ -20,12 +25,13 @@ const parseDataSource = (url: string) => { }; const DevtoolsAction: React.FC = props => { - const logoSrc = process.env._MODERN_DEVTOOLS_LOGO_SRC!; const opts: Required = { endpoint: 'https://modernjs.dev/devtools', ...props, + def: _(new ClientDefinition()).toPlainObject().merge(props.def).value(), dataSource: parseDataSource(props.dataSource ?? ''), }; + const logoSrc = opts.def.assets.logo; const [showDevtools, toggleDevtools] = useToggle(false); let src = opts.endpoint; diff --git a/packages/devtools/mount/src/components/Devtools/FrameBox.module.scss b/packages/devtools/client/src/mount/components/Devtools/FrameBox.module.scss similarity index 100% rename from packages/devtools/mount/src/components/Devtools/FrameBox.module.scss rename to packages/devtools/client/src/mount/components/Devtools/FrameBox.module.scss diff --git a/packages/devtools/mount/src/components/Devtools/FrameBox.tsx b/packages/devtools/client/src/mount/components/Devtools/FrameBox.tsx similarity index 100% rename from packages/devtools/mount/src/components/Devtools/FrameBox.tsx rename to packages/devtools/client/src/mount/components/Devtools/FrameBox.tsx diff --git a/packages/devtools/mount/src/components/Devtools/heading.svg b/packages/devtools/client/src/mount/components/Devtools/heading.svg similarity index 100% rename from packages/devtools/mount/src/components/Devtools/heading.svg rename to packages/devtools/client/src/mount/components/Devtools/heading.svg diff --git a/packages/devtools/mount/src/components/Devtools/xmark.svg b/packages/devtools/client/src/mount/components/Devtools/xmark.svg similarity index 100% rename from packages/devtools/mount/src/components/Devtools/xmark.svg rename to packages/devtools/client/src/mount/components/Devtools/xmark.svg diff --git a/packages/devtools/mount/src/components/LoadingIcon.tsx b/packages/devtools/client/src/mount/components/LoadingIcon.tsx similarity index 100% rename from packages/devtools/mount/src/components/LoadingIcon.tsx rename to packages/devtools/client/src/mount/components/LoadingIcon.tsx diff --git a/packages/devtools/mount/src/components/Portal.tsx b/packages/devtools/client/src/mount/components/Portal.tsx similarity index 100% rename from packages/devtools/mount/src/components/Portal.tsx rename to packages/devtools/client/src/mount/components/Portal.tsx diff --git a/packages/devtools/mount/src/components/Visible.tsx b/packages/devtools/client/src/mount/components/Visible.tsx similarity index 100% rename from packages/devtools/mount/src/components/Visible.tsx rename to packages/devtools/client/src/mount/components/Visible.tsx diff --git a/packages/devtools/client/src/mount/index.tsx b/packages/devtools/client/src/mount/index.tsx new file mode 100644 index 000000000000..e47e3620c17c --- /dev/null +++ b/packages/devtools/client/src/mount/index.tsx @@ -0,0 +1,7 @@ +import { createRoot } from 'react-dom/client'; +import DevtoolsAction from './components/Devtools/Action'; + +// @ts-expect-error +const { container, options } = window._modern_js_devtools_app; +const root = createRoot(container); +root.render(); diff --git a/packages/devtools/mount/src/types.d.ts b/packages/devtools/client/src/mount/types.d.ts similarity index 100% rename from packages/devtools/mount/src/types.d.ts rename to packages/devtools/client/src/mount/types.d.ts diff --git a/packages/devtools/mount/src/utils/draggable.ts b/packages/devtools/client/src/mount/utils/draggable.ts similarity index 100% rename from packages/devtools/mount/src/utils/draggable.ts rename to packages/devtools/client/src/mount/utils/draggable.ts diff --git a/packages/devtools/client/src/routes/layout.css b/packages/devtools/client/src/routes/layout.css deleted file mode 100644 index 609253955e26..000000000000 --- a/packages/devtools/client/src/routes/layout.css +++ /dev/null @@ -1,3 +0,0 @@ -body { - margin: 0; -} \ No newline at end of file diff --git a/packages/devtools/client/tsconfig.json b/packages/devtools/client/tsconfig.json index 4264c19d6557..000425217999 100644 --- a/packages/devtools/client/tsconfig.json +++ b/packages/devtools/client/tsconfig.json @@ -9,5 +9,5 @@ "@shared/*": ["./shared/*"] } }, - "include": ["src", "shared", "config", "modern.config.ts"] + "include": ["src", "exports", "shared", "config", "modern.config.ts"] } diff --git a/packages/devtools/kit/src/mount-point.ts b/packages/devtools/kit/src/mount-point.ts index 1fe636bcd31c..91b4d61be6f3 100644 --- a/packages/devtools/kit/src/mount-point.ts +++ b/packages/devtools/kit/src/mount-point.ts @@ -1,3 +1,5 @@ +import type { ClientDefinition } from './client'; + export interface MountPointFunctions { getLocation: () => string; } @@ -5,4 +7,5 @@ export interface MountPointFunctions { export interface SetupClientOptions extends Record { endpoint?: string; dataSource?: string; + def?: ClientDefinition; } diff --git a/packages/devtools/mount/.browserslistrc b/packages/devtools/mount/.browserslistrc deleted file mode 100644 index f5ceef6bb8ec..000000000000 --- a/packages/devtools/mount/.browserslistrc +++ /dev/null @@ -1,5 +0,0 @@ -chrome >= 51 -edge >= 15 -firefox >= 54 -safari >= 10 -ios_saf >= 10 diff --git a/packages/devtools/mount/.eslintrc.js b/packages/devtools/mount/.eslintrc.js deleted file mode 100644 index a84ee271a188..000000000000 --- a/packages/devtools/mount/.eslintrc.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - root: true, - extends: ['@modern-js'], -}; diff --git a/packages/devtools/mount/CHANGELOG.md b/packages/devtools/mount/CHANGELOG.md deleted file mode 100644 index 1b16159bc930..000000000000 --- a/packages/devtools/mount/CHANGELOG.md +++ /dev/null @@ -1,67 +0,0 @@ -# @modern-js/devtools-mount - -## 2.39.1 - -## 2.39.0 - -## 2.38.0 - -## 2.37.2 - -## 2.37.1 - -## 2.37.0 - -## 2.36.0 - -## 2.35.1 - -## 2.35.0 - -## 2.34.0 - -### Patch Changes - -- Updated dependencies [dcdeea5] -- Updated dependencies [eca24a2] - - @modern-js/runtime@2.34.0 - -## 2.33.1 - -### Patch Changes - -- @modern-js/runtime@2.33.1 - -## 2.33.0 - -### Patch Changes - -- Updated dependencies [6ea89ab] -- Updated dependencies [ae35c65] -- Updated dependencies [2bcff4f] -- Updated dependencies [44da57b] - - @modern-js/runtime@2.33.0 - -## 2.32.1 - -### Patch Changes - -- Updated dependencies [90e053a] - - @modern-js/runtime@2.32.1 - -## 2.32.0 - -### Patch Changes - -- Updated dependencies [e5a3fb4] -- Updated dependencies [6076166] -- Updated dependencies [a030aff] -- Updated dependencies [92591c6] -- Updated dependencies [5255eba] - - @modern-js/runtime@2.32.0 - -## 2.31.2 - -### Patch Changes - -- @modern-js/runtime@2.31.2 diff --git a/packages/devtools/mount/README.md b/packages/devtools/mount/README.md deleted file mode 100644 index 8fa00f661e63..000000000000 --- a/packages/devtools/mount/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# Modern.js App - -## Setup - -Install the dependencies: - -```bash -pnpm install -``` - -## Get Started - -Start the dev server: - -``` -pnpm dev -``` - -Enable optional features or add a new entry: - -``` -pnpm new -``` - -Build the app for production: - -``` -pnpm build -``` - -Preview the production build locally: - -``` -pnpm serve -``` - -For more information, see the [Modern.js documentation](https://modernjs.dev/en). diff --git a/packages/devtools/mount/modern.config.ts b/packages/devtools/mount/modern.config.ts deleted file mode 100644 index 5fee5db647cd..000000000000 --- a/packages/devtools/mount/modern.config.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { nanoid } from 'nanoid'; -import { appTools, defineConfig } from '@modern-js/app-tools'; -import packageMeta from './package.json'; - -const DEVTOOLS_MARK = nanoid(); - -// https://modernjs.dev/en/configure/app/usage -export default defineConfig<'rspack'>({ - source: { - entries: { - main: { - entry: './src/index.tsx', - disableMount: true, - }, - }, - preEntry: [ - require.resolve('modern-normalize/modern-normalize.css'), - require.resolve('@radix-ui/themes/styles.css'), - ], - globalVars: { - 'process.env.VERSION': packageMeta.version, - 'process.env.DEVTOOLS_MARK': DEVTOOLS_MARK, - }, - }, - output: { - copy: [{ from: './src/types.d.ts', to: './' }], - legalComments: 'linked', - disableCssExtract: true, - disableFilenameHash: true, - distPath: { - js: './', - }, - }, - dev: { - port: 8781, - }, - tools: { - htmlPlugin: process.env.NODE_ENV === 'production' ? false : {}, - styleLoader: { - insert: function insert(element) { - const key = `__DEVTOOLS_STYLE_${process.env.DEVTOOLS_MARK}`; - // @ts-expect-error - window[key] = window[key] || []; - // @ts-expect-error - window[key].push(element); - }, - }, - bundlerChain(chain) { - chain.output.libraryTarget('commonjs'); - chain.module - .rule('RADIX_TOKEN') - .test(/\/@radix-ui\/themes\/styles.css/) - .use('RADIX_TOKEN') - .loader('./plugin/radix-token-transformer.js') - .options({ root: '._modern_js_devtools_mountpoint' }); - }, - }, - performance: { - chunkSplit: { - strategy: 'all-in-one', - }, - }, - plugins: [ - appTools({ - bundler: 'experimental-rspack', - }), - ], -}); diff --git a/packages/devtools/mount/package.json b/packages/devtools/mount/package.json deleted file mode 100644 index dd199c10bd4f..000000000000 --- a/packages/devtools/mount/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "@modern-js/devtools-mount", - "version": "2.39.1", - "main": "dist/main.js", - "types": "dist/types.d.ts", - "scripts": { - "reset": "npx rimraf ./**/node_modules", - "dev": "modern dev", - "build": "modern build", - "start": "modern start", - "serve": "modern serve", - "new": "modern new", - "lint": "modern lint", - "upgrade": "modern upgrade" - }, - "engines": { - "node": ">=14.0.0" - }, - "files": [ - "dist" - ], - "dependencies": {}, - "devDependencies": { - "modern-normalize": "^2.0.0", - "@modern-js-app/eslint-config": "workspace:*", - "@modern-js/app-tools": "workspace:*", - "@modern-js/builder-rspack-provider": "workspace:*", - "@modern-js/devtools-kit": "workspace:*", - "@modern-js/eslint-config": "workspace:*", - "@modern-js/runtime": "workspace:*", - "@modern-js/tsconfig": "workspace:*", - "@radix-ui/themes": "^2.0.0", - "@stitches/react": "^1.2.8", - "@types/jest": "~29.2.4", - "@types/lodash-es": "^4.17.9", - "@types/node": "~16.11.7", - "@types/react": "~18.0.26", - "@types/react-dom": "~18.0.10", - "lodash-es": "^4.17.21", - "nanoid": "3.3.4", - "react": "~18.2.0", - "react-dom": "~18.2.0", - "react-use": "^17.4.0", - "rimraf": "~3.0.2", - "type-fest": "^4.1.0", - "typescript": "~5.0.4", - "ufo": "^1.2.0", - "webpack": "^5.88.1" - } -} diff --git a/packages/devtools/mount/src/index.tsx b/packages/devtools/mount/src/index.tsx deleted file mode 100644 index 6140487dac1f..000000000000 --- a/packages/devtools/mount/src/index.tsx +++ /dev/null @@ -1 +0,0 @@ -export { mountDevTools } from './mount'; diff --git a/packages/devtools/mount/src/modern-app-env.d.ts b/packages/devtools/mount/src/modern-app-env.d.ts deleted file mode 100644 index 3f453508cee1..000000000000 --- a/packages/devtools/mount/src/modern-app-env.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -/// -/// diff --git a/packages/devtools/mount/src/mount.tsx b/packages/devtools/mount/src/mount.tsx deleted file mode 100644 index 214b0ee2ba26..000000000000 --- a/packages/devtools/mount/src/mount.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import { createRoot } from 'react-dom/client'; -import DevtoolsAction from './components/Devtools/Action'; -import type { MountDevTools } from '@/types'; - -export const mountDevTools: MountDevTools = (options = {}) => { - const container = document.createElement('div'); - container.className = '_modern_js_devtools_container'; - container.id = process.env.DEVTOOLS_MARK!; - document.body.appendChild(container); - - const shadow = container.attachShadow({ mode: 'closed' }); - - const styleTagsField = `__DEVTOOLS_STYLE_${process.env.DEVTOOLS_MARK}`; - if (styleTagsField in window) { - // @ts-expect-error - const styleTags = window[styleTagsField]; - if (!Array.isArray(styleTags)) { - throw new TypeError( - `Expect window.${styleTagsField} should be array but got ${typeof styleTags}.`, - ); - } - for (const tag of styleTags) { - if (tag instanceof HTMLElement) { - shadow.appendChild(tag); - } - } - } - - const app = document.createElement('div'); - app.className = '_modern_js_devtools_mountpoint'; - app.id = process.env.DEVTOOLS_MARK!; - shadow.appendChild(app); - - const root = createRoot(app); - - root.render(); -}; diff --git a/packages/devtools/mount/tsconfig.json b/packages/devtools/mount/tsconfig.json deleted file mode 100644 index 4264c19d6557..000000000000 --- a/packages/devtools/mount/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "extends": "@modern-js/tsconfig/base", - "compilerOptions": { - "declaration": false, - "jsx": "preserve", - "baseUrl": "./", - "paths": { - "@/*": ["./src/*"], - "@shared/*": ["./shared/*"] - } - }, - "include": ["src", "shared", "config", "modern.config.ts"] -} diff --git a/packages/devtools/plugin/package.json b/packages/devtools/plugin/package.json index dc69f5b60c58..c717525167ce 100644 --- a/packages/devtools/plugin/package.json +++ b/packages/devtools/plugin/package.json @@ -49,7 +49,6 @@ "dependencies": { "birpc": "0.2.13", "@modern-js/devtools-kit": "workspace:*", - "@modern-js/devtools-mount": "workspace:*", "@modern-js/devtools-client": "workspace:*", "@modern-js/utils": "workspace:*", "serve-static": "^1.14.1", diff --git a/packages/devtools/plugin/src/cli.ts b/packages/devtools/plugin/src/cli.ts index be515cb030bc..ab1d4747c930 100644 --- a/packages/devtools/plugin/src/cli.ts +++ b/packages/devtools/plugin/src/cli.ts @@ -46,7 +46,7 @@ export const devtoolsPlugin = ( res.end(); }; const useMainRoute = () => { - req.url = '/html/main/index.html'; + req.url = '/html/client/index.html'; serveMiddleware(req, res, usePageNotFound); }; serveMiddleware(req, res, useMainRoute); @@ -72,21 +72,16 @@ export const devtoolsPlugin = ( const mountOpts = { dataSource: `${ROUTE_BASENAME}/rpc`, endpoint: ROUTE_BASENAME, + def: new ClientDefinition(), __keep: true, } as SetupClientOptions; - let runtimeEntry = require.resolve( - '@modern-js/plugin-devtools/runtime', - ); + let runtimeEntry = require.resolve('@modern-js/devtools-client/mount'); runtimeEntry = withQuery(runtimeEntry, mountOpts); return { builderPlugins: [rpc.builderPlugin], source: { preEntry: [runtimeEntry], - globalVars: { - 'process.env._MODERN_DEVTOOLS_LOGO_SRC': new ClientDefinition() - .assets.logo, - }, }, tools: { devServer: { diff --git a/packages/devtools/plugin/src/runtime.ts b/packages/devtools/plugin/src/runtime.ts deleted file mode 100644 index 985e27e5c9ce..000000000000 --- a/packages/devtools/plugin/src/runtime.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { SetupClientOptions } from '@modern-js/devtools-kit'; -import { mountDevTools } from '@modern-js/devtools-mount'; -import { parseQuery } from 'ufo'; - -try { - const opts = parseQuery(__resourceQuery); - mountDevTools(opts as SetupClientOptions); -} catch (err: unknown) { - const e = new Error('Failed to execute mount point of DevTools.'); - e.cause = err; - console.error(e); -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7b2cb58499da..af61b306c54e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1307,6 +1307,9 @@ importers: '@modern-js/types': specifier: workspace:* version: link:../../toolkit/types + '@modern-js/utils': + specifier: workspace:* + version: link:../../toolkit/utils '@radix-ui/react-collapsible': specifier: ^1.0.3 version: 1.0.3(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0) @@ -1447,84 +1450,6 @@ importers: specifier: ^5 version: 5.0.4 - packages/devtools/mount: - devDependencies: - '@modern-js-app/eslint-config': - specifier: workspace:* - version: link:../../review/eslint-config-app - '@modern-js/app-tools': - specifier: workspace:* - version: link:../../solutions/app-tools - '@modern-js/builder-rspack-provider': - specifier: workspace:* - version: link:../../builder/builder-rspack-provider - '@modern-js/devtools-kit': - specifier: workspace:* - version: link:../kit - '@modern-js/eslint-config': - specifier: workspace:* - version: link:../../review/eslint-config - '@modern-js/runtime': - specifier: workspace:* - version: link:../../runtime/plugin-runtime - '@modern-js/tsconfig': - specifier: workspace:* - version: link:../../review/tsconfig - '@radix-ui/themes': - specifier: ^2.0.0 - version: 2.0.0(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0) - '@stitches/react': - specifier: ^1.2.8 - version: 1.2.8(react@18.2.0) - '@types/jest': - specifier: ~29.2.4 - version: 29.2.6 - '@types/lodash-es': - specifier: ^4.17.9 - version: 4.17.9 - '@types/node': - specifier: ~16.11.7 - version: 16.11.68 - '@types/react': - specifier: ^18 - version: 18.0.21 - '@types/react-dom': - specifier: ^18 - version: 18.0.6 - lodash-es: - specifier: ^4.17.21 - version: 4.17.21 - modern-normalize: - specifier: ^2.0.0 - version: 2.0.0 - nanoid: - specifier: 3.3.4 - version: 3.3.4 - react: - specifier: ~18.2.0 - version: 18.2.0 - react-dom: - specifier: ~18.2.0 - version: 18.2.0(react@18.2.0) - react-use: - specifier: ^17.4.0 - version: 17.4.0(react-dom@18.2.0)(react@18.2.0) - rimraf: - specifier: ~3.0.2 - version: 3.0.2 - type-fest: - specifier: ^4.1.0 - version: 4.1.0 - typescript: - specifier: ~5.0.4 - version: 5.0.4 - ufo: - specifier: ^1.2.0 - version: 1.3.0 - webpack: - specifier: ^5.88.1 - version: 5.88.1(esbuild@0.17.19) - packages/devtools/plugin: dependencies: '@modern-js/devtools-client': @@ -1533,9 +1458,6 @@ importers: '@modern-js/devtools-kit': specifier: workspace:* version: link:../kit - '@modern-js/devtools-mount': - specifier: workspace:* - version: link:../mount '@modern-js/utils': specifier: workspace:* version: link:../../toolkit/utils @@ -15626,14 +15548,6 @@ packages: resolution: {integrity: sha512-Gfkvwk9o9kE9r9XNBmJRfV8zONvXThnm1tcuojL04Uy5uRyqg93DC83lDebl0rocZCfKSjUv+fWYtMQmEDJldg==} dev: false - /@stitches/react@1.2.8(react@18.2.0): - resolution: {integrity: sha512-9g9dWI4gsSVe8bNLlb+lMkBYsnIKCZTmvqvDG+Avnn69XfmHZKiaMrx7cgTaddq7aTPPmXiTsbFcUy0xgI4+wA==} - peerDependencies: - react: '>= 16.3.0' - dependencies: - react: 18.2.0 - dev: true - /@storybook/addon-actions@7.5.1(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-GieD3ru6EslKvwol1cE4lvszQCLB/AkQdnLofnqy1nnYso+hRxmPAw9/O+pWfpUBFdjXsQ7GX09+wEUpOJzepw==} peerDependencies: @@ -17161,12 +17075,6 @@ packages: '@types/webpack': 4.41.32 dev: true - /@types/lodash-es@4.17.9: - resolution: {integrity: sha512-ZTcmhiI3NNU7dEvWLZJkzG6ao49zOIjEgIE0RgV7wbPxU0f2xT3VSAHw2gmst8swH6V0YkLRGp4qPlX/6I90MQ==} - dependencies: - '@types/lodash': 4.14.199 - dev: true - /@types/lodash@4.14.181: resolution: {integrity: sha512-n3tyKthHJbkiWhDZs3DkhkCzt2MexYHXlX0td5iMplyfwketaOeKboEVBqzceH7juqvEg3q5oUoBFxSLu7zFag==} dev: true @@ -26825,11 +26733,6 @@ packages: engines: {node: '>=6'} dev: false - /modern-normalize@2.0.0: - resolution: {integrity: sha512-CxBoEVKh5U4DH3XuNbc5ONLF6dQBc8dSc7pdZ1957FGbIO5JBqGqqchhET9dTexri8/pk9xBL6+5ceOtCIp1QA==} - engines: {node: '>=6'} - dev: true - /moment@2.29.3: resolution: {integrity: sha512-c6YRvhEo//6T2Jz/vVtYzqBzwvPT95JBQ+smCytzf7c50oMZRsR/a4w88aD34I+/QVSfnoAnSBFPJHItlOMJVw==} From 96ede9e6db5363d5b8259b09dcbcad348cd12ad1 Mon Sep 17 00:00:00 2001 From: qixuan <58852732+GiveMe-A-Name@users.noreply.github.com> Date: Tue, 7 Nov 2023 10:16:17 +0800 Subject: [PATCH 8/8] fix: remake server ssr logger msg (#4922) --- .changeset/dirty-ligers-roll.md | 6 ++ .../plugin-runtime/src/ssr/prefetch.tsx | 57 +++++++++++++++---- .../ssr/serverRender/renderToStream/index.ts | 4 +- .../ssr/serverRender/renderToString/entry.ts | 14 ++--- .../ssr/serverRender/renderToString/index.ts | 6 -- .../src/ssr/serverRender/tracker.ts | 49 +++++++++------- .../tests/ssr/serverRender/tracker.test.ts | 12 ++-- 7 files changed, 92 insertions(+), 56 deletions(-) create mode 100644 .changeset/dirty-ligers-roll.md diff --git a/.changeset/dirty-ligers-roll.md b/.changeset/dirty-ligers-roll.md new file mode 100644 index 000000000000..cf95c638f920 --- /dev/null +++ b/.changeset/dirty-ligers-roll.md @@ -0,0 +1,6 @@ +--- +'@modern-js/runtime': patch +--- + +fix: remake server ssr logger msg +fix: 重写 ssr server 日志信息 diff --git a/packages/runtime/plugin-runtime/src/ssr/prefetch.tsx b/packages/runtime/plugin-runtime/src/ssr/prefetch.tsx index f129d7d055b1..a47f811b734a 100644 --- a/packages/runtime/plugin-runtime/src/ssr/prefetch.tsx +++ b/packages/runtime/plugin-runtime/src/ssr/prefetch.tsx @@ -1,31 +1,48 @@ import { renderToStaticMarkup } from 'react-dom/server'; import { run } from '@modern-js/runtime-utils/node'; import { ChunkExtractor } from '@loadable/server'; +import { time } from '@modern-js/runtime-utils/time'; import { RuntimeContext } from '../core'; +import { LoaderResult } from '../core/loader/loaderManager'; import { SSRPluginConfig } from './serverRender/types'; +import { SSRTracker, SSRTimings, SSRErrors } from './serverRender/tracker'; // todo: SSRContext const prefetch = async ( App: React.ComponentType, context: RuntimeContext, config: SSRPluginConfig, + tracker: SSRTracker, ) => run(context.ssrContext!.request.headers, async () => { const { ssrContext } = context; const { loadableStats } = ssrContext!; if (!config.disablePrerender) { - // disable renderToStaticMarkup when user configures disablePrerender - if (loadableStats) { - const extractor = new ChunkExtractor({ - stats: loadableStats, - entrypoints: [ssrContext!.entryName].filter(Boolean), - }); - renderToStaticMarkup( - extractor.collectChunks(), - ); - } else { - renderToStaticMarkup(); + try { + const end = time(); + // disable renderToStaticMarkup when user configures disablePrerender + if (loadableStats) { + const extractor = new ChunkExtractor({ + stats: loadableStats, + entrypoints: [ssrContext!.entryName].filter(Boolean), + }); + renderToStaticMarkup( + extractor.collectChunks(), + ); + } else { + renderToStaticMarkup(); + } + + const cost = end(); + + tracker.trackTiming(SSRTimings.PRERENDER, cost); + } catch (e) { + const error = e as Error; + tracker.trackError(SSRErrors.PRERENDER, error); + + // re-throw the error + throw e; } } @@ -36,7 +53,23 @@ const prefetch = async ( }; } - const loadersData = await context.loaderManager.awaitPendingLoaders(); + let loadersData: Record = {}; + try { + const end = time(); + + loadersData = await context.loaderManager.awaitPendingLoaders(); + + const cost = end(); + + tracker.trackTiming(SSRTimings.USE_LOADER, cost); + } catch (e) { + const error = e as Error; + tracker.trackError(SSRErrors.USE_LOADER, error); + + // re-throw the error + throw e; + } + Object.keys(loadersData).forEach(id => { const data = loadersData[id]; if (data._error) { diff --git a/packages/runtime/plugin-runtime/src/ssr/serverRender/renderToStream/index.ts b/packages/runtime/plugin-runtime/src/ssr/serverRender/renderToStream/index.ts index de32721166ce..cb2388a959d1 100644 --- a/packages/runtime/plugin-runtime/src/ssr/serverRender/renderToStream/index.ts +++ b/packages/runtime/plugin-runtime/src/ssr/serverRender/renderToStream/index.ts @@ -33,12 +33,12 @@ export const render = ({ App, context }: ServerRenderOptions) => { } const cost = end(); - tracker.trackTiming(SSRTimings.SSR_RENDER_SHELL, cost); + tracker.trackTiming(SSRTimings.RENDER_SHELL, cost); }, onAllReady() { // calculate streaming ssr cost const cost = end(); - tracker.trackTiming(SSRTimings.SSR_RENDER_TOTAL, cost); + tracker.trackTiming(SSRTimings.RENDER_HTML, cost); }, onShellError(e) { // Don't log error in `onShellError` callback, since it has been logged in `onError` callback diff --git a/packages/runtime/plugin-runtime/src/ssr/serverRender/renderToString/entry.ts b/packages/runtime/plugin-runtime/src/ssr/serverRender/renderToString/entry.ts index ee78cb8112aa..56017c3d3c9e 100644 --- a/packages/runtime/plugin-runtime/src/ssr/serverRender/renderToString/entry.ts +++ b/packages/runtime/plugin-runtime/src/ssr/serverRender/renderToString/entry.ts @@ -162,17 +162,17 @@ export default class Entry { private async prefetch(context: RuntimeContext) { let prefetchData; - const end = time(); try { - prefetchData = await prefetch(this.App, context, this.pluginConfig); + prefetchData = await prefetch( + this.App, + context, + this.pluginConfig, + this.tracker, + ); this.result.renderLevel = RenderLevel.SERVER_PREFETCH; - const prefetchCost = end(); - - this.tracker.trackTiming(SSRTimings.SSR_PREFETCH, prefetchCost); } catch (e) { this.result.renderLevel = RenderLevel.CLIENT_RENDER; - this.tracker.trackError(SSRErrors.PREFETCH, e as Error); } return prefetchData || {}; @@ -204,7 +204,7 @@ export default class Entry { .finish(); const cost = end(); - this.tracker.trackTiming(SSRTimings.SSR_RENDER_HTML, cost); + this.tracker.trackTiming(SSRTimings.RENDER_HTML, cost); this.result.renderLevel = RenderLevel.SERVER_RENDER; } catch (e) { this.tracker.trackError(SSRErrors.RENDER_HTML, e as Error); diff --git a/packages/runtime/plugin-runtime/src/ssr/serverRender/renderToString/index.ts b/packages/runtime/plugin-runtime/src/ssr/serverRender/renderToString/index.ts index cbfeb29b4ed9..60716bd4610d 100644 --- a/packages/runtime/plugin-runtime/src/ssr/serverRender/renderToString/index.ts +++ b/packages/runtime/plugin-runtime/src/ssr/serverRender/renderToString/index.ts @@ -1,8 +1,6 @@ import { run } from '@modern-js/runtime-utils/node'; -import { time } from '@modern-js/runtime-utils/time'; import { ServerRenderOptions } from '../types'; import { PreRender } from '../../react/prerender'; -import { SSRTimings } from '../tracker'; import SSREntry from './entry'; export const render = ({ @@ -20,11 +18,7 @@ export const render = ({ }); entry.metrics.emitCounter('app.visit.count', 1); - const end = time(); const html = await entry.renderToHtml(context); - const cost = end(); - - entry.tracker.trackTiming(SSRTimings.SSR_RENDER_TOTAL, cost); const cacheConfig = PreRender.config(); if (cacheConfig) { diff --git a/packages/runtime/plugin-runtime/src/ssr/serverRender/tracker.ts b/packages/runtime/plugin-runtime/src/ssr/serverRender/tracker.ts index ba1726767a23..fec003814476 100644 --- a/packages/runtime/plugin-runtime/src/ssr/serverRender/tracker.ts +++ b/packages/runtime/plugin-runtime/src/ssr/serverRender/tracker.ts @@ -3,14 +3,15 @@ import type { BaseSSRServerContext } from '@modern-js/types'; export type SSRTracker = ReturnType; export enum SSRTimings { - SSR_RENDER_TOTAL, - SSR_PREFETCH, - SSR_RENDER_HTML, - SSR_RENDER_SHELL, + PRERENDER, + RENDER_HTML, + RENDER_SHELL, + USE_LOADER, } export enum SSRErrors { - PREFETCH, + PRERENDER, + USE_LOADER, RENDER_HTML, RENDER_STREAM, RENDER_SHELL, @@ -24,10 +25,15 @@ const errors: Record< logger?: string; } > = { - [SSRErrors.PREFETCH]: { - reporter: 'SSR Error - App Prefetch Render', - logger: 'App Prefetch Render', - metrics: 'app.prefetch.render.error', + [SSRErrors.PRERENDER]: { + reporter: 'SSR Error - App Prerender', + logger: 'App Prerender', + metrics: 'app.prerender.error', + }, + [SSRErrors.USE_LOADER]: { + reporter: 'SSR Error - App run useLoader', + logger: 'App run useLoader', + metrics: 'app.useloader.error', }, [SSRErrors.RENDER_HTML]: { reporter: 'SSR Error - App Render To HTML', @@ -53,27 +59,26 @@ const timings: Record< logger?: string; } > = { - [SSRTimings.SSR_PREFETCH]: { - reporter: 'ssr-prefetch', - serverTiming: 'ssr-prefetch', - metrics: 'app.prefeth.cost', - logger: 'App Prefetch cost = %d ms', + [SSRTimings.PRERENDER]: { + reporter: 'ssr-prerender', + serverTiming: 'ssr-prerender', + metrics: 'app.prerender.cost', + logger: 'App Prerender cost = %d ms', }, - [SSRTimings.SSR_RENDER_HTML]: { + [SSRTimings.RENDER_HTML]: { reporter: 'ssr-render-html', serverTiming: 'ssr-render-html', metrics: 'app.render.html.cost', logger: 'App Render To HTML cost = %d ms', }, - [SSRTimings.SSR_RENDER_TOTAL]: { - reporter: 'ssr-render-total', - serverTiming: 'ssr-render-total', - metrics: 'app.render.cost', - logger: 'App Render Total cost = %d ms', - }, - [SSRTimings.SSR_RENDER_SHELL]: { + [SSRTimings.RENDER_SHELL]: { reporter: 'ssr-render-shell', }, + [SSRTimings.USE_LOADER]: { + reporter: 'use-loader', + serverTiming: 'use-loader', + logger: 'App run useLoader cost = %d ms', + }, }; export function createSSRTracker({ diff --git a/packages/runtime/plugin-runtime/tests/ssr/serverRender/tracker.test.ts b/packages/runtime/plugin-runtime/tests/ssr/serverRender/tracker.test.ts index a6c5fa4121fa..cc6e3ecb899c 100644 --- a/packages/runtime/plugin-runtime/tests/ssr/serverRender/tracker.test.ts +++ b/packages/runtime/plugin-runtime/tests/ssr/serverRender/tracker.test.ts @@ -60,18 +60,16 @@ describe('tracker', () => { it('track ssr error', () => { const error = new Error('mock error'); - tracker.trackError(SSRErrors.PREFETCH, error); + tracker.trackError(SSRErrors.PRERENDER, error); - expect(reporter.errors).toEqual([ - ['SSR Error - App Prefetch Render', error], - ]); - expect(logger.errors).toEqual([['App Prefetch Render', error]]); - expect(metrics.errors.get('app.prefetch.render.error')).toEqual(1); + expect(reporter.errors).toEqual([['SSR Error - App Prerender', error]]); + expect(logger.errors).toEqual([['App Prerender', error]]); + expect(metrics.errors.get('app.prerender.error')).toEqual(1); }); it('track ssr timing', () => { const cost = 13; - tracker.trackTiming(SSRTimings.SSR_RENDER_HTML, cost); + tracker.trackTiming(SSRTimings.RENDER_HTML, cost); expect(serverTiming.serverTimings).toEqual([['ssr-render-html', cost]]); expect(logger.timings).toEqual([['App Render To HTML cost = %d ms', cost]]);